最近在学习spring集成struts。
我用spring1.2集成struts1已经成功了,各部分功能都运行正常。
听说spring版本是向下兼容的,然后我把spring的相关包都删了,把spring2.0所有包都导入了(因为初学,不知道哪些包要用到)。这个时候还是能运行正常的。
要用到2.0配置的新特性是要改一下配置文件头的吧?
于是我把spring配置文件头的
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans >
改成了
<?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">
然后启动,启动的时候没有报错,但是访问的时候出现
Servlet action is not available
改这个文件头的时候一切正常啊,这是什么问题呢?
还有这个文件头的含义是什么?下载帮助信息还是其它什么?找了好久都没文章解释这个,请前辈们帮下忙
我用spring1.2集成struts1已经成功了,各部分功能都运行正常。
听说spring版本是向下兼容的,然后我把spring的相关包都删了,把spring2.0所有包都导入了(因为初学,不知道哪些包要用到)。这个时候还是能运行正常的。
要用到2.0配置的新特性是要改一下配置文件头的吧?
于是我把spring配置文件头的
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans >
改成了
<?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">
然后启动,启动的时候没有报错,但是访问的时候出现
Servlet action is not available
改这个文件头的时候一切正常啊,这是什么问题呢?
还有这个文件头的含义是什么?下载帮助信息还是其它什么?找了好久都没文章解释这个,请前辈们帮下忙
解决方案 »
- Hibernate问题
- 自学java如何找工作
- 急:一个webservice 问题
- 关于struts2标签库中updownselect 的问题?
- org.springframework.orm.hibernate3.HibernateTemplate
- Delphi客户端,Java服务器端的webservice之间非基本数据类型数据传送问题,
- struts中连接数据库
- struts的action抛出nullpointexception,我能否通过调试发现错误?
- 求一段JTable代码
- 关于axis在weblogic部署ws的问题(斑竹和大侠们帮忙)
- jbpm从开始节点获取下一步流向的问题
- QQ相册
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-contexts-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
拷贝这个看看