Iv�n, Are you running this as a separate application or from a JSP different from the original request? It was my understanding that the requirement was to return a response to the user and also generate an email to be sent to the user containing the same response. If that is the case, I think you will have a problem with the url.openConnection() approach if you are doing it from a separate application if authentication is being used. I don't think the HttpServletResponse.getWriter() method is going to be much use to you either if you want to use it to get the output of the current JSP. There are custom tags available on jsptags.com that will send an email for you.
Regards, Richard At 11:25 AM 6/26/2002 -0600, you wrote: >OK, i finally found it, look at the Example: > >String URLString = "http://XXX.com/someJSP?AAA=" + aaa; > >URL url = new URL(URLString); >URLConnection conn = url.openConnection(); >DataInputStream in = new DataInputStream(conn.getInputStream()); > >while ((linea = in.readLine()) != null) > Message+=linea + "\n"; > >So, Message has all the content > >Now, about the images (relative paths), well, here's a web page where it >explain it, but it's a little bit complicated, maybe there's a simple way to >do it, if somebody know, welcome he is. > >http://www.jguru.com/faq/view.jsp?EID=741046 > > >>From: Iv�n Escobedo <[EMAIL PROTECTED]> >>Reply-To: "A mailing list for discussion about Sun Microsystem's Java >> Servlet API Technology." <[EMAIL PROTECTED]> >>To: [EMAIL PROTECTED] >>Subject: Re: Getting the output of a JSP >>Date: Wed, 26 Jun 2002 10:32:08 -0600 >> >>ok, now, how to convert this Object to a string? i already test it, and it >>shows an error, i tried to do this: Strin str = (String)obj; >> >> >>>From: Rodrigo Ruiz Aguayo <[EMAIL PROTECTED]> >>>Reply-To: "A mailing list for discussion about Sun Microsystem's Java >>> Servlet API Technology." <[EMAIL PROTECTED]> >>>To: [EMAIL PROTECTED] >>>Subject: Re: Getting the output of a JSP >>>Date: Wed, 26 Jun 2002 08:48:15 -0600 >>> >>> > >>> >URL url = new URL(<server URL containing JSP>); >>> >URLConnection con = url.openConnection(); >>> >Object obj = con.getContent(); >>> > >>> >Is this it? Otherwise sorry to add to the confusion :-) >>> > >>> >das >>> > >>> >>>I think this is exactly what Ivan was asking for. >>>Recently I had to implement a newsletter and that was the technique I used >>>for retrieving my JSP code from my app. >>> >>>I have one question related to this one: >>> >>>How can images be embedded into the mail? >>>Now, I just use absolute URLs for every image in the JSP (Iv�n, take care >>>of this, because relative URLs will not work in the mail client). >>>I know images can be embedded into the e-mail as attachs, and referenced >>>from the page, but I don't know how to do this with Java Mail API. >>> >>>I've been looking for examples on internet, but I haven't found anything >>>yet. >>> >>>Anybody has experience in this issue? >>> >>>Thanks in advance >>> >>>___________________________________________________________________________ >>>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 >> >> >> >> >>_________________________________________________________________ >>Hable con sus amigos en l�nea, pruebe MSN Messenger: >>http://messenger.msn.es >> >>___________________________________________________________________________ >>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 > > > > >_________________________________________________________________ >Hable con sus amigos en l�nea, pruebe MSN Messenger: http://messenger.msn.es > >___________________________________________________________________________ >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
