You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Supratim Bandyopadhyaya <ma...@gmail.com> on 2010/08/11 11:27:33 UTC

how to remove .action suffix in struts 2.1

Hi all,
I need to remove the .action suffix associated with the actions.
Please advise how to do this.
Thanks and regards,
Supratim

Re: how to remove .action suffix in struts 2.1

Posted by Łukasz Lenart <lu...@gmail.com>.
Do you use the REST plugin ? If so please try with the latest snapshot
as there was a bug in RestActionMapper which prevents to properly
handle static resources.


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

2012/7/10 lucas owen <sr...@gmail.com>:
> thanks Lukasz, but I get the same error.
>
> my welcome file is index.html, so first of all it complains:
>
> HTTP 404 - There is no Action mapped for namespace / and action name
> index.html
>
> But now I can access my actions without the .action in the URL. The problem
> is that the CSS's dont display, I presume that it's requesting style.css and
> because of the new configuration it's expecting style.css to be an action...
>
> --
>
> My configuration:
>
> <constant name="struts.action.extension" value=""/>    --> in struts.xml
>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> --> in web.xml
>
> thanks in advance!!
>
>
> 2012/7/10 Łukasz Lenart <lu...@googlemail.com>
>>
>> 2012/7/10 lucas owen <sr...@gmail.com>:
>> > <filter-mapping>
>> > <filter-name>struts2</filter-name>
>> > <url-pattern>*</url-pattern>
>> > </filter-mapping>
>>
>> It should be /*
>>
>> And what kind of error do you have with css ?
>>
>>
>> Regards
>> --
>> Łukasz
>> mobile +48 606 323 122 http://www.lenart.org.pl/
>> Warszawa JUG conference - Confitura http://confitura.pl/
>>
>> ---------------------------------------------------------------------
>> 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


Re: how to remove .action suffix in struts 2.1

Posted by lucas owen <sr...@gmail.com>.
thanks Lukasz, but I get the same error.

my welcome file is index.html, so first of all it complains:

HTTP 404 - There is no Action mapped for namespace / and action name
index.html

But now I can access my actions without the .action in the URL. The problem
is that the CSS's dont display, I presume that it's requesting style.css
and because of the new configuration it's expecting style.css to be an
action...

--

My configuration:

<constant name="struts.action.extension" value=""/>    --> in struts.xml

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
--> in web.xml

thanks in advance!!


2012/7/10 Łukasz Lenart <lu...@googlemail.com>

> 2012/7/10 lucas owen <sr...@gmail.com>:
> > <filter-mapping>
> > <filter-name>struts2</filter-name>
> > <url-pattern>*</url-pattern>
> > </filter-mapping>
>
> It should be /*
>
> And what kind of error do you have with css ?
>
>
> Regards
> --
> Łukasz
> mobile +48 606 323 122 http://www.lenart.org.pl/
> Warszawa JUG conference - Confitura http://confitura.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: how to remove .action suffix in struts 2.1

Posted by Łukasz Lenart <lu...@googlemail.com>.
2012/7/10 lucas owen <sr...@gmail.com>:
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>*</url-pattern>
> </filter-mapping>

It should be /*

And what kind of error do you have with css ?


Regards
-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

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


Re: how to remove .action suffix in struts 2.1

Posted by lucas owen <sr...@gmail.com>.
sorry to resurrect this thread but this solution doesn't work for me (and
I'm using struts 2.1.6)

do i have to change anything else in web.xml?

I have tried from

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>

to

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>

then it works, but I have problems with the CSS

any help is appreciated!!

2010/8/13 Dave Newton <da...@gmail.com>

> Again, XML configuration is the preferred mechanism.
>
> Dave
>
> On Thursday, August 12, 2010, Ruben Cepeda <ru...@hotmail.com>
> wrote:
> >
> > If you haven't done so yet you'll have to create a struts.properties
> file and override it.  Here
> http://struts.apache.org/2.0.11/docs/strutsproperties.html
> >
> > -Ruben Cepeda
> >
> >
> >
> >> Date: Wed, 11 Aug 2010 14:57:33 +0530
> >> Subject: how to remove .action suffix in struts 2.1
> >> From: mail.supratim@gmail.com
> >> To: user@struts.apache.org
> >>
> >> Hi all,
> >> I need to remove the .action suffix associated with the actions.
> >> Please advise how to do this.
> >> Thanks and regards,
> >> Supratim
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: how to remove .action suffix in struts 2.1

Posted by Dave Newton <da...@gmail.com>.
Again, XML configuration is the preferred mechanism.

Dave

On Thursday, August 12, 2010, Ruben Cepeda <ru...@hotmail.com> wrote:
>
> If you haven't done so yet you'll have to create a struts.properties file and override it.  Here http://struts.apache.org/2.0.11/docs/strutsproperties.html
>
> -Ruben Cepeda
>
>
>
>> Date: Wed, 11 Aug 2010 14:57:33 +0530
>> Subject: how to remove .action suffix in struts 2.1
>> From: mail.supratim@gmail.com
>> To: user@struts.apache.org
>>
>> Hi all,
>> I need to remove the .action suffix associated with the actions.
>> Please advise how to do this.
>> Thanks and regards,
>> Supratim
>

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


RE: how to remove .action suffix in struts 2.1

Posted by Ruben Cepeda <ru...@hotmail.com>.
If you haven't done so yet you'll have to create a struts.properties file and override it.  Here http://struts.apache.org/2.0.11/docs/strutsproperties.html

-Ruben Cepeda



> Date: Wed, 11 Aug 2010 14:57:33 +0530
> Subject: how to remove .action suffix in struts 2.1
> From: mail.supratim@gmail.com
> To: user@struts.apache.org
> 
> Hi all,
> I need to remove the .action suffix associated with the actions.
> Please advise how to do this.
> Thanks and regards,
> Supratim
 		 	   		  

Re: how to remove .action suffix in struts 2.1

Posted by Dave Newton <da...@gmail.com>.
(Although XML configuration is really the preferred mechanism.)

Dave

On Wed, Aug 11, 2010 at 7:19 AM, Rakeshkumar Parmar <
rakeshkumar_parmar@persistent.co.in> wrote:

> Hi,
>
>  You can find it in struts-default.properties file.
>           struts.action.extension=action
>
>  create struts.properties file in /WEB-INF/class and provide no extension.
> That should work for you.
>
> regards,
> Rakesh
>
> -----Original Message-----
> From: Supratim Bandyopadhyaya [mailto:mail.supratim@gmail.com]
> Sent: Wednesday, August 11, 2010 2:58 PM
> To: Struts Users Mailing List
> Subject: how to remove .action suffix in struts 2.1
>
> Hi all,
> I need to remove the .action suffix associated with the actions.
> Please advise how to do this.
> Thanks and regards,
> Supratim
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Persistent Systems Ltd. It is intended only for the use of
> the individual or entity to which it is addressed. If you are not the
> intended recipient, you are not authorized to read, retain, copy, print,
> distribute or use this message. If you have received this communication in
> error, please notify the sender and delete all copies of this message.
> Persistent Systems Ltd. does not accept any liability for virus infected
> mails.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: how to remove .action suffix in struts 2.1

Posted by Rakeshkumar Parmar <ra...@persistent.co.in>.
Hi,

  You can find it in struts-default.properties file.
           struts.action.extension=action

  create struts.properties file in /WEB-INF/class and provide no extension. That should work for you.

regards,
Rakesh

-----Original Message-----
From: Supratim Bandyopadhyaya [mailto:mail.supratim@gmail.com] 
Sent: Wednesday, August 11, 2010 2:58 PM
To: Struts Users Mailing List
Subject: how to remove .action suffix in struts 2.1

Hi all,
I need to remove the .action suffix associated with the actions.
Please advise how to do this.
Thanks and regards,
Supratim

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

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