You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Md. Ariful Islam" <ar...@yahoo.com> on 2007/08/21 09:08:50 UTC

Having problem with Swedish characters in request

Hello all,

I am using struts 2 to develop a web-application.  I'm having problem when I submit a form having any Swedish character (like ö, å or ä) in a testbox, it becomes '?' in the action class.  In the begining of the jsp file, I have the code below:


<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="sv" xml:lang="sv">

<%@ taglib prefix="s" uri="/struts-tags" %>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link href="<s:url value="/css/intranet.css"/>" rel="stylesheet" type="text/css"/>
    <link href="<s:url value="/skript/intranet.js"/>"  type="text/javascript"/>
</head>
<body>
.......
</body>



I haven't added any language configuration related stuffs anywhere else.  One more thing,  it has no problem with characters in the response.  I mean, when i have one of those characters in a string in the database and wants to show it on the page, it works fine.  

Can anyone please help me?

Thanks,
~ Arif


       
---------------------------------
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.

Re: Having problem with Swedish characters in request

Posted by "Md. Ariful Islam" <ar...@yahoo.com>.
It worked !!! Thanks, Toni, thanks a lot.  

It was the locale, as I'm using an us_EN machine.


Toni Lyytikäinen <to...@gmail.com> wrote: I don't remember having any similar problems with the Finnish locale which
is nearly the same as the Swedish one. The cause of the problem is probably
that the parameters are in wrong encoding (UTF-8 most probably). Since you
are using ISO-8859-1, check that the browser in the form page is actually
using that encoding (in Firefox View->Character Encoding or right click on
page ->View Page Info). Also check the encoding settings of you Application
Server or Servlet Container. Adding the default locale and encoding scheme
into struts.properties also may or may not help:

### This can be used to set your default locale and encoding scheme
struts.locale=fi_FI
struts.i18n.encoding=iso-8859-15

(subsitute fi_FI for your locale)

On 8/21/07, Md. Ariful Islam  wrote:
>
>
> Hello all,
>
> is there anyone who can give me some light on this problem?  I need this
> very urgently.  Hope you'll be kind enough to response quickly.
>
> ~ Arif
>
> "Md. Ariful Islam"  wrote: Hello all,
>
> I am using struts 2 to develop a web-application.  I'm having problem when
> I submit a form having any Swedish character (like ö, å or ä) in a textbox,
> it becomes '?' in the action class.  In the beginning of the jsp file, I
> have the code below:
>
>
>
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
>
> " rel="stylesheet" type="text/css"/>
>
> "  type="text/javascript"/>
>
>
> .......
>
>
>
>
> I haven't added any language configuration related stuffs anywhere
> else.  One more thing,  it has no problem with characters in the
> response.  I mean, when i have one of those characters in a string in the
> database and want to show it on the page, it works fine.
>
> Can anyone please help me?
>
> Thanks,
> ~ Arif
>
>
>
> ---------------------------------
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.
>
>
> ---------------------------------
> Ready for the edge of your seat? Check out tonight's top picks on Yahoo!
> TV.


       
---------------------------------
Need a vacation? Get great deals to amazing places on Yahoo! Travel. 

Re: Having problem with Swedish characters in request

Posted by Toni Lyytikäinen <to...@gmail.com>.
I don't remember having any similar problems with the Finnish locale which
is nearly the same as the Swedish one. The cause of the problem is probably
that the parameters are in wrong encoding (UTF-8 most probably). Since you
are using ISO-8859-1, check that the browser in the form page is actually
using that encoding (in Firefox View->Character Encoding or right click on
page ->View Page Info). Also check the encoding settings of you Application
Server or Servlet Container. Adding the default locale and encoding scheme
into struts.properties also may or may not help:

### This can be used to set your default locale and encoding scheme
struts.locale=fi_FI
struts.i18n.encoding=iso-8859-15

(subsitute fi_FI for your locale)

On 8/21/07, Md. Ariful Islam <ar...@yahoo.com> wrote:
>
>
> Hello all,
>
> is there anyone who can give me some light on this problem?  I need this
> very urgently.  Hope you'll be kind enough to response quickly.
>
> ~ Arif
>
> "Md. Ariful Islam" <ar...@yahoo.com> wrote: Hello all,
>
> I am using struts 2 to develop a web-application.  I'm having problem when
> I submit a form having any Swedish character (like ö, å or ä) in a textbox,
> it becomes '?' in the action class.  In the beginning of the jsp file, I
> have the code below:
>
>
>
> PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
>
>
>
>
> " rel="stylesheet" type="text/css"/>
>
> "  type="text/javascript"/>
>
>
> .......
>
>
>
>
> I haven't added any language configuration related stuffs anywhere
> else.  One more thing,  it has no problem with characters in the
> response.  I mean, when i have one of those characters in a string in the
> database and want to show it on the page, it works fine.
>
> Can anyone please help me?
>
> Thanks,
> ~ Arif
>
>
>
> ---------------------------------
> Luggage? GPS? Comic books?
> Check out fitting  gifts for grads at Yahoo! Search.
>
>
> ---------------------------------
> Ready for the edge of your seat? Check out tonight's top picks on Yahoo!
> TV.

Re: Having problem with Swedish characters in request

Posted by "Md. Ariful Islam" <ar...@yahoo.com>.
Hello all,

is there anyone who can give me some light on this problem?  I need this very urgently.  Hope you'll be kind enough to response quickly.

~ Arif

"Md. Ariful Islam" <ar...@yahoo.com> wrote: Hello all,

I am using struts 2 to develop a web-application.  I'm having problem when I submit a form having any Swedish character (like ö, å or ä) in a textbox, it becomes '?' in the action class.  In the beginning of the jsp file, I have the code below:



PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">



<%@ taglib prefix="s" uri="/struts-tags" %>


    
    
" rel="stylesheet" type="text/css"/>
    
"  type="text/javascript"/>


.......




I haven't added any language configuration related stuffs anywhere else.  One more thing,  it has no problem with characters in the response.  I mean, when i have one of those characters in a string in the database and want to show it on the page, it works fine.  

Can anyone please help me?

Thanks,
~ Arif


       
---------------------------------
Luggage? GPS? Comic books? 
Check out fitting  gifts for grads at Yahoo! Search.

       
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV.