• Post Reply Bookmark Topic Watch Topic
  • New Topic

Get HTML Fragment From JSP Page  RSS feed

 
Doug Ly
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there anyway I can get the rendered html fragment out of a jsp template.
Say, I have a jsp file call test.jsp. In one of my java class (which has access to the all the servlet API can offer) I want to get the rendered from that jsp file. I was looking at the RequestDispatcher.include() but I don't think it gives me what I want.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use java.net.URLConnection to "hit" the page and get the rendered response back. (The HttpClient project is also useful for things like this.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!