Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Re: Special URL servlet request.

Harry Mantheakis

2004-01-23

Replies:

Hello

Tim Funk wrote...

> But you won't have access to request parameters
> since there are none.

Not as parameters, true, but Tomcat lets you retrieve the information
through the extra path information.

See: HttpServeltRequest.getPathInfo

I use it all the time :-)

Harry Mantheakis
London, UK


> 2 Ways:
>
> 1) Map /digfidl like you are currently doing. But you won't have access to
> request parameters since there are none. You'll need a custom api/code to
> decode the request. Or you could use a Filter and HttpServletRequestWrapper
> to handle the decoding for you so you could use getParameter()
>
> 2) Use mod rewrite to rewrite the request so it places all the parameters in
> a key valued query string. Use google and the mod_rewrite guide on the
> specifics of how to do that.
>
> -Tim
>
> matsmobil wrote:
>
>>
>> This request works:http://digfi.com/digfidl/digfidl and calls my Servlet
>> OK.
>>
>> The question is how can I call my servlet with the following URL:
>> http://digfi.com/digfidl/digfidl/dAc/OM1617RbR/YT4075/Uk5673We/qih/dFOE1051/1
>> gpus/LYxx/tKG0/iXcaP.rm"/>?copyright="digfi.com"&author="Chine
>> & The Slippery Horns"&title="Scatterminded"
>>
>> I have to make this request like this because my calling applikation can't
>> use '?' in the URL-requests.
>>
>> Could this be done in TC 5.0.18 only ore do I have to have apache as
>> frontend for
>> TC 5.0.18.
>> ---------------------
>> In TC/conf/server.xml I have added the following row:
>> <Context path="/digfidl" docBase="digfidl" debug="0" reloadable="true" />
>>
>> ---------------------
>> TC/webapps/digfidl/WEB-INF/web.xml contains:
>> <web-app>
>> -
>> <servlet>
>> <servlet-name>digfidl</servlet-name>
>> <servlet-class>se.two4hr.servlet.DLServlet</servlet-class>
>> </servlet>
>> -
>> <servlet-mapping>
>> <servlet-name>digfidl</servlet-name>
>> <url-pattern>/digfidl</url-pattern>
>> </servlet-mapping>
>> </web-app>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail: tomcat-user-help@(protected)
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.