Hi, Mario,
On Thursday 19 January 2006 11:47, Mario Ivankovits wrote:
> Hi Enrique!
>
> > But shouldn't it be a more generic and straightforward mechanism to
> > solve this problem? To the best of my knowledge, the problem is with
> > the class HTMLEncoder, and particularly with this method:
>
> Thanks for "begging" me - not sure if this is the correct word ;-) . It
> forced me to dig a little bit deeper into the problem.
>
> It looks like I found the real problem now. By design, if you use UTF-8
> NO encoding at all should be done.
>
> It has something to do with the ExtensionsFilter, in more detail with
> AddResource.writeWithFullHeader.
> There a ResponseWriter WITHOUT ENCODING will be instantiated and thus it
> will use ISO-8859-1 by default - WOHA!!!
My problem has nothing to do with encoding/decoding, but I got a null pointer
exception in
AddResources.writeWithFullHeader/HtmlRenderUtils.selectContentType area.(See
below) The statements that the exception occurs are:
FacesContext context = FacesContext.getCurrentInstance();
contentTypeListString =
(String)context.getExternalContext().getRequestHeaderMap().get("Accept");
It is either context, getExternalContext(), or getRequestHeaderMap () that
produces a null pointer. I can not rebuild 1.1.1 myFaces as I don't see any
build.xml files in the source tree. I also retrieved the current source
files via svn. Unfortunately, the newly built jars do not run in my
environment (appears that the tomcat cannot start my listener if I use the
latest build). Since you are at it I wonder if you would be so kind to take
a look at it. I wonder if it is ok if the method just returns when it
encounters a null pointer.
The problem occurs on the first page after the user has logged in and it
disappears when the page has been refreshed. After that the user can
navigate to different pages using the tabs produced by jscookmenu.
I use tile and jscookmenu, and have the container's login mechanism to trigger
a login page.
Everything is find if I don't use jscookmenu, so the problem relates to or is
triggered by jscookmenu.
Thanks in advance if you can shed some light.
Wei
=====================================
java.lang.NullPointerException
at
org.apache.myfaces.renderkit.html.HtmlRendererUtils.selectContentType(HtmlRendererUtils.java:919)
at
org.apache.myfaces.component.html.util.AddResource.writeWithFullHeader(AddResource.java:443)
at
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:243)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:275)
at
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:217)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:197)
at org.apache.catalina.core.ApplicationFilterChain.access$000
(ApplicationFilterChain.java:50)
at
org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:156)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:152)