diff --git a/apps/blank/src/main/resources/struts.properties b/apps/blank/src/main/resources/struts.properties index da1fcc77f..8c29875f6 100644 --- a/apps/blank/src/main/resources/struts.properties +++ b/apps/blank/src/main/resources/struts.properties @@ -1,2 +1,2 @@ -struts.objectFactory = spring struts.devMode = true +struts.enable.DynamicMethodInvocation = false diff --git a/apps/mailreader/src/main/webapp/pages/tour.html b/apps/mailreader/src/main/webapp/pages/tour.html index a56a2d2df..abc7dacf9 100644 --- a/apps/mailreader/src/main/webapp/pages/tour.html +++ b/apps/mailreader/src/main/webapp/pages/tour.html @@ -23,7 +23,6 @@ Of course, the full source code to the MailReader is included in the distribution. -

@@ -216,8 +215,20 @@


- Among other things, - the web.xml specifies the "Welcome File List" for an application. + You might note taht the web.xml configuration does not specify which file extension + to use with actions. + The default extension for Struts 2 is ".action", + but the extension can be changed in the struts.properties file. + For compatability with prior releases, the MailReader uses a .do extension for actions. +

+ +
+
struts.properties
+
struts.action.extension = do
+
+ +

+ The web.xml does specify a "Welcome File List" for the application. When a web address refers to a directory rather than an individual file, the container consults the Welcome File List for the name of a page to open by default. @@ -251,6 +262,7 @@ page to a certain action mapping.

+

Sites can list zero or more "Welcome" pages in the web.xml. @@ -1263,7 +1275,8 @@ public void setSession(Map value) {


- You might notice that the name of the Logon action element is not "Logon" but "Logon!*". + You might notice that the name of the Logon action element is not "Logon" + but "Logon!*". The asterisk is a special "wildcard" notation that tells the framework to match any series of character at this point. In the method attribute, @@ -1273,13 +1286,25 @@ public void setSession(Map value) { the framework matches "cancel" or "input" with the wildcard and fills in the blanks.

+

+ The "trailing bang" notation was hardwired into WebWork 2. + To provide backward compatibility, + the notation is supported by Struts 2.0. + If you prefer to use wildcards to emulate the same notation, + as the Mailreader does, + you should disable the old notation in the Struts properties file. +

+ +
+
struts.properties
+
struts.enable.DynamicMethodInvocation = false
+
+

Using wildcards with a exclamation point (or "bang") is not the only way we can use - wilcards. + wilcards to invoke methods. If we wanted to use actions like "inputLogin", we could move the asterisk and use an action name like "*Logon". - (Albeit, the trailing bang is a common convention, - adopted from on a similar WebWork 2 feature.)

diff --git a/apps/starter/src/main/resources/struts.properties b/apps/starter/src/main/resources/struts.properties index da1fcc77f..8c29875f6 100644 --- a/apps/starter/src/main/resources/struts.properties +++ b/apps/starter/src/main/resources/struts.properties @@ -1,2 +1,2 @@ -struts.objectFactory = spring struts.devMode = true +struts.enable.DynamicMethodInvocation = false