不行啊,是要在JSP表达式当中<%PubTagLib.printSubTitle(aa);%> 无法用标签的

解决方案 »

  1.   

    用了struts2就不要用jsp表达式了吧
      

  2.   


    ValueStack vs=request.getParame("ValueStack");
    //用valuestack来取,action传过来的都放再里面,具体怎么写我忘了,楼主去google  struts2 valuestack 或 jsp valuestack 应该就有了
      

  3.   

    com.opensymphony.xwork2.util.OgnlValueStack valueStack = (OgnlValueStack) request.getAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY);//其中ServletActionContext是org.apache.struts2.ServletActionContext,即: public static final String STRUTS_VALUESTACK_KEY = "struts.valueStack";Object obj = iognlvstack_Stack.findValue("valName");
      

  4.   

    解决了,在Action里将aa赋好值,然后前台页面直接写<%String aa = (String)request.getAttribute("aa");%>就可以得到Action里将aa的值
    不过我不太明白,我在Action里也没有写request.setAttribute之类的代码,为什么前台就能直接request.getAttribute("aa")呢?难道说是struts2的机制里就隐含着setAttribute()了吗
      

  5.   

    因为你在action里已经实现了 aa的 get和set方法了.
    其实你在页面上直接调用struts2的标签就行<s:property value="aa" />
      

  6.   


    HttpServletRequest httpRequest = ServletActionContext.getRequest();Map request = (Map) context.get("request");request.put("aaa", "aaa");
      

  7.   

    El表达式${requestSope.xxx}jsp表达<%=request.getAttribute("xxx")%>
    struts2标签
    <s:property value="xxx" />
      

  8.   


    不写request.setAttribute之类的代码是得不到的
      

  9.   

    可我的确没写request.setAttribute(),而可以得到aa的值啊
      

  10.   

    解决了,在Action里将aa赋好值,然后前台页面直接写 <%String aa = (String)request.getAttribute("aa");%>就可以得到Action里将aa的值 
    不过我不太明白,我在Action里也没有写request.setAttribute之类的代码,为什么前台就能直接request.getAttribute("aa")呢?难道说是struts2的机制里就隐含着setAttribute()了吗