1

POSTリクエストが成功すると、リクエストは次のようにリダイレクトされます。

private String message; //Getter and setter.

//Required validators.
@Action(value = "AddUpadteCategory",
    results = {
        @Result(name=ActionSupport.SUCCESS, type="redirectAction", params={"namespace", "/admin_side", "actionName", "Category", "currentPage", "${currentPage}", "message", "${message}", "status", "${status}"}),
        @Result(name = ActionSupport.INPUT, location = "Category.jsp")},
    interceptorRefs={
        @InterceptorRef(value="defaultStack", params={"params.acceptParamNames", "catId, catName, currentPage, rowCount, totalPages, status", "validation.validateAnnotatedMethodOnly", "true"})
    })
public String insertOrUpdate()
{
    if(true)  //Some conditional check.
    {
         setMessage(getText("message.key.true"));
    }
    else
    {
          setMessage(getText("message.key.false"));
    }

    return ActionSupport.SUCCESS;
}

検証/変換エラーが発生しない場合、このメッセージはクエリ文字列パラメーターとして提供されます。

場合によっては、このメッセージが長い URL 文字列を形成する可能性があります。

リダイレクト アクションを使用しているときに、クエリ文字列パラメーターとして渡さずにこのメッセージを取得する方法はありますか?

このメッセージをセッションに保存することは、代替手段ではありません。

4

1 に答える 1