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 252518 - UTF-8 encoding not inherited from included JSP files
Summary: UTF-8 encoding not inherited from included JSP files
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-21 06:34 UTC by tveimo
Modified: 2018-02-02 13:06 UTC (History)
0 users

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 tveimo 2015-05-21 06:34:33 UTC

    
Comment 1 tveimo 2015-05-21 06:37:01 UTC
I start all my JSP files with 

<%@ include file="/WEB-INF/common/taglibs.jsp" %>

in which I define all common JSP includes, and most importantly pageEncoding:

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
[...]

This has worked on and off, without me being able to determine what triggers if it works or not. It appears not to work for .tag files all the time, when I use a similar setup for .tag files:

<%@ include file="../include.tag" %>

include.tag:
<%@ tag body-content="empty" pageEncoding="UTF-8" language="java" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
[...]

This works perfectly when the file is deployed in eg tomcat 7/8, and in IntelliJ.
Comment 2 tveimo 2015-05-21 09:00:58 UTC
I just tested with current nightly (20150520), and it seems to work better.
Comment 3 tveimo 2018-02-02 13:06:42 UTC
Doesn't seem to work outside war type projects. Eg in a gradle project, you explicitly need the encoding header in every single JSP file.