You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dale Newfield <Da...@Newfield.org> on 2008/03/03 17:28:35 UTC

Re: [struts] How to use Action Mapper?

smart acer wrote:
> Could anyone please guide me how to setup/use ActionMapper ---
> 
> I would like the URL http://localhost:9080/StrutsBlankWeb/example/ to
> redirect to http://localhost:9080/StrutsBlankWeb/example/HelloWorld.action

Sounds like you are looking for http://tuckey.org/urlrewrite/

-Dale

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


Re: [struts] How to use Action Mapper?

Posted by Dale Newfield <Da...@Newfield.org>.
smart acer wrote:
> Unfortunately only apache opensource is allowed for us so we cant use this.

I'm glad I don't have to deal with policies like this one.

> I think I can investigate putting the redirect in interceptor, and if that
> doesnt work then servlet filter? I thought ActionMapper does some of this.

The first problem you'll have if you try to push this inside the struts 
portion of your web application is that you'll need to configure struts 
to handle EVERY request (i.e.: an empty extension matches everything), 
so then you'll have to jump through hoops to get static content (.css, 
.js, images, etc.) working again.  Once you've got that fixed, you'll 
need to write a special purpose ActionMapper to handle this individual 
case (while not messing up the mapping for other actions), and then I 
predict you'll still have problems with "/StrutsBlankWeb/example/" vs 
"/StrutsBlankWeb/example".

-Dale

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


Re: [struts] How to use Action Mapper?

Posted by smart acer <sm...@gmail.com>.
The URL is actually derived from namespace, not context. (eg: context is
"StrutsBlankWeb", package namespace "/example"). And for whatever reason it
didnt occur to me that I could create a directory example inside Web Content
and put the welcome file! I am all set now, thanks!


On 3/3/08, Dave Newton <ne...@yahoo.com> wrote:
>
> You could also just use a welcome file with a redirect.
>
> --- smart acer <sm...@gmail.com> wrote:
> > thanks, yes to some extent this is what I am looking for but not the
> > complete features as mod_rewrite. Unfortunately only apache opensource
> is
> > allowed for us so we cant use this.
> >
> > I think I can investigate putting the redirect in interceptor, and if
> that
> > doesnt work then servlet filter? I thought ActionMapper does some of
> this.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: [struts] How to use Action Mapper?

Posted by Dave Newton <ne...@yahoo.com>.
You could also just use a welcome file with a redirect.

--- smart acer <sm...@gmail.com> wrote:
> thanks, yes to some extent this is what I am looking for but not the
> complete features as mod_rewrite. Unfortunately only apache opensource is
> allowed for us so we cant use this.
> 
> I think I can investigate putting the redirect in interceptor, and if that
> doesnt work then servlet filter? I thought ActionMapper does some of this.


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


Re: [struts] How to use Action Mapper?

Posted by smart acer <sm...@gmail.com>.
Hi Dale,

thanks, yes to some extent this is what I am looking for but not the
complete features as mod_rewrite. Unfortunately only apache opensource is
allowed for us so we cant use this.

I think I can investigate putting the redirect in interceptor, and if that
doesnt work then servlet filter? I thought ActionMapper does some of this.

Thanks
-Vj


On 3/3/08, Dale Newfield <Da...@newfield.org> wrote:
>
> smart acer wrote:
> > Could anyone please guide me how to setup/use ActionMapper ---
> >
> > I would like the URL http://localhost:9080/StrutsBlankWeb/example/ to
> > redirect to
> http://localhost:9080/StrutsBlankWeb/example/HelloWorld.action
>
> Sounds like you are looking for http://tuckey.org/urlrewrite/
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>