You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sergey Proskurnya <ma...@ukr.net> on 2003/12/17 11:51:51 UTC
ActionMapping - regexp pattern matching for path
Hello to all,
In Struts-1.1 it is possible to bind Actions to static URL path,
but is it possible to bind Actions to the set of the paths,
described by Java regular expression?
For example:
<action-mappings>
<action path="/users/.*"
type="com.mysite.UserPageAction"
scope="session"
validate="false">
</action>
</action-mappings>
I mean that in this case the requests for "/users/John/",
"/users/Mary/" and etc. will be handled by "com.mysite.UserPageAction".
Thanks for attention,
Sergey Proskurnya.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: ActionMapping - regexp pattern matching for path
Posted by Ted Husted <hu...@apache.org>.
Not in 1.1, but you can use wildcards in the nightly build.
http://jakarta.apache.org/struts/userGuide/building_controller.html#action_mapping_wildcards
Sergey Proskurnya wrote:
> Hello to all,
>
> In Struts-1.1 it is possible to bind Actions to static URL path,
> but is it possible to bind Actions to the set of the paths,
> described by Java regular expression?
> For example:
> <action-mappings>
> <action path="/users/.*"
> type="com.mysite.UserPageAction"
> scope="session"
> validate="false">
> </action>
> </action-mappings>
>
> I mean that in this case the requests for "/users/John/",
> "/users/Mary/" and etc. will be handled by "com.mysite.UserPageAction".
>
> Thanks for attention,
> Sergey Proskurnya.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: ActionMapping - regexp pattern matching for path
Posted by David Friedman <hu...@ix.netcom.com>.
Can't you use a module and set the action mapping to 'unknown="true"' so
that one particular action is used for everything? If so, you'd need to be
mapping actions as 'do/*' instead of '*.do', theoretically. I've been
meaning to try this now that I'm using /do/* as my Struts v1.1 mapping but I
haven't got around to using any modules yet. (I'm sooo slow on ths project,
like I don't want to do it).
Regards,
David
-----Original Message-----
From: Brice Ruth [mailto:bruth@fiskars.com]
Sent: Wednesday, December 17, 2003 3:27 PM
To: Struts Users Mailing List
Subject: Re: ActionMapping - regexp pattern matching for path
No, I don't believe this is possible currently. Wildcards of any kind
(extending to regexps) are not support for ActionMapping paths.
Sergey Proskurnya wrote:
>Hello to all,
>
>In Struts-1.1 it is possible to bind Actions to static URL path,
>but is it possible to bind Actions to the set of the paths,
>described by Java regular expression?
>For example:
><action-mappings>
> <action path="/users/.*"
> type="com.mysite.UserPageAction"
> scope="session"
> validate="false">
> </action>
></action-mappings>
>
>I mean that in this case the requests for "/users/John/",
>"/users/Mary/" and etc. will be handled by "com.mysite.UserPageAction".
>
>Thanks for attention,
> Sergey Proskurnya.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: ActionMapping - regexp pattern matching for path
Posted by Brice Ruth <br...@fiskars.com>.
No, I don't believe this is possible currently. Wildcards of any kind
(extending to regexps) are not support for ActionMapping paths.
Sergey Proskurnya wrote:
>Hello to all,
>
>In Struts-1.1 it is possible to bind Actions to static URL path,
>but is it possible to bind Actions to the set of the paths,
>described by Java regular expression?
>For example:
><action-mappings>
> <action path="/users/.*"
> type="com.mysite.UserPageAction"
> scope="session"
> validate="false">
> </action>
></action-mappings>
>
>I mean that in this case the requests for "/users/John/",
>"/users/Mary/" and etc. will be handled by "com.mysite.UserPageAction".
>
>Thanks for attention,
> Sergey Proskurnya.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
--
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org