struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <newton.d...@yahoo.com>
Subject Re: struts 2 request.getPramter - ActionContext
Date Tue, 12 Feb 2008 17:13:26 GMT
--- Jneto <j.vieiraneto@gmail.com> wrote:
> I work with struts 1 and I get paramters this way :
> 
> String v_name = request.getParameter("name");
> 
> How do I do with struts 2 in my Action attached?

public setName(String name) {
    v_name = name;
}

then access via v_name or a getName() method.

There are a couple of other ways, too, like implementing ParameterAware or,
as you are asking about, directly accessing the request, which isn't a great
idea.

I'd suggest looking through some of the S2 documentation on the wiki [1, 2,
3].

Dave

[1] http://struts.apache.org/2.x/docs/home.html
[2]
http://struts.apache.org/2.x/docs/how-can-we-access-request-parameters-passed-into-an-action.html
[3] http://struts.apache.org/2.x/docs/coding-actions.html



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


Mime
View raw message