File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Same Request Calling again

 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,

I have create on jsp application.i have do all business logics in controller. while running my application if i give refresh(F5) the same request calling again...
first time it show any alert msg mean if i give refresh(F5). it will call again the aler. how to rectify this.
 
Martin Vajsar
Sheriff
Pie
Posts: 3747
62
Chrome Netbeans IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question has nothing to do with JDBC. Moving to the JSP forum, where you'll get better responses.
 
tarun mall
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arunkumar Chinnadurai wrote:
Hi all,

I have create on jsp application.i have do all business logics in controller. while running my application if i give refresh(F5) the same request calling again...
first time it show any alert msg mean if i give refresh(F5). it will call again the aler. how to rectify this.


Sharing the code will help us understand your problem better.
 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tarun mall wrote:
Arunkumar Chinnadurai wrote:
Hi all,

I have create on jsp application.i have do all business logics in controller. while running my application if i give refresh(F5) the same request calling again...
first time it show any alert msg mean if i give refresh(F5). it will call again the aler. how to rectify this.


Sharing the code will help us understand your problem better.


this is my jsp file
-------------------




This is my Servlet file
--------------------------

 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this article and pay particular attention to the PRG pattern.

Also, you are putting Java code into a JSP? In 2012? That's a bad practice that's been discredited fro 10 years!
 
Ravi Majety
Ranch Hand
Posts: 59
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling DB Connection in the JSP is a bad practice. Instead you need to write your own exception handling technique where you can define your own words for different exceptions raised in Business Logic.

More over . You have commented the closed brace in the jsp file at line no. 9
 
Ravi Majety
Ranch Hand
Posts: 59
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean to block the Refresh option in your jsp?
 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smarty Ravi wrote:Do you mean to block the Refresh option in your jsp?


YES ...!

I got it via Java Script



Thanks to All...!
 
Ravi Majety
Ranch Hand
Posts: 59
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arun,

The code given by you can only restrict the user to press the "F5" button to Refresh, yet the user can refresh the page in the following ways.

1. Right Click on page > click on Reload page/Refresh
2. Click on Refresh button in the web browser.

so please verify indepth to solve the above issues in a single solution.
 
Arunkumar Chinnadurai
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Smarty Ravi wrote:Hi Arun,

The code given by you can only restrict the user to press the "F5" button to Refresh, yet the user can refresh the page in the following ways.

1. Right Click on page > click on Reload page/Refresh
2. Click on Refresh button in the web browser.

so please verify indepth to solve the above issues in a single solution.


Ok sir
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic