Jersey (Jax-RS) & EL
Posted
by smeg4brains
on Stack Overflow
See other posts from Stack Overflow
or by smeg4brains
Published on 2010-05-18T12:42:10Z
Indexed on
2010/05/19
20:10 UTC
Read the original article
Hit count: 382
Hi there!
im trying to get a controller to return a view through a Expression Language-Filter, but have no idea on how to get jersey to use EL for filtering a view.
View with EL-tags:
<html>
<title>%{msg}</title>
</html>
Controller:
@GET
@Produces("text/html")
public Response viewEventsAsHtml(){
String view=null;
try {
view=getViewAsString("events");
}catch(IOException e){
LOG.error("unable to load view from file",e);
return null;
}
Response.ResponseBuilder builder=Response.ok(view, MediaType.TEXT_HTML);
return builder.build();
}
How would one go about in order to get the controller to replace the ${msg} part in the view by some arbitrary value?
© Stack Overflow or respective owner