vinod sir struts 2 part 3
DESCRIPTION
Struts 2 Validation & Integrating Tiles PluginTRANSCRIPT
Prof. Vinod Pillai.
http://vinodthebest.wordpress.com
www.youtube.com/vinodthebest
Part – III
Application Development
2Prof. Vinod Pillai
Part – III : Struts 2 UI Tags & Integrating Tiles.
Validation
Using validate () Method
XML File Validation.
Struts 2 UI Tags.
Integrating Tiles Plug-in in Struts 2.
HttpServletRequest, HttpServletResponse, ServletContext
& HttpSession.
Prof. Vinod Pillai 3
6“Validation – Using validate () Method & XML”
Our Goal :
To create a Struts2 application with an index page. If userclicks the Login Button without entering the Username orPassword then it should display message appropriately errormessage.
4Prof. Vinod Pillai
Final Structure:
5Prof. Vinod Pillai
Index.jsp:
6Prof. Vinod Pillai
Struts.xml:
7Prof. Vinod Pillai
Action Class:
8Prof. Vinod Pillai
Welcome.jsp:
9Prof. Vinod Pillai
Second Option : XML File Validation
10Prof. Vinod Pillai
Final Structure:
11Prof. Vinod Pillai
LoginAction-validation.xml :
12Prof. Vinod Pillai
Action Class :
13Prof. Vinod Pillai
7“User Form”Our Goal :
To create a Struts2 application with an index page. If userclicks the Login Button it will redirect him to Welcome pagewhere some field values are coming from Action Classvariable & some major Form Fields.
14Prof. Vinod Pillai
Action Class :
15Prof. Vinod Pillai
Welcome.jsp:
16Prof. Vinod Pillai
8“Integrating Tiles Plug-in”
Our Goal :
To create a Struts2 application with an index page. As userclicks the Login Button it will redirect him to Welcome pagewhich having a common design layout which will becommon for all the pages.
17Prof. Vinod Pillai
Final Structure:
18Prof. Vinod Pillai
MainLayout.jsp:
19Prof. Vinod Pillai
Header.jsp:
Menu.jsp:
20Prof. Vinod Pillai
tiles.xml:
21Prof. Vinod Pillai
Index.jsp:
22Prof. Vinod Pillai
Struts.xml:
23Prof. Vinod Pillai
FirstPage.jsp:
SecondPage.jsp:
24Prof. Vinod Pillai
8 & 9“HttpServletRequest, HttpServletResponse, ServletContext
& HttpSession”Our Goal :
Getting ServletContext Object.
Getting HttpServletRequest Object.
Getting HttpServletResponse Object.
Getting HttpSession Object.
25Prof. Vinod Pillai
ApplicationAware/ServletContext:
26Prof. Vinod Pillai
SessionAware/HttpSession:
27Prof. Vinod Pillai
ServletRequestAware/HttpServletRequest:
28Prof. Vinod Pillai
ServletResponseAware :
29Prof. Vinod Pillai
Part – III : Struts 2 UI Tags & Integrating Tiles.
Validation
Using validate () Method
XML File Validation.
Struts 2 UI Tags.
Integrating Tiles Plug-in in Struts 2.
HttpServletRequest, HttpServletResponse, ServletContext
& HttpSession.
Prof. Vinod Pillai 30
Part – III
Completed
31Prof. Vinod Pillai