struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jneto <>
Subject struts 2 request.getPramter - ActionContext
Date Tue, 12 Feb 2008 16:57:35 GMT

I need a help about the ActionContext 

ActionContext context = ActionContext.getContext();

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 attached Action ?


//=============================My Action==============================

package example;

import java.text.SimpleDateFormat;   
import java.util.ArrayList;
import java.util.Date;   
import java.util.List;
import java.util.Map;   
import org.apache.struts2.interceptor.SessionAware;   
import com.opensymphony.xwork2.Action;   
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;   
import example.ClienteBean;
import example.ClienteDAO;

import java.util.Map;   
public class teste extends ActionSupport implements SessionAware{   
   private static final long serialVersionUID = -300519118088286674L;   
    public String execute(){
    	ActionContext context = ActionContext.getContext();

    	//=========I need to get the parameter right  here, What do I do?

		return "sucess"; 

	public void setSession(Map arg0) {
		// TODO Auto-generated method stub
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message