Jump to content

Using Java Servlets


Recommended Posts

I am trying to run a simple java servlet. I know that I am hosted on Jonny, and that I have java.

 

My servlet is in the "public_html/WEB-INF/classes/tests" directory and is named test.class.

 

My "public_html/WEB-INF/web.xml" file reads

 

 

&--#60;?xml version="1.0" encoding="ISO-8859-1"?&--#62;
&--#60;!DOCTYPE web-app
   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd"&--#62;
&--#60;web-app&--#62;

  &--#60;servlet&--#62;
    &--#60;servlet-name&--#62;t&--#60;/servlet-name&--#62;
    &--#60;servlet-class&--#62;tests.test&--#60;/servlet-class&--#62;
   &--#60;/servlet&--#62;

   &--#60;servlet-mapping&--#62;
    &--#60;servlet-name&--#62;t&--#60;/servlet-name&--#62;
    &--#60;url-pattern&--#62;/testservlet&--#60;/url-pattern&--#62;
   &--#60;/servlet-mapping&--#62;

&--#60;/web-app&--#62; 

 

when i go to "http://spacehitchhiker42.heliohost.org/testservlet" I get a 404 error.

 

does anyone know how to use servlets correctly on heliohost?

Link to comment
Share on other sites

If you would like to deploy a .war file follow these steps:

  1. Create your account on Johnny http://www.heliohost.org/home/create-johnny-account
  2. Request Java to be enabled on your account http://www.helionet.org/index/forum/74-java-requests/
  3. Wait patiently and keep your account active, because Java can only be enabled on a finite number of account at a time, and you must wait in line to have it enabled. It can take up to a month to get Java enabled depending on how many other people are in line ahead of you.
  4. Once Java is enabled on your account upload your .war file to your home directory. Ex: /home/username/MyProject.war
  5. Request to have the .war file deployed by creating a new topic in Customer Service http://www.helionet.org/index/forum/45-customer-service/

Link to comment
Share on other sites

I'm not a java/jsp expert, but we've offered java for about eight years and to the best of my knowledge no one has ever figured out how to get a working java servlet deployed without admin assistance. Java server pages .jsp files work fine if you just upload them to a java enabled account though. If you figure out a way to get a servlet deployed on your own let us know. We are working on a cPanel plugin that would allow users to deploy their own applications though.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...