Home Answers Viewqa Struts Validating the password field

 
 


Sidhu
Validating the password field
0 Answer(s)      4 months and 3 days ago
Posted in : Struts

When the validate method returns back to the registration page the password field get cleared there by asking again one more time to enter the password field at the time of re-submitting the form

*newuser.jsp*

<%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> Registration

RegAction.java

public class RegAction extends ActionSupport{

private String fname;
private String lname;
private String uname;
private String pwd;
private String gender;
private String country;
private String hobbies;
private String address;

public String getAddress() {
    return address;
}

public void setAddress(String address) {
    this.address = address;
}

public String getCountry() {
    return country;
}

public void setCountry(String country) {
    this.country = country;
}

public String getFname() {
    return fname;
}

public void setFname(String fname) {
    this.fname = fname;
}

public String getGender() {
    return gender;
}

public void setGender(String gender) {
    this.gender = gender;
}

public String getHobbies() {
    return hobbies;
}

public void setHobbies(String hobbies) {
    this.hobbies = hobbies;
}

public String getLname() {
    return lname;
}

public void setLname(String lname) {
    this.lname = lname;
}

public String getPwd() {
    return pwd;
}

public void setPwd(String pwd) {
    this.pwd = pwd;
}

public String getUname() {
    return uname;
}

public void setUname(String uname) {
    this.uname = uname;
}



@Override
public String execute()
{

    return SUCCESS;

}

@Override
public void validate()
{

    if(getFname().equals("")){
    addFieldError("fname", "Enter First Name");
    }
    else if(getLname().equals("")){
    addFieldError("lname", "Enter Last Name");
    }
    else if (getUname().equals("")){
    addFieldError("uname", "Enter USer Name");
    }

    else if(getPwd().equals("")){
    addFieldError("pwd", "Enter Password");
    }

// else if(getGender().equals("")){ // addFieldError("gender", "Select any Gender"); // }

    else if(getCountry().equals("")){
    addFieldError("country", "Select any Country");
    }

    else if(getHobbies().equals("")){
    addFieldError("hobbies", "Select a Hobby");
    }

    else if (getAddress().equals("")){
    addFieldError("address", "Enter the Address");
    }


}

}

struts.xml

/Login/login.jsp /Login/newuser.jsp

View Answers









