需要注意的是,action需要先被调用到,OGNL才能成功,因为action被执行才被压入值栈

package com.wolfgang.action;

import com.opensymphony.xwork2.ActionSupport;

public class TestOGNL extends ActionSupport{
    private String name="jeff";

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
    public String TestActionFuc()
    {
        return "success";        
    }
}
        <action name="testOGNL" class="com.wolfgang.action.TestOGNL">
            <result>/OGNL/static.jsp</result>
        </action>
    action方法
          属性:<s:property value="getName()"/>
          方法:<s:property value="TestActionFuc()"/>

 

相关文章:

  • 2022-12-23
  • 2021-06-15
  • 2021-11-27
  • 2021-11-16
  • 2021-12-14
猜你喜欢
  • 2021-10-26
  • 2022-12-23
  • 2022-02-12
  • 2021-07-20
  • 2021-04-19
相关资源
相似解决方案