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

Newbie question

Janey Powell

Joined: Mar 05, 2005
Posts: 3
Hi Everyone, I'm trying to write my first JSP and I'm having a bit of trouble, I'm a complete novice at J2EE "but I know a bit about J2SE) and I just can't figure out what Ive done wrong.

I've installed Tomcat 5 and when I enter http://localhost:8080 it confirms it's sucessfully installed, so far so good. Then I wrote a simple JSP....


</HTML> test it but every time I enter http://localhost:8080/jsp/first.jsp I get.....

HTTP Status 404 - /jsp/first.jsp

type Status report

message /jsp/first.jsp

description The requested resource (/jsp/first.jsp) is not available.
Apache Tomcat/5.5.7

What am I doing wrong?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33119

Welcome to JavaRanch!

What directory did you place the JSP in?

Note that once Tomcat finds the JSP, you are going to have a compiler error. Since Java is case sensitive, the scriplet should be <%= new java.util.Date() %>

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Janey Powell

Joined: Mar 05, 2005
Posts: 3
JAVA.DATE.UTIL well it has been a couple of years since the SCJP

Ok as to the directory I just have it in a directory called jsp off root (/jsp), I guess I need a special directory structure or something but I don't know what.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Under the Tomcat's webapps directory, create a folder for your app:
Under that, you need to create a folder called WEB-INF

Once you've done that, Tomcat will recognize it as a webapp.
You can then put your JSPs under the 'jsp' (or whatever you app's name is) directory and start hacking.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Janey Powell

Joined: Mar 05, 2005
Posts: 3
Hey thanks it works, kinda I get my page but no method call, I know JAVA_HOME is set so I'll have a poke around and see what the prob is.
I agree. Here's the link:
subject: Newbie question
It's not a secret anymore!