struts-config.xml 1.<form-beans>: (1)定义一个form-bean:(name[可自取]和type[包名.form名]) (2)定义其属性:为formbean 中的属性,指出其名字和灰型 (3)如: <form-beans> <form-bean name="partregpro" type="loginForm.PartregisterForm"> <form-property name="partname" type="java.lang.String" /> <form-property name="fatherpart" type="java.lang.int" /> <form-property name="partorder" type="java.lang.int" /> </form-bean> </form-beans> 2.<global-forwards> (1)根据名称直接跳转: (2)如: <global-forwards> <forward name="userself" path="/userself.jsp" /> </global-forwards> 3.(****)Action Mapping Definitions(1)input :表单验正失败转入的路径 "/*.jsp"(2)name : formname(3)path :指定请求访问的Action的路径 "/*" (4)type :指Action的完整路径名 包名+ actionname(5)scope :指actionForm 存入的范围(6)validate:指是否执行表单验证(7) <forward name="insearchuser" path="/success.jsp" />请求转发路径 (**)解析:当对Action进行访问时,通过(3)找到真实路径(4),同时通过(2)(5)将from bean给action,如果validate为true,就将在调用action之前进行验证,如果验证失败就进入(1),如果成功,就跳入(7)所指定网页.(8)如:<action input="/partmanager.jsp" name="registernewpart" path="/registernewpart" type="loginAction.RegisterNewPartAction"> <forward name="registernewpart" path="/registernewpart.jsp" /> </action>(9)链接池的配置<data-sources > <data-source key="test" pe="org.apache.commons.dbcp.BasicDataSource"> <set-property property="driverClassName"value="oracle.jdbc.driver.OracleDriver" /> <set-property property="password" value="hai_er" /> <set-property property="url" value="jdbc:oracle:thin:@192.168.100.53:1521:orcl" /> <set-property property="username" value="hai_er" /> <set-property property="maxActive" value="10" /> <set-property property="maxWait" value="5000" /> <set-property property="autoCommit" value="true" /> <set-property property="defaultAutoCommit" value="true" /> <set-property property="defaultReadOnly" value="false" /> </data-source> </data-sources>web.xml(1)<servlet>为固定<servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet>(2)<servlet-mapping><!-- Standard Action Servlet Mapping --> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping>(3)<taglib><taglib> <taglib-uri>/WEB_INF/struts-bean.tld</tablib> <taglib-location>/WEB_INF/strut