This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | I18N - Cannot create new JSP when <jsp-property-group page-encoding=UTF-16 | ||
---|---|---|---|
Product: | javaee | Reporter: | Martin Schovanek <mschovanek> |
Component: | JSP | Assignee: | issues@javaee <issues> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | CC: | jsedek, kfrank |
Priority: | P3 | Keywords: | I18N |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
Martin Schovanek
2008-06-27 16:49:50 UTC
Next: ----- 5) modify index.jsp and save it 6) changeet the encoding in web.xml to UTF-8 7) modify index.jsp and save it ERROR2: 'PWC6330: Page enconding specified in BOM (UTF-16BE) is different from that specified at jsp-property-group. To fix it you have to delete the BOM outside NetBeans. Nasty, but can be workarounded by setting project encoding to UTF-16 as well. The new template instance apparently uses project encoding but then the page is loaded by the one provided by jsp parser. I'll look at it on Monday. Thanks for finding this. When a new freemarker template is instancionalized, project ${encoding} is substituted with the project encoding. So if you create a project with UTF-8 encoding and then create a JSP, the page directive will declare UTF-8. There is a problem that you can override the <%@page pageEncoding%> directive by the deployment descriptor. Then according to the JSP specification, if the file doesn't start with BOM then the encoding defined in DD has the highest precedence and is used. So we create the file with the project encoding, put the pageEncoding into with the project encoding, but then the file is loaded by UTF-16 determined by the parser. The same problem happens in runtime if you run the page. Since the DD can provide various encodings for various file paths, it cannot be fixed by keeping DD encoding == project encoding. One possibility is to have a way to choose the file encoding in the new file wizard, or when creating the file from template, check the DD, find proper url mapping and use the coresponding encoding if there is any. I am changing this issue to ENHANCEMENT, no time fix it now, it is not P2 defect anyway. BTW, as I already written a partial workaround is to set the project encoding to the value specified in DD before creating the file. This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss |