最近在学习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中出现The method configure() is undefined for the type Configuration
- 在写一个struts2的小例子时出错了,大家帮忙看下
- 关于mybatis返回List类型数据的问题
- 急!急!急!急!急!急!急!急!急!急!
- 谁有iBatis的资料,给份谢了(新手求教)
- mysql+ldap+xwiki 的配置
- An error occurred while evaluating custom action attribute "value" with value "${managePageForm.mPPageName}": Unable to find a v
- 请教大家一个关于 jdbc 连接 oracle 出现的中文问题.
- 寻找EJB失败的问题,请多多指教
- 我运行startup的时候显示bad command or file name
- 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">
拷贝这个看看