• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Repeated page directives

 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here goes another one.
I know other than the import page directive, none can be repeated within a page. But what happens if you do, for instance end up having two errorPage declarations either typing in directly or as a (hopefully unintended ) consequence of a page include.
One would think it generates a compilation error. However, when I tried this with my JRun3.1, it happily used the second error page. Surprisingly the second errorPage directive superceded the first one.
Is this normal? I hope not
 
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Main page has page directive with errorPage attribute and you want to include another page:
using jsp:include If you include a jsp-page that has page directive with errorPage attribute in it, that should not give you a problem ( request time ).
using include directive If you include jsp-page that has page directive with errorPage attribute in it, than u should get an error since two page directive with errorPage attribute will end up in a single final page ( compilation time )
This is my first thought, I have to try
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat 4.0.1 on NT.
include Directive: Translation time Error.
Page directive: can't have multiple occurrences of errorPage
include Action:
Scenario: main page had an errorPage. Included(action) another page with an errorPage attribute. Included (action) a third page which is made to throw an ArithmaticException.
Result: errorPage on the main page showed up.
I know that the Exception is being thrown because when I removed the errorPage in the main page I saw the exception on the Browser.
I think in the light of this, its important to know the scope of the "page" directive in the Spec. Seems like Tomcat and JRun behave differently.
- satya
 
reply
    Bookmark Topic Watch Topic
  • New Topic