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.
Currently file encoding can be specified separately for each JSP page. It would be useful to have a default setting on the Web Module level.
Is it enough to add module settings property and change handleCreateFromTemplate of JspDataObject.
Set target milestone to TBD
Consistent use of the I18N keyword.
Given the proposed solution for issue 7427, this issue now takes on a slightly different meaning. What might make sense is if there was an encoding property at the project (web module) level, which would control the encoding of newly created pages.
Reassigning to Petr Pisl. Will not be addressed for NetBeans 3.6.
I think this could be solved via deployment descriptor. We can add into the deployment descriptor for the new web module <jsp-property-group> <url-pattern>*.jsp</url-pattern> <page-encoding>UTF-8</page-encoding> </jsp-property-group> and then all the jsp files will be in UTF-8 encoding by default.
Note that the encoding that is set in the page directive or in the jsp property group in the deployment descriptor applies to the *page* encoding. This encoding is used for the HTTP response only if the response encoding has not been set separately. The page encoding is specifically for tools, and need not be the same as the response encoding. If for example the developers use a visual editor for JSPs, it's likely that they need to use the page encoding that this tool likes. If you're using the IDE, chances are that you don't care that much about the page encoding. We can pretty much set it to UTF-8 across the board as an initial value and that will be OK for our editor. Usually the issue that the developer has when they want to response to show correctly is setting the response encoding. This is what we should encourage our users to do when they're developing internationalized applications. If your web app is targetting regular browsers (that is, not PDAs or cellphones) then the best approach is to set the response encoding to UTF-8. If you do target those devices, you typically need to set the encoding on a per device basis (the 2.4 DD allow you to set the response encoding on a per language basis, but that's not that useful). Please refer to Norbert Lindenberg's write up for more about encoding: http://java.sun. com/developer/technicalArticles//Intl/MultilingualJSP/ My recommendation is to close this issue and do the following: - include the page encoding directive in the JSPs, default to UTF-8 - include sample code that sets the response encoding in the servlet sample code, with a comment that explains why we do it. If you use JSF, it will try to set the response encoding for you. I don't know whether Struts does.
> - include the page encoding directive in the JSPs, default to UTF-8 Ana, so you basically think that it's not necessary to have a per-webmodule setting for file encoding nor response encoding, it's just enough to set UTF-8 for file encoding in each page and that's it? Ken, you recently mentioned this issue in a related conversation - what do you think?
Implemented in 4.1 (both Ana's suggestions).
Now JSP files use project encoding value by default. (build 20080614)