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

Summary: UTF-8 encoding not inherited from included JSP files
Product: javaee Reporter: tveimo <tveimo>
Component: JSPAssignee: issues@javaee <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:

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.