Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Display error page using web.xml <error-page>

843844Apr 26 2007 — edited Apr 27 2007
I need to dispaly error page when IOException in thrown. How to do that with web.xml error-page tag?

start.jsf
public String doButton1Action() throws IOException{
		
		String value = getText1().getValue().toString();
		
		try {
			File f = new File(value);		
			InputStream in = new FileInputStream(f);
                        ...
		} catch (IOException e) {
			throw new IOException();
		}
		
		return "success";
	}
I have this in web.xml:

<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/ioerror.jsp</location>
</error-page>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 25 2007
Added on Apr 26 2007
9 comments
2,255 views