Changes for page Adding and Using the Conventions Plugin
on 2012/03/10 02:31
on 2012/03/03 23:27
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,4 +1,4 @@ 1 - EveryStruts2 user should be using the conventions plugin. It reduces xmlconfigurationtoalmost nothing, speeds up development time and improves readability.Thereis really noreasonnottouse it.For detailed information on the struts2-conventions-plugin see the [[struts2 site>>url:http://struts.apache.org/2.1.6/docs/convention-plugin.html]].1 +I think every struts2 user should be using the conventions plugin. It reduces xml to almost nothing, speeds up development time and improves readablility. I really can't think of a down side. There is a very simple example, for detailed information on the struts2-conventions-plugin see the [[struts2 site>>url:http://struts.apache.org/2.1.6/docs/convention-plugin.html]]. 2 2 3 3 Starting with an [[empty Struts2 project>>doc:Setting up a new Struts2 Project in Netbeans]]. 4 4 ... ... @@ -6,14 +6,14 @@ 6 6 7 7 Using the conventions plugin is very easy! 8 8 9 -It forms a relationship between your packages and the JSPs under //WEB-INF//(you can use other view technology but in this example we'll use JSPs).9 +It forms a relationship between your packages and the JSPs under WEB-INF (you can use other view technology but in this example we'll use JSPs). 10 10 11 11 == **Basic Rules you must obey when using conventions** == 12 12 13 -* Packages are scanned for "action", "struts" or "struts2" .When such a package is found all Classes which implement ActionSupport or end with the name "Action" become actions.13 +* Packages are scanned for "action", "struts" or "struts2" when such a package is found all Classes which implement ActionSupport or end with the name "Action" become actions. 14 14 * The package structure after "action", "struts" or "struts2" become part of the name space for the action. 15 -* JSPs for the root namespace are found under / //WEB-INF/content//other name spaces are added as folders under content.16 -* JSPs under ///WEB-INF/content//automatically become actions even if there is no corresponding action class.15 +* JSPs for the root namespace are found under /WEB-INF/content other name spaces are added as folders under content. 16 +* JSPs under /WEB-INF/content automatically become actions even if there is no corresponding action class. 17 17 * Action Classes will follow Java standard naming, that is camel case and the JSPs will be all lower case with hyphens between words. 18 18 19 19 == **Examples** == ... ... @@ -96,6 +96,4 @@ 96 96 </body> 97 97 </html> 98 98 99 -**That's it! Run the project and test it with** __http:~/~/localhost:8080/Example/enter-name__ 100 - 101 -To input a value or supply a get request by using the url, such as: __http:~/~/localhost:8080/Example/process-form?name=Ken__ 99 +**That's it run the project and test it with** http:~/~/localhost:8080/Example/enter-name to input a value or supply a get request by using the url, such as: http:~/~/localhost:8080/Example/process-form?name=Ken