Yes it's all in web.xml.

You certainly already have defined a mapping for the dispatcher servlet ?

The way to map your actions in the web.xml goes like this :

<servlet>
        <servlet-name>StripesDispatcher</servlet-name>
        
<servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

<servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>/dispatcher</url-pattern>
    </servlet-mapping>
<!-- all in action folder -->
<servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>/action/*</url-pattern>
    </servlet-mapping>

<!-- all .action suffixes -->
 <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>

<!-- action with @UrlBinding("/view/{foo}/{bar}") -->
 <servlet-mapping>
        <servlet-name>StripesDispatcher</servlet-name>
        <url-pattern>/view/*</url-pattern>
    </servlet-mapping>

HTH

Cheers

Remi

2010/10/4 Oddbjørn Sjøgren <bj...@yaymicro.com>

>
>
> On Mon, Oct 4, 2010 at 11:33 AM, VANKEISBELCK Remi <r...@rvkb.com> wrote:
>
>> Hi
>>
>> I think you have an url mapping issue : I guess Stripes dispatcher is
>> mapped on "*.action", so :
>>
>> http://.../myapp/search.action?searchString=foo...-> OK
>> http://.../myapp/search?searchString=foo -> Error
>>
>
> That's right. *.action is the default mapping when I have not explicitly
> set one right?
>
> Otherwise the clean URLs should work by default, so :
>> http://.../myapp/search.action/foo -> OK
>>
>> If you want to do it like this :
>> http://.../myapp/search/foo
>>
>> Then you have two options :
>> * define a mapping for dispatcher servlet on all your beans (as you don't
>> have the *.action suffix)
>> * use Dynamic Mapping Filter
>>
>
> Yes, I've pretty much understood that, but I just don't understand how to
> go about and do that.. Is it only a matter of changing the web.xml file?
> Could someone give me a short example on what I do?
>
>
>>
>> HTH
>>
>> Cheers
>>
>> Remi
>>
>> 2010/10/3 Oddbjørn Sjøgren <bj...@yaymicro.com>
>>
>>>  Hi
>>>
>>>
>>> I'm trying to implement clean URLs in a project, but I can't get to work.
>>> Right now the web.xml file has theese mappings:
>>>
>>>
>>> <servlet-mapping>
>>>
>>>   <servlet-name>default</servlet-name>
>>>
>>>   <url-pattern>/</url-pattern>
>>>
>>> </servlet-mapping>
>>>
>>>
>>> <servlet-mapping>
>>>
>>>   <servlet-name>jsp</servlet-name>
>>>
>>>   <url-pattern>*.jsp</url-pattern>
>>>
>>> </servlet-mapping>
>>>
>>>
>>> <servlet-mapping>
>>>
>>>   <servlet-name>jsp</servlet-name>
>>>
>>>   <url-pattern>*.jspx</url-pattern>
>>>
>>> </servlet-mapping>
>>>
>>>
>>> My ActionBeans all have a URL binding like UrlBinding("/search.action")
>>> on them, and the link http://domain.com/search.action?searchString=foo 
>>> obviously
>>> searches for "foo". Now here is what I want:
>>>
>>>
>>> - All urls should work as they are now (I don't want a lot of dead links)
>>>
>>> - In addition I want to introduce urls that look like
>>> http://domain.com/search/foo
>>>
>>>
>>> Basically my question is how to achieve this. So far I've only tried to
>>> change the the binding in the ActionBean to
>>> @UrlBinding("/search/{searchString}") but that only leads to 404 errors. I
>>> guess there is something I need to do in the web.xml file, but I just can't
>>> understand what to do. I also understand that there is some way to override
>>>
>>> NameBasedActionResolver, but I'm not sure how to do this? Can I just
>>> write a new class that extends it and override it's methods? Will this class
>>> magically be used instead, or do I have to tell Stripes to use it somehow?
>>>
>>>
>>> I'm running stripes 1.5.3 and java 1.6.0 on Linux
>>>
>>>
>>> Any help is greatly appreciated.
>>>
>>>
>>> Regards,
>>>
>>> Bjorn
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Virtualization is moving to the mainstream and overtaking non-virtualized
>>> environment for deploying applications. Does it make network security
>>> easier or more difficult to achieve? Read this whitepaper to separate the
>>> two and get a better understanding.
>>> http://p.sf.net/sfu/hp-phase2-d2d
>>> _______________________________________________
>>> Stripes-users mailing list
>>> Stripes-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> Virtualization is moving to the mainstream and overtaking non-virtualized
>> environment for deploying applications. Does it make network security
>> easier or more difficult to achieve? Read this whitepaper to separate the
>> two and get a better understanding.
>> http://p.sf.net/sfu/hp-phase2-d2d
>> _______________________________________________
>> Stripes-users mailing list
>> Stripes-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/stripes-users
>>
>>
>
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security 
easier or more difficult to achieve? Read this whitepaper to separate the 
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to