Skip to content

Commit

Permalink
WW-3714 Ensure correct delegation of new Result API
Browse files Browse the repository at this point in the history
  • Loading branch information
kusalk committed Nov 3, 2024
1 parent b0a4c4f commit 6fbd9e5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private void executeResult() throws Exception {
result = createResult();

if (result != null) {
result.execute(this);
result.execute((org.apache.struts2.ActionInvocation) this);
} else if (resultCode != null && !Action.NONE.equals(resultCode)) {
throw new ConfigurationException("No result defined for action " + getAction().getClass().getName()
+ " and result " + getResultCode(), proxy.getConfig());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public void serviceAction(HttpServletRequest request, HttpServletResponse respon
// if the ActionMapping says to go straight to a result, do it!
if (mapping.getResult() != null) {
Result result = mapping.getResult();
result.execute(proxy.getInvocation());
result.execute((org.apache.struts2.ActionInvocation) proxy.getInvocation());
} else {
proxy.execute();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ protected String handleToken(ActionInvocation invocation) throws Exception {
* Handles processing of invalid tokens. If a previously stored invocation is
* available, the method will attempt to return and render its result. Otherwise
* it will return INVALID_TOKEN_CODE.
*
*
* Note: Because a stored (previously completed) invocation's PageContext will be closed,
* this method must replace the stored PageContext with the current invocation's one (or a null).
* See {@link org.apache.struts2.util.InvocationSessionStore#loadInvocation(String key, String token)} for details.
*
*
* @param invocation
*
*
* @return
* @throws Exception
* @throws Exception
*/
@Override
protected String handleInvalidToken(ActionInvocation invocation) throws Exception {
Expand Down Expand Up @@ -154,7 +154,7 @@ protected String handleInvalidToken(ActionInvocation invocation) throws Exceptio
Result result = savedInvocation.getResult();

if ((result != null) && (savedInvocation.getProxy().getExecuteResult())) {
result.execute(savedInvocation);
result.execute((org.apache.struts2.ActionInvocation) savedInvocation);
}

// turn off execution of this invocations result
Expand All @@ -171,11 +171,11 @@ protected String handleInvalidToken(ActionInvocation invocation) throws Exceptio
* Handles processing of valid tokens. Stores the current invocation for
* later use by {@see #handleValidToken(ActionInvocation)}.
* See {@link org.apache.struts2.util.InvocationSessionStore#storeInvocation(String key, String token, ActionInvocation invocation)} for details.
*
*
* @param invocation
*
*
* @return
* @throws Exception
* @throws Exception
*/
@Override
protected String handleValidToken(ActionInvocation invocation) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private void executeResult() throws Exception {
if (this.result instanceof HttpHeaderResult) {

// execute the result to apply headers and status in every representations
this.result.execute(this);
this.result.execute((org.apache.struts2.ActionInvocation) this);
updateStatusFromResult();
}

Expand All @@ -219,7 +219,7 @@ private void executeResult() throws Exception {
// Normal struts execution (html o other struts result)
findResult();
if (result != null) {
this.result.execute(this);
this.result.execute((org.apache.struts2.ActionInvocation) this);
} else {
if (LOG.isDebugEnabled()) {
LOG.debug("No result returned for action {} at {}", getAction().getClass().getName(), proxy.getConfig().getLocation());
Expand Down

0 comments on commit 6fbd9e5

Please sign in to comment.