Hi Igor, I tried your suggestion and it works but looks like a
workaround more than a solution.
I have many pages that need some configuration. This is server side
configuration, for example how often a page should refresh itself.
I tryed to pass in these parameters as PageParameters but in this way
I have to convert this from String to Integer to use it and in every
call to the page I have to provide these parameters. At the same time
I do not have an easy place to put this page configuration params. I
think I can define a PageParameters bean for each page inside spring
but looks like a bad hack and this won't solve all the problems.
I expect page configuration to be a very common problem so I think
there should be a simple/standard approach for this or just some best
practices about this.
Thanks, bye
Lorenzo
2008/8/6 Igor Vaynberg <[EMAIL PROTECTED]>:
> well normally you would just do
>
> class monitorpage extends webpage {
> public monitorpage(string deviceid) {
> .. do whatever with deviceid
> }
> }
>
> if you need your pages to be bookmarkable then just use
>
> class monitorpage extends webpage {
> public monitorpage(pageparameters params) {
> string deviceid=params.get("0");
> }
> }
>
> and mount the page with mount("/device",new
> indexedurlcodingstrategy(monitorpage.class));
> then the urls are /device/deviceid
>
> -igor
>
> On Wed, Aug 6, 2008 at 10:48 AM, Lorenzo Bolzani <[EMAIL PROTECTED]> wrote:
>> Hi all, I have a page to monitor the status of a remote device.
>> The page just stay there and refresh automatically to display the actual
>> state.
>>
>> The problem is that I need to have to distinct pages to monitor two
>> distinct devices.
>>
>> My ideal approach would be to define two pages in spring, something like this
>>
>> <bean class="DeviceMonitorPage" name="monitor1">
>> <property name="device" ref="device1"/>
>> <property name="mountUrl" value="deviceMonitor1"/>
>> </bean>
>>
>> <bean class="DeviceMonitorPage" name="monitor2">
>> <property name="device" ref="device2"/>
>> <property name="mountUrl" value="deviceMonitor2"/>
>> </bean>
>>
>> but I know that Wicket is not going to look for this pages in my
>> spring-config file.
>>
>> In other words I need two instances of the same page configured in two
>> different ways.
>> Is this possibile? How can I pass in the parameters (with or without
>> spring)? I found nothing about this in the docs.
>> In this way I could pass in the ref name (device1 or device2) and make
>> it work with an explicit spring context lookup (no injection).
>>
>> The @SpringBean annotation works but in this specific case it is not
>> usable because of the two different parameters.
>>
>> Thanks for any suggestions.
>>
>>
>> Bye
>>
>> Lorenzo
>>
>> ---------------------------------------------------------------------
>> 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]
>
>
--
It has to start somewhere, It has to start sometime.
What better place than here, what better time than now?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]