I am new to Struts and want to pass an attribute from Action servlet to JSP
I had been trying to get the values which is sent as an attribute from the Action servlet to JSP.
Action Servlet
userRegistrationForm.setUserName(userName);
userRegistrationForm.setComments(comments);
userRegistrationForm.setEmail(email);
userRegistrationForm.setPassword(password);
request.setAttribute(mapping.getName(),userRegistrationForm);
return mapping.findForward("result");
In JSP i try to read as such it displays the attribute value as null.
<html:form action="/userRegistration" >
<bean:struts id="myFormBean" formBean="userRegistrationForm"/>
<bean:write name="myFormBean" property="userName"/>
<bean:write name="myFormBean" property="comments"/>
<bean:write name="myFormBean" property="email"/>
<bean:write name="myFormBean" property="password"/>
</html:form>
Please suggest me how to get back the values from the servlet to the JSP page...
Thanks in Advance