struts-user mailing list archives

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

Hi 
All
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 ?

Thanks 




//=============================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"; 
   
    }


	@Override
	public void setSession(Map arg0) {
		// TODO Auto-generated method stub
		
	}   
    
	
	
	
	
} 
-- 
View this message in context: http://www.nabble.com/struts-2-request.getPramter---ActionContext-tp15434537p15434537.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message