File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP basic help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

JSP basic help

sai baba

Joined: Apr 26, 2004
Posts: 9
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 test jsp 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?

Posts: 8 | Registered: Apr 2004 | IP: Logged

Satou kurinosuke
ranch hand
Member # 112140
posted February 26, 2006 09:04 PM
First, you've got an extra space between the % and the =.
You should remove it.

What file did you put this line in ? (filename and directory)
Posts: 835 | Registered: Nov 2005 | IP: Logged

sai baba
Member # 71858
posted February 27, 2006 07:29 AM
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.

Any Ideas/Suggestions?

Stefan Evans

Joined: Jul 06, 2005
Posts: 1580
suggestion: don't post the same question twice.
I agree. Here's the link:
subject: JSP basic help
It's not a secret anymore!