This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Same Request Calling again Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Same Request Calling again" Watch "Same Request Calling again" New topic
Author

Same Request Calling again

Arunkumar Chinnadurai
Ranch Hand

Joined: Dec 15, 2011
Posts: 56


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

Joined: Aug 22, 2010
Posts: 3606
    
  60

This question has nothing to do with JDBC. Moving to the JSP forum, where you'll get better responses.
tarun mall
Greenhorn

Joined: Nov 23, 2011
Posts: 13
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

Joined: Dec 15, 2011
Posts: 56

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

Joined: Jan 10, 2002
Posts: 60800
    
  65

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!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ravi Majety
Ranch Hand

Joined: Feb 26, 2009
Posts: 59

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

Joined: Feb 26, 2009
Posts: 59

Do you mean to block the Refresh option in your jsp?
Arunkumar Chinnadurai
Ranch Hand

Joined: Dec 15, 2011
Posts: 56

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

Joined: Feb 26, 2009
Posts: 59

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

Joined: Dec 15, 2011
Posts: 56

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Same Request Calling again
 
Similar Threads
Does Tomcat cache CSS files?
Tomcat not showing the deployed version
frames + refresh
How to prevent F5/ refresh web brower problem
Problem i am facing here................