-------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中 我想知道错在那里
希望高手给予指点非常感谢!!!!
<?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中 我想知道错在那里
希望高手给予指点非常感谢!!!!
解决方案 »
- 如何用PreparedStatement给一个外键字段传空值进去
- 关于.net 访问java webservice 结果集(oracle数据库)的问题?高手指教
- 求意见 下步怎么走,??
- 问一个关于HIBERNATE,不知道深不深奥的问题
- 高分求解,关于hibernate的问题(table per class hierarchy)
- 求助:jbuilder9正式版的crack文件,(好象KeyGen.exe不顶用啊?~~)
- 请教!!!
- hibernate联表查询
- spring hibernate 用注解生成表,怎么保存主从信息
- Ansj分词器在加上@Async的方法中停止执行代码,也不报任何错误和异常
- 请教webwork高手,急!!!!!!
- 请教 !关于修改jasperReport 样式问题
<forward name="success" path="/personList.jsp" />
</action>
<controller>
<set-property property="processorClass"
value="org.springframework.web.struts.DelegatingRequestProcessor"/>
</controller>
第二:struts1.x的默认配置文件好象是struts-config.xml如果改名字是不是web.xml要配置路径.
第三:struts1.x的action调试需要在web环境下进行,即通过浏览器调试