struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Re: s2: user-frendly urls in struts2
Date Sun, 27 Jul 2008 19:44:04 GMT
You might want to look into the RESTful URL's plugin.  But you can
just override the extension.  I usually set mine to .html (to hide the
technology being used), but I believe you can set it no nothing as
well. I use the following in struts.xml, I believe you can set the
value to "" also.

  <constant name="struts.action.extension" value="html"/>

You'll also have to change the servlet-mapping in web.xml to match.
  (*Chris*)

On Sun, Jul 27, 2008 at 9:27 AM, lei.java@gmail.com <lei.java@gmail.com> wrote:
> Hi,
>
> I have an action which can be reached by
>
>   - http://<hostname>/friends/viewpix.action
>
>
>   - http://<hostname>/friends/viewpix.action?id=2222
>
>
> My client doesn't want the *.action* to appear in the urls so is there a way
> to launch the action by using friendly urls, e.g., like these:
>
>
>   - http://<hostname>/friends/viewpix
>   - http://<hostname>/friends/viewpix?id=2222.
>
>
> Thanks.
>

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


Mime
View raw message