Bug 529208 - JSP Editor doesn't report 'Unhandled exception type Xxx' as a problem in JSP declaration
Summary: JSP Editor doesn't report 'Unhandled exception type Xxx' as a problem in JSP ...
Status: REOPENED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: jst.jsp (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: jst.jsp CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-12-26 05:34 EST by Fuwei Chin CLA
Modified: 2018-06-13 14:29 EDT (History)
1 user (show)

See Also:


Attachments
jsp-editor-doesn't-report-unhandled-exception (44.72 KB, image/png)
2017-12-26 05:34 EST, Fuwei Chin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.