struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 梁炳場 <pc.le...@gmail.com>
Subject Re: set different attribute according to the change of parameter
Date Sat, 08 Oct 2005 07:08:31 GMT
Should the parameter be passed into Action class by
http://xxx/foo?a=b ?

Can the Action class get the parameter value
and the link is http://xxx/foo only?

I do not want the parameter appear in the URL.

Thanks

2005/10/8, Laurie Harper <laurie@holoweb.net>:
> 梁炳場 wrote:
> > Can I do the following?
> >
> > Same action class sets different attribute
> > according to the change of parameter?
> >
> > Thanks
> >
> > <action path="/userProfileMaint"
> >       type="com.erp.struts.SetRoleHref"
> >       parameter="userProfileMaint"
> >
> > <action path="/quotationMaint"
> >       type="com.erp.struts.SetRoleHref"
> >       parameter="quotationMaint"
> >
> > public class SetRoleHref extends Action {
> >           String myValue = request.getParameter("parameter");
> >           session.setAttribute("rolehref", myValue);
>
> Sure, you can do that, except that the 'parameter' attribute in the
> action mapping isn't exposed as a request parameter (those come from the
>  HTTP request). You need to call getParameter() on the ActionMapping
> instance instead.
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
Mime
View raw message