• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Custom control + character encoding issue

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am using JSF 1.2 with JBoss 5.1 in Eclipse EE Helios.

The weird behavior I initially got was that rendering of my JSF page would seem to stop on it's own in the middle of rendering, and pretty bizarely, along the lines of :


And that's IT - no more output afterwards.

The stopping always happened somewhere in a specific list, but not always at the same place. The list was rendered by my own custom component, and it was outputting items from a DB. In the end, it turned out that there is an item in the list (although nowhere near where the breaking would occur) that had a UTF-8 character, which apparently broke the page mid-rendering (I conclude this from the fact that if the sole item is left out, rendering is done perfectly ok).

What I need now is a way to render this item. (:

What i have done:

1. Set character encoding on the page by:


and


2. Register a filter to set the encoding:



3. Register a PhaseListener to set the encoding:



4. Intercept the ResponseWriter for my component and set it's content type (I may have done this uncleanly as I haven't found a way to do it as it should be done; truth be told, I didn't put much effort in it, either, but this seems legit to me anyway)



I haven't managed to find much info on the web about this issue. The most insightful resource I found was this one:

https://coderanch.com/t/211549/JSF/java/JSF-Character-Sets-UTF-mainly

But it still doesn't provide a solution to my problem.

Any info is well appreciated.

Thanks,
Branislav
 
Branislav Milojkovic
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A small addition:

step 4 is definitely implemented wrong. It causes a similar breaking on it's own. If I leave it, then I get similar behavior for any kind of output from the custom control. If I remove it, the code at least works for standard characters.

Does anyone have an idea on how to modify the renderer? This is the only line of investigation that makes sense to me atm, but if anyone has another idea, feel free to say so.

Tnx,
Branislav
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic