Dear David,
Thanks for the solution, but in that case I beleive session will be overloaded. I want to keep this one as the last defence.I have just tried with a small PoC,
here is the code
My JSP -
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
</head>
<body>
<s:form id="Login" name="Login" action="myAction">
<s:textfield value="%{userid}" name="%{userid}">
</s:textfield>
<s:submit>Login</s:submit>
</s:form>
</body>
</html>
My Action Class
public class MyTestAction extends ActionSupport implements ServletRequestAware {
private static final long serialVersionUID = -3594301868048109081L;
private
String userid;
private HttpServletRequest request;
public String execute() throws Exception {
System.out.println("Step 3");
setUserid(userid);
if(this.userid!="sa")
return SUCCESS;
else
return INPUT;
}
public String getUserid() {
System.out.println("Step 1 " + userid);
return userid;
}
public void setUserid(String userid) {
System.out.println("Step 2 " + userid);
this.userid = userid;
}
public void setServletRequest(HttpServletRequest request) {
System.out.println("Step 4");
this.request = request;
}
}
and my Sturts.xml
<struts>
<include file="struts-default.xml" />
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<package name="ajaxdemo" extends="struts-default">
<action name="myAction" class="ajaxdemo.action.MyTestAction">
<result name="input">/mydetail.jsp</result>
<result>/mydetail.jsp</result>
</action>
</package>
</struts>
A very simple form with a textbox and user can enter his name. But every time, both the setter and getter of the userid are printing null.
Sorry to disturb you again.
Thanks