aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem in DynaValidatorForm" Watch "problem in DynaValidatorForm" New topic
Author

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 class:URformBean.java

code:
--------------------------------------------------------------------------------

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");}}

--------------------------------------------------------------------------------



Action class:URAction.java


code:
--------------------------------------------------------------------------------

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


code:
--------------------------------------------------------------------------------

<%@ taglib uri="/tags/struts-html" prefix="html"%><html:html><head><title>User Registration Form</title></head><body><html:errors/><html:form action="ura.do"><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>

--------------------------------------------------------------------------------



and
sucess page after sucessfully registered

struts-config.xml





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


regards
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Narasimha,

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.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in DynaValidatorForm