Thanks for that. Unfortunately it looks like the IPageFactory is already
provided with a PageProperties object. I might have to go back a level
and see what is invoking the IPageFactory as that is likely to be where
PageProperties is created.

I can't really do 'pre processing' of the data because I don't know what
the types of each parameter across the application is at that point.

What I'm aiming to try and do is override the 'getLong' method so that I
can trim off any 'jsession junk' that some search engines append to the
parameters when they store links to the website. They cause havoc at a
later date, especially the ones that encode the ';'. The url sent to the
app is then:

/a/34/b/23;jessionid=blah

When I call pageParameters.getLong("b", -1) it tries to interpret 

23;jessionid=blah

As the integer value of parameter "b" - which has obvious consequences.

I thought I could override getLong in my own PageParameters class and
trim off any trailing non digit characters before doing the conversion.

> -----Original Message-----
> From: Mauro Ciancio [mailto:[email protected]]
> Sent: Tuesday, 30 March 2010 12:33 PM
> To: [email protected]
> Subject: Re: Customizable PageParameters class?
> 
> Chris:
> 
> On Mon, Mar 29, 2010 at 10:22 PM, Chris Colman
> <[email protected]> wrote:
> > I wanted to add some error processing to some of the parameters I
> > receive and the processing is 'generic' for any integer types.
> >
> > The easiest way to do this would be in a derivative of the
> > PageParameters class. Given that wicket has lots of plug ins
facilities
> > and customizing options I was wondering if it's possible to specify
a
> > PageParameters factory to provide objects that wicket should use
when
> > processing a request.
> >
> > Does such a beasty exist?
> 
> You can intercept the page creation and parse the page parameters
> and validate it if needed. Take a look at:
> 
> Application#getSessionSettings()
> ISessionSettings#setPageFactory()
> IPageFactory interface.
> 
> HTH.
> Cheers.
> --
> Mauro Ciancio <maurociancio at gmail dot com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to