cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Lorenz" <jens.lor...@interface-projects.de>
Subject Re: RequestParmAction does not work with blanks in form input fie ld
Date Tue, 11 Jun 2002 13:48:58 GMT
RE: RequestParmAction does not work with blanks in form input field
----- Original Message -----
From: Sternath Elmar
To: 'cocoon-users@xml.apache.org'
Sent: Tuesday, June 11, 2002 3:27 PM
Subject: AW: RequestParmAction does not work with blanks in form input fie
ld


... Ooops. Pressed <enter> to quickly ...

> You're right, the exception does not have to do anything with the
blanks. What I
> want to do is the following: I try to get request params using
RequestParmAction.
> Then I add these request parms to a http get request string in my
sitemap:
> <map:part
src="http://scw_de:scw_xx@mhha7txc.mchh.siemens.de:8888/BOLServlet/
>
{IdType}Service.uploadDocument?Id={Id}&amp;Title={Title}&amp;DocType={DocT
ype}
>
&amp;Language={Language}&amp;Publisher={Publisher}&amp;Description={Descri
ption}
> &amp;SalesChannel={../1}"/

> Unfortunately, as soon as the request params contain characters which
must be
> escaped (like blanks) this http get request fails. I already tried to
use
> requestQuery instead of single params, but this does not work for
browser http post
> which I need
> because of doing file upload. Any ideas how to solve this problem?
>
> Thanks,
> Elmar

For these cases I have this Action (which is IMHO missing in Cocoon) ...


public class EncodeParameterAction extends AbstractAction implements
ThreadSafe
{
 public Map act( Redirector redirector, SourceResolver resolver, Map
objectModel, String src,
   Parameters parameters ) throws Exception
 {
  Logger logger = getLogger();

  String value = parameters.getParameter( "value" );
  String destkey = parameters.getParameter( "destkey" );

  Map resultMap = new HashMap();

  String encodedValue = URLEncoder.encode( value );
  resultMap.put( destkey, encodedValue );

  return resultMap;
 }
}


Regards,


Jens

--

jens.lorenz at interface-projects dot de

interface:projects GmbH                             \\|//
Tolkewitzer Strasse 49                              (o o)
01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
Germany


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message