You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Antonio Sánchez <ju...@gmail.com> on 2013/10/31 16:46:29 UTC

About struts.mapper.action.prefix.enabled

As far as I know the only way to render a cancel button inside a form is 
this:

<s:submit value="%{getText('button.label.cancel')}" 
action="cancelFormAction"/>

This requires

struts.mapper.action.prefix.enabled = true.

I can't imagine  a middle-high size development which does not use a 
single cancel button.

Shouldn't 'struts.mapper.action.prefix.enabled=true' by default?

Or, is there any other way to render a cancel button?



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


Re: Antwort: About struts.mapper.action.prefix.enabled

Posted by Lukasz Lenart <lu...@apache.org>.
2013/10/31 Antonio Sánchez <ju...@gmail.com>:
>> That requires to enable Dynamic Method Invocation.
>
> DMI is discouraged. It's better to enable action prefix.

But you can control it - you know what methods are available in the
action class. And many people opted to keep this functionality, so it
still be available but improved.

> I still believe there must be a strong reason why action prefix is disabled
> by default.

Think about action: prefix in the same manner as about method: prefix
but you aren't restricted to on class, but to whole application (in
case of actions).


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: Antwort: About struts.mapper.action.prefix.enabled

Posted by Antonio Sánchez <ju...@gmail.com>.
> That requires to enable Dynamic Method Invocation. 

DMI is discouraged. It's better to enable action prefix.

> Another option is to use not a button but a simple link. If your 
> application is stateless there is no need to POST a cancel request. 

Usually a middle size application will almost always use forms.

----------

I still believe there must be a strong reason why action prefix is 
disabled by default.

Thanks and regards.
Antonio

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


Antwort: About struts.mapper.action.prefix.enabled

Posted by Christoph Nenning <Ch...@lex-com.net>.
> As far as I know the only way to render a cancel button inside a form is 

> this:
> 
> <s:submit value="%{getText('button.label.cancel')}" 
> action="cancelFormAction"/>
> 
> This requires
> 
> struts.mapper.action.prefix.enabled = true.
> 
> I can't imagine  a middle-high size development which does not use a 
> single cancel button.
> 
> Shouldn't 'struts.mapper.action.prefix.enabled=true' by default?
> 
> Or, is there any other way to render a cancel button?
> 
> 

There are several ways.

One is to use a action method instead of an action:

<s:submit value="%{getText('button.label.cancel')}" method="cancel" />

That requires to enable Dynamic Method Invocation. And your actions must 
implement a cancel() method.


Another option is to use not a button but a simple link. If your 
application is stateless there is no need to POST a cancel request.


Regards,
Christoph

This Email was scanned by Sophos Anti Virus