aspose file tools*
The moose likes Tomcat and the fly likes Weird behaviour when calling a jsp page thinks its a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Weird behaviour when calling a jsp page thinks its a servlet" Watch "Weird behaviour when calling a jsp page thinks its a servlet" New topic
Author

Weird behaviour when calling a jsp page thinks its a servlet

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 582
I have a JSP Page PageC which calls another jsp page displayRow.jsp through the use of a form.

<FORM action="displayRow.jsp" method="post">

When I directly call pageC, it calls displayRow.jsp with no problems.

but when I use another route

PageA calls ServletA which forwards to PageB which calls ServletB which forwards to PageC which calls displayRow.jsp i get the error message

The requested resource (/servlet/displayRow.jsp) is not available.

Has anyone got an idea of what might be going on under the hood.

Thanks for any help Tony
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
Because of the way you write
<FORM action="displayRow.jsp" method="post">

the browser requests the jsp from the same base it used to get the servlet.
Thats why it is looking for "/servlet/displayRow.jsp"
You should specify the action URL more completely. You should also read about why using the invoker servlet (implied by "/servlet") is a bad idea here at the ranch FAQ.
Bill
Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 582
Thanks William,

I kind of guessed that may have been the problem, pages are working fine now.

Thanks again.

Tony
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Weird behaviour when calling a jsp page thinks its a servlet