Re: Session serialization and clustering

2014-05-22 Thread Martin Grigorov
Hi,

There is nothing to configure in Wicket.
All you need is to make sure that your Wicket Session is bound (see
Session#bind() method). This will create a Http Session and save Wicket's
Session as attribute in it.

Usually it is recommended to use normal member variable in Wicket Session
instead of using Session#setAttribute() because the latter works with
java.lang.Object. But if you use private Long userId; then you need to call
Session#dirty(true) when you change its value.

Martin Grigorov
Wicket Training and Consulting


On Fri, May 23, 2014 at 4:29 AM, Niranjan Rao  wrote:

> Greetings,
>
> On wicket 1.5.10 and tomcat 7.0.39 as server.
>
> Right now my goal is to maintain the authenticated session when web
> application is reloaded for some reason as long as session expired. In
> other words, if we refresh the application, logged in users should not have
> to login again.
>
> I was reading up on this and it looks like same problem applies to
> clustering as session state needs to be serialized across multiple nodes.
> So far, I could not find a definitive way how to configure wicket. My
> search skills must be going south as I am sure this is a common problem for
> production systems.
>
> I have changed tomcat configuration so that it can persist the session
> information. For my application purposes we just have userid as a session
> variable. User id is set using setAttribute call when user signs in to the
> application. For practical purposes, all pages are stateless as majority of
> the "pages" are actually ajax service calls. The containers that makes
> these calls don't change much. So not too much worried about wicket data
> serialization.
>
> When tomcat serializes data, these values are not getting serialized, so
> when application is refreshed/redeployed, user is forced to login again.
> Interestingly enough, when tomcat is restarted, it works correctly. When I
> just copy new war file or ask tomcat manager to reload, it does not work.
>
> I tried adding writeObject method in my session class. Log statements in
> this method indicate that getAttribute call returns null.
>
> Can you please help me to solve this problem or point my nose in right
> direction/documentation.
>
> Regards,
>
> Niranjan
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Jetty 9 Websocket

2014-05-22 Thread Martin Grigorov
Hi,

Jetty 9.1 implements JSR356 and the recommended way is to use
wicket-native-websocket-javax module.

On May 23, 2014 4:38 AM, "Jan Moxter"  wrote:
>
> Hallo,
>
>
> right now if you download a jetty server in the version 9 you get the
stable version 9.1.5.v20140505. The API for the websocket implementation
did change between 9.0 and 9.1. so that the wicket-native-websocket-jetty9
module does not work any more.
>
>
> - are you planning to update the module to work with jetty 9.1 or do you
propose a new module wicket-native-websocket-jetty9.1?
> - do you have this on your roadmap?
>
>
> For my own application I already generated my own "
wicket-native-websocket-jetty9.1" I could provide the code if wanted
>
>
>
>
> Thanks
>
>
> Jan
>
>


Jetty 9 Websocket

2014-05-22 Thread Jan Moxter
Hallo, 


right now if you download a jetty server in the version 9 you get the stable 
version 9.1.5.v20140505. The API for the websocket implementation did change 
between 9.0 and 9.1. so that the wicket-native-websocket-jetty9 module does not 
work any more. 


- are you planning to update the module to work with jetty 9.1 or do you 
propose a new module wicket-native-websocket-jetty9.1? 
- do you have this on your roadmap? 


For my own application I already generated my own " 
wicket-native-websocket-jetty9.1" I could provide the code if wanted 




Thanks 


Jan 




Session serialization and clustering

2014-05-22 Thread Niranjan Rao

Greetings,

On wicket 1.5.10 and tomcat 7.0.39 as server.

Right now my goal is to maintain the authenticated session when web 
application is reloaded for some reason as long as session expired. In 
other words, if we refresh the application, logged in users should not 
have to login again.


I was reading up on this and it looks like same problem applies to 
clustering as session state needs to be serialized across multiple 
nodes. So far, I could not find a definitive way how to configure 
wicket. My search skills must be going south as I am sure this is a 
common problem for production systems.


I have changed tomcat configuration so that it can persist the session 
information. For my application purposes we just have userid as a 
session variable. User id is set using setAttribute call when user signs 
in to the application. For practical purposes, all pages are stateless 
as majority of the "pages" are actually ajax service calls. The 
containers that makes these calls don't change much. So not too much 
worried about wicket data serialization.


When tomcat serializes data, these values are not getting serialized, so 
when application is refreshed/redeployed, user is forced to login again. 
Interestingly enough, when tomcat is restarted, it works correctly. When 
I just copy new war file or ask tomcat manager to reload, it does not work.


I tried adding writeObject method in my session class. Log statements in 
this method indicate that getAttribute call returns null.


Can you please help me to solve this problem or point my nose in right 
direction/documentation.


Regards,

Niranjan

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



Re: PageParameters refresh on page reload

2014-05-22 Thread Edgar Merino
Thanks for the response Martin, good to know this is fixed in v7 (and 
the workaround for v6).



On 21/05/14 14:08, Martin Grigorov wrote:

Hi,

This is fixed in Wicket 7.x. We didn't apply the fix to 6.x because it is a
behavior change.
You can read the current parameters in #onConfigure() with
getRequestCycle().getRequest().getRequestParameters() and override with
them the page's parameters (page.getPageParameters())

Martin Grigorov
Wicket Training and Consulting


On Wed, May 21, 2014 at 9:41 PM, Edgar Merino  wrote:


Hello, I've got a problem that I've just noticed today: When an instance
of a WebPage is created with some url parameters, the PageParameters object
is never updated, that is, if I refresh the same webpage with different url
parameters this won't be taken into account, instead the first params used
to create the WebPage are used. Is there a way to have url parameters
updated on each page request?

Thanks in advance.

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





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



Re: Question / Best Practise / (List)Model vs. (List)DataProvider

2014-05-22 Thread Patrick Davids
Hi Colin,
and thanx to all responders...

Ok, I think I got it... somehow... ;-)

