You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stavros Kounis <go...@osmosis.gr> on 2003/05/26 17:53:09 UTC

[SUMMARY] Re: xsp esql gives escaped output (its request param problem?)

after a whole weekend play with cocoon i have find a sollution

searching in this mailing archive i have notice that this is a problemm
that other users have too so i write down my experiences:


- first of all a new cocoon instance (2.1 [a cvs snapshot in my harddisk
some weeks old])

- i have leave all cocoon conf files untouched, so the default encoding is
UTF-8

- create a .html  with a form to post data, using UTF-8 encoding in head.
but here is a small point. i use XMLspy to edit all my xml, html ..files,
so there is not enough to select UTF-8 in head of html, i have to set my
editor (xmlspy) to save non-xml files using utf-8 encoding (othewise i use
to get strange results).

- create my .xsp file using utf-8 encoding. the scope of this file is just
to echo the data that my form post. (after succesfull echo i have create
more .xsp doing things with my data base)

- and final put some lines in sitemap.xmap to make clear that the posted
data are in utf-8
********sitemap.xmap entry:
<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
	<map:components>
		<map:actions>
			<map:action name="set-encoding" src="org.apache.cocoon.acting.SetCharacterEncodingAction"/>
		</map:actions>
	</map:components>
	<map:pipelines>
		<map:pipeline>
			<map:act type="set-encoding">
				<map:parameter name="form-encoding" value="UTF-8"/>
			</map:act>
			<map:match pattern="*.html">
				<map:read mime-type="text/html" src="{1}.html"/>
			</map:match>
			<map:match pattern="*.xsp">
				<map:generate type="serverpages" src="{1}.xsp"/>
				<map:transform src="xml.xsl"/>
				<map:serialize type="xml"/>
			</map:match>
		</map:pipeline>
	</map:pipelines>
</map:sitemap>
**********
that's it. now i can go on with cocoon.



i think that this will be a usefull how-to for cocoon wiki but my poor
english dont let me write the how-to. so if anyone can help i can
comment and pack my example and sent to work with it.

---stavros




On Mon, 26 May 2003, Christian Haul wrote:

> On 25.May.2003 -- 03:05 PM, Stavros Kounis wrote:
> > after many combination i can't reach something that work
> >
> > i think that the problem is how xsp get request parameters
> > so i had to go one level up and test the part of my xsp that get the
> > parameters.
> >
> > using a simple .xsp that just echo the content of a req-par i cant find
> > until now the right combination that will show me in browser the (greek)
> > content of a req-par. (xml is the serialization i use for xsp)
> >
> > first
> > i have try to change all encodings for serializers in main sitemap to
> > iso-8859-7 (without success)
> >
> > second
> > i have try to change all this to utf-8 and follow the how-to in
> > wiki.cocoondev.org (without success too)
> >
> > based on:
> > http://wiki.cocoondev.org/Wiki.jsp?page=RequestParameterEncoding
> > i have put the follow instructions in web.xml:
> > 		<init-param>
> > 			<param-name>container-encoding</param-name>
> > 			<param-value>iso-8859-7</param-value>
> > 		</init-param>
> > 		<init-param>
> > 			<param-name>form-encoding</param-name>
> > 			<param-value>UTF-8</param-value>
> > 		</init-param>
>
> According to the wiki site you are referring to this should be
> iso-8859-1 for the container-encoding and utf-8 for the form
> encoding. But then you would need to set the serializers to utf-8 as
> well. Have you checked that the page with the form contains a valid
> <meta/> tag for the encoding? According to the wiki the html page
> needs to have a <head/> or the serialized will not add the encoding
> information.
>
> > now i'm consider to give up, if i can't send requsts (in greek) how can i
> > go further, and finish this project using php or asp.
>
> I would expect that you will hit the same encoding problems with other
> systems as well.
>
> > is it possible for cocoon to handle requests in other encodings (we care about greek)?
>
> Definately : yes.
>
> > is this a tomcat or java problem?
>
> >From what I understand the browser not indicating the encoding but
> using the same as the page with the form is the problem.
>
> 	Chris.
>



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