19 September 2009

Enable Arabic in JSPX:

Enable arabic entring arabic letters in JSPX forms goes as if any other framework that hides servlets details.
you will need to add a Filter as the following :
public class InitFilter implements Filter {

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
// pass the request along the filter chain
chain.doFilter(request, response);
}
}
and then configure this filter in your web.xml :

<filter>
<display-name>InitFilter</display-name>
<filter-name>InitFilter</filter-name>
<filter-class>com.goodtreeit.storefront.web.InitFilter</filter-class>
</filter> <filter-mapping> <filter-name>InitFilter</filter-name> <servlet-name>JspxHandler</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping>

No comments: