Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3379

Using apache urlrewrite to @ result redirectAction invalid after addActionMessage and addActionError

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.8
    • None
    • Core Actions
    • None
    • Core Interceptors

    • Important

    Description

      My codeļ¼š
      @Namespace("/app")
      @Results({

      @Result(name="success", type="redirectAction", params =

      {"actionName" , "orders"}

      ),
      })
      public class OrdersController extends ActionSupport implements ModelDriven<Object>{

      // GET /orders
      public HttpHeaders index()

      { list = ordersService.getAll(); System.out.println(this.getActionMessages()); // use apache urlrewrite After no value here return new DefaultHttpHeaders("index").disableCaching(); }

      }

      //============================================================================

      @Namespace("/app")
      @Results({
      @Result(name="success", type="redirectAction", params =

      { "actionName" , "orders"}

      )
      })
      public class OrdersBatchController extends ActionSupport {
      private static final long serialVersionUID = 6072741035167921283L;

      //POST /orders-batch
      public String create()

      { addActionMessage("Order-batch removed successfully"); return SUCCESS; }

      }

      If you did not use apache urlrewrite the code above is no problem.
      post -> http://www.demo.com/app/orders-batch to orders success
      In the orders of the index method to obtain actionMessage

      According to the actual situation into the domain name:
      http://app.demo.com/orders-batch (Actually equal to http://www.demo.com/app/orders-batch)
      I have a corresponding change in s: from to ensure that requests to orderBatchController the create method.
      However, @ result success can not find the corresponding controller, and gives error: namespace: / app / app
      I re-configured as:
      @ Result (name = "success", type = "redirectAction", params = ( "namespace ",""," actionName", "orders"))
      Note: namespace = "" correctly when it is requested.

      But such problems, and my orders, or the index method actionMessages not actionErrors for access, and I do not know why, I need help. Thanks

      Attachments

        Activity

          People

            Unassigned Unassigned
            mysoko lyh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: