You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vanja Petreski <vp...@gmail.com> on 2008/07/02 13:05:01 UTC
Specific extension per namespace
Hello,
Is it possible to solve the following problem in some other way then
implementing the custom ActionMapper (Struts 2.0.11.1):
1) struts.action.extension=html
2) I am using the rome rss s2 plugin and have the special namespace for
feeds: /feeds
3) I am accessing feed f1 (for example) via .../feeds/f1.html, but I want
this: .../feeds/f1.xml
4) If I change 1) to struts.action.extension=html, xml then I can access via
both xml and html, but I don't want that
5) I want to access all my action that aren't in the feed namespace ONLY via
default html action extension, but actions in the package with the feed
namespace ONLY with xml extension
Thanx,
Vanja
Re: Specific extension per namespace
Posted by Vanja Petreski <vp...@gmail.com>.
Hi Jeromy,
I've just wrote the generic ExtendedActionMapper ;)
Which is the best way to share stuff like this?
V
On Wed, Jul 2, 2008 at 3:33 PM, Jeromy Evans <
jeromy.evans@blueskyminds.com.au> wrote:
> Vanja Petreski wrote:
>
>> Hello,
>>
>> Is it possible to solve the following problem in some other way then
>> implementing the custom ActionMapper (Struts 2.0.11.1):
>>
>> 1) struts.action.extension=html
>>
>> 2) I am using the rome rss s2 plugin and have the special namespace for
>> feeds: /feeds
>>
>> 3) I am accessing feed f1 (for example) via .../feeds/f1.html, but I want
>> this: .../feeds/f1.xml
>>
>> 4) If I change 1) to struts.action.extension=html, xml then I can access
>> via
>> both xml and html, but I don't want that
>>
>> 5) I want to access all my action that aren't in the feed namespace ONLY
>> via
>> default html action extension, but actions in the package with the feed
>> namespace ONLY with xml extension
>>
>> Thanx,
>> Vanja
>>
>>
>>
>
> No there's no built-in solution.
> On the plus side, just because users are able to access /index.xml instead
> of /index.html, it's unlikely they ever would as you never provide links
> like that. This is one of those cases where it's annoying to you, but users
> will rarely notice and if they do they there is no consequence.
>
> A quick solution is a URL filter. eg. in your config for mod_jk so your
> container only sees .xml requests at /feeds/*
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Re: Specific extension per namespace
Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Vanja Petreski wrote:
> Hello,
>
> Is it possible to solve the following problem in some other way then
> implementing the custom ActionMapper (Struts 2.0.11.1):
>
> 1) struts.action.extension=html
>
> 2) I am using the rome rss s2 plugin and have the special namespace for
> feeds: /feeds
>
> 3) I am accessing feed f1 (for example) via .../feeds/f1.html, but I want
> this: .../feeds/f1.xml
>
> 4) If I change 1) to struts.action.extension=html, xml then I can access via
> both xml and html, but I don't want that
>
> 5) I want to access all my action that aren't in the feed namespace ONLY via
> default html action extension, but actions in the package with the feed
> namespace ONLY with xml extension
>
> Thanx,
> Vanja
>
>
No there's no built-in solution.
On the plus side, just because users are able to access /index.xml
instead of /index.html, it's unlikely they ever would as you never
provide links like that. This is one of those cases where it's annoying
to you, but users will rarely notice and if they do they there is no
consequence.
A quick solution is a URL filter. eg. in your config for mod_jk so your
container only sees .xml requests at /feeds/*
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org