struts1配置文件样本


<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
          "http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>
	<form-beans>
		<form-bean name="BaseForm"
			type="org.apache.struts.validator.DynaValidatorForm">
		</form-bean>
		<form-bean name="LoginForm" type="package.LoginForm" />
		<form-bean name="ENClassForm" type="package.ENClassForm">
			<form-property name="id" type="java.lang.String" />
			<form-property name="name" type="java.lang.String" />
			<form-property name="description" type="java.lang.String" />
			<form-property name="teacherId" type="java.lang.String" />
		</form-bean>
		<form-bean name="StudentForm" type="package.StudentForm"
			extends="BaseForm" />
			
		<form-bean name="GroupForm" type="package.GroupForm"
			extends="BaseForm"></form-bean>
	</form-beans>

	<global-exceptions>

	</global-exceptions>

	<global-forwards>
		<forward name="helloWorld" path="/helloWorld.do" />
		<forward name="welcome" path="/Welcome.do" />
		<forward name="welcome" path="/Welcome.do" redirect="true"/>
	</global-forwards>

	<action-mappings>
		<action path="/changeLocale" parameter="method"
			type="package.InternationalizationAction">
			<forward name="loginPage" path="/login.jsp" />
			<forward name="homepage" path="/main.jsp" />
		</action>

		<action input="/groupMain.jsp" parameter="method" name="GroupForm"
			path="/GroupAction" type="package.GroupAction" scope="session">
			<forward name="success" path="/groupMain.jsp"></forward>
		</action>
		
		<action input="/login.jsp" name="LoginForm" path="/Login"
			scope="request" type="package.LoginAction">
			<forward name="success" path="/main.jsp" />
			<forward name="failure" path="/login.jsp" />
		</action>
		
		<action input="/ENClassMain.jsp" parameter="method" name="ENClassForm"
			path="/ENClassAction" scope="request"
			type="package.ENClassAction">
			<forward name="modification" path="/updateENClassPage.jsp" />
			<forward name="register" redirect="true" path="/registerENClassPage.jsp" />
			<forward name="display" redirect="true" path="/ENClassMain.jsp" />
			<forward name="reLogin" path="/login.jsp" />
		</action>
		
		<action input="/studentMain.jsp" parameter="method" name="StudentForm"
			path="/StudentAction" scope="request" type="package.StudentAction">
			<forward name="modification" path="/registerStudentPage.jsp" />
			<forward name="display" path="/studentMain.jsp" />
			<forward name="displayInfo" path="/displayStudentInfoPage.jsp" />
			<forward name="register" path="/registerStudentPage.jsp" />
		</action>
		
		<action path="/Welcome" forward="/welcomeStruts.jsp" />
		
	</action-mappings>

	<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />

	<message-resources parameter="ApplicationResource" />

	<plug-in className="org.apache.struts.tiles.TilesPlugin">
		<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
		<set-property property="moduleAware" value="true" />
	</plug-in>

	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
		<set-property property="pathnames"
			value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
	</plug-in>

</struts-config>


你可能感兴趣的:(apache,xml,struts)