Archie144

Localization Issue-Locale Doesn't Pass When We Use Dataurl

Recommended Posts

I'm using dataURL attribute where I'm giving path of my servlet. In my servlet I'm creating xml required for displaying fusion chart and writing that in ServletOutputStraem.

When this servlet gets called using dataURL I'm getting en_us locale in that servlet even if I change my locale to chinese locale because of which I get x-axis and y-axis in english only.

but I'm getting correct locale in jsp where I've given dataURL path of my servlet.

 

Can anyne tell me how can I get correct browser locale using this dataURL attribute?

 

below is my sample:

 

<param name="FlashVars" value="ChartNoDataText=<%=resource.getMessage(request.getLocale(),"Error.key")%>&LoadDataErrorText=<%=resource.getMessage(request.getLocale(),"Error.key")%>&dataURL=./MyServlet"/>

 

Here I'm getting Error.key localized but I'm not getting strings localized which I'm localizing in MyServlet i.e titles or x -y axis labels

 

Edited by Archie144

Share this post


Link to post
Share on other sites

No one has any idea how to solve this issue? I also observed we can not pass 2 parmeter as a query string wth that servlet url, when I tried to send 2 I could get value of only one and 2nd parameter returns null value.

 

I'm using dataURL attribute where I'm giving path of my servlet. In my servlet I'm creating xml required for displaying fusion chart and writing that in ServletOutputStraem.

When this servlet gets called using dataURL I'm getting en_us locale in that servlet even if I change my locale to chinese locale because of which I get x-axis and y-axis in english only.

but I'm getting correct locale in jsp where I've given dataURL path of my servlet.

 

Can anyne tell me how can I get correct browser locale using this dataURL attribute?

 

below is my sample:

 

<param name="FlashVars" value="ChartNoDataText=<%=resource.getMessage(request.getLocale(),"Error.key")%>&LoadDataErrorText=<%=resource.getMessage(request.getLocale(),"Error.key")%>&dataURL=./MyServlet"/>

 

Here I'm getting Error.key localized but I'm not getting strings localized which I'm localizing in MyServlet i.e titles or x -y axis labels

 

Share this post


Link to post
Share on other sites

Hi

 

As I understand, you have two different issues here:

 

1. XML generated by the servlet does not contain the correct Chinese characters.

 

2. Unable to process Multiple parameters from the URL.

 

#1 Please verify that the xml output of the servlet is UTF-8 encoded.

 

response.setContentType("text/xml; charset=UTF-8");

 

#2 Please provide a URL such as this: &dataURL=test.php?param1=abc%26param2=def when using html embedding.

 

Here are a few suggestions:

 

1. I suggest that you use Javascript embedding method to render the chart. This is a much easier and advanced.

 

2. You should try the FusionCharts jsp tag library provided with the latest version of FusionCharts. This will ease the process of embedding chart in a jsp page.

 

Please implement them if you find the time and patience. Please ignore them if it is not possible to do so in your environment.

 

 

I also noticed that this topic has been posted in the Sharepoint forum, whereas this problem is related to java/jsp.

 

To get quicker replies please ensure that you post under the correct forum topic.

 

Hope this helps :)

Srividya Sharma

Share this post


Link to post
Share on other sites

Thanks for first informing that I've posted topic in wrong place.

I was wondering why I'm not getting replies.

 

Problem is not with the Chinese charcters, if I pass chinese characters then I do get those corrcetly in Chinese language but when I hit MyServlet url and control goes to MyServet then over there I get locale=en always. This is my problem. Even page which sends request to MYservlet gets localized correctly but on MyServlet I get always english locale so whatver values I try to localize there I get in English.

Is there any need or way by which I can set dataURL parameter as "use locale"..somthing like this?

 

 

Hi

 

As I understand, you have two different issues here:

 

1. XML generated by the servlet does not contain the correct Chinese characters.

 

2. Unable to process Multiple parameters from the URL.

 

#1 Please verify that the xml output of the servlet is UTF-8 encoded.

 

response.setContentType("text/xml; charset=UTF-8");

 

#2 Please provide a URL such as this: &dataURL=test.php?param1=abc%26param2=def when using html embedding.

 

Here are a few suggestions:

 

1. I suggest that you use Javascript embedding method to render the chart. This is a much easier and advanced.

 

2. You should try the FusionCharts jsp tag library provided with the latest version of FusionCharts. This will ease the process of embedding chart in a jsp page.

 

Please implement them if you find the time and patience. Please ignore them if it is not possible to do so in your environment.

 

 

I also noticed that this topic has been posted in the Sharepoint forum, whereas this problem is related to java/jsp.

 

To get quicker replies please ensure that you post under the correct forum topic.

 

Hope this helps :)

Srividya Sharma

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now