05. struts2中为Action属性注入值

2020-11-26  本文已影响0人  c9096743e3b0

概述

配置

<action name="helloworld" class="com.liuyong666.action.HelloWorldAction">
    <param name="savePath">/resource</param>
    <result name="success">/WEB-INF/page/hello.jsp</result>
</action>

对应类中的变化

public class HelloWorldAction{
    private String savePath;

    public String getSavePath() {
        return savePath;
    }
    public void setSavePath(String savePath) {
        this.savePath = savePath;
    }
       ......
}

好处

上一篇 下一篇

猜你喜欢

热点阅读