• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Same Request Calling again

 
Ranch Hand
Posts: 56
Android MyEclipse IDE Windows XP
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question has nothing to do with JDBC. Moving to the JSP forum, where you'll get better responses.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
--------------------------

 
Sheriff
Posts: 67583
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 59
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic