This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes Struts and the fly likes struts-validations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts-validations" Watch "struts-validations" New topic


sudha javvadi
Ranch Hand

Joined: Mar 23, 2007
Posts: 97
Hi All,

I did a sample application using struts1.3.8. I have two fields username and password. Even though I am entering username and password I am getting a message "username is required" . What might went wrong? I really couldn't guess , so please help me. Below is the part of struts-config.xml and validation.xml.


<action path="/login"
input="/pages/login.jsp" >
<forward name="success" path="/pages/regSuccess.jsp" />

<form name="login">
<field property="username" depends="required">
<arg key="login.username" />

<field property="pwd" depends="required">
<arg key="login.pwd" />
tanveer chowdry

Joined: Jul 17, 2007
Posts: 21
I don't see any problem with the code. Do you also have validate method in the form ? that may be getting called since you have set validate="true" in the action mapping.

Can you mail the code. I will be able to figure out.

Regards,<br />tanveer<br /> <br />SCJP 1.4 (86%)<br />SCWCD 1.5 (98%)
sudha javvadi
Ranch Hand

Joined: Mar 23, 2007
Posts: 97
Thankyou for your reply tanveer. I got what the mistake I made. Now it is working correctly.

I agree. Here's the link:
subject: struts-validations
It's not a secret anymore!