On Wed, 26 Jun 2002, Iv�n Escobedo 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
Could this be done with a filter? Intercept the response on the way back, and you should have the entire output. > >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 > Milt Epstein Research Programmer Systems and Technology Services (STS) Campus Information Technologies and Educational Services (CITES) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED] ___________________________________________________________________________ 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
