Bug 529208

Summary: JSP Editor doesn't report 'Unhandled exception type Xxx' as a problem in JSP declaration
Product: [WebTools] WTP Source Editing Reporter: Fuwei Chin <fuweichin>
Component: jst.jspAssignee: jst.jsp <jst.jsp-inbox>
Status: REOPENED --- QA Contact: Nitin Dahyabhai <thatnitind>
Severity: minor    
Priority: P3 CC: jcollier
Version: unspecifiedKeywords: needinfo
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Attachments:
Description Flags
jsp-editor-doesn't-report-unhandled-exception none

Description Fuwei Chin CLA 2017-12-26 05:34:07 EST
Created attachment 272035 [details]
jsp-editor-doesn't-report-unhandled-exception

Steps to Reduce:
1. Put a scriptlet in a jsp. e.g.
<%!
16:    public void storeConfig(Properties cfg){
17:      FileUtils.writeStringToFile(getConfigFile(), JSON.toJSONString(cfg), StandardCharsets.UTF_8);
18:    }
%>
2. Access the jsp via browser

Actual Result:
An error occurred at line: 17 in the jsp file: /test.jsp
Unhandled exception type IOException

Expected Result:
No such compilation error, JSP Editor should warn me earlier, just like Java Editor, tells me there is a non-RuntimeException not handled.
Comment 1 John Collier CLA 2018-03-07 12:04:11 EST
The JSP editor and validator code appears to be in Source Editing, so moving there.
Comment 2 Nitin Dahyabhai CLA 2018-03-07 16:28:28 EST
The contents of the JSP file compile down into a Servlet service method that explicitly declares it can throw a ServletException or IOException, as defined in section 9 of the JSP specification. No compile-time error message should appear for this.
Comment 3 Nitin Dahyabhai CLA 2018-03-07 16:39:54 EST
Which version is this? Do you have a Minimal Working Example that shows the problem? Without fully qualified class names, it's not something I can try to reproduce.