You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "f.nemeth" <f....@freemail.hu> on 2012/08/29 17:33:16 UTC

Re: [T5.1] Input string is not valid; the character at position X is not valid

I changed Steve's solution to replace the space character with Tapestry
default $0020. The following link with %20 (=space) works now:
http://localhost/b2c/productcatalog/article/detail/F/1K0061500P%20041/0

My code is:
  	@Match("ContextPathEncoder")
  	public static void adviseExceptionHandler(MethodAdviceReceiver receiver)
throws SecurityException, NoSuchMethodException {
  	    MethodAdvice advice = new MethodAdvice() {
  	        public void advise(Invocation invocation) {
  	            try {
                   String param = (String) invocation.getParameter(0);
                    if(param != null) {
                        param = param.replace(" ", "$0020");
                        invocation.override(0, param);
                    }
  	                invocation.proceed();
  	            } catch (IllegalArgumentException e) {
  	            }
  	        }
  	    };
  	    Method method = ContextPathEncoder.class.getMethod("decodePath",
String.class);
  	    receiver.adviseMethod(method, advice);
  	}




--
View this message in context: http://tapestry.1045711.n5.nabble.com/T5-1-Input-string-is-not-valid-the-character-at-position-X-is-not-valid-tp2436757p5715887.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

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