• 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
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

isErrorPage and errorPage attributes

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
I was trying out a simple example of isErrorPage and errorPage ...follwing is the code

TestJSP1.jsp



ErrorHandler.jsp



When i execute TestJSP1.jsp for the first time ,it seems as if the exception is not thrown and Hello World is printed...then when i refresh the same page, exception is thrown and 'Sorry there was an error.Please try again!!!' is printed...Why didn't TestJSP1.jsp throw an exception when executed for the first time itself?

cheers,
Poonam.
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure. try putting your code in the <head> ? - also you dont need to put it in a loop. or an if statement. just throw the exception.
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Poonam,

This looks to me an issue related to your browser. Perhaps because of the way the browser caches the pages. If you are using Internet Explorer, I will suggest you try following settings: Tools-> Internet Options - > Temporary Internet Files-Settings ->
Here, for 'Check for newer versions of pages' choose 'Every visit to the page'. The default option is 'Automatically'.
Now it should work the way it is supposed to be.
Note: Browser settings may change depending on the browser & the version.
 
Nilesh Miskin
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mark Wa wrote:Not sure. try putting your code in the <head> ? - also you dont need to put it in a loop. or an if statement. just throw the exception.



I think she purposefully put the code in if statement. If she didn't so & had tried to throw exception straightaway, the code would not compile because the 'Hello World' statement would become unreachable.
 
reply
    Bookmark Topic Watch Topic
  • New Topic