struts-config.xml <form-beans> <form-bean name="QueryParamsForm" type="app.QueryParamsForm"/> </form-beans> <action-mappings> <action path = "/QueryParams" type = "app.QueryParamsAction" name = "QueryParamsForm" validate = "false" > <forward name="nextPage" path="/QueryParams.jsp" /> </action> </action-mappings>
ActionForm has the setter and getter methods for name, age and description. Action: public final class QueryParamsAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form1, HttpServletRequest request, HttpServletResponse response) throws Exception { QueryParamsForm form = (QueryParamsForm)form1; //String name = (String) PropertyUtils.getSimpleProperty(form, "name"); String name = (String) request.getParameter("name"); //String age = (String) PropertyUtils.getSimpleProperty(form, "age"); String age = (String) request.getParameter("age"); String description = (String) PropertyUtils.getSimpleProperty(form, "description"); out.println(name); out.println(age); out.println(description); return (mapping.findForward("nextPage")); } My initial query string is: http://localhost:8080/vijay/QueryParams.do?name=vijay&age=26 This instantiates the ActionForm, sets age and name, comes to teh Action, print age and name correctly, prints description as null(as expected), goes to "nextPage" whcih is QueryParams.jsp. In QueryParams.jsp, I print name, age and assign a textbox for the atribute 'description' which when submitted should set description in the ActionForm. It does so. When it comes back to Action, description gets printed but name and age are now null. > It should work the way you want (session scoped forms retain > their values.) > > Post the relevant parts of struts-config (the form bean and action) > and the part of the Action code where you're trying to access the form > properties, and see if someone can spot a problem. Also describe > the flow > of your app. > > My guess is that you're dealing with two different form beans, > but I need to > see the config file. > > -- > Wendy Smoak > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]