代码之家  ›  专栏  ›  技术社区  ›  Shane Courtrille

如何在Struts2操作中构建操作url?

  •  2
  • Shane Courtrille  · 技术社区  · 14 年前

    我有一个返回需要调用另一个Struts2操作的url的操作。在JSP中 <s:url>

    4 回复  |  直到 14 年前
        1
  •  3
  •   Steve Gevers    14 年前

    因为struts正在创建您的action类,所以只需使用Inject注释并让struts告诉您!

    @Inject
    public void setActionMapper(ActionMapper mapper) {
        this.actionMapper = mapper;
    }
    
        2
  •  0
  •   Steven Benitez    14 年前

    您可能需要在操作中自己构造URL。您可能需要查看的一件事是org.apache.struts2.components.URL。这是s:url标记用来创建url的类,尽管您自己创建url可能更容易。

        3
  •  0
  •   Vinay Lodha    14 年前

    你可以使用动作链。。。你所要做的就是叫另一个行动。