2

I have created a simple JSP file that I want to deploy in Jetty 7.2. Jetty is running and I can see the default web page at http://localhost:8080/. I started Jetty with the java -jar start.jar command.

I saved my simple JSP file jsp_test.jsp at <my_jetty_directory>/webapps/jsp_test.jsp and then I tried to access that file on http://localhost:8080/jsp_test.jsp and http://localhost:8080/webapps/jsp_test.jsp but none of them works.

Is there something more I have to do? Where in the Jetty file structure should I place my JSP file?

If you know a helpful tutorial I would be thankful. I haven't found any good ones.

Jonas
  • 121,568
  • 97
  • 310
  • 388

1 Answers1

2

You have to place it in a folder inside webapps:

webapps/myapp -> http://localhost:8080/myapp/test.jsp

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
  • Thanks, that is a step closer. Now I get `HTTP ERROR: 503; Problem accessing /test/jsp_test.jsp. Reason: Service Unavailable` ...does this mean that JSP isn't started by default by Jetty? I added some information to my question. – Jonas Nov 06 '10 at 09:23
  • @Jonas - check the log files. If the context has failed to start, there should be something there. – Bozho Nov 06 '10 at 11:16
  • I installed a new Jetty, and did like you described. Now is it working perfectly. Thanks. Now I'm going to learn how to do Serlvets. – Jonas Nov 07 '10 at 22:09
  • I got a similar problem with Servlets: http://stackoverflow.com/questions/4122629/how-do-i-deploy-a-servlet-in-jetty – Jonas Nov 08 '10 at 09:43