You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Karr, David" <da...@wamu.net> on 2008/07/13 03:55:14 UTC
Thoughts of using explicit regexps instead of wilcards for action mappings?
One thing that's always bothered me a bit about using wildcards for
action mappings is that it's somewhat less self-documenting than I'd
like. Although I like being more concise, I'd really rather have an
alternative form that is still concise but still specifies what possible
wildcard values to expect.
For instance, if instead of specifying an action name like "MyStuff_*",
I instead used a regular expression, like
"MyStuff_(add|save|load|delete)", that is still more concise than having
to repeat all the almost duplicate actions, but it says specifically
what patterns to expect. The simplified wildcard system doesn't allow
for this.
Obviously, this would require a code change to allow regular expression
action name matching instead of the simplified regexp that is used now.
Has anyone ever considered this?
Re: Struts Text & Property together(s:text and s:property
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Jishnu Viswanath wrote:
> Hi all,
> I would like to achieve something like this <s:text name=<s:
> property value="someProperty" /> />
>
>
If your action extends ActionSupport, or implements TextProvider, or a
TextProvider is in the ValueStack, then you can call one of the various
getText() methods to access resources.
Something like the following should work:
<s:property value="getText(someProperty)"/>
ie. evaluate someProperty, then invoke the getText(String) method to get
the resource with that name.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Struts Text & Property together(s:text and s:property
Posted by Jishnu Viswanath <ji...@tavant.com>.
Hi all,
I would like to achieve something like this <s:text name=<s:
property value="someProperty" /> />
I know this code is not going to work; in short the name that should
come is inside a property,
Eg:-
someProperty = "my.text.label"
<s:property value=" someProperty "/> gives me my.text.label
<s:text name="my.text.label"/> give me the value I wanted.
But how can I get both at same time?
Any one has any idea?
PS: I am using struts 2 :)
Regards,
Jishnu Viswanath
Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Thoughts of using explicit regexps instead of wilcards for action
mappings?
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Karr, David wrote:
> "MyStuff_(add|save|load|delete)", that is still more concise than having
>
>
> Has anyone ever considered this?
>
>
I threw this together but don't use it any more:
http://code.google.com/p/struts2urlplugin/
You can plugin a regex matcher (default) or plaintext or others.
After using it for a while I found it more effective to build custom
action mappers instead of over-engineer an all-purpose actionmapper.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org