RE: [JBoss-user] How to execute a JSP in a EJB
Hi Pedro, I had a similar problem to the one you are facing. I wanted to generate a JSP page statically, and as a previous poster mentioned, you cannot do this without connecting to the webserver via HTTP. As an alternative to using XSL/XML, you could also use Velocity, http://jakarta.apache.org/velocity/ which allows for static page generation and variable substitution, etc. Also I was left with a nice user friendly template that could still be edited in a HTML editor. Cheers, Dave -Original Message-From: Pedro E. Gómez [mailto:[EMAIL PROTECTED]]Sent: Saturday, 12 May 2001 8:46 AMTo: [EMAIL PROTECTED]Subject: Re: [JBoss-user] How to execute a JSP in a EJB Sorry for the confution. The idea is other, is something like this: The data base have some products information, and i want to send this information to an user, the goal is to format the data using an JSP template, and produce a HTML page and send it by email Something like this: EJB COMPONENT ---> Get data form the DB. | |> Get the JSP template (Page) | |-> Execute the template with the data | |-> Send the result by email. I want to send a beatifull EMAIL to the user There is not a servlet involved, becouse of is a proccess that is 100% executed in the EJB container. The mails has to be send in batch proccess. I will have a proccess that every night sends the emails to the users. I will appreciate a lot your help. Thansk. Message sent with MISIVA.Visit us at http://www.pragma.com.co/misiva ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] How to execute a JSP in a EJB
I would recommend using XML/XSL for this. the XML/XSL transformation can be invoked from anywhere and provides a more flexible solution than a JSP. EJB COMPONENT ---> Get data form the DB. ---> Generate it into an XML document | |> Get the XSL template (Page) | |-> Execute the transformation with the data and the stylesheet | |-> Send the result by email. and voila, you are good to go Filip ~ Namaste - I bow to the divine in you ~ Filip Hanik Software Architect [EMAIL PROTECTED] www.filip.net > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Per Lewau > Sent: Friday, May 11, 2001 4:22 PM > To: [EMAIL PROTECTED] > Subject: Re: [JBoss-user] How to execute a JSP in a EJB > > > > On Fri, 11 May 2001, Pedro E. Gómez wrote: > > > > > Sorry for the confution. > > > > The idea is other, is something like this: > > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] How to execute a JSP in a EJB
On Fri, 11 May 2001, Pedro E. Gómez wrote: > > Sorry for the confution. > > The idea is other, is something like this: > > The data base have some products information, and i want to send this information to >an user, the > goal is to format the data using an JSP template, and produce a HTML page and send >it by email > > Something like this: > > EJB COMPONENT ---> Get data form the DB. > | > |> Get the JSP template (Page) > | > |-> Execute the template with the data > | > |-> Send the result by email. *new list member decloaking* Hello everyone, Sorry, no can do. The JSP page is not interpreted but instead compiled into a servlet that must be accessed via HTTP (the web server). What you'd have to do in that case would be to make an HTTP connection to the web server which would run the JSP page and produce HTML output. Unfortunately an EJB is not allowed to open a socket (perhaps you can grant that permission somehow) so you'd have to do it from outside. You could write a client that runs outside the EJB container and downloads the JSP and passes the result an EJB. Either by connecting to a session bean or using JMS and a message driven bean. But then it would be just as easy to use JavaMail from the client directly. > > I want to send a beatifull EMAIL to the user > > There is not a servlet involved, becouse of is a proccess that is 100% executed in >the EJB container. The JSP is compiled into a servlet. > The mails has to be send in batch proccess. > > I will have a proccess that every night sends the emails to the users. > > I will appreciate a lot your help. Hope it helps. --- Per Lewau ([EMAIL PROTECTED]) "Why waste time learning, when ignorance is instantaneous?" - Hobbes ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] How to execute a JSP in a EJB
Sorry for the confution. The idea is other, is something like this: The data base have some products information, and i want to send this information to an user, the goal is to format the data using an JSP template, and produce a HTML page and send it by email Something like this: EJB COMPONENT ---> Get data form the DB. | |> Get the JSP template (Page) | |-> Execute the template with the data | |-> Send the result by email. I want to send a beatifull EMAIL to the user There is not a servlet involved, becouse of is a proccess that is 100% executed in the EJB container. The mails has to be send in batch proccess. I will have a proccess that every night sends the emails to the users. I will appreciate a lot your help. Thansk.Message sent with MISIVA.Visit us at http://www.pragma.com.co/misiva ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] How to execute a JSP in a EJB
1. JSP has HTML Form 2. Form is 'POSTED' to a servlet 3. Servlet extracts the form data - i.e. mail contents + other params 4. A session bean in accessed that fronts an entity bean as well. 5. The data from teh database is got from the entity bean 6. The session bean compiles the mai and uses a mail handler -either another bean or a simple java class to send the mail. Hopefully everyone is happy after reading the mail. Vinay - Original Message - From: "Pedro E. Gómez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 11, 2001 7:46 PM Subject: [JBoss-user] How to execute a JSP in a EJB > Hello! > > I am developing an application which has to send an email to some users. > > The email is in HTML format, but what I have to do is to create the mail using some information from > a Data Base and a HTML template. > > The administrator can change the template every day. > > What I want to do is to have a JSP page, and then, execute that page and send it to the users > > Can I execute a JSP and put the code in a String for sending it to the users? > > Thanks. > > __ > Message sent with Misiva > Visit us at http://www.pragma.com.co/misiva > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] How to execute a JSP in a EJB
Sure, look at the Java mail class. - Original Message - From: "Pedro E. Gómez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 11, 2001 2:46 PM Subject: [JBoss-user] How to execute a JSP in a EJB > Hello! > > I am developing an application which has to send an email to some users. > > The email is in HTML format, but what I have to do is to create the mail using some information from > a Data Base and a HTML template. > > The administrator can change the template every day. > > What I want to do is to have a JSP page, and then, execute that page and send it to the users > > Can I execute a JSP and put the code in a String for sending it to the users? > > Thanks. > > __ > Message sent with Misiva > Visit us at http://www.pragma.com.co/misiva > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user > ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
Re: [JBoss-user] How to execute a JSP in a EJB
Assuming I understand the problem, I would have a JSP page where the user sends input to an EJB. The EJB would package up the email message from the JSP page input and the information in the database and send the emails using JavaMail. Let me know if I am missing the point Ivan - Original Message - From: "Pedro E. Gómez" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, May 11, 2001 11:46 AM Subject: [JBoss-user] How to execute a JSP in a EJB > Hello! > > I am developing an application which has to send an email to some users. > > The email is in HTML format, but what I have to do is to create the mail using some information from > a Data Base and a HTML template. > > The administrator can change the template every day. > > What I want to do is to have a JSP page, and then, execute that page and send it to the users > > Can I execute a JSP and put the code in a String for sending it to the users? > > Thanks. > > __ > Message sent with Misiva > Visit us at http://www.pragma.com.co/misiva > > ___ > JBoss-user mailing list > [EMAIL PROTECTED] > http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] How to execute a JSP in a EJB
Hello! I am developing an application which has to send an email to some users. The email is in HTML format, but what I have to do is to create the mail using some information from a Data Base and a HTML template. The administrator can change the template every day. What I want to do is to have a JSP page, and then, execute that page and send it to the users Can I execute a JSP and put the code in a String for sending it to the users? Thanks. __ Message sent with Misiva Visit us at http://www.pragma.com.co/misiva ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user