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.
When a jsp page has defined encoding in charset value and in pageEncoding attribute and these encodings are different, then the file is open and saved with encoding from charset. According to the JSP 2.0 specification the pageEncoding has to be used for saving and opening pages.
This is bug in tomcat's parser. Maybe is connected with issue #38251.
making P2 as encoding issue which is important.
case: - create web module - edit web.xml add <page-encoding> element to specify encoding (e.g. EUC-JP), save and close - create JSP JSP is generated as follows: ------ <@page contentType="text/html; charset=EUC-JP"%> <@page pageEncoding="UTF-8"%> <html>... ------ In this case, it means; response character encoding is EUC-JP pageEncoding is UTF-8 value of <page-encoding> element is EUC-JP I understand charset attribute can be different from pageEncoding, it's in issue #40780, But I don't think pageEncoding can be different from the value of <page-encoding> element, because the above example cause org.apache.jsper.JasperException in my environment. Tomcat's translated error message is corrupted in my NS7, but it seems to report mismatch of EUC-JP and UTF-8. In this case, here is what I'm thinking: - <page-encoding> has been set by the user (EUC-JP) - I think pageEncoding needs to be same as <page-encoding>, but set as UTF-8 - charset attribute can be different, but it needs to be set same value (EUC-JP) because of bug in tomcat's parser. Would you give me your comments?
Petr, so do we have a Tomcat bug number that we can use for tracking this? If not, can you file one? Thanks.
I filled new bug against tomcat: http://issues.apache.org/bugzilla/show_bug.cgi?id=27517
I did small fix. This fix remove including the charset into jsp file during creating file from template. As result of this fix, the jsp file will not have defined charset after creating. The issue in tomcat is still here, so if somebody add the charset with different encoding as encoding in the pageEncoding, then the opening and saving file will not be in correct encoding. The fix is: http://web.netbeans.org/source/browse/web/core/src/org/netbeans/modules/web/core/jsploader/JspDataObject.java.diff?r1=1.45&r2=1.46
Reviewed by QE in the trunk build #200403081900. The fix looks fine.
Reviewed. Fix looks fine.
So the partial fix is now in the 3.6 branch. I think, now we can downgrade the priority to P3 and wait for the new tomcat.
The bug was fixed in the Tomcat. So now it works in the ide as well.
verfied as per comments in this report.