resultのtypeに"RedirectResult" を指定します。
Apache Struts 2 Documentation|Redirect Result
実装例:
java
1import org.apache.struts2.convention.annotation.Action;
2import org.apache.struts2.convention.annotation.Namespace;
3import org.apache.struts2.convention.annotation.Result;
4import org.apache.struts2.convention.annotation.Results;
5
6import com.opensymphony.xwork2.ActionSupport;
7
8@Namespace("/")
9@Results({
10 @Result(name = ActionSupport.SUCCESS, type = "redirect", location = "任意のURL")
11})
12public class SamplePictureAction extends ActionSupport {
13 @Action("picture")
14 public String execute() throws Exception {
15 return SUCCESS;
16 }
17
18}
19
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/05/09 06:06
2017/05/26 10:44