본문 바로가기
Framework/struts2

Struts 2 Tutorial

by windrises 2008. 7. 8.

RoseIndia Struts 2 Tutorial and Online free training helps you learn new elegant Struts 2 Framework with examples. Struts 2 is very elegant and flexible front controller framework based on many standard technologies like Java Filters, Java Beans, ResourceBundles, XML etc.

  1. Struts 2 Features It is very extensible as each class of the framework is based on an Interface and all the base classes are given an extra application and even you can add your own. 
  2. Struts 2 History Apache Struts is an open-source framework that is used for developing Java web application. Originally developed by the programmer and author Craig R. McClanahan this was later taken over by the Apache Software Foundation in 2002.  
  3. Struts 2 Architecture Struts and webwork has joined together to develop the Struts 2 Framework. Struts 2 Framework is very extensible and elegant for the development of enterprise web application of any size. In this section we are going to explain you the architecture of Struts 2 Framework.  
  4. Why Struts 2 The new version Struts 2.0 is a combination of the Sturts action framework and Webwork. According to the Struts 2.0.1 release announcement, some key features are:
  5. Struts 1.x Vs Struts 2.x In the following section, we are going to compare the various features between the two frameworks. Struts 2.x  is very simple in comparison to the struts 1.x ,  few of its excelling features are:  
  6. Downloading and Installing Struts 2 In this section we will download and install the Struts 2.0 on the latest version of Tomcat container. We will first download tomcat and configure it as our development server.
       
    Struts 2 Hello World Application
  7. Creating the development directory Structure In this section we will create directory structure of our Struts 2 Hello World application based on Struts 2 framework. Our Struts 2 Hello World application is your first step towards developing applications based on Struts 2 framework.
  8. Writing Jsp, Java and Configuration files In this section we will write JSP, Java and required configuration files for our Struts 2 Hello World application. Now in struts 2 struts.xml is used to configure the applications. We will also deploy and test the application.   
  9. Struts 2 xml configuration file In this section we will introduce you with the struts.xml file. This section explains you how best you can use the struts.xml file for you big projects.
     
    Struts 2 Actions
  10. Struts 2 Actions Example When a client request matches the action's name, the framework uses the mapping from struts.xml file to process the request.  
  11. Struts 2 Actions Introduction When a client request matches the action's name, the framework uses the mapping from struts.xml file to process the request. The mapping to an action is usually generated by a Struts Tag.

    Struts 2 Login Application
  12. Developing Login Application in Struts 2 In this section we are going to develop login application based on Struts 2 Framework. Our current login application does not validate the user against the database 
  13. Adding Validation to Struts 2 Login Application In this section we will write the code to validate the login application. After completing this section you will be able to write validations for your Struts 2 projects.
  14. Running and testing application In this section we will run the example on Tomcat 6.0 server and check how it works.  
  15. Client Side Validation in Struts 2 Login Application In this section we will see how to write code that will generate Java Script code for client side validation. In the last section we developed Login-validator.xml configuration file for defining the server side validation.    
  16. Validations using Struts 2 Annotations In this section we are going to validate our login application using Annotations in Action class. Our current login application does not validate the user against the database. 
  17. Login/Logout With Session In this section, we are going to develop a login/logout application with session. This application checks the user authentication. Whenever you run, it takes an user id and a password (Both the user id and password is "admin") it displays the welcome page, when both fields are correctly filled.

    Struts 2 Tags  
  18. Struts Tags In this section we will introduce you with the tags provided along with Struts 2 framework. It is necessary to understand all the tags provided along with Struts 2 framework.
     
    Struts 2 Tags Examples          
  19. Struts 2 Tags Examples (Generic Tags) Struts 2 tags tutorials and examples.
  20. Control Tags-If / Else If / Else In this section we are going to discuss the various control tags ( The Control Tags are used for flow control, such if, else and iterate.).
  21. Append Tag (Control Tags) Example In this section, we are going to describe the append tag . The append tag is a generic tag that is used to merge multiple iterators into one iterator.
  22. Generator Tag (Control Tags) Example In this section, we are going to describe the generator tag . The generator tag is a generic tag that is used to generate iterators based on different attributes passed .
  23. Generator Tag (Control Tags) Using Count Attributes In this section, we are going to describe the generator tag using the count attributes.
  24. Generator Tag (Control Tags) Using an Iterator with Id Attributes In this section, we are going to describe the generator tag using the id attributes.
  25. Iterator Tag (Control Tags) Example In this section, we are going to describe the Iterator tag. Iterator tag is used to iterate over a value. An iterable value can be either of: java.util.Collection, java.util.Iterator.
  26. Merge Tag (Control Tags) Example In this section, we are going to describe the merge tag . The merge tag is a generic tag that is used to  merge iterators. The successive call to the merged iterator causes each merge iterator to have a chance to expose its element, subsequently next call allows the next iterator to expose its element.
  27. Subset Tag (Control Tags) Example In this section, we are going to describe the subset tag . The subset tag is a generic tag that  takes an iterator and outputs a subset of it. It delegates to org.apache.struts2.util.SubsetIteratorFilter internally to perform the subset functionality.
  28. Subset Tag (Control Tags) Example Using Count In this section, we are going to describe the subset tag using the count  parameter. The count parameter indicate the number of entries to be set in the resulting subset iterator.
  29. Subset Tag (Control Tags) Example Using Start In this section, we are going to describe the subset tag using the start parameter. The start parameter is of integer type. It indicates the starting index (eg. first entry is 0) of entries in the source (needed to make available as the first entry in the resulting subset iterator).
  30. Action Tag (Data Tag) Example In this section, we are going to describe the action tag . The action tag is a generic tag that is used to call actions directly from a JSP page by specifying the action name and an optional namespace.
  31. Bean Tag (Data Tag) Example In this section, we are going to describe the Bean Tag . The Bean tag is a generic tag that is used to instantiates a class that conforms to the JavaBeans specification.
  32. Date Tag (Data Tag) Example In this section, we are going to describe the Date tag .The date tag allows to format a Date in a quick and easy way. User can specify a custom format (eg. "dd/MM/yyyy hh:mm"), can generate easy readable notations (like "in 2 hours, 14 minutes"), or can just fall back on a predefined format with key 'struts.date.format' in the properties file.
  33. Include Tag (Data Tag) Example In this section, we are going to describe the include tag . The include tag is a generic tag that is used to include a servlet's output (result of servlet or a JSP page) to the current page.
  34. Param Tag (Data Tag) Example In this section, we are going to describe the param tag. The param tag is a generic tag that is used to parameterize other tags. For example the include tag and bean tag. The parameters can be added with or without a name as a key.
  35. Set Tag (Data Tag) Example In this section, we are going to describe the Set tag . The set tag is a generic tag that is used to assign a value to a variable in a specified scope.
  36. Text Tag (Data Tag) Example In this section, we are going to describe the text tag. The text tag is a generic tag that is used to render a I18n text message.
  37. Property Tag (Data Tag) Example In this section, we are going to describe the property tag . The property tag is a generic tag that is used to get the property of a value, which will default to the top of the stack if none is specified.
  38. Struts 2 Tags (UI Tags) Examples
           
    Form Tags Examples
  39. Checkbox Tag (Form Tag) Example In this section, we are going to describe the checkbox tag . The checkbox tag is a UI tag that is used to render an HTML input element of type checkbox, populated by the specified property from the ValueStack.
  40. Checkboxlist Tag (Form Tag) Example In this section, we are going to describe the checkboxlist tag . The checkboxlist tag is a UI tag that creates a series of checkboxes from a list. Setup is like <s:select /> or <s:radio />, but creates checkbox tags.
  41. Combobox Tag (Form Tag) Example In this section, we are going to describe the combobox tag . The combo box is basically an HTML INPUT of type text and HTML SELECT grouped together to give you a combo box functionality.
  42. Datetimepicker Tag (Form Tag) Example In this section, we are going to describe the datetimepicker tag . The datetimepicker tag is a UI tag that is used to render a date/time picker in a dropdown container.
  43. Doubleselect Tag (Form Tag) Example In this section, we are going to describe the doubleselect tag . The doubleselect tag is a UI tag that renders two HTML select elements with second one changing displayed values depending on selected entry of first one.
  44. File Tag (Form Tag) Example In this section, we are going to describe the file tag . The file tag is a UI tag that renders an HTML file input element achieved through browsing.
  45. Form Tag Example In this section, we are going to describe the form tag . The form tag is a UI tag that renders HTML an input form.
  46. Label Tag (Form Tag) Example In this section, we are going to describe the label tag . The label tag is a UI tag that is used to render an HTML LABEL that allow to output label:name type of combinations that has the same format treatment as the rest of UI controls.
  47. Optiontransferselect Tag (Form Tag) Example In this section, we are going to describe the Optiontransferselect tag. The Optiontransferselect tag is a UI tag that create an option transfer select component.
  48. Optgroup Tag (Form Tag) Example In this section, we are going to describe the optgroup tag . The optgroup tag is a UI tag that creates an optgroup component which needs to resides within a select tag <s:select>.
  49. Password Tag (Form Tag) Example In this section, we are going to describe the password tag . The password tag is a UI tag that renders an HTML input tag of type password.
  50. Radio Tag (Form Tag) Example In this section, we are going to describe the radio tag . The radio tag is a UI tag that renders a radio button input field.
  51. Reset Tag (Form Tag) Example In this section, we are going to describe the reset tag . The reset tag is a UI tag that  is used together with the form tag to provide form resetting.
  52. Select Tag (Form Tag) Example In this section, we are going to describe the select tag. The select tag is a UI tag that is used to render a HTML input tag of type select.
  53. Submit Tag (Form Tag) Example In this section, we are going to describe the submit tag. The submit tag is a UI tag that is used to render a submit button. The submit tag is used together with the form tag to provide asynchronous form submissions.
  54. Textarea Tag (Form Tag) Example In this section, we are going to describe the textarea tag. The textarea tag is a UI tag that is used to render HTML textarea.
  55. Textfield Tag (Form Tag) Example In this section, we are going to describe the textfield tag. The textfield tag is a UI tag that is used to render an HTML input field of type text.
  56. Updownselect Tag (Form Tag) Example In this section, we are going to describe the updownselect tag. The updownselect tag is a UI tag that creates a select component with buttons to move up and down the elements in the select component .

    Non-Form UI Tags
  57. Actionerror and Actionmessage Tags (Non-Form UI Tags) Example In this section, we are going to describe the actionerror and actionmessage tags. The actionerror tag is a UI tag that renders action errors(in the jsp pages.) if they exists while the actionmessage tag renders action messages if they exists.
  58. Fielderror Tag (Non-Form UI Tags) Example In this section, we are going to describe the fielderror tags. The fielderror tag is a UI tag that renders field errors if they exists.                         
     
    Struts 2 Examples 
  59. Struts 2 Date
    In this section we will discuss the date processing functionalities available in the Struts 2 Framework. 
  60. Date Format Examples In this tutorials you will learn about Date Format function in Struts 2. We have provided fully tested example code to illustrate the concepts.  
  61. Struts 2 datepicker Example In this section we will show you how to develop datetimepicker in struts 2. Struts 2 uses the dojo toolkit for creating date picker.  
  62. Struts 2 Format Examples In this section you will learn how to format Date and numbers in Struts 2 Framework. Our Struts 2 Format Examples are very easy to grasp and you will learn these concepts in very small time.
  63. Struts 2 File Upload In this section you will learn how to write program in Struts 2 to upload the file on the server. In this example we will also provide you the code to save the save on the server in the upload directory.
     
    Struts 2 Resources Examples
  64. Struts 2 Resources Examples The struts 2 resources examples     
  65. Static Parameter In this section, we will develop a simple application to access the static parameter. We will use a JavaBean to set and get the static parameters. Each static parameter has a value.   
  66. Accessing Session Object In this section, we will develop a simple application to access the framework resources like the session object, session context and the last accessed session time.
  67. Access Request and Response In this section, you will learn to develop an application that accesses the request and response object in struts 2 application.

    Struts 2 Tools
  68. Struts 2 Eclipse Plugin This page contains the examples and the list of plugins that are available for Struts 2 Development using Eclipse IDE.
  69. Struts 2 IDE This page contains the list of IDE available to ease the development of Struts 2 Framework based applications. The IDE for Struts 2 will actually make the development cycle of the much easier.
  70. Struts 2 Application Developing user registration application based on Struts 2 Framework. This Struts 2 Application is a simple user registration application that will help you learn how to develop real world application using Struts 2 Framework.
  71. Struts 2 Ajax In this section explains you Ajax based development in Struts 2. Struts 2 provides built-in support for Ajax using Dojo toolkit.

'Framework > struts2' 카테고리의 다른 글

s:if  (0) 2008.10.21
struts2에서 간단한 ajax 테스트  (0) 2008.04.01
태그 라이브러리  (1) 2008.04.01
액션매퍼, 인터셉터  (0) 2008.03.19
struts2 환경설정  (0) 2008.03.03