1

I have a requirement to display an error page in my JSF application when certain HTTP errors or Java exceptions are encountered and provide the user with a form on the error page which they can use to report the error as a possible bug. At the same time I need ensure that the error page is only displayed in response to a real application error and not as a result of the user accessing the error page directly by typing in the URL and potentially submitting spurious bug reports.

I have tried locating the error pages in WEB-INF which prevents the user from accessing the page directly, however the HTTP post method on the form fails when the user tries to submit the bug report.

A quick search on StackOverflow shows that there are several similar questions, however none of them relate to the use case I am trying to meet. The closest question I have found is How to detect whether user have reached a page by JSF navigation rule redirect or by typing the URL? which suggests checking the referer request header but says that overzealous proxy/firewall/security software can hide the referer header so I don't believe this is the correct solution for this requirement.

In summary my question is.... What is the best way to ensure that an error page which contains a form is only displayed when a real application error has occurred and not due to the user typing in the URL?

Note: This question is following on from another question (Is it possible to submit a form that has been rendered from a JSF page location in WEB-INF?) I asked on StackOverflow but I didn't get any answers, so I'm hoping that by not constraining the question as I did previously I might get some responses.

Community
  • 1
  • 1
Paul H
  • 2,104
  • 7
  • 39
  • 53

0 Answers0