2. About Myself
● Chad Davis
● Blackdog Software, Inc.
● J2EE Consulting
● Corporate Training
● Struts 2 in Action
● Open Source Enthusiast
● Debian Devotee
3. Road Map
● Something for everyone
● Struts 2 introduction
● Ajax introduction
● Walk through a code sample
● Questions at any time
4. Struts 2
● Web application framework
● Java Servlets
● Second generation
● Software engineering
6. Classic Web Applications < htm l>
< head>
< link rel= quot;stylesheetquot; type= quot;text/cssquot; href= quot;css/ajaxUserBrowser.cssquot; />
< /head>
< body>
< h2> Artist Browser Control< /h2>
< form nam e= quot;ClassicRetrieveUserquot; action= quot;ClassicRetrieveUser.actionquot;
m ethod= quot;postquot;>
< select nam e= quot;usernam equot; id= quot;ClassicRetrieveUser_usernam equot;>
< option value= quot;Jim m yquot;> Jim m y< /option>
< option value= quot;Charlie Joequot;> Charlie Joe< /option>
< option value= quot;Maryquot; selected= quot;selectedquot;> Mary< /option>
< option value= quot;Artyquot;> Arty< /option>
< /form >
< /body>
< /htm l>
URL: /manningSampleApp/chapterEight/ClassicRetrieveUser.action
Data: username=mary
7. How it works: classic style
● Browser makes request
– Http
– URL
– Data
● Server
– Processes data
– Sends HTML page response
● Browser receives, renders HTML
11. How it works: Ajax
● Browser uses Javascript to submit request
– Http
– URL
– Data
● Server
– Processes data
– Sends data response ( JSON, XML, etc. )
● Browser Javascript
– Proceses data
– DHTML
13. Ajax Selling Points
● Low bandwith
● No page rendering issues
● Supports a stronger Separation of Concerns
14. Observations . . .
What does the server do?
The page abstraction: JSP, ASP, PHP
What should new frameworks do?
15. Struts 2 Architecture
● Does all the dirty work for you
● Separation of Concerns !!
● Interceptors, Actions, Results, ValueStack
16.
17. Daily development
● Actions
– you write them
● Results
– declare them
– write them if necessary
● Interceptors
– nothing!
– declare or write if necessary
18. Configuration
● Declare your actions
● Declare your results
● XML, Annotations