Skip to content

Commit a685f8a

Browse files
committed
1 parent 36bb1b8 commit a685f8a

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/main/java/act/app/ActionContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import act.util.ActContext;
3838
import act.util.MissingAuthenticationHandler;
3939
import act.util.PropertySpec;
40+
import act.view.RenderAny;
4041
import org.osgl.$;
4142
import org.osgl.concurrent.ContextLocal;
4243
import org.osgl.http.H;
@@ -420,6 +421,9 @@ public ActionContext forceResponseStatus(H.Status status) {
420421
}
421422

422423
public Result nullValueResult() {
424+
if (hasRenderArgs()) {
425+
return new RenderAny();
426+
}
423427
if (null != forceResponseStatus) {
424428
return new Result(forceResponseStatus){};
425429
} else {

src/main/java/act/util/ActContext.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ public Map<String, Object> renderArgs() {
325325
return C.newMap(renderArgs);
326326
}
327327

328+
protected boolean hasRenderArgs() {
329+
return !renderArgs.isEmpty();
330+
}
331+
328332
/**
329333
* Associate a user attribute to the context. Could be used by third party
330334
* libraries or user application

testapp/src/main/java/testapp/endpoint/OutputRequestParamsTestBed.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import act.util.OutputRequestParams;
77
import org.osgl.mvc.annotation.GetAction;
88

9-
import static act.controller.Controller.Util.render;
10-
119
@UrlContext("/output-params")
1210
public class OutputRequestParamsTestBed {
1311

@@ -16,13 +14,11 @@ public class OutputRequestParamsTestBed {
1614

1715
@GetAction("specific")
1816
public void testOutputSpecificParam(@Output String param1, int param2, EventBus param3) {
19-
throw render();
2017
}
2118

2219
@GetAction("all")
2320
@OutputRequestParams
2421
public void testOutputAllParams(String param1, int param2, EventBus param3) {
25-
throw render();
2622
}
2723

2824
}

0 commit comments

Comments
 (0)