• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

result.jsp not found 404 error

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

I am using tomcat 5,windows xp
When i am displaying the result using jsp(by using request dispatcher), i am getting 404 error
My result.jsp is under root directory
But when i display result using "BeerSelect" servlet its working fine.
I have set classpath to point tomcat\common\lib\jsp-api.jar

could anyone help me to trouble shoot this problem.
This is my code

My jsp code is


[ARG: added code tags]
 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
UseCodeTags . Code is difficult to read. You can edit your post to include them using the button or re-post the question with proper formatting.
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
- you don't need to explicitly add tomcat\common\lib\jsp-api.jar to your classpath. Tomcat's startup files are configured to include that directory in the classpath automatically.
- I can't quite understand what's the significance of the difference in using BeerSelect or BeerExpert? To me BeerExpert seems to be a class capable of retrieving data from somewhere [database, memory objects, etc]. As long as the data's being retrieved correctly, there shouldn't be any trouble. If you're getting an exception at the line where you invoke a method on the Beer... instance, it might just be the source of your trouble.
- Have you checked to see if you're getting any exceptions during the course of the stated execution flow?
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you call/invoke result.jsp directly?
And by root directory, I assume that its the web app root directory.
 
vinoth kumartc
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi amit,

I tried to invoke jsp directly from the url.But still i get the 404 resource not found error.

hi anivaran,

The beer expert class just returns a arraylist.I have checked its functionality its working fine..

In the above post if i remove the comments(green color) and remove the jsp part in the BeerSelect class, im getting the result.where the beerservlet formats the html and send to the browser.

But the problem is with the jsp file.The jsp file is under the root directory.Do we need to configure jsp sepearately.Please advice
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[a] Can you verify that under the ...\tomcat\webapps\[WebAppName]\ you can see result.jsp file?
Also, if you can't access the JSP file through a direct URL, then there's something definitely wrong with your deployment, assuming the answer to [a] is yes. Probably you should try re-deploying your web application.
 
vinoth kumartc
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am able to see the result.jsp under my webapplication folder.But i could not invoke directly from url.But still i could access other html files and jsp files from url
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My Dear
Just change your Text editor you are probably using notepad change it and use Wordpad because notepad cant create JSP file and therefor youre servlet cant see any jsp file in your directory..just change it
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hossein yousefi wrote:My Dear
Just change your Text editor you are probably using notepad change it and use Wordpad because notepad cant create JSP file and therefor youre servlet cant see any jsp file in your directory..just change it



Is this meant to be a joke..?
 
hossein yousefi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vinoth kumartc wrote:I am able to see the result.jsp under my webapplication folder.But i could not invoke directly from url.But still i could access other html files and jsp files from url


vinoth kumartc is reading Oreily Head first to JSP and thats Mini MVC web App just lets try it
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

hossein yousefi wrote:
vinoth kumartc is reading Oreily Head first to JSP and thats Mini MVC web App just lets try it



Try what..?
 
vinoth kumartc
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya its true, i tried in a notepad that's why it did'nt recognize..I will try in a word pad and keep yout posted.

thanks for your reply.
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vinoth kumartc wrote:Ya its true, i tried in a notepad that's why it did'nt recognize..I will try in a word pad and keep yout posted.

thanks for your reply.



You can program in a notepad, in a notepad++, in a vi or whatever simple text editor, that has completly nothing to do with your problem.

Can you show your folder hierarchy and your configuration files?
 
Albareto McKenzie
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look at this topic also:

https://coderanch.com/t/437188/Tomcat/error

might help you as is a similar problem.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey! make a new file result.jsp file then again compile BeerSelect.java file and start tomcat server it will solve your problem may be
 
reply
    Bookmark Topic Watch Topic
  • New Topic