Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt error-page attribute of page directive

 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<%@ page errorPage="errorHandler.jsp" %>

This will be in the directory of current jsp

can I use like this

<%@ page errorPage="/errorHandler.jsp" %>

In study kit its given

errorPage- Specifies a relative URL to another JSP page that is
capable of handling errors on behalf of the current
page.
 
VijayKumar Sivagnanam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Renu,

can I use like this

<%@ page errorPage="/errorHandler.jsp" %>


You can very well give relative urls in the errorPage attribute of page directive. In this case, it looks to the context root for the specified file.
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
errorPage- Specifies a relative URL to another JSP page that is
capable of handling errors on behalf of the current
page.


My doubt is then why is it given relative to a jsp page?
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specifies a relative URL to another JSP page that is
capable of handling errors on behalf of the current
page.


A URL that leads you to the error handling JSP
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks I got it now
 
VijayKumar Sivagnanam
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My doubt is then why is it given relative to a jsp page?


You can have multiple error pages scattered in different directories, based on the exception types or the functional modules. You can have the error page for a specific module in the same directory or any subdirectory.

If we want to specify the error pages for the whole application, we can specify it in the DD. So it is logical to have relative url to specify the page specific error pages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic