You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Enke Michael <Mi...@wincor-nixdorf.com> on 2001/10/09 11:59:13 UTC

Patch: encoding for requests

Hi,
there is no support for different encodings for the
<xsp-request:get-parameter> tag as I found after
reading "C2 Foriegn Language Support".
But this is essential for e.g. form input fields
if the form has another encoding than the jsp container.
This patch introduces two attributes:
<xsp-request:get-parameter name="..." encoding="aaa" jspEncoding="bbb"/>
- aaa is the encoding of the form data (in URL e.g. <URL>?input=%a1%b2)
- bbb is the encoding the jsp container uses.
  The default per JSP spec is ISO-8859-1 and this is also the default
  in this patch. But if someone likes to have another encoding
  for the JSP container he has to specify here too.

If the formular uses UTF-8 encoding and we didn't change the
tomcat encoding, we have to write:
<xsp-request:get-parameter name="..." encoding="UTF-8"/>

Following the patches for:
xdocs/request.xml
src/org/apache/cocoon/components/language/markup/xsp/XSPRequestHelper.java
src/org/apache/cocoon/components/language/markup/xsp/java/request.xsl

Michael

PS: IMHO i's a miss in the JSP spec that there is no getParameter(String
encoding)


Re: for the committer: Patch: encoding for requests

Posted by Enke Michael <Mi...@wincor-nixdorf.com>.
Martin Man wrote:
> 
> On Tue, Oct 16, 2001 at 10:56:36AM +0200, Enke Michael wrote:
> > Martin Man wrote:
> > >
> > > On Wed, Oct 10, 2001 at 08:16:43AM +0200, Enke Michael wrote:
> > > > I would ask you to change the "jspEncoding" to "jsp-encoding"
> > > > in all 3 patches because it is the common syntax.
> > > > I realized to late - sorry.
> > >
> > > I do not understand why to call it even jsp-encoding, ..., if it's internal
> > > encoding used by *servlet container* itself it doesn't have anything to do
> > > with jsp, ..., or am I missing something.. ???
> >
> > That is true. But why you made no proposal to be constructive?
> > Let's call it container-encoding.
> 
> sorry for no proposal, just didn't have anything appropriate in mind :),
> container-encoding looks good, .., i've changed the "encoding" attribute to be
> "form-encoding" to avoid confusion...
> 
> please check that it works correctly, the changes are in 2.1 cvs
> I'll backport them to 2.0 as soon as there will be support for them in
> <xsp-request:get-parameter-values> also...

I downloaded and tested it: It's ok.
But I have a question about request.xsl, may be there are two mistakes?
line 243: getAttribute(objectModel,<xsl...>)
after objectModel, shouldn't be there a "this.contentHandler"?
The same on line 279: getRequestedURL

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: for the committer: Patch: encoding for requests

Posted by Martin Man <Ma...@seznam.cz>.
On Tue, Oct 16, 2001 at 10:56:36AM +0200, Enke Michael wrote:
> Martin Man wrote:
> > 
> > On Wed, Oct 10, 2001 at 08:16:43AM +0200, Enke Michael wrote:
> > > I would ask you to change the "jspEncoding" to "jsp-encoding"
> > > in all 3 patches because it is the common syntax.
> > > I realized to late - sorry.
> > 
> > I do not understand why to call it even jsp-encoding, ..., if it's internal
> > encoding used by *servlet container* itself it doesn't have anything to do
> > with jsp, ..., or am I missing something.. ???
> 
> That is true. But why you made no proposal to be constructive?
> Let's call it container-encoding.

sorry for no proposal, just didn't have anything appropriate in mind :),
container-encoding looks good, .., i've changed the "encoding" attribute to be
"form-encoding" to avoid confusion...

please check that it works correctly, the changes are in 2.1 cvs 
I'll backport them to 2.0 as soon as there will be support for them in
<xsp-request:get-parameter-values> also...

> 
> Michael

thanx,
martin
-- 
2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: for the committer: Patch: encoding for requests

Posted by Martin Man <Ma...@seznam.cz>.
On Wed, Oct 10, 2001 at 08:16:43AM +0200, Enke Michael wrote:
> I would ask you to change the "jspEncoding" to "jsp-encoding"
> in all 3 patches because it is the common syntax.
> I realized to late - sorry.

I do not understand why to call it even jsp-encoding, ..., if it's internal
encoding used by *servlet container* itself it doesn't have anything to do
with jsp, ..., or am I missing something.. ???

> 
> Michael
> 

martin
-- 
2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


for the committer: Patch: encoding for requests

Posted by Enke Michael <Mi...@wincor-nixdorf.com>.
I would ask you to change the "jspEncoding" to "jsp-encoding"
in all 3 patches because it is the common syntax.
I realized to late - sorry.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org