Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Repeated page directives

 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • 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
 
ersin eser
Ranch Hand
Posts: 1072
  • Mark post as helpful
  • send pies
  • 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
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic