• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending to email using JSP

 
tangara goh
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 4496
267
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic