xml 代码
- <action-mappings >
- <action
- attribute="indexForm"
- input="/index.jsp"
- name="indexForm"
- parameter="state"
- path="/index"
- scope="request"
- />
- action-mappings>
- <controller processorClass="org.springframework.web.struts.DelegatingRequestProcessor"/>
这种通过加一个构造器,而不用在action里面都要写type="org.springframework.web.struts.DelegatingActionProxy"
而在另外一个文件中专门用来写/index 和action的对应如:
xml 代码
- <beans default-autowire="byName">
- <bean name="/index"
- class="org.langsin.computer.web.action.IndexAction"
- singleton="false">
- <property name="userService">
- <ref bean="userService" />
- property>
- bean>
- beans>
这个文件名字可以叫action-servlet.xml