|
With this code you can call a JSP page and capture the output. You can use it for example use a JSP page to format an email message or a file. No need to edit code if you want to change the content, just the JSP page. Code: JSP 1.2 |
| |
Overall Rating:
 User Rated
| |
Works!  Written by Anonymous User (#1702-321) (Monday, April 12, 2010)
 |
Strengths: easy, short Weaknesses: needs hint regarding request object Details: I'm using similar code now. I just wanted to warn that it's important to have a working request object. I tried a wrapper that I have written as request object and it didn't work. After I used the original ServletRequest it worked flawless! Review Based On: 1 Hour(s) of usage |
Does not work on Weblogic 10.3  Written by Anonymous User (#1565-196) from Seattle, WA (Monday, November 02, 2009)
 |
Strengths: Works on Tomcat Weaknesses: Does'nt work on Weblogic 10.3 Details: I tried the same code snippet in Tomcat 6.x and it works.
However, in Weblogic 10.3 I get an empty string when printing the output. The following line in my code:
String email = new String(wrapper.getOutput());
System.out.println("email output in error:" + email);
prints nothing for weblogic and the actual html for Tomcat. Any idea what could be wrong? Review Based On: using demo only |
Thank you!!!  Written by Anonymous User (#1350-62) from Germany (Saturday, November 29, 2008)
 |
Strengths: perfect Weaknesses: none Details: Thanks for the snippet. I was searching for this solution for days on the web but no effective and simple idea could be found. All found architectures only played around with servlet filters and other overstated stuff but this is exactly what I was looking for. Simple, effectiv and not exorbitant. Thanks. Review Based On: using demo only |
Capture JSP & Servlet output  Written by Anonymous User (#1519-219) from San Francisco (Wednesday, July 02, 2008)
 |
Strengths: Perfect Weaknesses: None Details: I was looking for something like this in the past. But the best I could come up with was opening a HTTP connection from the server to itself. This solution is much more lightweight. We use it for generating cacheable HTML snippets and will also replace our existing email generator with this. Thanks a lot. Review Based On: 1 Day(s) of usage |
BufferedHttpResponseWrapper  Written by Anonymous User (#1866-268) from England (Friday, May 23, 2008)
 |
Strengths: Easy and effective Weaknesses: no comment Details: Thanks Joost den Boer for this snippet - just the thing I was looking for! Simple to import the new class into the jsp and you are able to grab data incoming from the RequestDispatcher. Useful in retrieving data from a servlet via the PrintWriter. I found that I didn't need to use the "response.encodeRedirectURL" but just used the servlet path in the getRequestDispatcher("/servletPath") Review Based On: 1 Hour(s) of usage |
Does exactly what it says on the tin  Written by Anonymous User (#1557-155) from London, UK (Tuesday, January 08, 2008)
 |
Strengths: Worked first time with no tweaking Weaknesses: no comment Details: This was very straightforward to drop into my code and did exactly what was required, capturing the output of a JSP as a string. I have used it in exactly the way described by the author, to send a JSP as an HTML email.
This has made a complicated task into a very simple one. Thank you very much. Review Based On: 1 Hour(s) of usage |
| |
|