Related Pages:
Validating the password field
Validating the password field  When the validate method returns back to the registration page the password field get cleared there by asking again one more time to enter the password field at the time of re-submitting the form
validating username and password from database
validating username and password from database  Hello sir, i am developing a login page. i want that when i fill data in text fields. it validate data from database. if enter data is match from database. page goes to next page
you get a password field in struts
you get a password field in struts   How do you get a password field in struts
How to change password mask field?
How to change password mask field?  I want to use '*' character in password. thanks in advanced............   password masking character in the standard password field can't be changed
Password Field in HTML
Password Field in HTML       When users type characters in a password field, the browser displays asterisks or bullets instead of the characters. Password text field is same
Java Password Field
Java Password Field In this section we will discuss how to use password field in Java. To create a password field in Java Swing JPasswordField is used... of text field which allows to enter password only. Due to the security reason
Validating Number Very Urgent - JSP-Servlet
Validating Number Very Urgent  Respected Sir/Madam, I am R.Ragavendran.. I want u to insert the coding for validating number in the place... field...then u can u use this... function Validate
Validating Emp ID Reply - JSP-Servlet
Validating Emp ID Reply  Respected Sir/Madam, I am Ragavendran.R.. Thanks for your quick response.. Actually I need to check whether Emp ID... ur field name... var anum=/(^\d+$)|(^\d+\.\d+$)/ if (anum.test(id)) return
validating a HTML
validating a HTML  What are the reasons for validating a HTML
change password - JSP-Servlet
password text field. after that, in the new password text field. now user clicks... for a user. this web page consists of changing the password for the existing user. it look like this: current password new password confirm new password SUBMIT
Validating XML
Validating XML  Hi, I have a string containing data in XML format. I have to Validate this xml data. Is there any method in java that allows strings as input to validate xml?   Please visit the following link: http
jQuery password validation
jQuery password Validation : jQuery "equalTo: "#password" " is the method to validate or check password if the element is empty (text input) or  unequal  password type entered. With the help of this password
Password
Password  make a program which ask ask the username and password * in this format. in C language
Login Password Validation iPhone / iPAD
Login Password Validation iPhone / iPAD  HOW TO WRITE A TEST CASE TO SET THE VALIDATION FOR LOGIN AND PASSWORD FIELD IN OBJECTIVE C, IOS.   ...([loginView.passwordField.text length] > 0, @"The field should not be empty"); [loginView release
Developing Forgot Password Form
Developing Forgot Password Form       In this section we will develop Forgot Password Form code for our application. Developing Forgot Password Form  
validating web pages
validating web pages  How to validate HTML web pages
Validating image size
Validating image size  How to validate image size to 2MB in javascript which is updating to mysql database
Send forgot Password through mail - JSP-Servlet
Send forgot Password through mail   hello every one I am designing a admin login page where i am validating the password through file(Example if user Name is Sreenivas and types sree as password i check a file where i
Validating User in JSP
into `user` (`user`, `password`) values('amit','kumar'); Code for validating... Validating User in JSP       Example program for validating user in JSP In this example we have to develop a JSP
Inserting a value to an Enum field in Table
Inserting a value to an Enum field in Table  I'm writing a code..., password varchar (10), is_Admin enum('Y','N'), In the Java code I have a user class with similair attributes: private String username; private String password
validating a form before data is entered.
validating a form before data is entered.  How can I avoid validating a form before data is entered
change password servlets - JSP-Interview Questions
there should be a field for password for curresponding user. The new password...change password servlets  hi all, i need the codes to create a change password servlet.  Hi, I dont have the time to write the code. But i
validating - Swing AWT
validating   hi another problem i am facing in swing is that is i have got many textfeilds ex: Roll No: Name: Address: so Roll No TextField have to Contains only Numbers. Name TextFields have to contain only
validating email id
validating email id  how to validate the email id ?   <html> <script> function validate(){ var e=document.getElementById('email').value; var regExpObj = /(\d\d\d)-\d\d\d\d\d\d\d\d/; var reg
How to retrieve a field from SQLite to Edittext in android
How to retrieve a field from SQLite to Edittext in android  Hi... Im new to android.. i do no how to retrieve a field from database(SQLite). I'd like to retrieve password field to my edittext in my app.. This is my code
How to retrieve a field from SQLite to Edittext in android
How to retrieve a field from SQLite to Edittext in android  Hi... Im new to android.. i do no how to retrieve a field from database(SQLite). I'd like to retrieve password field to my edittext in my app.. This is my code
iPhone Input Field, iPhone Input Field Tutorial
iPhone Input Field Generally, input fields are used to take input from the users.  In iPhone application we can use Text Field to take the input.  Text field displays editable text and once you taps it'll display a keyboard
Using Non Field Validators
Using Non Field Validators You can use non-field validators for server side...; An Example using non field validators is goven below login.jsp <%@ taglib... = 1L; private String userName; private String password; public String
Java swing store the encrypted password into database
. When the user enters the password field, the value is first encrypted... the password field. Example: import javax.swing.*; import java.awt.*; import...Java swing store the encrypted password into database In this tutorial, you
Validating date in javascirpt - Development process
Validating date in javascirpt   Hi Friends, Can u plz give sample code for validating date in javascript using textbox.((dd--mm--yyyy format) Thank u in advance  Hi, The following code may be useful
validating text fields - Swing AWT
validating text fields  hi i am using NETBEANS IDE so when i want to validate TEXTFEILDS if one textfield is blank then it should focus on that particular textfield so help me with this plz..... /* * To change this template
Validating date in javascript - Java Interview Questions
Validating date in javascript   Hi Deepak, Can u give sample code validating date in javascript using text box. thank u in advance  In what format you are going to enter the date in Text box (i.e : dd/mm
forgot password?
forgot password?  forgot password
password check
password check  how to check sighup passowrd and login password
change password
change password  how to change password in the login form.... by giving options to user like this old password, new password.. pls help
Reset Password
Reset Password  coding for reset password
retype password
retype password  coding for retype password
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
forget password?
forget password?  can anyone help me? how to create a module of forget password?the password can reset by generate random password and send to user's email..i develop the php system using xampp and dreamweaver
forget password
forget password  codding for forget password using spring framework
Validating Duplicate Entry To Database - Java Beginners
Validating Duplicate Entry To Database  I have a servlet that adds data to the table called foodtype in (Ms Access). i already have Chinese, vegetarian entered in table. what am trying to do is to validate when entering foodtypes
Forgot password
Forgot password  hi i want to develop a code for when user clicks on forgot password then the next page should be enter his mobile no then the password must be sent to his mobile no...! Thanks in advance Nag Raj
password change
password change  Hi , I am using jsf and trying to write a code to change the password of a user . Ihave to retrine userid fromdata base how to do that using session
3D PASSWORD
3D PASSWORD  HI i would like to know abt where the 3d password in india used and also few info about the 3d password pls rply some1 as soon as possible
Password validation
password and confirm password are same or not Validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
Password validation
Password validation  Hi. I have a change password form. In that i have to check the values given in the new password and confirm password are same or not. Please help.   Here is a code that accepts the current password
PHP User Authentication Login and password check Tutorial
to the database. $dbname="name"; #Password to verify its you. $dbpass="...); //Updates the field "count" where the given //row was specified

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.