husted 2002/07/10 13:21:25
Modified: web/blank/WEB-INF web.xml struts-config.xml
Added: web/blank/WEB-INF validation.xml tiles-defs.xml
Log:
Update blank application for tiles, validator, et cetera.
Revision Changes Path
1.4 +13 -23 jakarta-struts/web/blank/WEB-INF/web.xml
Index: web.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/web/blank/WEB-INF/web.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- web.xml 19 Mar 2002 03:56:11 -0000 1.3
+++ web.xml 10 Jul 2002 20:21:25 -0000 1.4
@@ -6,20 +6,6 @@
<web-app>
-
- <!-- Example Database Initialization Servlet Configuration
- <servlet>
- <servlet-name>database</servlet-name>
- <servlet-class>org.apache.struts.example.DatabaseServlet</servlet-class>
- <init-param>
- <param-name>debug</param-name>
- <param-value>2</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- -->
-
-
<!-- Standard Action Servlet Configuration (with debugging) -->
<servlet>
<servlet-name>action</servlet-name>
@@ -52,26 +38,30 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
- <!-- Example Application Tag Library Descriptor
- <taglib>
- <taglib-uri>/WEB-INF/app.tld</taglib-uri>
- <taglib-location>/WEB-INF/app.tld</taglib-location>
- </taglib>
- -->
<!-- Struts Tag Library Descriptors -->
<taglib>
- <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
+ <taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
- <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
+ <taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
- <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
+ <taglib-uri>/tags/struts-logic</taglib-uri>
+ <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>/tags/struts-nested</taglib-uri>
+ <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>/tags/struts-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
1.5 +132 -96 jakarta-struts/web/blank/WEB-INF/struts-config.xml
Index: struts-config.xml
===================================================================
RCS file: /home/cvs/jakarta-struts/web/blank/WEB-INF/struts-config.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- struts-config.xml 1 Apr 2002 06:03:07 -0000 1.4
+++ struts-config.xml 10 Jul 2002 20:21:25 -0000 1.5
@@ -5,114 +5,150 @@
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<!--
- This is a blank Struts configuration file based on the example application,
- with commented examples of some items.
+ This is a blank Struts configuration file with an example
+ welcome action/page and other commented sample elements.
- NOTE: If you have a generator tool to create the corresponding Java classes
- for you, you could include the details in the "form-bean" declarations.
- Otherwise, you would only define the "form-bean" element itself, with the
+ Tiles and the Struts Validator are configured using the factory defaults
+ and are ready-to-use.
+
+ NOTE: If you have a generator tool to create the corresponding Java classes
+ for you, you could include the details in the "form-bean" declarations.
+ Otherwise, you would only define the "form-bean" element itself, with the
corresponding "name" and "type" attributes, as shown here.
-->
<struts-config>
-
- <!-- ========== Data Source Configuration =============================== -->
+<!-- ==================================== Data Source Configuration -->
<!--
- <data-sources>
- <data-source
- autoCommit="false"
- description="Example Data Source Configuration"
- driverClass="org.postgresql.Driver"
- maxCount="4"
- minCount="2"
- password="mypassword"
- url="jdbc:postgresql://localhost/mydatabase"
- user="myusername"
- />
- </data-sources>
+ <data-sources>
+ <data-source>
+ <set-property
+ property="autoCommit"
+ value="false"/>
+ <set-property
+ property="description"
+ value="Example Data Source Configuration"/>
+ <set-property
+ property="driverClass"
+ value="org.postgresql.Driver"/>
+ <set-property
+ property="maxCount"
+ value="4"/>
+ <set-property
+ property="minCount"
+ value="2"/>
+ <set-property
+ property="password"
+ value="mypassword"/>
+ <set-property
+ property="url"
+ value="jdbc:postgresql://localhost/mydatabase"/>
+ <set-property
+ property="user"
+ value="myusername"/>
+ </data-source>
+ </data-sources>
-->
- <!-- ========== Form Bean Definitions =================================== -->
- <form-beans>
+<!-- ======================================== Form Bean Definitions -->
+
+ <form-beans>
+
+ <!-- sample form bean descriptor for an ActionForm
+ <form-bean
+ name="inputForm"
+ type="app.InputForm"/>
+ end sample -->
+
+ <!-- sample form bean descriptor for a DynaActionForm
+ <form-bean
+ name="logonForm"
+ type="org.apache.struts.action.DynaActionForm">
+ <form-property
+ name="username"
+ type="java.lang.String"/>
+ <form-property
+ name="password"
+ type="java.lang.String"/>
+ end sample -->
+
+ </form-beans>
+
+
+<!-- ================================= Global Exception Definitions -->
+
+ <global-exceptions>
+ <!-- sample exception handler
+ <exception
+ key="expired.password"
+ type="app.ExpiredPasswordException"
+ path="/changePassword.jsp"/>
+ end sample -->
+ </global-exceptions>
+
+
+<!-- =================================== Global Forward Definitions -->
+
+ <global-forwards>
+ <!-- Default forward to "Welcome" action -->
+ <!-- Demonstrates using index.jsp to forward -->
+ <forward
+ name="welcome"
+ path="/Welcome.do"/>
+ </global-forwards>
+
+
+<!-- =================================== Action Mapping Definitions -->
+
+ <action-mappings>
+
+ <!-- Default "Welcome" action -->
+ <!-- Forwards to Welcome.jsp -->
+ <action
+ path="/Welcome"
+ type="org.apache.struts.actions.ForwardAction"
+ parameter="/pages/Welcome.jsp"/>
+
+ <!-- sample input and input submit actions
+
+ <action
+ path="/Input"
+ type="org.apache.struts.actions.ForwardAction"
+ parameter="/pages/Input.jsp"/>
+
+ <action
+ path="/InputSubmit"
+ type="app.InputAction"
+ name="inputForm"
+ scope="request"
+ validate="true"
+ input="/pages/Input.jsp"/>
+
+ end samples -->
+
+
+ </action-mappings>
+
+
+<!-- ===================================== Controller Configuration -->
+
+ <controller
+ processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
+
+
+<!-- ================================ Message Resources Definitions -->
+
+ <message-resources parameter="resources.application"/>
+
+
+<!-- ======================================= Plug Ins Configuration -->
- <!-- Example logon form bean
- <form-bean name="logonForm"
- type="org.apache.struts.example.LogonForm"/>
- -->
-
- </form-beans>
-
-
- <!-- ========== Global Forward Definitions ============================== -->
- <global-forwards>
-
- <!-- Example logon forward
- <forward name="logon" path="/logon.jsp"/>
- -->
-
- </global-forwards>
-
-
- <!-- ========== Action Mapping Definitions ============================== -->
- <action-mappings>
-
- <!-- Example logon action
- <action path="/logon"
- type="org.apache.struts.example.LogonAction"
- name="logonForm"
- scope="request"
- input="/logon.jsp">
- </action>
- -->
-
- <!-- Example logoff action
- <action path="/logoff"
- type="org.apache.struts.example.LogoffAction">
- <forward name="success" path="/index.jsp"/>
- </action>
- -->
-
-
- <!-- The standard administrative actions available with Struts -->
- <!-- These would be either omitted or protected by security -->
- <!-- in a real application deployment -->
- <action path="/admin/addFormBean"
- type="org.apache.struts.actions.AddFormBeanAction"/>
- <action path="/admin/addForward"
- type="org.apache.struts.actions.AddForwardAction"/>
- <action path="/admin/addMapping"
- type="org.apache.struts.actions.AddMappingAction"/>
- <action path="/admin/reload"
- type="org.apache.struts.actions.ReloadAction"/>
- <action path="/admin/removeFormBean"
- type="org.apache.struts.actions.RemoveFormBeanAction"/>
- <action path="/admin/removeForward"
- type="org.apache.struts.actions.RemoveForwardAction"/>
- <action path="/admin/removeMapping"
- type="org.apache.struts.actions.RemoveMappingAction"/>
-
-
- </action-mappings>
-
- <!-- ========== Message Resources Definitions =========================== -->
-
- <message-resources parameter="ApplicationResources"/>
-
- <!-- ========== Plug Ins Configuration ================================== -->
-
- <!--
- Add multiple validator resource files by setting the pathnames property
- with a comma delimitted list of resource files to load.
- Default pluggable validator definitions are contained in validator-rules.xml.
- Add any validation rules for forms in validator.xml.
- -->
- <!--
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
- <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
- /WEB-INF/validation.xml"/>
+ <set-property
+ property="pathnames"
+ value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
- -->
</struts-config>
1.1 jakarta-struts/web/blank/WEB-INF/validation.xml
Index: validation.xml
===================================================================
<form-validation>
<!--
This is a blank Validator form file with a commented examples.
-->
<global>
<!-- An example global constant
<constant>
<constant-name>postalCode</constant-name>
<constant-value>^\d{5}\d*$</constant-value>
</constant>
end example-->
</global>
<formset>
<!-- An example form
<form name="logonForm">
<field
property="username"
depends="required">
<arg0 key="logonForm.username"/>
</field>
<field
property="password"
depends="required,mask">
<arg0 key="logonForm.password"/>
<var>
<var-name>mask</var-name>
<var-value>^[0-9a-zA-Z]*$</var-value>
</var>
</field>
</form>
end example form -->
</formset>
<!-- An example formset for another locale
<formset language="fr">
<constant>
<constant-name>postalCode</constant-name>
<constant-value>^[0-9a-zA-Z]*$</constant-value>
</constant>
</formset>
-->
</form-validation>
1.1 jakarta-struts/web/blank/WEB-INF/tiles-defs.xml
Index: tiles-defs.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config.dtd">
<!--
This is a blank Tiles definition file with a commented example.
-->
<tiles-definitions>
<!-- sample tiles definitions
<definition name=".mainLayout" path="/common/layouts/classicLayout.jsp">
<put name="title" value="Sample Page Title" />
<put name="header" value="/common/header.jsp" />
<put name="menu" value=".mainMenu" />
<put name="footer" value="/common/footer.jsp" />
<put name="body" value=".portal.body" />
</definition>
<definition name=".mainMenu" path="/common/layouts/vboxLayout.jsp" >
<putList name="componentsList" >
<add value=".menu.links" />
<add value=".menu.taglib.references" />
<add value=".menu.printer.friendly" />
<add value=".menu.old.documents" />
</putList>
</definition>
end samples -->
</tiles-definitions>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>