I have a jsp page, Action and ActionForm classes.
When sending parameters from JSP to Action, parameters are not being propagated to Action class.
Here is what I have:
struts-config file:
<form-beans>
<form-bean name="myForm" type="path_to_form.FormClass">
</form-bean>
</form-beans>
<action-mappings>
<action path="/myAction" type="somePath.myAction" name="myForm" scope="request" input="/My.jsp">
</action>
</action-mappings>
[/color blue]
JSP file:
function doSearch(val)
{
//frm = document.forms['wbasPropsForm'];
frm = document.wbasPropsForm;
frm.operation.value = "search";
if (checkForm(val))
{
frm.submit();
}
}
<html:form action="myAction.do">
html:text property="strValue" styleClass="searchField"/>
</html:form>
[/color blue]
ActionForm class:
public class FormClass extends ActionForm {
private String _strValue;
public String getStrValue(){return _strAvalue;}
public void setStrValue(String string){_strValue=string;}
[/color blue]
Action class:
FormClass aFormClass = (FormClass) form;
session.setAttribute("myForm", aFormClass);
String val = Utils.trim(aFormClass.getStrValue());
[/color blue]
............
val[/color red] is not getting a value.
If anyone knows the answer to that, it would be greate.
When sending parameters from JSP to Action, parameters are not being propagated to Action class.
Here is what I have:
struts-config file:
<form-beans>
<form-bean name="myForm" type="path_to_form.FormClass">
</form-bean>
</form-beans>
<action-mappings>
<action path="/myAction" type="somePath.myAction" name="myForm" scope="request" input="/My.jsp">
</action>
</action-mappings>
[/color blue]
JSP file:
function doSearch(val)
{
//frm = document.forms['wbasPropsForm'];
frm = document.wbasPropsForm;
frm.operation.value = "search";
if (checkForm(val))
{
frm.submit();
}
}
<html:form action="myAction.do">
html:text property="strValue" styleClass="searchField"/>
</html:form>
[/color blue]
ActionForm class:
public class FormClass extends ActionForm {
private String _strValue;
public String getStrValue(){return _strAvalue;}
public void setStrValue(String string){_strValue=string;}
[/color blue]
Action class:
FormClass aFormClass = (FormClass) form;
session.setAttribute("myForm", aFormClass);
String val = Utils.trim(aFormClass.getStrValue());
[/color blue]
............
val[/color red] is not getting a value.
If anyone knows the answer to that, it would be greate.