Struts2的处理流程及为Action的属性注入值

1、Struts2的处理流程

Struts2的处理流程及为Action的属性注入值

          

2、为Action的属性注入值

public class HelloWorldAction {
private String savePath;

public String getSavePath() {
return savePath;
}

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

}

< package name = " test " namespace = " /test " extends = " struts-default " >
< action name = " helloworld " class = " com.ljq.action.HelloWorldAction " >
<!-- 为Action的属性注入值 -->
< param name = " savePath " >/ images </ param >
< result name = " success " >/ WEB - INF / page / hello.jsp </ result >
</ action >
</ package >

上面通过<param>节点为action的savePath属性注入“/images”

你可能感兴趣的:(struts2)