tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Milou <emmanuel.mi...@savoirfairelinux.com>
Subject Re: Wrong path to servlets
Date Tue, 29 Jan 2008 21:48:50 GMT
The jsp code is very basic. Here is the content of each jsp file:
<%
 getServletContext().getRequestDispatcher("/servlet/org.capella.intranet.agenda.AgendaServlet").forward(request,response);
%>

Of course, each jsp file calls the right servlet... like I said before, 
if the jsp file is in a sub directory, the name of the sub directory is 
preprended to the path .


david delbecq wrote:
> Difficult to say, without the actual jsp code....
>
> Emmanuel Milou a écrit :
>> Hi,
>> I would like to have your input on this problem. It is quite tricky 
>> and I hope you will be able to help me.
>> Here is my configuration: JDK 1.6.0_03, Apache-Tomcat5.5.25, 
>> connector ajp13.
>> When I click on an option in the menu bar of my home page, JSP code 
>> is executed to call the servlet. It looks like that:  
>> /getServletContext().getRequestDispatcher("/servlet/path_to_servlet").forward(request,response);

>>
>> /The problem is that before the page is displayed, the path is 
>> modified, and if the JSP file was in a subdirectory (for instance 
>> named toto), the name of the directory is added to the path, and 
>> finally the browser looks for /toto/servlet/path_to_servlet, /which 
>> doesn't exist and I get an 404 Not Found Error. The right URL is 
>> /servlet/path_to_servlet, it works when I manually test.
>> It gives the same result for each JSP file saved in a subdirectory.
>> You must know that I used to run Tomcat 5.5 with the same 
>> configuration and it worked fine.
>> Thanks for your help.
>>
>> Emmanuel
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


-- 
Emmanuel Milou
Consultant en Logiciel Libre
Savoir-Faire Linux Inc.
emmanuel.milou@savoirfairelinux.com
514-276-5468 poste 136


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message