hello, In my application I am haviing followings.. 1>user creates request by filling up various forms (on JSP) 2>after user finishes all this final JSP having all the details is displayed. 3>the HTML generated from these JSP(including all the details of request) needs to be sent to authorised person via mail.
one suggestion i got is to generate the HTML code in java file and set it as the body of mail.
but i think it will be too complex to implement b'coz the JSP that generates this html is of 500+ lines!!!
I want to know is there n e way by which we can store the HTML generated from the JSP on serverside also in some directory? by doing this what i will need to do is just to pass the HTML file in the mail body. Please reply soon... Its really urgent! Thanks in advance!
okay... Thank you very much i am trying to search how to use this include() method to store the jsp into html format in some directory! I would be very thank full if you can suggest in what directions i should search.
After some reflexion, I'm not sure that what I've spitted here would work. The include() will output the content of the JSP in the response's output buffer, so I'm not sure you can do something with it.
Why does it have to be in HTML, and further, why does it have to be the same HTML as what the user sees? That doesn't make sense from a usability point of view. Why wouldn't a tabular text view -which can be generated easily on the server- suffice?
As to your question, it is possible to get the generated HTML using a post processing filter but it would probably be more hassle that it's worth. Web pages in a browser are put together differently than HTML in an email.
With email, everything needed to render the page is sent in one bundle (multipart request).
This means that, not only would you have to capture the generated HTML, but that you would have to parse it to figure out what additional resources are needed, and then build a multipart document that contains all of these resources.
If this were my issue, I would look into either getting the specs changed to allow (as Ulf suggested) sending a plain text email message or, building a simplified HTML message that can be easily built up from a plain old Java class. [ April 18, 2007: Message edited by: Ben Souther ]