There are several ways to do this. Doing this in JSP is a bit annoying.
As already mentioned, you can use Servlet and insert / load variables there. For example, by accessing the session context:
MyBean myBean = (MyBean)FacesContext.getCurrentInstance()
.getExternalContext().getSessionMap().get("myBean");
Or you can output it in HTTP Response from a method in your Bean application. For example:
try {
String xml = "<person>damian</person>";
FacesContext ctx = FacesContext.getCurrentInstance();
final HttpServletResponse resp = (HttpServletResponse)ctx.getExternalContext().getResponse();
resp.setContentType("text/xml");
resp.setContentLength(xml.length());
resp.getOutputStream().write(xml.getBytes());
resp.getOutputStream().flush();
resp.getOutputStream().close();
ctx.responseComplete();
} catch (IOException e) {
e.printStackTrace();
}
, Facelets, <f:view>.