You are 1 of 2 Active JSP Visitors
  JSP Home  |  Resources  |  Write a Review  |  My Favor-Its  |  Login
Share on Facebook Tweet this! Share on Google+ Share on LinkedIn Add to   Add to StumbleUpon eee

Resource Menu
 Capture JSP outputCode Snippet 
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


User Reviews   
   Authentic (0)  Anonymous (6) 

Overall Rating:
Codango PHP, ASP .NET, JSP Scripts, Resources, Reviews
Click to Read Reviews
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  

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  




  Link to Us  |  About Us   Advertise  |  Contact Us  |  Website Help  
Write a User Review Today!
Its Fun, Fast, and Easy!
Web site monitoring by Web Site Monitor - for Android

2015 InfoVertica, LLC, All Rights Reserved *