Total members 11894 |It is currently Mon Nov 25, 2024 12:25 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





I have a problem in JSF. I can put arabic text in the pages but when the user
enters any arabic words and when the page refreshes the arabic text the user
entered changed to rubish characters.

I guess it is a problem in encoding but i was told the solution to this to make
the encoding UTF-8, but still not working.

Any suggestions?




Author:
Proficient
User avatar Posts: 280
Have thanks: 1 time

I solved the problem using a filter that ensures that the character encoding is
UTF-8:

Code:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
// TODO Auto-generated method stub
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
chain.doFilter(request, response);
}

Code:
<filter>
<description>
Setting the character encoding of the request</description>
<display-name>
RequestEncodingFilter</display-name>
<filter-name>RequestEncodingFilter</filter-name>
<filter-class>CharacterEncodingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>RequestEncodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>


_________________
Please recommend my post if you found it helpful


Author:
Proficient
User avatar Posts: 228
Have thanks: 0 time
Post new topic Reply to topic  [ 2 posts ] 

  Related Posts  to : Arabic Support in JSF
 Arabic website partner     -  
 Read Arabic text from file     -  
 Looking for IT Support Job     -  
 Browser Support     -  
 Looking for Work in IT Support     -  
 AJAX - Browser support     -  
 Component subclasses that support painting     -  
 Support Vector Machine coding on Matlab...     -  
 java.util classes and interfaces support event handling     -  



Topic Tags

Java JSF
cron





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com