Changes for page Adding and Using the Conventions Plugin
on 2012/03/10 02:31
on 2012/03/10 01:50
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -11,10 +11,11 @@ 11 11 == **Basic Rules you must obey when using conventions** == 12 12 13 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 -* The package structure after "action", "struts" or "struts2" become part of the name space for the action. 14 +* Action Classes follow Java standard naming practices. That is the classes are written in camel case. 15 +* The JSPs which act as the view for an action class will be all lower case with hyphens between words. 16 +* The package structure after "action", "struts" or "struts2" become part of the name space for the action. Packages which follow become struts2 namespaces. 15 15 * JSPs for the root namespace are found under ///WEB-INF/content// other name spaces are added as folders under content. 16 16 * JSPs under// /WEB-INF/content// automatically become actions even if there is no corresponding action class. 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** == 20 20 ... ... @@ -51,7 +51,7 @@ 51 51 52 52 To access this action: http:~/~/localhost:8080/Example/enter-name 53 53 54 -=== Example 2 - Process form and display results === 55 +=== **Example 2 - Process form and display results** === 55 55 56 56 We need to create an action to process the name from the above example. We know that we must put this action in a package which contains the name "action", "struts" or "struts2". 57 57 ... ... @@ -64,7 +64,7 @@ 64 64 package com.example.action; 65 65 \\import com.opensymphony.xwork2.ActionSupport; 66 66 \\public class ProcessForm extends ActionSupport{ 67 - private String name; ~/~/If this was public we could om mit the getters/setters68 + private String name; ~/~/If this was public we could omit the getters/setters 68 68 \\ @Override 69 69 public String execute(){ 70 70 ~/~/processing goes here