-------struts.xml配置
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"><struts-config>
  <data-sources />
  <form-beans />
  <global-exceptions />
  <global-forwards /> 
  <action-mappings >
    <action path="/personList">
      <forward name="success" path="/personList.jsp" />
    </action>
  </action-mappings> 
 <controller>
  <set-property property="processorClass"
      value="org.springframework.web.struts.DelegatingRequestProcessor"/>
</controller>
  <message-resources parameter="com.wang.learnspring17.struts.ApplicationResources" /> 
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
  <set-property property="contextConfigLocation"
      value="/WEB-INF/classes/applicationContext.xml"/>
</plug-in>
</struts-config>---------------spring配置 
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="personDAO"
class="com.yiboit.learnspring19.po.PersonDAO">
<property name="sessionFactory">
<ref bean="sessionFactory"></ref>
</property>
</bean>
<bean name="/personList" class="com.wang.learnspring17.struts.action.PersonListAction">
<property name="personDAO" ref="personDAO"></property>
</bean>

</beans>
----------------------------action中的代码
public class PersonListAction extends Action {

PersonDAO personDAO = null;
public void setPersonDAO(PersonDAO personDAO) {
this.personDAO = personDAO;
} public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) { System.out.println("1=1---------------------1");
System.out.println(personDAO+"--------------");
return null;
}
}程序的其他地方是用工具生成的 我 为什么程序执行时没有打印出任何东西   
给我的感觉程序没有走到 Action中  我想知道错在那里 
希望高手给予指点非常感谢!!!!

解决方案 »

  1.   

       <action path="/personList"    type="org.springframework.web.struts.DelegatingActionProxy" > 
          <forward name="success" path="/personList.jsp" /> 
        </action> 
      

  2.   

    加 type="org.springframework.web.struts.DelegatingActionProxy"的意思是把action托管给spring来管理
      

  3.   

    不行我托管是用DelegatingRequestProcessor设置的  下面的代码
    <controller> 
      <set-property property="processorClass" 
          value="org.springframework.web.struts.DelegatingRequestProcessor"/> 
    </controller> 
      

  4.   

    SSH的问题 我个人觉得 你只给这么点代码不好看!
      

  5.   

    没报什么错吗?是不是没加日志的包进去?commons-logging,log4j之类的
      

  6.   

    第一:设置断点,看进入action的execute()没?如果没进入,则配置文件有误
    第二:struts1.x的默认配置文件好象是struts-config.xml如果改名字是不是web.xml要配置路径.
    第三:struts1.x的action调试需要在web环境下进行,即通过浏览器调试