You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kiran Kumar <mk...@yahoo.com> on 2004/04/24 08:56:33 UTC

Multibyte string Tomcat ,struts IE

Hi All,
  I need help on sending multibyte characters in URL
using html:link , we are following the steps mentioned
below
  i have searched for the information on google but
could not come across anything helpful ,
  (it is also mentioned in some post that IE adds its
own encoding when the data is submitted and that
browsers do not send the character encoding in "real
life") 
   hope someone on this list can help me out

1.Is is possible to send multibyte string in url
(using HTTP GET method) ?
2.If we have to encode the String what are the ways
that i can do the same and how do i decode the string
?
3. Is there any javascript which takes the query
string and submits it as POST method

Steps we Use 
1. EUC-JP string taken from postgres database
(database encoding is in EUC-JP),
2. The string is put in hashmap as well as a
ActionForm 
3. In jsp page we use 
 
<html:link action ="/myaction.do" name =
"reporterList"     property = "reporterListMap" >
<bean:write name="reporterList" property="reporter"/>
</html:link>
 
Here the string is displayed properly
 
when we click on this link the EUC-JP string is
encoded and sent to the next action
 
when the string is accessed in action class it is
malformed
 
We have a setcharacterencoding filter (tomcat) that
has encoding as EUC_JP
We have tried
eucString = Actionform.getstring();
byte[] stringBytesISO =
eucString.getBytes("ISO-8859-1");
    eucString = new String(stringBytesISO, "EUC-JP");
 
But this works perfectly if we use a POST method but
not on GET 
 
Version We Use 
Tomcat 4.1.27
Struts 1.1



Looking forward for your replies

Thanks,
Kiran






	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash

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


Re: Multibyte string Tomcat ,struts IE

Posted by Kiran Kumar <mk...@yahoo.com>.
Hi all,
  We used java.net.URLEncoder.encode (string,"EUC_JP")
and it works with GET method . previously we had
hashmaps with name value pairs and used html:link ,
now we removed the HTML:Link and wrote a method that
takes a hashmap and returns a String key=euc_jp
encoded value (query string),

in jsp we use
<%String ctx = request.getcontextpath();%>
<a href=<%ctx%>/'<html:rewrite
href="/someaction">?query_string . 


Please let me know if this is ok or we need to do
something else 

Thanks,
Kiran
--- Kiran Kumar <mk...@yahoo.com> wrote:
> Hi All,
>   I need help on sending multibyte characters in URL
> using html:link , we are following the steps
> mentioned
> below
>   i have searched for the information on google but
> could not come across anything helpful ,
>   (it is also mentioned in some post that IE adds
> its
> own encoding when the data is submitted and that
> browsers do not send the character encoding in "real
> life") 
>    hope someone on this list can help me out
> 
> 1.Is is possible to send multibyte string in url
> (using HTTP GET method) ?
> 2.If we have to encode the String what are the ways
> that i can do the same and how do i decode the
> string
> ?
> 3. Is there any javascript which takes the query
> string and submits it as POST method
> 
> Steps we Use 
> 1. EUC-JP string taken from postgres database
> (database encoding is in EUC-JP),
> 2. The string is put in hashmap as well as a
> ActionForm 
> 3. In jsp page we use 
>  
> <html:link action ="/myaction.do" name =
> "reporterList"     property = "reporterListMap" >
> <bean:write name="reporterList"
> property="reporter"/>
> </html:link>
>  
> Here the string is displayed properly
>  
> when we click on this link the EUC-JP string is
> encoded and sent to the next action
>  
> when the string is accessed in action class it is
> malformed
>  
> We have a setcharacterencoding filter (tomcat) that
> has encoding as EUC_JP
> We have tried
> eucString = Actionform.getstring();
> byte[] stringBytesISO =
> eucString.getBytes("ISO-8859-1");
>     eucString = new String(stringBytesISO,
> "EUC-JP");
>  
> But this works perfectly if we use a POST method but
> not on GET 
>  
> Version We Use 
> Tomcat 4.1.27
> Struts 1.1
> 
> 
> 
> Looking forward for your replies
> 
> Thanks,
> Kiran
> 
> 
> 
> 
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for
> 25�
> http://photos.yahoo.com/ph/print_splash
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 

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