Struts 2 spassword input type password sample code

Struts 2 spassword input type password sample code

In this example you will see how to use s:password which is similar to html input type password. Below is sample which we use in our demo and also field label will be retrieved from ResourceBundle using key attribute: 

<s:password key=”label.password” name=”password” />

  • Project structure:

Struts 2 spassword input type password sample code

  • index.jsp

  • success.jsp:

  •  Struts2SampleCodeAction.java

  • Web page output:

Struts 2 spassword input type password sample code

  • Validation of fields without any data when click Submit button:

Struts 2 spassword input type password sample code

  • Enter data:

Struts 2 spassword input type password sample code

  • After click Submit button:

Struts 2 spassword input type password sample code

For more information please read details on struts 2 site here 

download  Download Project:  Struts2ExampleCode

Leave a Reply

Your email address will not be published. Required fields are marked *