+ -
当前位置:首页 → 问答吧 → 关于struts2的配置问题

关于struts2的配置问题

时间:2011-12-07

来源:互联网

struts2的配置如下 其中class交给spring管理了
XML code
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <constant name="struts.enable.DynamicMethodInvocation" value="false" />
    <constant name="struts.devMode" value="true" />
    <constant name="struts.action.extension" value="action"></constant>
    <package name="oa" namespace="/" extends="struts-default">
          <action name="position_*" class="positionAction" method="{1}">
            <result name="list" type="dispatcher"> /WEB-INF/position_jsp/list.jsp</result>
            <result name="toList" type="redirectAction">position_list</result>
        </action>
        
    </package>
</struts>


在XML code
<result name="toList" type="redirectAction">position_list</result>
一行报错
Undefined actionName parameter 求解答

作者: hfq869072989   发布时间: 2011-12-07

...来人啊 帮忙 看下啊

作者: hfq869072989   发布时间: 2011-12-07

XML code
<struts>
     
    <!-- s2sh整合时,创建对象的工作交给了spring来做,这涉及到一些内部的机制,
    只要知道就可以了,下面这行代码是整合时必须加上的 -->
    <constant name="struts.objectFactory" value="spring"></constant>
    
    <package name="login" extends="struts-default" namespace="/login">...

作者: hllfl   发布时间: 2011-12-07

position_list是什么

作者: LeeHomWong   发布时间: 2011-12-07

引用 2 楼 hllfl 的回复:

XML code
<struts>

<!-- s2sh整合时,创建对象的工作交给了spring来做,这涉及到一些内部的机制,
只要知道就可以了,下面这行代码是整合时必须加上的 -->
<constant name="struts.objectFactory" value="spring"></constant>

<package name=……

。。这句话忘了 还是谢谢你

作者: hfq869072989   发布时间: 2011-12-07

引用 3 楼 leehomwong 的回复:

position_list是什么

 <action name="position_*" 
*是通配符 position_list 就等于访问名为 position_list的ACTION

作者: hfq869072989   发布时间: 2011-12-07

热门下载

更多