File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem in DynaValidatorForm Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in DynaValidatorForm" Watch "problem in DynaValidatorForm" New topic

problem in DynaValidatorForm

Narasimha Raju Naidu
Ranch Hand

Joined: Mar 23, 2007
Posts: 37
hi to all

i am not getting the parameter values whlie dispalying the errors. i am providing all my code here can any one help me regarding this

Form Bean


import javax.servlet.http.*;import org.apache.struts.action.*;import org.apache.struts.validator.*; public class URFormBean extends DynaValidatorForm{public void reset(ActionMapping actionMapping,HttpServletRequest req){System.out.println("reset called");set("userName","UserName");set("passOne","");set("passTwo","");set("age","");set("email","email id");System.out.println("reset end");}}




import javax.servlet.http.*;import org.apache.struts.action.*; public class URAction extends Action{public ActionForward execute(ActionMapping actionMapping,ActionForm form,HttpServletRequest req,HttpServletResponse res)throws Exception{try{URFormBean ufb=(URFormBean)form;}catch (Exception e){System.out.println("error");} //System.out.println((String)ufb.get("userName"));return actionMapping.findForward("ur");}}


Form: urform.jsp


<%@ taglib uri="/tags/struts-html" prefix="html"%><html:html><head><title>User Registration Form</title></head><body><html:errors/><html:form action=""><b>User Name:</b><html:text property="userName"/><br><b>Password:</b><html assword property="passOne"/><br><b>Re-password:</b><html assword property="passTwo"/><br><b>age:</b><html:text property="age"/><br><b>email:</b><html:text property="email"/><br><html:submit property="submit" value="Register"/></html:form></body></html:html>


sucess page after sucessfully registered


all the above are different source code and im not getting any errors or exceptions
can any one tell where i am doing mistakes

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864

The code you've posted is virtually unreadable. Please format your code with line breaks and indentations to make it more readable. Once you have formatted it, surround it with UBB code tags. By this, I mean [ c o d e ] and [ / c o d e ]. This will preserve the formatting in the post.

*Note, I put extra spaces in the tags above so they wouldn't be interpretted as real UBB tags. You should remove them when you put them in your post.

Consultant, Sima Solutions
I agree. Here's the link:
subject: problem in DynaValidatorForm
It's not a secret anymore!