This week's book giveaway is in the Java in General forum.
We're giving away four copies of Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework and have Michael Redlich on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

requested resource (first.jsp) not available

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try

RequestDispatcher view=request.getRequestDispatcher("first.jsp");
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this with a simple setup as you told me, and everything works fine.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
-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!!!
 
I hired a bunch of ninjas. The fridge is empty, but I can't find them to tell them the mission.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic