开发者

Jersey with JSPs, without tags

I am using Jersey to do the URL binding for my web application. Hence, I am using it as a very simple MVC. I can manage to have Jersey return my JSPs, however:

When I pass my model to the view, it is passed as "it" -开发者_运维问答- and I can access it on my JSP using tags, ala: ${it}, however, I want to use it as a JSP variable, via <%= it %>

Is there a way to do that?


I totally fail to see why you would ever do that, but anyway, the scriptlet equivalent of the EL expression

${it}

would be

<%=pageContext.findAttribute("it")%>

Update: as per the comments:

because I am experimenting with a new framework -- i want to pass in many html blobs and i want to access them via it.get("main"), it.get("footer"), etc

Just make it a Map<String, Something> or a Javabean class, then you'll be able to get them by

${it.main}, ${it.footer}, etc

where main, footer, etc are Map keys or Javabean properties. It'll return the value.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