Hi folks, no real need for custom tags or 2.3 filters here...guess you might want to have a closer look at the getInputStream() rsp. the getReader()/getWriter() methods for reading the body contents, plus getHeaders() for the header part, if necessary...;) Check out the API docs, referring to the ServletRequest and ServletResponse interfaces here (implemented by HTTPServletRequest/HTTPServletResponse, who would have guessed that...)
HTH, -- Chris (SCPJ2) NB. Seen a lot of questions about rather basic|necessary stuff here lately, so on this occasion I take the freedom to recommend reading my (still) favorite book on Java web technology here: if possible, check out Hans Bergsten's 'Java Server Pages', available from O'Reilly. Bergsten is not just covering JSP, but servlet technology and web applications in general, including J2EE, and you will be astonished how many details he presents just along the way, in such a short book. It's fun to read and fun to work with, and never boring, as far as I can say for myself, at least. If you too value an understanding of things higher than 'knowing' a lot of details you can always look up anyway, that is ;) ----- Original Message ----- From: "Richard Yee" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 26, 2002 4:50 PM Subject: Re: Getting the output of a JSP Iv�n, As I stated in a previous email, you can do this by writing your own custom tag or if your application server supports the 2.3 servlet spec., a filter. What application server are you using? Regards, Richard At 08:38 AM 6/26/2002 -0600, you wrote: >yes, this is it. I need to store the whole jsp in a string, 'cause the >content of a mail has to be a string, so, when i send it, the client mail >understand the content as an html with images, etc. But before i send that >content, i need to set all the parameters that the JSP has, so the client >receive a customized web page in his mail. > >I'm sorry that my english is not very well. This technical concepts kill me, >i'm form Costa Rica, so i speak spanish, and thank you all for you replies > > >>From: Greg Dunn <[EMAIL PROTECTED]> >>Reply-To: [EMAIL PROTECTED] >>To: [EMAIL PROTECTED] >>Subject: Re: Getting the output of a JSP >>Date: Tue, 25 Jun 2002 14:01:10 -0500 >> >>I think he wants to store the entire text of the JSP in a string variable >>as >>it was sent from the server to the client for display. Maybe to store as a >>text file or something. (Not that I know how to do that.) Maybe an >>explanation of why you want this would help enlighten the experts. >> >> >>Greg >> >> >> >>-----Original Message----- >>From: A mailing list for discussion about Sun Microsystem's Java Servlet >>API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of >>Galbreath, Mark >>Sent: Tuesday, June 25, 2002 12:25 PM >>To: [EMAIL PROTECTED] >>Subject: Re: Getting the output of a JSP >> >> >>There must be a translation issue here (or I am being obtuse), because I'm >>still not getting it. You are saying that (1) the JSP is already being >>displayed in a browser, but (2) you need in in a String. Do you mean that >>the JSP that is NOW being displayed you do not need/want to be displayed >>and >>INSTEAD want the JSP to be captured in a String so that String someMethod() >>will return this String? I don't understand your "String XXX = >>someProcess(Example.jsp?name=i)" example. If you have example.jsp and a >>Name variable already, why do you want to pass it to someProcess()? Do you >>want XXX to represent an entire JSP with dynamic fields? Is the end result >>something like: >> >>StringBuffer sb = new StringBuffer("<%@"); >> sb.append( page >>contentType=\"text/html;charset=WINDOWS-1252\"") >> sb.append( "sErrorPage=\"false\""); >> sb.append( "errorPage=\"/error.jsp\""); >> sb.append( "session=\"true\""); >> sb.append( "taglib uri=\"struts-logic.tld\" >>prefix=\"logic\""); >> sb.append( "taglib uri=\"struts-bean.tld\" prefix=\"bean\""); >> sb.append( "taglib uri=\"struts-html.tld\" prefix=\"html\""); >> sb.append( "taglib uri=\"partner.tld\" prefix=\"partner\" >>%>"); >> sb.append( "<html>"); >> sb.append( "<head></head>"); >> sb.append( "<body>"); >> sb.append( "Hello, <%= request.getAttribute( \"name\") %>"); >> sb.append( "</body>"); >> sb.append( "</html>"); >>String XXX = sb.toString(); >> >>? >> >>Mark >> >>-----Original Message----- >>From: Iv�n Escobedo [mailto:[EMAIL PROTECTED]] >>Sent: Tuesday, June 25, 2002 12:11 PM >> >>The output is a jsp already displayed on a browser, but i need it not in a >>browser but contained in a String variable. >> >> >> >From: "Galbreath, Mark" <[EMAIL PROTECTED]> >> >Date: Mon, 24 Jun 2002 20:33:56 -0400 >> > >> >What output? Your question doesn't make any sense. You already have the >> >name being displayed as you say you want it. If you just want to keep >>the >> >format for use somewhere else, put Name in session scope: >> > >> >String XXX = "<html><body>" + session.getAttribute( "Name") + >> >"</body></html>"; >> > >> >Mark >> > >> >-----Original Message----- >> >From: Iv�n Escobedo [mailto:[EMAIL PROTECTED]] >> >Sent: Monday, June 24, 2002 7:17 PM >> > >> >How can i set a String variable with the output of a JSP already loaded >>or >> >processed. >> > >> >Here's the jsp page: >> > >> >Example.JSP >> > >> ><html> >> ><body> >> >Hello <%= request.getAttribute("Name") %> >> ></body> >> ></html> >> > >> >So, i need this process to load and retrieve the JSP output: >> > >> >String XXX = SomeProcess(Example.jsp?Name=ij) >> > >> >So, finally XXX will contains: >> > >> >XXX = "<html><body>Hello ij</body></html>" >> >>__________________________________________________________________________ _ >>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >>of the message "signoff SERVLET-INTEREST". >> >>Archives: http://archives.java.sun.com/archives/servlet-interest.html >>Resources: http://java.sun.com/products/servlet/external-resources.html >>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html >> >>__________________________________________________________________________ _ >>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >>of the message "signoff SERVLET-INTEREST". >> >>Archives: http://archives.java.sun.com/archives/servlet-interest.html >>Resources: http://java.sun.com/products/servlet/external-resources.html >>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > > > >_________________________________________________________________ >Env�e y reciba su correo de Hotmail desde el m�vil: http://mobile.msn.com > >___________________________________________________________________________ >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff SERVLET-INTEREST". > >Archives: http://archives.java.sun.com/archives/servlet-interest.html >Resources: http://java.sun.com/products/servlet/external-resources.html >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
