Hi, I want to create a JSF page having an IFRAME on it. I want IFRAME
to be loaded from an action.
I created the following:
In the action I have:
public String viewContent() {
HttpServletResponse response =
(HttpServletResponse)facesContext.getExternalContext().getResponse();
response.setContentType("text/plain");
ServletOutputStream out;
try {
out = response.getOutputStream();
out.write(("This is a test" +
learnitem.getLearnitemTitle()).getBytes());
out.flush();
} catch (Exception e) {
log.debug("Exception during writing content to iframe", e);
}
facesContext.responseComplete();
return null;
}
in the XHTML page I have:
<h:commandLink value="download" action="#{learn.viewContent}"
target="xxxx" />
<iframe name="xxxx">
</iframe>
When I press download button the content gets loaded into the iframe
(as expected).
QUESTION: How to get rid of download button? I want to automatically
get the content when master page is loaded.
In a NON JSF application I would do <iframe src="aServlet"></iframe>
but here how do I found what to srite for src to obtain a call to
learn.viewContent() ?
Thanx
Marius
begin:vcard
fn:Oancea Marius
n:Marius;Oancea
org:Hermann Oberth Faculty of Engineering, Lucian Blaga University of Sibiu;Department of Computer Science
adr:;;4 Emil Cioran Str.;Sibiu;Sibiu;550025;Roumania
email;internet:[EMAIL PROTECTED]
title:Asist. Ing.
tel;home:+40 369 401740
tel;cell:+40 742 207963
url:http://www.csac.ulbsibiu.ro
version:2.1
end:vcard