You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "Mathias P.W Nilsson" <ma...@snyltarna.se> on 2008/06/29 20:45:34 UTC

Exception for MixedParamUrlCodingStrategy

Hi!
I'm using MixedParamUrlCodingStrategy and I must miss something in how this
is set up properly

I have mounted the page in init in my application class
mount(new MixedParamUrlCodingStrategy("brand", BrandInterceptor.class,new
String[]{"id"}));

When building up the bookmarkable page link I do this in my Root page

Brand brand = (Brand) item.getModelObject();
PageParameters params = new PageParameters();
params.add( "id",  brand.getId().toString() );
Link brandLink = new BookmarkablePageLink( "brandLink"
,BrandInterceptor.class, params );

But it always ends with this error. 

[RequestCycle] Too many path parts, please provide sufficient number of path
parameter names
java.lang.IllegalArgumentException: Too many path parts, please provide
sufficient number of path parameter names
	at
org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:178)

Any pointers on how to solve this?
-- 
View this message in context: http://www.nabble.com/Exception-for-MixedParamUrlCodingStrategy-tp18184025p18184025.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Exception for MixedParamUrlCodingStrategy

Posted by Erik van Oosten <e....@grons.nl>.
I've no idea how this could work, or why it doesn't now.
Could you not just include different panels on one page, instead of
forwarding to different pages?

Regards,
    Erik.


Mathias P.W Nilsson schreef:
> https://localhost/hairless-web/brand/71/
>
> this is the generated URL.
>
> The BrandInterceptor send request to ItemList. Maybe this isn't the way to
> do this?
>
> public BrandInterceptor( PageParameters parameters ){
> 		
> 		filters = new LinkedList<ItemFilter>();		
> 		Long brandId = parameters.getLong( "id" );
> 		if ( brandId != null ) { 
> 			Brand brand = getBrandDao().getBrand( brandId );
> 			filters.add( new BrandFilter( brand ));
> 			setResponsePage( new ItemListPage( filters )  );
> 		} else{
> 			
> 			setResponsePage( new Base() );
> 		}
> 	}
>   

-- 

--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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


Re: Exception for MixedParamUrlCodingStrategy

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
I think this is my problem.

I mount items to ItemListPage

I get this Exception

23:29:51,694 INFO  [GZIPFilter] Gzipping and sending content for
https://localhost/hairless-web/items/brand/25/ItemResourceServlet
23:29:51,694 ERROR [RequestCycle] URL fragment has unmatched key/value pair:
brand/25/ItemResourceServlet

The ItemResourceServlet is a servlet the handles request for
/ItemResourceServlet in web-xml. So it thinks that it is 3 parameters!
-- 
View this message in context: http://www.nabble.com/Exception-for-MixedParamUrlCodingStrategy-tp18184025p18185544.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Exception for MixedParamUrlCodingStrategy

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Sorry to fast. This changes the URL again....
-- 
View this message in context: http://www.nabble.com/Exception-for-MixedParamUrlCodingStrategy-tp18184025p18185210.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Exception for MixedParamUrlCodingStrategy

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
I read in some Post from Igor that the best way of doing this should be

throw new RestartResponseAtInterceptPageException(new ItemListPage( filters
) );

This seams to solve the problem
-- 
View this message in context: http://www.nabble.com/Exception-for-MixedParamUrlCodingStrategy-tp18184025p18185193.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Exception for MixedParamUrlCodingStrategy

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
https://localhost/hairless-web/brand/71/

this is the generated URL.

The BrandInterceptor send request to ItemList. Maybe this isn't the way to
do this?

public BrandInterceptor( PageParameters parameters ){
		
		filters = new LinkedList<ItemFilter>();		
		Long brandId = parameters.getLong( "id" );
		if ( brandId != null ) { 
			Brand brand = getBrandDao().getBrand( brandId );
			filters.add( new BrandFilter( brand ));
			setResponsePage( new ItemListPage( filters )  );
		} else{
			
			setResponsePage( new Base() );
		}
	}
-- 
View this message in context: http://www.nabble.com/Exception-for-MixedParamUrlCodingStrategy-tp18184025p18185147.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: Exception for MixedParamUrlCodingStrategy

Posted by Erik van Oosten <e....@grons.nl>.
Hello Mathias,

Well, that looks quite alright to me.
Could you post the generated URL? Do you have more mounts to the same 
page class?

Regards,
     Erik.


Mathias P.W Nilsson wrote:
> Hi!
> I'm using MixedParamUrlCodingStrategy and I must miss something in how this
> is set up properly
>
> I have mounted the page in init in my application class
> mount(new MixedParamUrlCodingStrategy("brand", BrandInterceptor.class,new
> String[]{"id"}));
>
> When building up the bookmarkable page link I do this in my Root page
>
> Brand brand = (Brand) item.getModelObject();
> PageParameters params = new PageParameters();
> params.add( "id",  brand.getId().toString() );
> Link brandLink = new BookmarkablePageLink( "brandLink"
> ,BrandInterceptor.class, params );
>
> But it always ends with this error. 
>
> [RequestCycle] Too many path parts, please provide sufficient number of path
> parameter names
> java.lang.IllegalArgumentException: Too many path parts, please provide
> sufficient number of path parameter names
> 	at
> org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy.decodeParameters(MixedParamUrlCodingStrategy.java:178)
>
> Any pointers on how to solve this?
>   



--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/

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