aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes requested resource (first.jsp) not available Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "requested resource (first.jsp) not available" Watch "requested resource (first.jsp) not available" New topic
Author

requested resource (first.jsp) not available

amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
the case is as follows:

1 html file
1 servlet
1 jsp

i am using tomcat

i have all these files placed at their required locations
html and jsp under webapps/root...and servlet under classes
root is the name of application
i have my html calling servlet...and servlet calling the jsp file
initially i call my html and things goes well...and when a request is made from html file it shows that requested resource (first.jsp) not available
servlet file compiled fine...and got .class version of it
i wrote the jsp code in a notepad and saved it as first.jsp
i assume that we don't compile jsp file...container does for us..placed first.jsp text file as it is under webapps/root

there is no syntax problem with any of these files...how to about solving this problem...help appreciated.

thank you
amal shah
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 225
what path you gave to access jsp file within html file?
They both exist in the same directory?

It would be good if you post the dir structure and the html file contents.
Anbu Rajendran
Greenhorn

Joined: Aug 09, 2006
Posts: 18
Try using a different webapp folder. ROOT is the default
web application in Tomcat. Using a different webapp
with your own web.xml might expose the problem.
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
dir structure...
webapps/root/WEB-INF/classes
root---->web app name
(1) root contains first.jsp and html file
(2) WEB-INF contains web.xml
(3) classes contains .class file of servlet

this is how i call jsp from servlet file:
RequestDispatcher view=request.getRequestDispatcher("/first.jsp");

i have all paths and classpaths stuff set

is this entire thing related to setting some catalina thing...because i read it somewhere...if yes.......what is it...am completely unaware of the catalina stuff...help appreciated

thanking you
amal shah
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 225
Try

RequestDispatcher view=request.getRequestDispatcher("first.jsp");
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
both ("/first.jsp")---(first.jsp") gives same result....pls help................how to about solving this problem.....am new to servlets...help appreciated

thank you
amal shah
Charlie A
Greenhorn

Joined: Apr 17, 2005
Posts: 19
I hope that you have set the CATALINA_HOME and JAVA_HOME environment variable. If not below is the procedure to do it.

1. Right Click "My Computer", select Properties.
2. Click 'Advanced' Tab
3. Click 'Environmental Variables' Button
4. Under 'User Variables XXXX' frame, click the New button
5. Give the Variable name as 'CATALINA_HOME' and values as the root directory of the Tomcat folder eg: 'C:\jakarta-tomcat-X.X.X'
6. similary add a new variable called 'JAVA_HOME' and give the value as jdk root directory eg:- 'C:\j2sdk1.4.2_11'
7. Now reboot the machine, and start using your application.


When the world says, "Give up,"<br />Hope whispers, "Try it one more time."
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
i have my catalina and java home variables set...still no solution...pls help....as to how am i suppose to proceed
resource (first.jsp) not available...http status 404
help appreciated

thank you
amal shah
Surendra Kumar
Ranch Hand

Joined: Jul 04, 2006
Posts: 225
I tried this with a simple setup as you told me, and everything works fine.
Daniel Dalton
Ranch Hand

Joined: Mar 20, 2005
Posts: 146
Just a thought - your first.jsp file IS actually called that - as oppossed to first.jsp.txt for instance and you're just not displaying extensions on windows??
amal shah
Ranch Hand

Joined: May 05, 2006
Posts: 92
yes right...my first.jsp is actually first.jsp.txt
how do i make file "first" with a jsp extension
pls help...as am new to servlets jsp stuff

thank you
amal shah
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
-Open this first.jsp.txt file in Notepad
- GO to File>>save as

File name = "first.jsp"
file type = "All File"

I think it is enough!!!


Nilesh Patel
SCJP 1.5 - 87%
 
Don't get me started about those stupid light bulbs.
 
subject: requested resource (first.jsp) not available
 
Similar Threads
where do i place html,class files etc?
running sql in jsp
Apache Tomcat and Servlet
Tomcat and HTTp Status 404 for JSP testing
Help getting servlet to run using Tomcat 5.5