File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes get HTML code ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "get HTML code ???" Watch "get HTML code ???" New topic

get HTML code ???

marko stone

Joined: Oct 16, 2002
Posts: 23
how i can get in servlet html code, which was generated in another servlet ?
Christopher Dixon

Joined: Jan 30, 2002
Posts: 22
If you just want to include it in a page the servlet is generating, look at Request.getRequestDispatcher(String).include()
To capture the code, either wrap the Request in a proxy that writes to your own Writer or OutputStream, or look at servlet filtering.
If you're trying to screen scrape, there are lots of packages out there to do it (check out Struts), or you can open a and do it the hard way.
Google is the Oracle. Ask and ye shall receive.
[ October 28, 2002: Message edited by: Christopher Dixon ]
I agree. Here's the link:
subject: get HTML code ???
It's not a secret anymore!