• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
We9 Struts 2.0
 

We9 Struts 2.0

on

  • 2,219 views

 

Statistics

Views

Total Views
2,219
Views on SlideShare
2,219
Embed Views
0

Actions

Likes
0
Downloads
26
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    We9 Struts 2.0 We9 Struts 2.0 Presentation Transcript

    • Struts 2.0 Don Brown
    • Web, Circa 2000
    • Web, Circa 2006
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    • Struts 2 Architecture
      • Struts 1
      • Action 
      • ActionForm 
      • ActionForward 
      • struts-config.xml 
      • ActionServlet 
      • RequestProcessor 
      • Struts 2
      • Action
      • Action or POJO’s
      • Result
      • struts.xml
      • FilterDispatcher
      • Interceptors
    • Struts Plugins
    • Simple Example
    • Struts 1 < html:errors /> < html:form action = &quot;/SaveMeeting&quot; > < table border = &quot;0&quot; width = &quot;100%&quot; > < tr > < th align = &quot;right&quot; > Name: </ th > < td align = &quot;left&quot; > < html:text property = &quot;name&quot; size = ”50” /> </ td > </ tr > < tr > < th align = &quot;right&quot; > Date:
    • </ th > < td align = &quot;left&quot; > < html:text property = &quot;date&quot; size = &quot;50&quot; /> </ td > </ tr > < tr > < th align = &quot;right&quot; > Invitees: </ th > < td align = &quot;left&quot; > < html:select property = &quot;invitees&quot; multiple = &quot;true&quot; > < html:options collection = &quot;employees&quot; property = &quot;value&quot; labelProperty = &quot;label&quot; /> </ html:select >
    • </ tr > < tr > < th align = &quot;right&quot; > Description: </ th > < td align = &quot;left&quot; > < html:textarea property = &quot;description&quot; rows = &quot;4&quot; cols = &quot;50&quot; /> </ td > </ tr > < tr > < td align = &quot;right&quot; > &nbsp; </ td >
    • ... Only four pages! < td align = &quot;left&quot; > < html:submit property = &quot;DO_SUBMIT&quot; > Save </ html:submit > </ td > </ tr > </ table > </ html:form >
    • Struts 2 < s:form action = &quot;Meeting&quot; validate = &quot;true&quot; > < s:token /> < s:textfield label = ”Name” name = “name” /> < s:textfield label = ”Date&quot; name = &quot;date&quot; /> < s:select label = ”Invitees” name = &quot;invitees&quot; list = &quot;employees&quot; /> < s:textarea label = ”Description” n ame = &quot;description&quot; rows = &quot;4&quot; cols = &quot;50&quot; /> < s:submit value = ”Save&quot; method = &quot;save&quot; /> </ s:form >
    • Example Revisited
    • <s:textfield label=&quot;Name&quot; name=&quot;name&quot; tooltip = &quot;Meeting name&quot; />
    • < s:datepicker label=&quot;Date&quot; name=&quot;date&quot;/>
    • < s:optiontransferselect ... />
    • < jsp:include page = &quot;/ajax/commonInclude.jsp&quot; /> ... <s:textarea theme = &quot;ajax&quot; label=&quot;Description&quot; name=&quot;description&quot; rows=&quot;4&quot; cols=&quot;50&quot; />
    • But there's more . . .
    • Brian Kernighan Law of Debugging Difficulty Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
    • Prevention and Cure
    • struts.devMode = true
    •  
    •  
    • Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); } }
    • any.action?debug=console
    • any.action?profiling=yes
    • Time to Upgrade?
    • Tutorials, Guides, and FAQs
    • Struts 2 Training Course
    • < action name = &quot;editGangster&quot; class = &quot;org.apache.struts2.s1.Struts1Action&quot; > < param name = &quot;className&quot; > com.mycompany.gangstas.EditGangsterAction </ param > < result > gangsterForm.jsp </ result > </ action > Run Struts 1 Actions as Is
    • How do I get started?
    • Where We are Going