how t ocapture the jsp output page

hi,my situation is to mail the ouput jsp page(last of my app) .i know how to send the mail.so the problem is i need to capture the jsp page so that i can mail it.thanks
[203 byte] By [stalin_111521a] at [2007-11-27 9:12:58]
# 1
Even I would like to know about this. I have a requirement similar to this one. I think somehow we need to make the output jsp as body of the email. Let's wait for experts replies.
skp71a at 2007-7-12 21:59:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

I haven't done this personally, but I believe it can be done by using filters. The following is some pseudocode.

1) Create a Wrapper class with a method to get output stream

class JSPOutputResponseWrapper extends HttpServeletResponseWrapper {

public ServletOutputStream getOutputStream() throws ... {

}

}

2) Create the filter class. In the class use the JSPOutputResponseWrapper class

public class JSPFilter implements Filter {

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

JSPOutputResponseWrapper wrappedResponse = new JSPOutputResponseWrapper(response)

chain.doFilter(request, wrappedResponse);

// get JSP output and email from here using wrappedResponse

}

}

3) web.xml

<filter>

<filter-name>JSPFilter</filter-name>

<filter-class>com.mycompany.myapp.filter.JSPFilter</filter-class>

</filter>

<filter-mapping>

<filter-name>JSPFilter</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping>

Let me know what do you think.

PatrickWanga at 2007-7-12 21:59:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
thats it man i got it thank u
stalin_111521a at 2007-7-12 21:59:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...