1

I have developed a project in netbeans using tomcat. But I am new to web hosting. I dont know what is the procedure to upload it in the server. I have used mysql database. suppose i go for a free hosting like 000webhost if i will upload whole the project folder then will it work or i have something else to do?

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
    <servlet-name>home</servlet-name>
    <servlet-class>home</servlet-class>
</servlet>
<servlet>
    <servlet-name>hp</servlet-name>
    <servlet-class>home</servlet-class>
</servlet>
<servlet>
    <servlet-name>rg</servlet-name>
    <servlet-class>rg</servlet-class>
</servlet>
<servlet>
    <servlet-name>dat</servlet-name>
    <servlet-class>dat</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>home</servlet-name>
    <url-pattern>/home</url-pattern>
</servlet-mapping>
<servlet-mapping>
    <servlet-name>dat</servlet-name>
    <url-pattern>/dat</url-pattern>
</servlet-mapping>
<session-config>
    <session-timeout>
        30
    </session-timeout>
</session-config>

jonny depp
  • 55
  • 1
  • 2
  • 8

2 Answers2

1

You need to upload your project in web hosting that supports Tomcat. For example there are Java Web Hosting and Web Hosting. Web Hosting is more meant for regular websites and java web hosting is meant more for web applications that want to be uploaded to internet. You can upload regular website to Java web hosting. The big difference however is that Java web hosting supports web application projects made with virtual servers like Tomcat, Glassfish, JBoss, etc.

I have uploaded one time my web application into Java Web Hosting but I used Glassfish. Usually Java web hosting that supports Glassfish are much more expensive than those which supports Tomcat.

  1. You need a java web hosting that supports Tomcat.
  2. You can upload your project on that server, I highly recommend consulting that specific java web hosting company for where to load your application.
Amir
  • 1,031
  • 2
  • 19
  • 42
  • can you gimme some name of java web hosting? – jonny depp Feb 14 '14 at 18:19
  • sure, first one that comes up to me in Google is http://www.superjavahost.com/. I highly recommend that you check different java web hosting companies and compare them to ease your decision. – Amir Feb 14 '14 at 18:22
  • okay then but there will i have to upload whole my project like all folders web,nbproject,src,libraries or only the rar file. and one more qsn what about the mysql part? – jonny depp Feb 14 '14 at 18:24
  • No, you need to make war file. You can do war file in Netbeans simply by right clicking your project in Projects section and from the menu click Build. Once build is success it will give you in the console the .war file location. That's the file that you need to upload to your java web hosting. – Amir Feb 14 '14 at 18:40
  • k thanks a ton do i need to change anything regarding to the mysql as it may appear as localhost:portno. in the address bar – jonny depp Feb 14 '14 at 18:59
  • You're welcome. If you have embedded MySQL to your project, meaning that you are using embedded database then it would be enough to upload .war file. But if it is not, then you need to install MySQL in your java web hosting and bring your database data there. – Amir Feb 14 '14 at 19:24
0

You can use a FTP client to upload your files to the public_html directory.It is in the cPanel area.

Saurabh Jain
  • 1,600
  • 1
  • 20
  • 30
  • I suggest you to read the entire documention/faq before doing anything. It will help you in clearing your doubts with uploading and other issues that will follow. – Saurabh Jain Feb 14 '14 at 18:13
  • yeah i can upload the whole folder in it directly i do know that. but is that it or anything else to do as i have used sevlets,mysql database – jonny depp Feb 14 '14 at 18:14
  • u mean all folders of my project only ?no need to upload the war file anymore? and what about the mysql part? – jonny depp Feb 14 '14 at 18:26