struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selim Hendrickson <selimhendrick...@iyte.edu.tr>
Subject Re: struts turkish character problem
Date Mon, 05 Jul 2004 09:38:55 GMT
Merhaba Eyup Bey,

We experienced a similar problem about a year ago. Below is the code we 
used for solving the issue. Hope it works for you too.
I belive there is a problem with the ActionForms with different 
encodings, therefore we wrote this small request preprocessor.
You could also use a ServletFilter if you want.

Selamlar,

Selim YORGANCIOGLU

IZTEK Consulting Services
Software Engineer
selimhendrickson [at] iyte.edu.tr
0232 750 6557

/*********************************************************************************************/
package iyte.oi.struts.control;

import iyte.oi.util.tracer.Debug;
import iyte.oi.web.util.SessionParameters;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.RequestProcessor;

public class RequestProcessorOI extends RequestProcessor {

    /**
     * Constructor for RequestProcessorOI
     */
    public RequestProcessorOI() {
        super();
    }
   
    protected boolean processPreprocess(HttpServletRequest request, 
HttpServletResponse response) {           
        boolean returnVal = super.processPreprocess(request, response);
        try {
            request.setCharacterEncoding("ISO-8859-9");
        } catch(UnsupportedEncodingException uee) {
            Debug.println("Unsupported Encoding: ISO-8859-9");
        }
        if(!returnVal) return returnVal;       
        SessionParameters.addParameters(request);
        return true;
    }

}
/************************************************************************************/


Eyup TEKIN wrote:

>hi
>there is a webapp including oracledatabase(datas are hold with turkish
>character) ejbs on borlandapplicationserver ,tomcat,struts and jsps.
>i can write turkish character in jsp page side.but dynaaction form creates a
>selection list.and that list cant show turkish character.in tomcat's
>catalina.sh file there is a "-Dfile encoding=1254" parameter.and i wrote in
>the struts part below convertion
>
>"
>byte[] s0_byte = satirArray[0].getBytes("Cp1254");
>satirArray [1]= new String(s1_byte, "Cp1252");
>"
>i solved problem but how can i solve this problem in another way? maybe
>general solution will be beter.
>
>sincerely
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>  
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message