Struts 2 double validator

The double validator is used check that the double is within a specific range. Plain validator syntax of double validator. <validators> <validator type="double"> <param name=”fieldName">fieldName</param> <param name="min">minDouble</param> <param name="max">maxDouble</param> <message>message string</message> </validator> </validators><validators> <validator type="double"> <param name=”fieldName">fieldName</param> <param name="min">minDouble</param> <param name="max">maxDouble</param> <message>message string</message> </validator> </validators> Field validator syntax of double validator. <validators> <field name="fieldName"> <field-validator … Read more

Struts 2 int validator

The int validator is used check that the integer is within a specific range. Plain validator syntax of int validator. <validators> <validator type="int"> <param name=”fieldName">fieldName</param> <param name="min">minInt</param> <param name="max">maxInt</param> <message>message string</message> </validator> </validators><validators> <validator type="int"> <param name=”fieldName">fieldName</param> <param name="min">minInt</param> <param name="max">maxInt</param> <message>message string</message> </validator> </validators> Field validator syntax of int validator. <validators> <field name="fieldName "> … Read more

Struts 2 stringlength validator

The stringlength validator is used check that the length of the string field is within a specified range. Plain validator syntax of stringlength validator. <validators> <validator type="stringlength"> <param name="fieldName">fieldName</param> <param name="minLength"> minLength</param> <param name="maxLength"> maxLength</param> <param name="trim">true</param> <message>message string</message> </validator> </validators><validators> <validator type="stringlength"> <param name="fieldName">fieldName</param> <param name="minLength"> minLength</param> <param name="maxLength"> maxLength</param> <param name="trim">true</param> <message>message string</message> … Read more

JSP exception implicit object

JSP exception object is an instance of javax.servlet.jsp.JspException. This object is used in exception handling to print the error message. But is only be used on that jsp page on which isErrorPage attribute is true. Example: welcome.jsp <html> <head> <title>Exception handling example</title> </head> <body> <% out.print(10/0); %> </body> </html><html> <head> <title>Exception handling example</title> </head> <body> … Read more

Categories JSP

JSP page implicit object

JSP page object is an instance of java.lang.Object. As we discussed earlier that JSP is translated into servlet by web container. JSP page object refers the instance of this servlet. It acts as a synonym for this object. As it represents the servlet, it must be cast to HttpServlet. this can also be used directly … Read more

Categories JSP

JSP pageContext implicit object

JSP pageContext object is an instance of javax.servlet.jsp.PageContext. This object is used to manipulate page, request, application and session attributes. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> … Read more

Categories JSP

JSP session implicit object

JSP session object is an instance of javax.servlet.http.HttpSession. This object is used to for session tracking or session management. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> welcome.jsp … Read more

Categories JSP

JSP application implicit object

JSP application object is an instance of javax.servlet.ServletContext. This object is used to get initialization parameters defined in web.xml. Example: index.jsp <html> <head> <title>application implicit object example</title> </head> <body> <h3>To see the website name click on the below link.</h3> <a href="welcome.jsp">Click here</a> </body> </html><html> <head> <title>application implicit object example</title> </head> <body> <h3>To see the website … Read more

Categories JSP

JSP config implicit object

JSP config object is an instance of javax.servlet.ServletConfig. This object is used to get the configuration information about a page like servlet name, servlet context, configuration parameters etc. Example: index.jsp <html> <head> <title>config implicit object example</title> </head> <body> <h3>To see the website name click on the below link.</h3> <a href="welcome.jsp">Click here</a> </body> </html><html> <head> <title>config … Read more

Categories JSP

JSP response implicit object

JSP response object is an instance of javax.servlet.http.HttpServletResponse. It is mainly used to modify the response. Example: login.jsp <html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html><html> <head> <title>login</title> </head> <body> <form action="welcome.jsp"> <input type="text" name="userName" /> <input type="submit" value="login"/> </form> </body> </html> welcome.jsp <html> <head> <title>response … Read more

Categories JSP