aspose file tools*
The moose likes JSP and the fly likes sending to email using JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "sending to email using JSP" Watch "sending to email using JSP" New topic
Author

sending to email using JSP

tangara goh
Ranch Hand

Joined: Dec 27, 2009
Posts: 125
Dear experts,

I got the following sample code by googling...






My question is what is uri="/blx.tld" ?

I can't figure it out.....and hope somebody who is experienced here can tell me what is this uri about? Can I just follow this code and the message will be sent to my designated email if I change the email address to my email address?
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3277
    
  54

tangara goh wrote:My question is what is uri="/blx.tld" ?

It is the URI for a JSP Tag Library Descriptor. Have a look at this tutorial for more details.

tangara goh wrote:Can I just follow this code and the message will be sent to my designated email if I change the email address to my email address?

No. You should not even try that.
JSP pages are to be used as viewer components - you should never use it for any other purposes, data processing, mail sending, or whatever. Basically, there should not be any java code inside a JSP.
You should choose a servlet for handling the request coming from the client, and use some business components (at least, a separate java class) for the mail sending purpose. After the mail has sent, the Servlet can dispatch the request to a JSP which shows a message stating that the mail has sent.

For the business logic of sending emails, you may use some API/Framework - Javamail is one of such API.

Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending to email using JSP