cancel
Showing results for 
Search instead for 
Did you mean: 

WebScript URL encoding

sergi_l
Champ on-the-rise
Champ on-the-rise
Hi all!

Easy question.
I'm publishing an Alfresco WebScript as simple as:

mytest.get.desc.xml
<webscript>
   <shortname>test</shortname>
   <description>my test</description>
   <url>/sls/mytest?parametro={parametro}</url>
   <authentication>guest</authentication>
   <transaction>none</transaction>   
</webscript>

mytest.get.html.ftl
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" >
</head>
<body>
resultado: ${args.parametro}
</body>
</html>

If I send: http://localhost:8080/alfresco/service/sls/mytest?parametro=test
The result is: test

If I send: http://localhost:8080/alfresco/service/sls/mytest?parametro=É
The result is: �

If I send: http://localhost:8080/alfresco/service/sls/mytest?parametro=ñ
The result is: �

That's to say. Why these special characters are not being shown??
How can I configure my webscripts to manage the URL encoding and to show the corresponding character??

Sending the same characters encoded causes the same output Smiley Sad
Ñ  –> %D1 (http://www.w3schools.com/TAGS/ref_urlencode.asp)
If I send: http://localhost:8080/alfresco/service/sls/mytest?parametro=%D1
The result is: �
Same result!!

Please, help!
Many thanks,

Sergi
2 REPLIES 2

artem
Champ in-the-making
Champ in-the-making
Hi, have the same problem. Did you find solution?

artem
Champ in-the-making
Champ in-the-making
Resolve problem by configuring Tomcat Server character encoding (http://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q2)
1. Set the URIEncoding attribute on the <Connector>
2. Set the useBodyEncodingForURI attribute on the <Connector>