Jump to content

guardmed

Members
  • Posts

    6
  • Joined

  • Last visited

guardmed's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you Krydos, this is impressive. I would like to know how you were able to make it work (as the "HelloWorld" project isn't really the goal I'm trying to achieve). One thing is a mystery to me. The welcome page works - it goes to Hello.jps like it should - http://guardmed.heliohost.org/HelloWorld/ The servlet works - like Shineryuu showed in the screenshot - http://guardmed.heliohost.org/HelloWorld/HelloWorld Directly accessing the jsp no longer works - it originally worked, but now no longer does - http://guardmed.heliohost.org/HelloWorld/Hello.jsp I don't understand how using the direct url no longer works. More interesting, the jsp can be reached using the welcome page, but not directly. So I'm guessing something probably changed with the url address. I wonder what. Thank you and happy holidays, whichever they may be.
  2. I tried using my local installation of tomcat and run this war. It works on my machine. http://localhost:8080/HelloWorld/Hello.jsp works Since the above is defined as the welcome page I also get it when using http://localhost:8080/HelloWorld/ Finally, the servlet works. I can reach it using http://localhost:8080/HelloWorld/HelloWorld I still don't understand why neither the servlet nor the welcome page definition work on the heliohost server.
  3. Thank you Krydos I deleted all files from the account (jsp, class, xml, images. everything). I uploaded HelloWorld.war. The reason I did not do so in the first place is because of the following thread - http://www.helionet.org/index/topic/11272-deploying-war-file-java-application/page__hl__%2Bservlet+%2Bfile__fromsearch__1 Information about this war file: The website name is HelloWorld - in my system I actually use http://localhost:8080/HelloWorld/ So I assume on the heliohost server it should be something like guardmed.heliohost.org/HelloWorld There is one JSP in the war, it's named Hello.jsp. This is actually reachable using the url http://guardmed.heliohost.org/HelloWorld/Hello.jsp There is one servlet in the war, it's named HelloWorld. Could not reach it any way There is a web.xml with the following needed information The welcome page is defined to be Hello.jsp, meaning that the url http://guardmed.heliohost.org/HelloWorld/ should go directly to http://guardmed.heliohost.org/HelloWorld/Hello.jsp For some reason right now this doesn't happen. It does happen on my system. There is a servlet mapping for HelloWorld to /HelloWorld. So I would expect http://guardmed.heliohost.org/HelloWorld/HelloWorld to go the servlet (but it doesn't). It's interesting to see that the tomcat does open the war, because it opens the jsp when called directly. Any help would be appreciated
  4. Hello, I have an account on Jhonny with java enabled. JSP is working fine but Servlets just won't work. I tried the most basic class I could find: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("<HTML>"); out.println("<HEAD><TITLE>Hello World</TITLE></HEAD>"); out.println("<BODY>"); out.println("<H1>Hello World</H1>"); out.println("Today is: " + (new java.util.Date().toString()) ); out.println("</BODY></HTML>"); } // doGet } // HelloWorld And compiled it. I uploaded it to /public_html/WebContent/WEB-INF/classes and added the needed info to web.xml. I could not reach the servlet HelloWorld. I uploaded it to /public_html/WEB-INF/classes and added the needed info to web.xml. I still could not reach the servlet HelloWorld. I tried any combination I could think of in order to get this servlet to work, but nothing did the trick. If anyone knows or has been able to activate the servlets, here are my three questions: Where did you put the compiled servlet class? Where did you put the "web.xml" (I know, in the WEB-INF, but there are two)? How did you do the servlet mapping in the "web.xml" (using the .class in the path or not)? What URL did you use to reach the servlet (with starting from the <name>.heliohost.org/)? I tried any combination I could think of but nothing did the trick. Thank
×
×
  • Create New...