我写了一个小的登录过程,可是发现项目中没有struts.proprety这个文件也能运行。我在网上查了都说要和spring配置的时
候要修改struts.property里面的属性不知道这个文件在哪找到?是不是struts2.1.6不需要struts.property这个文件么?
还有就是struts2.1.6怎么配置让spring代理?并且spring里怎么代理他呢?给个简单的代码给我看下呵呵~~~~!!

解决方案 »

  1.   

    貌似不需要配置吧,这个文件没有就自己建撒  文件名错了  应该是struts.properties
      

  2.   

    你发个连接struts和spring代理的代码片段我看下就知道了谢谢
      

  3.   

    web.xml<?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/applicationContext.xml
    </param-value>
    </context-param> <listener>
    <listener-class>
    org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener> <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
    org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
    </filter> <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    </web-app>struts.xml<struts>
    <constant name="struts.objectFactory" value="spring" />
    <package name="one" extends="struts-default">
    <action name="login_form">
    <result>/WEB-INF/jsp/login_form.jsp</result>
    </action>
    </package>
    </struts>applicationContext.xml<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <bean id="login" class="action.Login" scope="prototype">
    </bean>
    </beans>
      

  4.   

    struts2一般都不怎么使用properties文件进行配置的,一般使用xml文件,
    like 楼上的
      

  5.   

    struts2可以使用properties,做一般的配置也可以在资源国际化
    properties用在资源国际化的时候居多.