在Struts2的配置文件Struts.xml文件中怎么获取Action类中的数据呀!
如:action.class文件下的内容有

String tplPath ="/index.jsp";
struts.xml文件类容的如下
<action name="xxx" method="xxx“class="member.loginIndeAct">
   <result name="success">${tplPath}</result>
  <result name="error">/error.jsp</result>
</action>

还要配一些什么东西,请高手说明一下

解决方案 »

  1.   

    ${tplPath} 这个不是EL表达式,只是一种从action获得tplPath变量值的方式。你应该成功了!
      

  2.   

    1.tplPath属性在Action中应该有get/set方法。注:配置文件中${tplPath}不是EL的用法,而是OGNL表达式的用法。
        Ognl三个操作符: 「%」「#」「$」 
      

  3.   

    Struts2.0是支持EL的.但是2.1以后的版本不支持EL了,只支持ONGL表达式.
      

  4.   

    <action name="resultTypist" class="tScoreExamAction" method="resultTypist">
     <result name="success" type="redirectAction">
      <param name="actionName">physical_total</param>
    <param name="trainClassId">${educationTrainClass.trainClassId}</param>
     </result>
    </action>${educationTrainClass.trainClassId}action 中传过来的值.