cancel
Showing results for 
Search instead for 
Did you mean: 

MAM: Umlaut in event URL

Former Member
0 Kudos

Hi folks.

When I submit a event in MAM which looks like this:

http://localhost:4444/MAU/notification/re_street_select.do?uq=34365358&event=onViewByStreet&;

SELECTED_STREET_NAME=Kolpingstraße

I receive the value of the parameter in controller method like this:

Kolpingstra�e

It seams that i can not use an umlaut in parameter values.

I thought MAM is an international application. The encoding should be done correctly. I use UTF-8 as encoding like the standard MAM application does.

I tried to add a Servlet filter but the javax.servlet package shipped with MI does not contain the Filter interface.

Any ideas?

Thank you in advance.

Best regards,

Sascha

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hello sascha,

try putting the following tags in your JSPs.

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">

<%@ page pageEncoding="UTF-8" %>

<%@ page language="java" contentType="text/html;charset=UTF-8" %>

if it doesn't work, try encoding your parameter value.

String utf8Value = new String(paramValue.getBytes("ISO-8859-1"), "UTF-8");

jo

Former Member
0 Kudos

Hi Jo.

The tags:

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <%@ page language="java" contentType="text/html;charset=UTF-8" %> are already set in the standard MAU application includes. <%@ page pageEncoding="UTF-8" %>

can not be used because the compile throws an exception:

Page directive: Invalid attribute, pageEncoding

I debugged the application and checked the parameters of the request in the doHandleEvent method of the Frontend. The parameter has the correct value: Kolpingstraße.

When the super.doHandleEvent method is called the parameter gets converted and has the wrong encoding.

This is a problem of MAU or MAM I guess. I am only talking about standard classes.

You mentioned trying to encode the parameter by myself.

When should I do this?

SAP does exactly this conversion itself in the super method of doHandleEvent in the FrontServlet class.

I have no clue how to solve it.

Cheers,

Sascha

Former Member
0 Kudos

hello sascha,

you can forget about <%@ page pageEncoding="UTF-8" %>

it is only for the new servlet spec.

so you cannot modify the front servlet...

here's another option: since you are trying to pass the

parameter thru the URL (i.e. GET method) try escaping your paramater value.

javascript has the <i>escape</i> and/or <i>encodeURIComponent</i>

(IE5.5 NS6 later) functions which you can use to encode

your value before creating the URL.

regards

jo

Former Member
0 Kudos

Hi Jo.

This also does not work. I tried it using the Java URLEncoder which does the same as the escape method.

The funny thing is, that it works when I use Firefox.

To make things clear again:

I am extending the standrad MAU Frontend. In the FrontServlet the parameter arrives as Kolpingstraße when i use IE. After that MAU converts all parameter values and it gets converted to Kolpingstra??e.

When I use Firefox instead the value arrives already converted (KolpingstraÃ?e) . Then the MAU standard conversion is done and it looks like Kolpingstraße which is correct.

So maybe i have to change a IE setting? Or use a different charset?

Damn it.

Anyway thanks for ur help so far.

Cheers Sascha

Former Member
0 Kudos

Hi Sascha,

Jo was talking about a browser side javascript, not a serverside Java Function. When using java server side the information is already mixed up, so you need to encode the special chars before sending them.

Rgds THomas

Former Member
0 Kudos

Hi Thomas.

I also tried it. The escape function converts ß to %DF which is the same value that i receive if i use the Java function. Anyway, when I use the escaped version the ß arrives in the request parameter as ß. Nice. But afterwards, MAU uses a conbversion Method and converts it from ISO to UTF and i get a ? for the ß.

This also does not work for me. Its frustrating.

When i submit a form which contains values with ß using the post action everything works fine. Its just not working with links.

Cheers,

Sascha