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 108682 - I18N - vwp jsf templates/project files need to seed encoding as per feq
Summary: I18N - vwp jsf templates/project files need to seed encoding as per feq
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: _ potingwu
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2007-07-02 18:46 UTC by Ken Frank
Modified: 2007-11-07 19:20 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 Ken Frank 2007-07-02 18:46:07 UTC
new feq on file and project encoding has that jsp files will have their encoding tags seeded with that
of the project encoding, and use that encoding for how the jsp/jsf is viewed inside ide
besides how it impacts the runtime.

this issue is to have that done for these vwp files - there are several sections in template
manger for jsf and vwp files -

(see also 100178)

here is extract of mail on this topic from 
Peter Pisl and myself:
>1. vwp jsp files have additional encoding info in them, like below
and its hardcoded now in the templates:

>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>
>>>> <jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" 
>>>> xmlns:h="http://java.sun.com/jsf/html" 
>>>> xmlns:jsp="http://java.sun.com/JSP/Page" 
>>>> xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
>>>>
>>>>     <jsp:directive.page contentType="text/html;charset=UTF-8" 
>>>> pageEncoding="UTF-8"/>
>>>>
>>>> ---> do all of those 3 values (encoding, charset, pageEncoding) need 
>>>> to be seeded with
>>>> the project encoding value ?
>>>>     

>> The encoding and pageEncoding have to be same. If there will be 
>> different value then an exception is thrown in runtime. The charset 
>> value doesn't have to be same, it refers encoding of the response.
>>   

>>>> (and does this need any change to vwp code or templates ?
>>>>     

>> Yes, it does.


also, this might be related:>the vwp top level page has response encoding property -
>>>> does it need to be seeded with that of project encoding or can it stay
>>>> as utf-8  ? 
>>>>     

>> It can be different. But i'm not sure, what is common solution. My 
>> feeling is that people try to have the file in the same encoding as the 
>> response. But I don't have any data for this.
>>
>> 

--> does anything need to be done about the default values for that property ?
Comment 1 _ potingwu 2007-07-02 19:07:14 UTC
Please give more advise on how to fix this issue! Example for what should be. From the e-mail segments, looks like I can
get the whole idea. Thanks!
Comment 2 Ken Frank 2007-07-02 19:16:28 UTC
contact Petr Pisl and Quy for more on how to solve.

ken.frank@sun.com
Comment 3 _ potingwu 2007-07-16 23:03:40 UTC
I still need example of what should be for the created page.
Comment 4 Ken Frank 2007-07-16 23:08:29 UTC
As mentioned, Peter Pisl and also Tomas Zezula can give you the info -
see issue 107910 on regular jsp files on this very topic - 

and some more info from mail with Peter

a.  newly created jsp/html/xml files will have the encoding or meta
> charset tag
> be that of the global project encoding, or if there is no global project
> encoding set
> (in the case of a project that does not implement feq) - the encoding of
> the locale
> user is in will be used.
>
> from mail:
>
> 1) New JSP, HTML and XML files from template must be created in encoding
> obtained from FEQ.
>
> 2) JSP <%@page encoding="xxx"%> directive must reflect the FEQ encoding
> (same as in #1).
>
> 3) XML <?xml encoding="xxx"?> processing instruction must reflect the
> FEQ encoding (same as in #1).
>
> 4) HTML file from template may be generated with proper META tag
> specifying the FEW encoding  (the same encoding as in #1)
>
>
>
> b. this will also apply to all references to encoding in vwp jsp/jsf
> files (3 references) ?
>
yes


ken.frank@sun.com
Comment 5 Ken Frank 2007-08-14 16:12:04 UTC
now the feq file encoding handling for jsp and html files is implemented;
97871, 107910 for jsp --

thus we need to have this one done for seeing of vwp jsp files so all web apps
jsp files will be behaving the same.

can this one be done soon ?

ken.frank@sun.com
Comment 6 _ potingwu 2007-09-11 00:27:01 UTC
Since the old NetBeans DataObject.createFromTemplate does not support 'encoding' template setting as I known, I need to
rewrite the templates by using the new FreeMarker scripting support.

I did that rewrite before but failed because the FreeMarker does not directly support JSF page in web sub-folder. I.e.,
web page created in 'web' has no issue but not under.

I need to implement the 'template parameters' to support the web sub-folder.
Comment 7 _ potingwu 2007-09-12 23:06:59 UTC
I have implemented the templates for the new FreeMarker scripting support. Now you will see the project encoding in the
JSP/JSPF files. E.g., project encoding=windows-31j

<?xml version="1.0" encoding="windows-31j"?>
...
<jsp:root version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:webuijsf="http://www.sun.com/webui/webuijsf">
    <jsp:directive.page contentType="text/html;charset=windows-31j" pageEncoding="windows-31j"/>
Comment 8 kaa 2007-11-07 19:20:39 UTC
verified: jsp, xml doc, html files are using project encoding.
Checked with build 1106, ja locale, UTF-8/win-31j.