Methods Summary |
---|
public int | doEndTag()
try {
reader.close();
} catch (IOException ex) {}
reader = null;
return EVAL_PAGE;
|
public int | doStartTag()
reader = getReaderFromResource(resource);
exposeVariable(reader);
return EVAL_BODY_INCLUDE;
|
private void | exposeVariable(java.io.Reader reader)
if (id != null) {
pageContext.setAttribute(id, reader);
}
|
private java.io.Reader | getReaderFromResource(java.lang.String name)
HttpServletRequest request =
(HttpServletRequest)pageContext.getRequest();
HttpServletResponse response =
(HttpServletResponse)pageContext.getResponse();
RequestDispatcher rd = null;
// The response of the local URL becomes the reader that
// we export. Need temporary storage.
IOBean ioBean = new IOBean();
Writer writer = ioBean.getWriter();
ServletResponseWrapper responseWrapper =
new ServletResponseWrapperForWriter(
response, new PrintWriter(writer));
rd = pageContext.getServletContext().getRequestDispatcher(name);
try {
rd.include(request, responseWrapper);
return ioBean.getReader();
} catch (Exception ex) {
throw new JspException(ex);
}
|
private void | init()
id = null;
resource = null;
|
public void | release()Releases any resources we may have (or inherit)
super.release();
init();
|
public void | setId(java.lang.String id)Tag's 'id' attribute
this.id = id;
|
public void | setResource(java.lang.String resource)Tag's 'resource' attribute
this.resource = resource;
|