You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Volker Schneider <vo...@danet.de> on 2002/06/19 13:47:17 UTC
request.setCharacterEncoding doubles pipeline execution
Dear colleagues,
I want to use ä,ö,ü within my site and after looking in the mailing list, I
found a replay of vadim which says, that I have to set character encoding in
a separate action before form validation.
I put this setting into my special SessionValidatorAction:
Request theRequest =
(Request)aObjectModel.get(Constants.REQUEST_OBJECT);
if (theRequest == null)
{
System.out.println("Fatal error: No request object available.");
return null;
}
try
{
theRequest.setCharacterEncoding("UTF-8");
}
catch (Exception e)
{
System.out.println("FatalError: Encoding error");
return null;
}
If then the next action will access the request object, this action above
will start again and so it was executed 2 times and cocoon returns a
dispatcher error.
What does setCharacterEncoding do? Does it send a new request? What can I do
to avoid this behaviour? Where to place the "setCharacterEncoding()" call?
Thank you, best regards
- Volker -
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: request.setCharacterEncoding doubles pipeline execution
Posted by Volker Schneider <vo...@danet.de>.
Hi colleagues,
this is a bug in HttpRequest (Cocoon 2.0.2):
public String getParameter(String name) {
String value = this.req.getParameter(name);
System.out.println("Name="+name+", Value="+value);
if ((this.form_encoding == null) || (value == null)) {
return value;
}
return decode(value);
}
The "value" variable has to be checked against null. Then
setCharacterEncoding() works with UTF-8.
Please add this to your bug list.
Best regards
- Volker -
-----Original Message-----
From: Volker Schneider [mailto:volker.schneider@danet.de]
Sent: Mittwoch, 19. Juni 2002 13:47
To: cocoon-users@xml.apache.org
Subject: request.setCharacterEncoding doubles pipeline execution
Dear colleagues,
I want to use ä,ö,ü within my site and after looking in the mailing list, I
found a replay of vadim which says, that I have to set character encoding in
a separate action before form validation.
I put this setting into my special SessionValidatorAction:
Request theRequest =
(Request)aObjectModel.get(Constants.REQUEST_OBJECT);
if (theRequest == null)
{
System.out.println("Fatal error: No request object available.");
return null;
}
try
{
theRequest.setCharacterEncoding("UTF-8");
}
catch (Exception e)
{
System.out.println("FatalError: Encoding error");
return null;
}
If then the next action will access the request object, this action above
will start again and so it was executed 2 times and cocoon returns a
dispatcher error.
What does setCharacterEncoding do? Does it send a new request? What can I do
to avoid this behaviour? Where to place the "setCharacterEncoding()" call?
Thank you, best regards
- Volker -
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>