We9 Struts 2.0

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    We9 Struts 2.0 - Presentation Transcript

    1. Struts 2.0 Don Brown
    2. Web, Circa 2000
    3. Web, Circa 2006
    4.  
    5.  
    6.  
    7.  
    8.  
    9.  
    10.  
    11.  
    12.  
    13.  
    14.  
    15.  
    16.  
    17.  
    18. 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
    19. Struts Plugins
    20. Simple Example
    21. 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:
    22. </ 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 >
    23. </ 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 >
    24. ... Only four pages! < td align = &quot;left&quot; > < html:submit property = &quot;DO_SUBMIT&quot; > Save </ html:submit > </ td > </ tr > </ table > </ html:form >
    25. 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 >
    26. Example Revisited
    27. <s:textfield label=&quot;Name&quot; name=&quot;name&quot; tooltip = &quot;Meeting name&quot; />
    28. < s:datepicker label=&quot;Date&quot; name=&quot;date&quot;/>
    29. < s:optiontransferselect ... />
    30. < 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; />
    31. But there's more . . .
    32. 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.
    33. Prevention and Cure
    34. struts.devMode = true
    35.  
    36.  
    37. Built-in Testing Support public class MyActionTest extends StrutsTestCase { public void testExecute() throws Exception { assertTrue(true); } }
    38. any.action?debug=console
    39. any.action?profiling=yes
    40. Time to Upgrade?
    41. Tutorials, Guides, and FAQs
    42. Struts 2 Training Course
    43. < 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
    44. How do I get started?
    45. Where We are Going

    + wangjiazwangjiaz, 3 years ago

    custom

    1225 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1225
      • 1225 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 20
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories