Struts2

Struts2 Validation With Example

<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; justify&semi;">&NewLine;<p><b>Introduction to Struts2 Validation Framework<&sol;b><br &sol;>&NewLine;Struts Action 2 relies on a validation framework provided by <b>XWork <&sol;b>to enable the application of input validation rules to your Actions before they are executed&period; Struts2 Validation Framework allows us to separate the validation logic from actual Java&sol;JSP code&comma; where it can be reviewed and easily modified later&period;<&sol;p>&NewLine;<p>The Struts2 Validation Framework alleviates much of the headache associated with handling data validation&comma; allowing you to focus on validation code and not on the mechanics of capturing data and re-displaying incomplete or invalid data&period;<&sol;p>&NewLine;<p>Validation framework comes with set of useful routines to handle form validation automatically and it can handle both server side as well as client side form validation&period; If certain validation is not present&comma; you can create your own validation logic by implementing java interface <i><b>com&period;opensymphony&period;xwork2&period;Validator<&sol;b><&sol;i> and plug it into validation framework as a re-usable component&period;<&sol;p>&NewLine;<p>Validator uses XML configuration files to determine which validation routines should be installed and how they should be applied for a given application&period; <i><b>validators&period;xml<&sol;b><&sol;i> file contains all common validators declaration&period; If <i><b>validators&period;xml<&sol;b><&sol;i> file is not present in classpath&comma; a default validation file is loaded from path <i><b>com&sol;opensymphony&sol;xwork2&sol;validator&sol;validators&sol;default&period;xml&period;<&sol;b><&sol;i><&sol;p>&NewLine;<p>The first configuration file&comma; <i><b>validator-rules&period;xml&comma;<&sol;b><&sol;i> declares the validation routines that should be plugged into the framework and provides logical names for each of the validations&period; The <i><b>validator-rules&period;xml <&sol;b><&sol;i>file also defines client-side JavaScript code for each validation routine&period; Validator can be configured to send this JavaScript code to the browser so that validations are performed on the client side as well as on the server side&period;<&sol;p>&NewLine;<h2><b>Validators Scope<&sol;b><&sol;h2>&NewLine;<p>There are two types of Validators in Struts2 Validation Framework&period;<&sol;p>&NewLine;<ol style&equals;"text-align&colon; left&semi;">&NewLine;<li><b>Field Validators<&sol;b><&sol;li>&NewLine;<li><b> Non-field validators<&sol;b><&sol;li>&NewLine;<&sol;ol>&NewLine;<div id&equals;"ads-id" align&equals;"center"><&sol;div>&NewLine;<p><b>Field validators<&sol;b>&comma; as the name indicate&comma; act on single fields accessible through an action&period; A validator&comma; in contrast&comma; is more generic and can do validations in the full action context&comma; involving more than one field &lpar;or even no field at all&rpar; in validation rule&period; Most validations can be defined on per field basis&period; This should be preferred over non-field validation wherever possible&comma; as field validator messages are bound to the related field and will be presented next to the corresponding input element in the respecting view&period;<&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;validators&gt&semi; &NewLine; &lt&semi;field name&equals;"bar"&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"required"&gt&semi; &NewLine; &lt&semi;message&gt&semi;You must enter a value for bar&period;&lt&semi;&sol;message&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;&sol;field&gt&semi; &NewLine;&lt&semi;&sol;validators&gt&semi; &NewLine;<&sol;pre>&NewLine;<p><b>Non-field validators<&sol;b> only add action level messages&period; Non-field validators are mostly domain specific and therefore offer custom implementations&period; The most important standard non-field validator provided by XWork is ExpressionValidator&period;<&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;validators&gt&semi; &NewLine; &lt&semi;validator type&equals;"expression"&gt&semi; &NewLine; &lt&semi;param name&equals;"expression"&gt&semi;foo lt bar&lt&semi;&sol;param&gt&semi; &NewLine; &lt&semi;message&gt&semi;Foo must be greater than Bar&period;&lt&semi;&sol;message&gt&semi; &NewLine; &lt&semi;&sol;validator&gt&semi; &NewLine;&lt&semi;&sol;validators&gt&semi; &NewLine;<&sol;pre>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<div dir&equals;"ltr" style&equals;"text-align&colon; left&semi;">&NewLine;<h2><b>Validator Example-<&sol;b><&sol;h2>&NewLine;<p>In this chapter we will look into how Struts&&num;8217&semi;s validation framework&period; At Struts&&num;8217&semi;s core&comma; we have the validation framework that assists the application to run the rules to perform validation before the action method is executed&period;<&sol;p>&NewLine;<p>Client side validation is usually achieved using Javascript&period; But one should not rely upon client side validation alone&period; Best practice suggests that the validation should be introduced at all levels of your application framework&period; Now let us look at two ways of adding validation to our Struts project&period;<&sol;p>&NewLine;<p>Here we will take an example of Employee whose name&comma; age&comma; email and telephone would be captured using a simple page and we will put two validation to make sure that use always enters a name&comma; age should be in between 18 and 65 email should be valid telephone should be valid&period;<&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;07&sol;121212&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<p>In this example we will see how we can validate a employee page using Struts 2&period; Let&&num;8217&semi;s first create the employee page&period; We use Struts UI tags to create the employee page&period; The <b>&lt&semi;s&colon;head &sol;&gt&semi;<&sol;b> tag should be placed in the head section of the HTML page&period; The s&colon;head tag automatically generates links to the css and javascript libraries that are necessary to render the form elements&period;<&sol;p>&NewLine;<p>So let us start with the main JSP page of the example&period;<&sol;p>&NewLine;<&sol;div>&NewLine;<pre class&equals;"highlight">&lt&semi;&percnt;&commat; page contentType&equals;"text&sol;html&semi; charset&equals;UTF-8"&percnt;&gt&semi; &NewLine;&lt&semi;&percnt;&commat; taglib prefix&equals;"s" uri&equals;"&sol;struts-tags"&percnt;&gt&semi; &NewLine;&lt&semi;html&gt&semi; &NewLine;&lt&semi;head&gt&semi; &NewLine;&lt&semi;title&gt&semi;Employee Form - Struts2 Demo &vert; dineshonjava&period;com&lt&semi;&sol;title&gt&semi; &NewLine;&lt&semi;s&colon;head &sol;&gt&semi; &NewLine;&lt&semi;&sol;head&gt&semi; &NewLine; &NewLine;&lt&semi;body&gt&semi; &NewLine;&lt&semi;h2&gt&semi;Employee Form&lt&semi;&sol;h2&gt&semi; &NewLine; &NewLine;&lt&semi;s&colon;form action&equals;"employee" method&equals;"post" validate&equals;"true"&gt&semi; &NewLine; &lt&semi;s&colon;textfield name&equals;"name" key&equals;"name" size&equals;"20" &sol;&gt&semi; &NewLine; &lt&semi;s&colon;textfield name&equals;"age" key&equals;"age" size&equals;"20" &sol;&gt&semi; &NewLine; &lt&semi;s&colon;textfield name&equals;"email" key&equals;"email" size&equals;"20" &sol;&gt&semi; &NewLine; &lt&semi;s&colon;textfield name&equals;"telephone" key&equals;"telephone" size&equals;"20" &sol;&gt&semi; &NewLine; &lt&semi;s&colon;submit method&equals;"addEmployee" key&equals;"label&period;add&period;employee" align&equals;"center" &sol;&gt&semi; &NewLine;&lt&semi;&sol;s&colon;form&gt&semi; &NewLine;&lt&semi;&sol;body&gt&semi; &NewLine;&lt&semi;&sol;html&gt&semi; &NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p><i><b>myapp&period;properties<&sol;b><&sol;i><&sol;p>&NewLine;<pre class&equals;"highlight">name&equals; Name &NewLine;age&equals; Age &NewLine;email&equals; Email &NewLine;telephone&equals; Telephone &NewLine;label&period;add&period;employee&equals;Add Employee &NewLine; &NewLine;errors&period;invalid&equals;&dollar;&lbrace;getText&lpar;fieldName&rpar;&rcub; is invalid&period; &NewLine;errors&period;required&equals;&dollar;&lbrace;getText&lpar;fieldName&rpar;&rcub; is required&period; &NewLine;errors&period;number&equals;&dollar;&lbrace;getText&lpar;fieldName&rpar;&rcub; must be a number&period; &NewLine;errors&period;range&equals;&dollar;&lbrace;getText&lpar;fieldName&rpar;&rcub; is not in the range &dollar;&lbrace;min&rcub; and &dollar;&lbrace;max&rcub;&period; &NewLine;<&sol;pre>&NewLine;<p>For this tutorial&comma; we will create an Action class called <i><b>EmployeeAction <&sol;b><&sol;i>which will contain few fields&period; Create a file <i><b>EmployeeAction&period;java<&sol;b><&sol;i> in package <i><b>com&period;dineshonjava&period;struts2&period;action<&sol;b><&sol;i><&sol;p>&NewLine;<pre class&equals;"highlight">package com&period;dineshonjava&period;struts2&period;action&semi; &NewLine; &NewLine;import com&period;opensymphony&period;xwork2&period;ActionSupport&semi; &NewLine; &NewLine;&sol;&ast;&ast; &NewLine; &ast; &commat;author Dinesh Rajput &NewLine; &ast; &NewLine; &ast;&sol; &NewLine;public class EmployeeAction extends ActionSupport &lbrace; &NewLine; &NewLine; private static final long serialVersionUID &equals; 1L&semi; &NewLine; private String name&semi; &NewLine; private Integer age&semi; &NewLine; private String email&semi; &NewLine; private String telephone&semi; &NewLine; &NewLine; public String addEmployee&lpar;&rpar; &lbrace; &NewLine; return SUCCESS&semi; &NewLine; &rcub; &NewLine; public String getName&lpar;&rpar; &lbrace; &NewLine; return name&semi; &NewLine; &rcub; &NewLine; public void setName&lpar;String name&rpar; &lbrace; &NewLine; this&period;name &equals; name&semi; &NewLine; &rcub; &NewLine; public Integer getAge&lpar;&rpar; &lbrace; &NewLine; return age&semi; &NewLine; &rcub; &NewLine; public void setAge&lpar;Integer age&rpar; &lbrace; &NewLine; this&period;age &equals; age&semi; &NewLine; &rcub; &NewLine; public String getEmail&lpar;&rpar; &lbrace; &NewLine; return email&semi; &NewLine; &rcub; &NewLine; public void setEmail&lpar;String email&rpar; &lbrace; &NewLine; this&period;email &equals; email&semi; &NewLine; &rcub; &NewLine; public String getTelephone&lpar;&rpar; &lbrace; &NewLine; return telephone&semi; &NewLine; &rcub; &NewLine; public void setTelephone&lpar;String telephone&rpar; &lbrace; &NewLine; this&period;telephone &equals; telephone&semi; &NewLine; &rcub; &NewLine; &NewLine;&rcub; &NewLine;<&sol;pre>&NewLine;<p>Note that <i><b>EmployeeAction <&sol;b><&sol;i>class has fields name&comma; email&comma; telephone and age&period; Also it has a method called <i><b>addEmployee&lpar;&rpar; <&sol;b><&sol;i>which doesn’t have any logic&comma; it just return SUCCESS&period;<&sol;p>&NewLine;<p><b>Configuration file-<&sol;b><br &sol;>&NewLine;Now we will add entry for this new action class in<i><b> struts&period;xml <&sol;b><&sol;i>file&period; Open the <b>struts&period;xml <&sol;b>file which will be present under resources folder&period;<&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;&quest;xml version&equals;"1&period;0" encoding&equals;"UTF-8" &quest;&gt&semi; &NewLine;&lt&semi;&excl;DOCTYPE struts PUBLIC &NewLine; "-&sol;&sol;Apache Software Foundation&sol;&sol;DTD Struts Configuration 2&period;0&sol;&sol;EN" &NewLine; "http&colon;&sol;&sol;struts&period;apache&period;org&sol;dtds&sol;struts-2&period;0&period;dtd"&gt&semi; &NewLine; &NewLine;&lt&semi;struts&gt&semi; &NewLine; &lt&semi;constant name&equals;"struts&period;enable&period;DynamicMethodInvocation" value&equals;"false" &sol;&gt&semi; &NewLine; &lt&semi;constant name&equals;"struts&period;devMode" value&equals;"false" &sol;&gt&semi; &NewLine; &lt&semi;constant name&equals;"struts&period;custom&period;i18n&period;resources" value&equals;"myapp" &sol;&gt&semi; &NewLine; &NewLine; &lt&semi;package name&equals;"default" extends&equals;"struts-default" namespace&equals;"&sol;"&gt&semi; &NewLine; &lt&semi;action name&equals;"employee" class&equals;"com&period;dineshonjava&period;struts2&period;action&period;EmployeeAction"&gt&semi; &NewLine; &lt&semi;result name&equals;"success"&gt&semi;&sol;success&period;jsp&lt&semi;&sol;result&gt&semi; &NewLine; &lt&semi;result name&equals;"input"&gt&semi;&sol;employee&period;jsp&lt&semi;&sol;result&gt&semi; &NewLine; &lt&semi;result name&equals;"error"&gt&semi;&sol;error&period;jsp&lt&semi;&sol;result&gt&semi; &NewLine; &lt&semi;&sol;action&gt&semi; &NewLine; &lt&semi;&sol;package&gt&semi; &NewLine; &NewLine;&lt&semi;&sol;struts&gt&semi; &NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Note that we are mapping the <b>EmployeeAction <&sol;b>class with name employee&period; Also on success user will be redirected to <b>success&period;jsp<&sol;b> page&period; Notice that there is another result tag with name input&period; Whenever the validation logic encounter some validation error&comma; it redirects the user back to page specified as input&period; Thus in our example&comma; user will be redirected back to <b>employee&period;jsp<&sol;b> in case of any errors&period;<br &sol;>&NewLine;<i><b>success&period;jsp<&sol;b><&sol;i><&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;&percnt;&commat; page contentType&equals;"text&sol;html&semi; charset&equals;UTF-8"&percnt;&gt&semi; &NewLine;&lt&semi;&percnt;&commat; taglib prefix&equals;"s" uri&equals;"&sol;struts-tags"&percnt;&gt&semi; &NewLine;&lt&semi;html&gt&semi; &NewLine;&lt&semi;head&gt&semi; &NewLine;&lt&semi;title&gt&semi;Employee Page - Struts2 Demo &vert; dineshonjava&period;com&lt&semi;&sol;title&gt&semi; &NewLine;&lt&semi;&sol;head&gt&semi; &NewLine; &NewLine;&lt&semi;body&gt&semi; &NewLine; &lt&semi;h2&gt&semi;Employee Added Successfully&period;&lt&semi;&sol;h2&gt&semi; &NewLine;&lt&semi;&sol;body&gt&semi; &NewLine;&lt&semi;&sol;html&gt&semi; &NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p><i><b>index&period;jsp<&sol;b><&sol;i><&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;&percnt;&commat; page contentType&equals;"text&sol;html&semi; charset&equals;UTF-8"&percnt;&gt&semi; &NewLine;&lt&semi;&percnt;&commat; taglib prefix&equals;"s" uri&equals;"&sol;struts-tags"&percnt;&gt&semi; &NewLine;&lt&semi;html&gt&semi; &NewLine;&lt&semi;head&gt&semi; &NewLine;&lt&semi;title&gt&semi;Welcome Page - Struts2 Demo &vert; dineshonjava&period;com&lt&semi;&sol;title&gt&semi; &NewLine;&lt&semi;&sol;head&gt&semi; &NewLine;&lt&semi;body&gt&semi; &NewLine;&lt&semi;s&colon;a href&equals;"employee&period;jsp"&gt&semi;Add Employee&lt&semi;&sol;s&colon;a&gt&semi; &NewLine;&lt&semi;&sol;body&gt&semi; &NewLine;&lt&semi;&sol;html&gt&semi; &NewLine;<&sol;pre>&NewLine;<h2><b>Adding Validation Logic<&sol;b><&sol;h2>&NewLine;<p>Now we are ready with the basic employee form on which we will add the validation logic&period; Following will be the validations rules&colon;<&sol;p>&NewLine;<ul style&equals;"text-align&colon; left&semi;">&NewLine;<li><b>Name <&sol;b>field is mandatory<&sol;li>&NewLine;<li><b>Age <&sol;b>field is mandatory&period; It should be a number between 18 and 65&period;<&sol;li>&NewLine;<li><b>Email <&sol;b>field is mandatory&period; It should be a valid email address&period;<&sol;li>&NewLine;<li><b>Telephone <&sol;b>is mandatory&period;<&sol;li>&NewLine;<&sol;ul>&NewLine;<p>In order to define validation logic for particular form&comma; we first have to create an XML file which will hold this data&period; Struts2 define a specific naming convention in defining validation xml files&period; The format is <i><b>&lt&semi;ActionClassName&gt&semi;-validation&period;xml<&sol;b><&sol;i>&period; So for our application we will create a file <i><b>EmployeeAction-validation&period;xml<&sol;b><&sol;i>&period; Note that this file should be present in the same package as of action class&period;<&sol;p>&NewLine;<p>Create file <i><b>EmployeeAction-validation&period;xml <&sol;b><&sol;i>in package <b><i>com&period;dineshonjava&period;struts2&period;action<&sol;i><&sol;b><&sol;p>&NewLine;<&sol;div>&NewLine;<pre class&equals;"highlight">&lt&semi;&excl;DOCTYPE validators PUBLIC "-&sol;&sol;Apache Struts&sol;&sol;XWork Validator 1&period;0&period;3&sol;&sol;EN" &NewLine; "http&colon;&sol;&sol;struts&period;apache&period;org&sol;dtds&sol;xwork-validator-1&period;0&period;3&period;dtd"&gt&semi; &NewLine;&lt&semi;validators&gt&semi; &NewLine; &lt&semi;field name&equals;"name"&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"requiredstring"&gt&semi; &NewLine; &lt&semi;param name&equals;"trim"&gt&semi;true&lt&semi;&sol;param&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;required" &sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;&sol;field&gt&semi; &NewLine; &lt&semi;field name&equals;"age"&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"required"&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;required" &sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"int"&gt&semi; &NewLine; &lt&semi;param name&equals;"min"&gt&semi;18&lt&semi;&sol;param&gt&semi; &NewLine; &lt&semi;param name&equals;"max"&gt&semi;65&lt&semi;&sol;param&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;range"&sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;&sol;field&gt&semi; &NewLine; &lt&semi;field name&equals;"email"&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"requiredstring"&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;required" &sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"email"&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;invalid" &sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;&sol;field&gt&semi; &NewLine; &lt&semi;field name&equals;"telephone"&gt&semi; &NewLine; &lt&semi;field-validator type&equals;"requiredstring"&gt&semi; &NewLine; &lt&semi;message key&equals;"errors&period;required" &sol;&gt&semi; &NewLine; &lt&semi;&sol;field-validator&gt&semi; &NewLine; &lt&semi;&sol;field&gt&semi; &NewLine;&lt&semi;&sol;validators&gt&semi; &NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<h2><b>Client Side Validation-<&sol;b><&sol;h2>&NewLine;<p>It is very easy to add Client Side validation or JavaScript validation to any form in Struts2&period; All you have to do is to add<b> validate&equals;&&num;8221&semi;true&&num;8221&semi;<&sol;b> in form tag in your JSP file&period; For example open <b>employee&period;jsp<&sol;b> and add <b>validate&equals;&&num;8221&semi;true&&num;8221&semi; <&sol;b>in form tag&period; Struts2 automatically generates the JavaScript code for client side validation of form&period;<&sol;p>&NewLine;<pre class&equals;"highlight">&lt&semi;s&colon;form action&equals;"employee" method&equals;"post" validate&equals;"true"&gt&semi; &NewLine; &period;&period;&period; &NewLine;&lt&semi;&sol;s&colon;form&gt&semi; &NewLine;<&sol;pre>&NewLine;<&sol;div>&NewLine;<p>Now&comma; right click on the project name and click <b>Export &gt&semi; WAR<&sol;b> File to create a War file&period; Then deploy this WAR in the Tomcat&&num;8217&semi;s webapps directory&period; Finally&comma; start Tomcat server and try to access<&sol;p>&NewLine;<p><b>URL<i> http&colon;&sol;&sol;localhost&colon;8080&sol;doj&sol;index&period;jsp<&sol;i><&sol;b><i>&period;<&sol;i><br &sol;>&NewLine;This will give you following screen&colon;<&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;07&sol;5555&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<&sol;div>&NewLine;<p><b>click on <i>Add Employee <&sol;i>link then you got the following <&sol;b><br &sol;>&NewLine;<b>URL <i>http&colon;&sol;&sol;localhost&colon;8080&sol;doj&sol;employee&period;jsp<&sol;i><&sol;b><&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;07&sol;66666&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<p><b>Employee error page because of validation fails<&sol;b><&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;07&sol;777&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<p><b><br &sol;>&NewLine;<&sol;b> <b>Employee page on success<&sol;b><&sol;p>&NewLine;<div class&equals;"separator" style&equals;"clear&colon; both&semi; text-align&colon; center&semi;"><img src&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-content&sol;uploads&sol;2013&sol;07&sol;8888&period;png" border&equals;"0" &sol;><&sol;div>&NewLine;<&sol;div>&NewLine;<h2><b>Download Source Code<&sol;b><br &sol;>&NewLine;<b><a href&equals;"https&colon;&sol;&sol;sites&period;google&period;com&sol;a&sol;dineshonjava&period;com&sol;dineshonjava&sol;dineshonjava&sol;Struts2Validation&period;zip&quest;attredirects&equals;0&amp&semi;d&equals;1" target&equals;"&lowbar;blank" rel&equals;"noopener">Struts2Validation&period;zip<&sol;a><&sol;b><&sol;h2>&NewLine;<p>&nbsp&semi;<&sol;p>&NewLine;<div style&equals;"background-color&colon; pink&semi; border-width&colon; thin&semi; text-align&colon; center&semi;"><b>&lt&semi;&lt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;struts-2-sending-mails&sol;">Previous<&sol;a> &lt&semi;&lt&semi;   &vert;&vert; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;struts-2-baby-step-to-learn&sol;">Index <&sol;a>&vert;&vert;   &gt&semi;&gt&semi;<a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;localization-i18n-in-struts2&sol;">Next<&sol;a> &gt&semi;&gt&semi;<&sol;b><&sol;div>&NewLine;<&sol;div>&NewLine;<div class&equals;"wp-post-navigation"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-pre"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;struts-2-sending-mails&sol;">Previous<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <div class&equals;"wp-post-navigation-next"> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <a href&equals;"https&colon;&sol;&sol;dineshonjava&period;com&sol;localization-i18n-in-struts2&sol;">Next<&sol;a> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab; <&sol;div> &NewLine;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;&Tab;<&sol;div>&NewLine;<script type&equals;"text&sol;javascript">&NewLine;jQuery&lpar;document&rpar;&period;ready&lpar;function&lpar;&dollar;&rpar; &lbrace;&NewLine; &dollar;&period;post&lpar;'https&colon;&sol;&sol;dineshonjava&period;com&sol;wp-admin&sol;admin-ajax&period;php'&comma; &lbrace;action&colon; 'mts&lowbar;view&lowbar;count'&comma; id&colon; '382'&rcub;&rpar;&semi;&NewLine;&rcub;&rpar;&semi;&NewLine;<&sol;script>

Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

4 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

4 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

4 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

4 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

4 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

4 years ago