Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with refresh button after sending mail  RSS feed

 
lalith kumar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,

I have successfully sent mail using java mail api but my problem is after sending mail if it returns success then i am sending it into success page. If i refresh that success page again and again mail will sent automatically.... How to avoid this if anyone knows please help me..... Its very urgent....


Thanks
Lalith
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is servlet / JSP related, so I'm moving this thread.

As for the answer, perhaps you can use a session. After the mail has been sent you set a flag indicating the mail has been sent. If the flag is set then don't send again.
 
Herman Schelti
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

try redirecting to the succespage, instead of forwarding.

Herman
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!