Got a new question then...
A RefreshingView, due to its method getItemModels(), also acts as a 
'Model Factory' for me... hmm...

Ähm, so, does anyone ever created a RefreshingView with a default model?
new RefreshingView("id", any_other_model_than_a_car?){
protected Iterator>getItemModels(){

}
}

Maybe, my first question relates to that.
But I am not sure... the RefreshingView is still a bit confusing to me...

Patrick


Am 19.05.2014 06:51, schrieb Colin Rogers:
> The way I see (right or wrong!) is,
>
> You create/manage Models for individual components on a case-by-case basis.
>
> For Repeaters which internal components are dynamically created, you need a 
> DataProvider to create and manage those Models for the components and the 
> Collections that comprise their data.
>
> DataProvider could be described as a 'Model Factory', and is not a Model in 
> itself.
>
> Cheers,
> Col.
>
> -Original Message-
> From: Sven Meier [mailto:s...@meiers.net]
> Sent: Friday, 16 May 2014 6:17 AM
> To: users@wicket.apache.org
> Subject: Re: Question / Best Practise / (List)Model vs. (List)DataProvider
>
> IDataProvider is all about efficiency, it provides efficient access to a 
> subset of the data.
>
> Perhaps we can make it even more efficient with the recent proposal on the 
> @dev list.
>
> Regards
> Sven
>
>
> On 05/08/2014 01:37 PM, Patrick Davids wrote:
>> Hi all,
>>
>> what I often think about, and I cannot really say is; when to use
>> Model or DataProvider as data providing object for components they
>> repeat some thing?
>>
>> Javadoc says, DataProvider are (good) for DataViews.
>> Hmm... ok, and they allow easer iterating (first index, count).
>>
>> I also can achieve this by using a LoadableDetachableModel>
>> combined with a ModelIteratorAdapater.
>>
>> Both have detaching logic... both featuring extension, both have a
>> sort of "load"-method (getObject() vs. getData()).
>>
>> Sometimes I think, they are so similar to each other... where is the
>> key difference?
>>
>> Would be cool if some of yours just reply his "two cents" of daily
>> programming experience... so I can get some new point of views.
>>
>> When do you use DataProvider or Model>?
>> Did you experienced the same, not to exactly know which one you will
>> use for your new page/panel/component?
>> And often think about pro and cons using it with RepeatingViews? And
>> later on, you see... "I could have used both... hmm..."
>>
>> thanx a lot for feedback and kind regards Patrick
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
> EMAIL DISCLAIMER This email message and its attachments are confidential and 
> may also contain copyright or privileged material. If you are not the 
> intended recipient, you may not forward the email or disclose or use the 
> information contained in it. If you have received this email message in 
> error, please advise the sender immediately by replying to this email and 
> delete the message and any associated attachments. Any views, opinions, 
> conclusions, advice or statements expressed in this email message are those 
> of the individual sender and should not be relied upon as the considered 
> view, opinion, conclusions, advice or statement of this company except where 
> the sender expressly, and with authority, states them to be the considered 
> view, opinion, conclusions, advice or statement of this company. Every care 
> is taken but we recommend that you scan any attachments for viruses.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: using Tomcat instead of Jetty in quickstart archetype

