I have installed Tomcat 4.1.18 successfully on Windows XP Pro. I run the startup.bat in my apache\bin directory and when I key in http://localhost:8080, I get the start page. However, when I try to bring up my JSP page, it is not working. <html> <body> <% out.println ("testing JSP"); %> <h1>JSP test</h1><br><hr> </body> Any idea why this is not working? Thanks in advance. </html>
The JSP page should be in under the webapps folder. If the JSP, say "yourjsp.jsp" is part of a web application eg "foo", your JSP should be at located in "%CATALINA_HOME%/webapps/foo/yourjsp.jsp" and via URL at http://localhost:8080/foo/yourjsp.jsp Sorry for the earlier post, was incorrect and in haste.
The URL is correct since I placed <h1> My JSP </h1> before the <% out.println ("JSP test"); %> I see that fine. It's the "JSP test" that's not coming out. Is there something that needs to be done prior or is there something missing from the HTML??
the code that Mike posted works for me as well. Are you looking for 'JSP test' to be printed in the JSP or in the Tomcat window opened with the startup.bat? I may be off here (which is usually the case) but you sounded like you might be looking in the startup.bat window, in which case you need System.out.println(). Again sorry if this is off the mark.