RTFM http://xml.apache.org/cocoon/userdocs/xsp/request.html: --------------------8<-------------------- xsp-request:get-parameter
Gets the value of the named request parameter. This is a value from the request string (e.g., ?fruit=apple) or from POSTed form data. If the parameter has more than one value, (e.g, ?fruit=apple&fruit=orange), then this gets the first value. See xsp-request:get-parameter-values. Possible attributes: form-encoding (depends on the encoding of the page which sends the form data) and container-encoding (default per servlet spec: ISO-8859-1 but if your servlet container uses another one you can adjust) --------------------8<-------------------- Vadim > -----Original Message----- > From: yuryx [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 11, 2002 5:59 AM > To: [EMAIL PROTECTED] > Subject: Re: Problem with encoding non-english request parameters > > Thanx for all! > > For solved this problem just use: > String par=new > String(request.getParameter("text1").getBytes("ISO-8859-1"),"KOI8-R"); > > Regards. > Yury. > > > yuryx wrote: > > > Hi all! > > > > I had the following problem: > > In my cocoon's page I had invalid encoding my non-english characters > > from request. > > > > with example: > > > > simple.xsp > > > > <?xml version="1.0" encoding="KOI8-R"?> > > > > > > <xsp:page language="java" > > xmlns:xsp="http://apache.org/xsp" > > > > > > > <page> > > > > <title>simple</title> > > > > <content> > > <form name="f1" method="get"> > > <xsp:logic> > > String par=request.getParameter("text1"); > > </xsp:logic> > > <h4><xsp:expr>par</xsp:expr></h4> > > <input name="text1" type="text"/> > > <input name="button1" type="submit"/> > > </form> > > </content> > > > > </page> > > </xsp:page> > > > > simple2html.xsl: > > > > <?xml version="1.0"?> > > > > <xsl:stylesheet version="1.0" > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > > xmlns:xsp-request="http://apache.org/xsp/request/2.0"> > > > > <xsl:template match="page"> > > <html> > > <head> > > <title> > > <xsl:value-of select="title"/> > > </title> > > </head> > > <body bgcolor="white" alink="red" link="blue" vlink="blue"> > > <xsl:apply-templates/> > > > > </body> > > </html> > > </xsl:template> > > > > <xsl:template match="@*|node()" > > priority="-2"><xsl:copy><xsl:apply-templates > > select="@*|node()"/></xsl:copy></xsl:template> > > <xsl:template match="text()" priority="-1"><xsl:value-of > > select="."/></xsl:template> > > > > </xsl:stylesheet> > > > > sitemap.xmap section: > > > > <map:match pattern="test/*"> > > <map:generate type="serverpages" src="work/test/{1}.xsp"/> > > <map:transform src="work/test/simple2html.xsl"/> > > <map:serialize type="html"/> > > </map:match> > > > > work result: > > > > <html xmlns:xsp-request="http://apache.org/xsp/request/2.0"> > > <head> > > <meta http-equiv="Content-Type" content="text/html; charset=KOI8-R"> > > <title>simple</title> > > </head> > > <body vlink="blue" link="blue" alink="red" bgcolor="white"> > > > > <title xmlns:xsp="http://apache.org/xsp">simple</title> > > > > <content xmlns:xsp="http://apache.org/xsp"> > > > > <form name="f1" method="get"> > > <h4>×Á×</h4> > > <input name="text1" type="text"> > > <input name="button1" type="submit"> > > > > </form> > > </content> > > > > > > </body> > > </html> > > > > Can anyone help me? > > > > Thanx. > > Yury. > > > > > > > > > > > > --------------------------------------------------------------------- > > Please check that your question has not already been answered in the > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > > For additional commands, e-mail: <[EMAIL PROTECTED]> > > > > > > > --------------------------------------------------------------------- > Please check that your question has not already been answered in the > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> > > To unsubscribe, e-mail: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faqs.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>