Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help with JSP and Tomcat

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with JSP and Tomcat

    Hello guys,

    I am new to JSP, and I need some help. I downloaded latest Tomcat and configure it. I think that i configured it in good way, because when I open http://localhost:8080/ a get this screen:



    I just wanted to test it, so I create some JSP file in Notepad. Beside that I created folder helloJSP with empty subfolder WEB-INF inside webapps folder.

    At the end when i have tried to test it, i get this error.


  2. #2
    Junior Member
    Join Date
    Apr 2011
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Help with JSP and Tomcat

    Your file index.jsp should be under webapps/helloJSP/index.jsp The JSP file should not be under WEB-INF folder. In WEB-INF folder only web.xml, libraries, java class and servlets are allowed

  3. The Following User Says Thank You to vinotht For This Useful Post:

    Json (April 19th, 2011)

  4. #3
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Help with JSP and Tomcat

    You can put your JSP's in the WEB-INF, in fact I do it all the time, because I want to hide the raw JSP from the outside world. Anything inside WEB-INF will be hidden and any user going to your server will not be able to reach the files in there directly. If you just want your sample JSP to run, place it in the correct path as described by vinotht, but if you still want it to remain inside the WEB-INF folder you will need to create a separate servlet, map that to some url or all urls and then use a request dispatcher to forward the user to the JSP inside the WEB-INF folder.

Similar Threads

  1. Dynamic Web Project + Tomcat 7.0
    By atul.mathur31 in forum What's Wrong With My Code?
    Replies: 0
    Last Post: January 18th, 2011, 07:01 PM
  2. TOMCAT CONFIGURE
    By jugalrockz in forum Java Servlet
    Replies: 1
    Last Post: January 5th, 2011, 07:09 PM
  3. JAAS implementaion for web application with tomcat
    By singharun in forum Java Servlet
    Replies: 0
    Last Post: August 30th, 2010, 05:56 AM
  4. Tomcat startup message
    By Lotfus in forum Java Servlet
    Replies: 3
    Last Post: May 10th, 2010, 08:47 AM
  5. Issues with Tomcat 6.0
    By sanyog24681 in forum Java Servlet
    Replies: 0
    Last Post: October 21st, 2008, 07:55 AM