This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi I have just installed tomcat on my windows xp machine.I downloaded the Apache-Tomcat version 5.5.15(windows executable) and also the jdk 5.0. When I enter http://localhost:8080/ into the browser, I get the tomcat Jakarta page-no problem.
When I try my first testjsp page (main.jsp)with the follwing expression in the body section of the jsp page: Hello! The time is now: <% = new java.util.Date() %>
I get the same line in my webpage: Hello! The time is now: <% = new java.util.Date() %>
The java expression is not evaluated, no error messages. Anyone have any suggestions what I should be doing?
Hey Thanks for the help, I have the file main.jsp in a WebProject folder which is a subfolder of the Tomcat Root folder(Root/WebProject/main.jsp).
From what little I know its supposed to be a simple test. I have no servelet in the page so am I still to have created WebProject\WEB-INF\web.xml? If so what will it contain in the servlet tag? I have not edited any other XML files.
As Satou pointed out, you have extra space in around the "=". And to answer you last question, I don't think you have to have web.xml in place for your page has no servlets and you don't need any parameters set etc. Also, instead of "root", I'd put it under "webapps", say "webapps/app1/main.jsp". Then http://your_ip:8080/app1/main.jsp should work. If not use Tomcat manager and do a "reload" should make you happy.
You don't need web.xml yet, but you should deploy your application under webapps, not ROOT. Create a new directory (e.g. myapp) under webapps, and put your main.jsp file in it. Access it with: http://localhost:8080/myapp/main.jsp