You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "lyh (JIRA)" <ji...@apache.org> on 2010/01/29 06:48:28 UTC
[jira] Created: (WW-3379) Using apache urlrewrite to @ result
redirectAction invalid after addActionMessage and addActionError
Using apache urlrewrite to @ result redirectAction invalid after addActionMessage and addActionError
----------------------------------------------------------------------------------------------------
Key: WW-3379
URL: https://issues.apache.org/struts/browse/WW-3379
Project: Struts 2
Issue Type: Bug
Components: Core Actions
Affects Versions: 2.1.8
Environment: Core Interceptors
Reporter: lyh
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 is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.