阅读480 返回首页    go 阿里云 go 技术社区[云栖]


Struts动态结果集

 

我们可以在action中动态指定结果集的location,其实就是在struts.xml文件中拿到action的属性而已。

 

UserAction

public class UserAction extends ActionSupport

{

      private String path;

      private String type;

      public String execute()

      {

              if(type == "1")

              {

                     path = "xy.jsp";

              } 

              else path = "xy2.jsp";

              return success;

      }

}

Getter和Setter省略

 

Struts.xml

<action name="uaction" >

        <result>${path}</result>

</action>

 

简单吧。

 

最后更新:2017-04-02 16:47:54

  上一篇:go 完成web开发必知工具
  下一篇:go Android 内存管理