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>
To provide clarity when working with multiple nested properties
To provide script variable for included JSP pages.
Does NOT create an instance of a bean
It provides access to a bean in scope
Don’t use to define a form bean to a new script variable name
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();
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