[
https://issues.apache.org/jira/browse/WW-3379?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Lukasz Lenart closed WW-3379.
-----------------------------
Resolution: Not A Problem
> Using apache urlrewrite to @ result redirectAction invalid after
> addActionMessage and addActionError
> ----------------------------------------------------------------------------------------------------
>
> Key: WW-3379
> URL: https://issues.apache.org/jira/browse/WW-3379
> Project: Struts 2
> Issue Type: Bug
> Components: Core Actions
> Affects Versions: 2.1.8
> Environment: Core Interceptors
> Reporter: lyh
> Priority: Major
> Fix For: 6.1.0
>
>
> 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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)