Skip to content

Commit 025ba5c

Browse files
committed
add accessor for javalin object for decoration
1 parent 75e9003 commit 025ba5c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/main/java/info/unterrainer/commons/httpserver/HttpServer.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ public <P extends BasicJpa, J extends BasicJson, E> GenericHandlerGroupBuilder<P
104104
return new GenericHandlerGroupBuilder<>(this, jpaType, jsonType, coreDaoProvider.getCoreDao());
105105
}
106106

107+
public Javalin getJavalin() {
108+
return javalin;
109+
}
110+
107111
private void create() {
108112

109113
Server server = new Server();
@@ -253,11 +257,11 @@ private void render(final Context ctx) throws IOException {
253257
Object dto = ctx.attribute(Attribute.RESPONSE_OBJECT);
254258
if (dto != null)
255259
switch ((ResponseType) ctx.attribute(Attribute.RESPONSE_TYPE)) {
256-
case JSON:
257-
ctx.result(jsonMapper.toStringFrom(dto));
258-
break;
259-
default:
260-
ctx.result((String) dto);
260+
case JSON:
261+
ctx.result(jsonMapper.toStringFrom(dto));
262+
break;
263+
default:
264+
ctx.result((String) dto);
261265
}
262266

263267
Integer status = ctx.attribute(Attribute.RESPONSE_STATUS);

0 commit comments

Comments
 (0)