zoukankan      html  css  js  c++  java
  • Struts2之页面取得当前actionName

    在页面上加入<s:debug />, 我们就可以查看stackContext的信息

    其中有一项:Key为com.opensymphony.xwork2.ActionContext.name里面保存的就是actionName

    直接使用<s:property value="com.opensymphony.xwork2.ActionContext.name" />就可以得到

    常用例:

    <s:set name="actionName" value="com.opensymphony.xwork2.ActionContext.name" >

    <s:if test="#actionName=='recommendReg'">

    doSomeThings

    </s:if>

    <s:else>

    doOtherThings

    </s:else>

    以下为<s:debug />,片段

    com.opensymphony.xwork2.dispatcher.HttpServletRequest org.apache.struts2.dispatcher.StrutsRequestWrapper@1ae7f61
    com.opensymphony.xwork2.ActionContext.locale en_US
    com.opensymphony.xwork2.dispatcher.HttpServletResponse com.opensymphony.module.sitemesh.filter.PageResponseWrapper@12cc880
    com.opensymphony.xwork2.ActionContext.name recommendReg
  • 相关阅读:
    Socket通信
    浏览器调用打印机
    python dict操作
    python list操作
    python 模块Example链接
    python random模块
    python configparser模块
    python unittest模块
    python timeit模块
    python datetime模块
  • 原文地址:https://www.cnblogs.com/firstdream/p/2377653.html
Copyright © 2011-2022 走看看