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.

Bug 38251 - Loading JSP incorrectly sets charset
Summary: Loading JSP incorrectly sets charset
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2003-12-19 18:48 UTC by Ana.von Klopp
Modified: 2007-07-31 13:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ana.von Klopp 2003-12-19 18:48:26 UTC
If a JSP in standard syntax has page directives 
with pageEncoding and contentType attributes, then 
loading the file also sets the charset attribute 
after the contentType.

This can be verified by using the current JSP 
template, which has contentType="text/html" and 
pageEncoding="UTF-8". The contentType comes out as 
"text/html;charset=UTF-8". 

Setting the charset attribute is not the right 
thing to do in this case. Unless the user sets the 
charset some other way, it will default to the 
pageEncoding anyway. If they do want to set it 
elsewhere (for example in a servlet); then setting 
it again is either ineffectual (because it is too 
late) or it, if it's not too late, then it 
potentially has the effect of overwriting 
behaviour that the user has coded elsewhere.
Comment 1 Ana.von Klopp 2003-12-19 18:49:10 UTC
I recommend that this be fixed for 3.6
Comment 2 Petr Pisl 2004-02-19 15:12:31 UTC
It seams like bug in jsp parser. If there are defined different
encoding in the charset and pageEncoding, then the right encoding is
the pageEncoding, but the parser returns encoding in charset.

If there is defined encoding in the deployment descriptor for the jsp
page, then the parser returns the right encoding from DD. 
Comment 3 Petr Pisl 2004-03-08 18:43:21 UTC
I filled new bug against tomcat:
http://www.netbeans.org/issues/show_bug.cgi?id=40791
Comment 4 Petr Pisl 2004-03-19 13:33:39 UTC
In the tamplate is not inserted the charset now. 
Comment 5 Dan Kolar 2007-07-31 13:54:25 UTC
v