tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Koberg <...@koberg.com>
Subject Re: How do you handle 'rewrite queries' ?
Date Wed, 05 Aug 2009 16:22:32 GMT
Don't know if this is an option, but you can use Jersey:

https://jersey.dev.java.net/

and something like:

@Path("/users/{username}")
public class UserResource {
    @GET
    @Produces("text/xml")
    public String getUser(@PathParam("username") String userName) {
         ...
     }
}


On Aug 5, 2009, at 8:30 AM, Paul Taylor wrote:

> Caldarale, Charles R wrote:
>>> From: Paul Taylor [mailto:paul_t100@fastmail.fm]
>>> Subject: Re: How do you handle 'rewrite queries' ?
>>>
>>>  <servlet-mapping>
>>>    <servlet-name>SearchServerServlet</servlet-name>
>>>    <url-pattern>/</url-pattern>
>>>  </servlet-mapping>
>>>
>>
>> The above causes the SearchServerServlet to be invoked when there's  
>> no path specified in the URI.  You want to add a mapping for /ws/ 
>> type/ to target the same servlet.
>>
>>  <servlet-mapping>
>>    <servlet-name>SearchServerServlet</servlet-name>
>>    <url-pattern>/ws/type</url-pattern>
>>  </servlet-mapping>
>>
>> Note that you can use a wildcard character ("*") if you have  
>> multiple patterns to match.  In fact, you may be able to simply  
>> modify the original mapping to have a <url-pattern> of /*, but I  
>> haven't tried it.
>>
>> - Chuck
>>
>>
> Thanks actually the default is not picking up the root case, I've  
> got a simpler related issue by war get deployed as searchserver in  
> webapps, is there a way I can leave it then and get it to pick up  
> from root
>
> i.e
>
> http://localhost:8080?query=%22R.E.S%22&type=artist&fmt=xml
>
>
> instead of
>
> http://localhost:8080/searchserver?query=%22R.E.S%22&type=artist&fmt=xml
>
> and how do i get it maps to port 80 so this will work
>
> http://localhost/searchserver?query=%22R.E.S%22&type=artist&fmt=xml
>
>
> I know these are basic questions but every time I use Tomcat ( I  
> last used it three years ago) I have real problems getting these  
> things working
>
> thanks Paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@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