This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes result.jsp not found 404 error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "result.jsp not found 404 error" Watch "result.jsp not found 404 error" New topic
Author

result.jsp not found 404 error

vinoth kumartc
Greenhorn

Joined: Aug 10, 2009
Posts: 12
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]
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 688

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.

Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
Anirvan Majumdar
Ranch Hand

Joined: Feb 22, 2005
Posts: 261
- 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?
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Can you call/invoke result.jsp directly?
And by root directory, I assume that its the web app root directory.


SCJP, SCWCD.
|Asking Good Questions|
vinoth kumartc
Greenhorn

Joined: Aug 10, 2009
Posts: 12
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

Joined: Feb 22, 2005
Posts: 261
[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

Joined: Aug 10, 2009
Posts: 12
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
hossein yousefi
Greenhorn

Joined: Nov 04, 2009
Posts: 2
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
Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
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

Joined: Nov 04, 2009
Posts: 2
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

Joined: Oct 08, 2009
Posts: 276
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

Joined: Aug 10, 2009
Posts: 12
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.
Albareto McKenzie
Ranch Hand

Joined: Apr 08, 2009
Posts: 298
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

Joined: Apr 08, 2009
Posts: 298
Look at this topic also:

http://www.coderanch.com/t/437188/Tomcat/error

might help you as is a similar problem.
 
 
subject: result.jsp not found 404 error