On Thu, Feb 10, 2011 at 11:56 PM, Peter Dotchev <[email protected]> wrote:
>
> Hi,
>
> Recently
> http://dotev.blogspot.com/2011/02/posting-non-ascii-characters-in-web.html I
> stumbled  over this issue too.
>
> I don't want to add _charset_ input to all the forms.
> Is there a way to set the request encoding to UTF-8?
> IMHO it would be better if the request encoding is configurable like it is
> done in Wicket.
>
> http://wiki.apache.org/tomcat/FAQ/CharacterEncoding Tomcat FAQ  suggests
> using a filter.
> How can I do that in Sling?

Hi, you can implement the javax.servlet.Filter interface and register
your implementation as a Filter service:

@Component(immediate = true)
@Properties({
        @Property(name = "filter.scope", value = "request",
propertyPrivate = true),
        @Property(name = "filter.order", value = "-9", propertyPrivate = true)
})
@Services({@Service(javax.servlet.Filter.class)})
public class YourFilter implements javax.servlet.Filter {
 ...
}



-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00
Quando omni flunkus moritatus!

Reply via email to