SSH结构问题:No bean named '/index' is defined 10
严重:Servlet.service()forservletactionthrewexceptionorg.springframework.beans.factory.N...
严重: Servlet.service() for servlet action threw exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '/index' is defined
我的Struts配置文件如下
<action
path="/index"
type="org.springframework.web.struts.DelegatingActionProxy"
cancellable="true">
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath*:context/*.xml" />
</plug-in>
<forward name="indexpage" path="/index.jsp"/>
</action>
我的Spring配置文件
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean name="/index" class="com.jqz.web.struts.action.IndexAction">
<property name="contentServices" ref="contentServices"/>
<property name="mkServices" ref="mkServices"/>
<property name="treeServices" ref="treeServices"/>
</bean>
web.xml配置文件如下
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:context/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
大家看看哪里出错了啊!急!!!
我的<bean name="/index" class="com.jqz.web.struts.action.IndexAction">
指向很正确! 我查过!谢谢 现在怀疑是原来的工程用的Myeclipse8.0做的,引入的是8.0下的包,现在导到Myeclipse 6.5里,引入的是6.5的包。Myeclipse8.0没有了,如何才能解决? 展开
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '/index' is defined
我的Struts配置文件如下
<action
path="/index"
type="org.springframework.web.struts.DelegatingActionProxy"
cancellable="true">
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation" value="classpath*:context/*.xml" />
</plug-in>
<forward name="indexpage" path="/index.jsp"/>
</action>
我的Spring配置文件
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean name="/index" class="com.jqz.web.struts.action.IndexAction">
<property name="contentServices" ref="contentServices"/>
<property name="mkServices" ref="mkServices"/>
<property name="treeServices" ref="treeServices"/>
</bean>
web.xml配置文件如下
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:context/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
大家看看哪里出错了啊!急!!!
我的<bean name="/index" class="com.jqz.web.struts.action.IndexAction">
指向很正确! 我查过!谢谢 现在怀疑是原来的工程用的Myeclipse8.0做的,引入的是8.0下的包,现在导到Myeclipse 6.5里,引入的是6.5的包。Myeclipse8.0没有了,如何才能解决? 展开
展开全部
一般bean的话用id来识别,你可以改你的bean id="index"试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询