struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@blueyonder.co.uk>
Subject Re: case insensitive action mapping ?
Date Fri, 18 Jun 2004 20:14:41 GMT
The only thing you missed out from saying is that they would then need to
configure Struts to use their custom RequestProcessor and custom
ActionConfig:

http://jakarta.apache.org/struts/userGuide/configuration.html

An alternative to Navjot's suggestion might to be change the
RequestProcessor to store the actions in a "case insensitive" map - extend
HashMap and override the get/set methods to convert to lower case (Commons
has a CaseInsensitiveMap object, but it doesn't extend HashMap, so you
couldn't use it here).

Then you would only need a custom RequestProcessor (and not custom
ActionConfig).

All you would need to do is override the RequestProcessor init() method as
follows:

    public void init(ActionServlet servlet,
                     ModuleConfig moduleConfig)
           throws ServletException {

           actions = new CaseInsensitiveMap();

           super.init(servlet, moduleConfig);

    }

Niall

----- Original Message ----- 
From: "Navjot Singh" <navjot.s@net4india.net>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, June 18, 2004 10:46 AM
Subject: Re: case insensitive action mapping ?


> i am not sure about any config that can help but all you need to is
> + override processPath method in RequestProcessor to check for
> case-insenstive path.
> + override ActionConfig class to keep path saved in lowercase/uppercase.
>
> list, am i missing anything?
>
> navjot
>
> Albrecht Berger wrote:
>
> > Hello,
> > at least one search-engine that is crawling my sites is
> > trying to access the controllers with a to lower case converted
> > urls.
> > For example the action "displayContent.do" is called
> > "displaycontent.do", which couldn't be found by RequestProcessor.
> >
> > Is there any configuration that is able to handle the action mapping
> > case insensitive ?
> >
> > Thx
> > berger
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> > .
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message