And, set it in the struts.properties file as the ActionMapper:

struts.mapper.class=org.apache.struts2.dispatcher.mapper.LsfwebMapper


On Feb 19, 2008 10:09 AM, Filipe David Manana <[EMAIL PROTECTED]> wrote:

> I managed to find a solution to be able to use extensionless actions.
> Just subclass the DefaultActionMapper like this:
>
> package org.apache.struts2.dispatcher.mapper;
> >
> > import java.util.*;
> >
> > public class LsfwebMapper extends DefaultActionMapper
> > {
> >    private static List<String> ignoredExtensions = new
> > ArrayList<String>();
> >
> >    static
> >    {
> >       ignoredExtensions.add(".jsp");
> >       ignoredExtensions.add(".css");
> >       ignoredExtensions.add(".js");
> >       ignoredExtensions.add(".gif");
> >       ignoredExtensions.add(".png");
> >       ignoredExtensions.add(".html");
> >    }
> >
> >
> >    String dropExtension(String name)
> >    {
> >       Iterator<String> it = ignoredExtensions.iterator();
> >
> >       while ( it.hasNext() )
> >       {
> >          if ( name.endsWith(it.next()) )
> >             return null;
> >       }
> >
> >       return super.dropExtension(name);
> >    }
> > }
> >
> >
> Don't forget to place this class in a directory named
> org/apache/struts2/dispatcher/mapper/  within your source directory,
> src/main/java/ (if using maven).
>
>
>
> On Sat, Jan 12, 2008 at 6:28 PM, Filipe David Manana <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
> >
> > I have set the property struts.action.extension to the empty string. I
> > can now invoke my actions with the default ".action" suffix, although I have
> > a problem:
> >
> > css files (ending in .css) and javascript (.js) are no longer accessible
> > to the client.
> >
> > How can I fix this?
> >
> > cheers
> >
> > --
> > Filipe David Manana,
> > [EMAIL PROTECTED]
> >
> > Obvious facts are like secrets to those not trained to see them.
>
>
>
>
> --
> Filipe David Manana,
> [EMAIL PROTECTED]
>
> Obvious facts are like secrets to those not trained to see them.
>



-- 
Filipe David Manana,
[EMAIL PROTECTED]

Obvious facts are like secrets to those not trained to see them.

Reply via email to