20. Strut-config.xml For requests that hit URL=“/logon” The frame work will invoke execute() on an instance of class com.codementor.LogonAction Store request parameters in form variable “LogonForm” which is defined in another location in the xml document. If the logical name returned by perform() is “failure” go to page “/failure.jsp” If the Logical name returned by perform() is “success” go to “/success.jsp” <action path=" /logon “ type= “ com.codementor.LogonAction ” name=" LogonForm " <forward name=" failure " path=" /failure.jsp " /> <forward name=" success " path=" /success.jsp " /> </action>
97. Bean:Define <bean:define id=“employeeList“ name=“selectEmployeesForm“ property=“employeeList“ type="java.util.Collection"/> Defines a referenceable variable named employeeList which is assigned that value Of the property employeeList in the form Bean. Collection employeeList = selectEmployeesForm.getEmployeeList();
98.
99.
100.
101.
102.
103.
104.
105.
106. Bean:Write JSP Equivalent: <%= modelForm.getClientName() %> If the named object is an object you do not have to define a property Ex: <bean:write name=“id” /> This commonly happens with a bean define or an id assigned in an iterator
Struts and Tiles Tutorial - This provides the base for a model view controller architecture.
The <set-property> tag is the only tag under the data-source node. Acceptable attributes of set-property: property value id
Tags under the form-beans node. Form-bean name type className dynamic id Allowable tags under form-bean with their attributes Description Display-name Form-property name type className initial size Icon Set-property property value id
Tags under the global-exceptions node Exception type key bundle className handler id path scope Tags under Exception Description Display-name Icon Set-property property value id
Tags under the global-forwards node Forward name path className contextRelative id redirect Tags under the forward node Description display=-name Icon set-property property value id
Action is the only tag under the action-mapping node it have the following attributes: Name Input Path Scope Type Attribute className Forward Id Include Parameter Prefix Roles Suffix Unknown Validate Tags under the action node Description Display-name Exception Forward Icon Set-property
The Controller tag has several attributes associated with it: processorClass bufferSize className contentType Debug forwardPattern Id inputForward Locale maxFileSize memFileSize multipartClass Nocache pagePattern tempDir Tags that can be used under the controller node Set-property
The Message-resources tag has several attributes associated with it: parameter className Factory id Key Null Tags that can be used under the message-resources node Set-property
The plug-in tag has a couple of attributes associated with it: className Id Tags that can be used under the plug-in node Set-property
The paramName does not need to be specified if the nested:link is used. It must be used nested in a form or in an iterator tag.
The value of isUSCitizen must be set to false in the reset() method for this control to work correctly. This is based on how checkbox values are sent in html.
It may be useful to create another validation-rules-<company>.xml for your company specific validation rules.
Unless you are developing your own validation rules, you should even need to look at this file. We are looking at it in an effort to provide a greater understanding of how the framework works.
The resource = false, tells the framework to not lookup anything from the resource file, to use the key as the name The ${var:minlength} is replaced with the value of var->var-name== minlength which in this case is 5. This allows the configuration of the value once.
How could you create a error message which would display the configured datePattern that is required?