2014-05-22 Thread Andrea Del Bene

Try mvn tomcat:run . It should work out of the box.

Hi,

I'm currently using Jetty as the servlet container to do development for my
Wicket web app and I use the Start class and Jetty Maven plugin that comes
with the wicket Quickstart.  I then start Jetty through running
Start#main(String[]) in my IDE (Intellij IDEA 12).

For some reason my sessionid s get reset when browsing to the login page on
localhost in Firefox, and I wanted to try using Tomcat to see if that
behaves differently.

I wondered if anyone has managed to swap Tomcat for Maven and if so how its
done, specifically, what would be the equivalent Start class and plugin xml
for the maven pom.xml.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-Tomcat-instead-of-Jetty-in-quickstart-archetype-tp4665977.html
Sent from the Users forum mailing list archive at Nabble.com.

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




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



using Tomcat instead of Jetty in quickstart archetype

2014-05-22 Thread Simon B
Hi, 

I'm currently using Jetty as the servlet container to do development for my
Wicket web app and I use the Start class and Jetty Maven plugin that comes
with the wicket Quickstart.  I then start Jetty through running
Start#main(String[]) in my IDE (Intellij IDEA 12).

For some reason my sessionid s get reset when browsing to the login page on
localhost in Firefox, and I wanted to try using Tomcat to see if that
behaves differently.

I wondered if anyone has managed to swap Tomcat for Maven and if so how its
done, specifically, what would be the equivalent Start class and plugin xml
for the maven pom.xml.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/using-Tomcat-instead-of-Jetty-in-quickstart-archetype-tp4665977.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How can I display modal dialog only if validation is sucessful?

2014-05-22 Thread Francois Meillet
Hi Bruce,

This is just one solution :
Have a look at http://pastebin.com/03DF5pcw


François Meillet
Formation Wicket - Développement Wicket





Le 21 mai 2014 à 16:15, Bruce Lombardi  a écrit :

> Hi,
> 
> 
> 
> I have a form with several question that a user must answer. If the answers
> are correct, an email is sent to the user and the user is returned to the
> login page. That's a bit abrupt for the user and I  would like to provide a
> simple modal dialog that confirms that the email is sent before sending them
> to the home page. However, if the answers to the questions are not correct,
> then a feedback panel must be displayed.
> 
> 
> 
> I've looked at the approaches to providing a confirmation panel in this link
> https://cwiki.apache.org/confluence/display/WICKET/Getting+user+confirmation
> and other places, but I am having a problem with the approach. The
> JavaScript seems to run as soon as the button is clicked - before onSubmit
> or onValidate runs on the server. So I can't stop the pop-up from showing
> if the questions were not answered correctly.
> 
> 
> 
> Does anyone know a way I can display the modal dialog only after validation
> has run?
> 
> 
> 
> Thanks,
> 
> 
> 
> Bruce
> 
> 
>