The JSF 2.2 web based application I am developing makes use of various error pages which are located in the WEB-INF directory and are displayed when an HTTP error or Java exception is encountered based on the configuration in the web.xml file.
On some error pages I would like to include a form which allows the user to report the issue and include various attributes that would be helpful when investigating the issue such as the request URI and the error message.
The issue I've got is when the user attempts to submit the form it fails with a page not found error as the HTTP post request method is using the URI of the page in the WEB-INF directory rather than the original page that failed and consequently sent the user to the error page.
I know that files in WEB-INF are not publicly accessible and understand that this is the root cause of the problem described above.
The rational for locating the error pages in the WEB-INF directory is to prevent users from accessing these pages directly and reporting an erroneous issue via the form I'm trying to implement.
My question is to ask whether there are any other ways of allowing the end user to submit a form (in this case a bug report) which has been rendered from a page in the WEB-INF directory, or is the only solution to move the error pages to somewhere outside the WEB-INF directory? If this isn't possible are there any other options to achieve a similar result?
来源:https://stackoverflow.com/questions/26681640/is-it-possible-to-submit-a-form-that-has-been-rendered-from-a-jsf-page-location