Wednesday, July 16, 2008

JSF: put an object in the request map

You can put everything into the request scope througt the ExternalContext
ExternalContext ctx = FacesContext.getCurrentInstance().getExternalContext();
Map map =ctx.getRequestMap();
map.put("person", new Person("John", "Smith"));

then can you show the data in the jsp page with the EL syntax as usual:
<h:outputText value="#{person.name}" />

No comments: