You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "jignesh.patel" <ji...@aspl.in> on 2008/03/07 05:53:22 UTC
Dynamic namespace in application
Hi,
I am having struts2 + hibernate application.It uses static
namespace(crud) like http://hax.mysite.com/crud/createUser.action.
I want it to be dynamic like, i can be able to set it with my algorithm
which is unique for each session ...
e.g
for 1 session)
http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
for 2 session)
http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
for 3 session)
http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
...
...
etc.
Is it possible in struts2 and if yes how ?
Thanks in advanced.
--
View this message in context: http://www.nabble.com/Dynamic-namespace-in-application-tp15889942p15889942.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by "jignesh.patel" <ji...@aspl.in>.
This is just for security purpose.Actually it is a very secure application
and i do not want to make rest of the world aware with urls,so they can copy
the urls or keep in history for future use.
jignesh.patel wrote:
>
> Hi,
> I am having struts2 + hibernate application.It uses static
> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
>
> I want it to be dynamic like, i can be able to set it with my algorithm
> which is unique for each session ...
> e.g
> for 1 session)
> http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
>
> for 2 session)
> http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
>
> for 3 session)
> http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
> ...
> ...
> etc.
>
> Is it possible in struts2 and if yes how ?
>
> Thanks in advanced.
>
--
View this message in context: http://www.nabble.com/Dynamic-namespace-in-application-tp15889942p15890274.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
stanlick@gmail.com wrote:
> Dude, that sounds very exciting! I was thinking you were just "tweaking"
> around the existing interceptor. Does it allow filtering on the action
> name?
>
I wouldn't say it's very exciting, but I've found it useful. Yep, you
can filter on the action name and can plugin additional
ActionNameMatcher beans. I'll add an example that someone asked about
recently; using a resource bundle to allow one action to be mapped to
URLs in multiple languages. eg. TicketsAction ->
(tickets|billets|karten).action
I've been careful to ensure it complements the other plugins by not
touching the Struts Configuration at all. You can use Convention, REST,
CodeBehind etc to setup the standard configuration and then use this
plugin to map URLs to it in (hopefully) any way imaginable. With
flexibility comes a performance price though.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by st...@gmail.com.
Dude, that sounds very exciting! I was thinking you were just "tweaking"
around the existing interceptor. Does it allow filtering on the action
name?
Peace,
Scott
On Fri, Mar 7, 2008 at 5:06 PM, Jeromy Evans <
jeromy.evans@blueskyminds.com.au> wrote:
> stanlick@gmail.com wrote:
> > Jeromy --
> >
> > I don't mean to step on your toes and your plug-in sounds great; but
> should
> > this "tiny extra" bit of namespace code be submitted as a patch to the
> > already existing wildcard code?
> Hi Scott,
>
> Xwork 2.1 already includes a NamedVariablePatternMatcher, with the same
> PatternMatcher inteface as the WildcardMatcher.
> They just can't be used at the same time across the application. A
> patch may be possible to do that.
>
> This new plugin consists of 37 new classes or interfaces and is a
> complete rewrite of the ActionMapping process. This plugin makes the
> NamedVariablePatternMatcher pluggable and URL pattern matcher pluggable.
>
> > P.S. What about the RESTful URL plug-in? Does it support swappable
> > namespaces?
> >
> >
>
> It can use the NamedVariablePatternMatcher. I've been using it a lot
> but found it isn't adequate except in the simplest applications.
>
> cheers,
> Jeromy Evans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Scott
stanlick@gmail.com
Re: Dynamic namespace in application
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
stanlick@gmail.com wrote:
> Jeromy --
>
> I don't mean to step on your toes and your plug-in sounds great; but should
> this "tiny extra" bit of namespace code be submitted as a patch to the
> already existing wildcard code?
Hi Scott,
Xwork 2.1 already includes a NamedVariablePatternMatcher, with the same
PatternMatcher inteface as the WildcardMatcher.
They just can't be used at the same time across the application. A
patch may be possible to do that.
This new plugin consists of 37 new classes or interfaces and is a
complete rewrite of the ActionMapping process. This plugin makes the
NamedVariablePatternMatcher pluggable and URL pattern matcher pluggable.
> P.S. What about the RESTful URL plug-in? Does it support swappable
> namespaces?
>
>
It can use the NamedVariablePatternMatcher. I've been using it a lot
but found it isn't adequate except in the simplest applications.
cheers,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by st...@gmail.com.
Jeromy --
I don't mean to step on your toes and your plug-in sounds great; but should
this "tiny extra" bit of namespace code be submitted as a patch to the
already existing wildcard code? I agree the action configuration needs to
be flexible but most of it already is. I would just hate to see the need to
drop three plug-ins to support parameterizing three adjacent attributes in
one action mapping! Plug-ins are an easy way to write these one-off
solutions and I can see things getting crazy without a more global
assessment.
P.S. What about the RESTful URL plug-in? Does it support swappable
namespaces?
Scott
On Fri, Mar 7, 2008 at 6:12 AM, Jeromy Evans <
jeromy.evans@blueskyminds.com.au> wrote:
> I've posted the snapshot jar, example source and an example webapp:
> http://code.google.com/p/struts2urlplugin/downloads/list
>
> The full source is being synsync'd to googlecode as I type.
> I won't make a formal release until there's user documentation, but
> you're welcome to ask me questions.
>
> The namespace example exactly matches your requirement. A userId is
> passed through the action's namespace to the UserAction.
>
> jignesh.patel wrote:
> > thanks jeromy
> > It would be fine for me,if you will send binary or any plug in example.
> >
> >
> > jignesh.patel wrote:
> >
> >> Hi,
> >> I am having struts2 + hibernate application.It uses static
> >> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
> >>
> >> I want it to be dynamic like, i can be able to set it with my algorithm
> >> which is unique for each session ...
> >> e.g
> >> for 1 session)
> >>
> http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
> >>
> >> for 2 session)
> >>
> http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
> >>
> >> for 3 session)
> >>
> http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
> >> ...
> >> ...
> >> etc.
> >>
> >> Is it possible in struts2 and if yes how ?
> >>
> >> Thanks in advanced.
> >>
> >>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Scott
stanlick@gmail.com
Re: Dynamic namespace in application
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
I've posted the snapshot jar, example source and an example webapp:
http://code.google.com/p/struts2urlplugin/downloads/list
The full source is being synsync'd to googlecode as I type.
I won't make a formal release until there's user documentation, but
you're welcome to ask me questions.
The namespace example exactly matches your requirement. A userId is
passed through the action's namespace to the UserAction.
jignesh.patel wrote:
> thanks jeromy
> It would be fine for me,if you will send binary or any plug in example.
>
>
> jignesh.patel wrote:
>
>> Hi,
>> I am having struts2 + hibernate application.It uses static
>> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
>>
>> I want it to be dynamic like, i can be able to set it with my algorithm
>> which is unique for each session ...
>> e.g
>> for 1 session)
>> http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
>>
>> for 2 session)
>> http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
>>
>> for 3 session)
>> http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
>> ...
>> ...
>> etc.
>>
>> Is it possible in struts2 and if yes how ?
>>
>> Thanks in advanced.
>>
>>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by "jignesh.patel" <ji...@aspl.in>.
thanks jeromy
It would be fine for me,if you will send binary or any plug in example.
jignesh.patel wrote:
>
> Hi,
> I am having struts2 + hibernate application.It uses static
> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
>
> I want it to be dynamic like, i can be able to set it with my algorithm
> which is unique for each session ...
> e.g
> for 1 session)
> http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
>
> for 2 session)
> http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
>
> for 3 session)
> http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
> ...
> ...
> etc.
>
> Is it possible in struts2 and if yes how ?
>
> Thanks in advanced.
>
--
View this message in context: http://www.nabble.com/Dynamic-namespace-in-application-tp15889942p15890674.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Dave Newton wrote:
> --- "jignesh.patel" <ji...@aspl.in> wrote:
>
>> I am having struts2 + hibernate application.It uses static
>> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
>>
>> I want it to be dynamic like, i can be able to set it with my algorithm
>> which is unique for each session ... e.g for 1 session)
>>
>>
> http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
>
>> for 2 session)
>>
>>
> http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
>
>>
>> for 3 session)
>>
>>
> http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
>
>> ...
>> ...
>> etc.
>>
>> Is it possible in struts2 and if yes how ?
>>
>
> You might be able to do something with a wildcard mapping, although I don't
> think it would be a real namespace.
>
> Why would you want to do this?
>
> Dave
>
>
If you're prepared to use an alpha version of a new plugin you'll be
able to do this easily with the following modification to struts.xml:
<package name="crud" namespace="/{userId}"/>
where userId is a property that will be set on your action. The
plugin's placeholder is on googlecode but I haven't had time to write
the userguide/wiki so it's not announced yet.
If you're interested I can post a binary and example early.
http://code.google.com/p/struts2urlplugin/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Dynamic namespace in application
Posted by Dave Newton <ne...@yahoo.com>.
--- "jignesh.patel" <ji...@aspl.in> wrote:
> I am having struts2 + hibernate application.It uses static
> namespace(crud) like http://hax.mysite.com/crud/createUser.action.
>
> I want it to be dynamic like, i can be able to set it with my algorithm
> which is unique for each session ... e.g for 1 session)
>
http://hax.mysite.com/2345RA234/createUser.action....http://hax.mysite.com/2345RA234/showUser.action...etc
>
> for 2 session)
>
http://hax.mysite.com/2323F3B2S/createUser.action....http://hax.mysite.com/2323F3B2S/showUser.action...etc
>
> for 3 session)
>
http://hax.mysite.com/E3459A531/createUser.action....http://hax.mysite.com/E3459A531/showUser.action...etc
> ...
> ...
> etc.
>
> Is it possible in struts2 and if yes how ?
You might be able to do something with a wildcard mapping, although I don't
think it would be a real namespace.
Why would you want to do this?
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org