RE: RequestParmAction does not work with blanks in form input field ----- Original Message ----- From: Sternath Elmar To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]:8888/BOLServlet/ > {IdType}Service.uploadDocument?Id={Id}&Title={Title}&DocType={DocT ype} > &Language={Language}&Publisher={Publisher}&Description={Descri ption} > &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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>