Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
Hi, I have a problem with designing authentication and session properly. I asked for help some time ago, but I was not able to fix the problem. I have a standard situation - I have an app that has bunch of pages and only main page with login form should be accessible for everyone. Everything else

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
But would it be possible to store User data in the session without having to fetch it from datastore on every request? My users don't interact with each other and they operate only on their own data. So it'd be most efficient to store User data in the session and interact with db only when some dat

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
So it's normal that I lose User data when I move from login to main page and I will have to fetch it from db quite often. When will it happen? I have users browsing around my app, doing most often nothing. Plenty of labels with gets. Will browsing like that trigger fetching user data from db? Or w

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
Marco: And it works without problems? There is no issue with user trying to log from 2 browser on same time, trying to cheat the system? I am just wondering if there is any risk of that. How does your code look then in session and how do you fetch your data? Martin: I was trying to save on cos

Re: Authentication and sessions - the right way?

2011-10-03 Thread Zeldor
I'd say it's mostly a cache. >From estimates I can say that 80-90% of the time data will be read-only. Only remaining 10-20% will be data manipulation. My current implementation is that I use setters on data in Session and then persist whole User. Like that: MySession.get().getUser().setFree_la

PropertyModel not refreshing

2011-10-06 Thread Zeldor
Hi, I have a form with labels that use PropertyModel. They work fine when I test them locally - when I click on submit button I get proper refreshed values in labels. But when I deploy my app it does not work, I still get old values. Where can be the problem? I am using Wicket 1.4.17 and deploying

Re: PropertyModel not refreshing

2011-10-06 Thread Zeldor
Why would there be a difference between local and deployed versions? And won't it negatively affect performance? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-refreshing-tp3877389p3877621.html Sent from the Users forum mailing list archive at Nabbl

Re: PropertyModel not refreshing

2011-10-06 Thread Zeldor
Thanks, I will give it a try :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/PropertyModel-not-refreshing-tp3877389p3877636.html Sent from the Users forum mailing list archive at Nabble.com. - To u

checkGroup - 2 out of 5?

2010-09-05 Thread Zeldor
Hi, I want to limit users to check exactly 2 options out of X. How can I do that? I'd also like it to switch last chosen one to new one, if user has already picked 2 [so it'd deselect last one and choose another, instead of not doing anything at all]. -- View this message in context: http://ap

Re: checkGroup - 2 out of 5?

2010-09-05 Thread Zeldor
Oh, I hoped that it can be avoided. So anyone has AJAX example at hand? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/checkGroup-2-out-of-5-tp2527723p2527763.html Sent from the Wicket - User mailing list archive at Nabble.com. -

Best practice for DropDownChoice?

2010-10-01 Thread Zeldor
Hi, I was looking at many threads here about that matter and even more google links, after not really being able to properly use examples from Wicket in Action and few others. So I wonder - what's the best and most common way to implement DropDownChoice and map the value at the same time [well, o

RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
Hi, I am trying to get through with the very basics of Wicket - radiochoice. But somehow I got stuck and all solutions I tried made my problems even worse... So, what am I doing wrong? I have this code: static final List NUMBERS = Arrays.asList(new String[] { "1", "2", "3" }); private RadioCho

Re: RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
help you without seeing more code and stack > > -igor > > On Thu, Oct 7, 2010 at 2:28 PM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=2967607&i=0>> > wrote: > > > > > Hi, > > > > I am trying to get through with

Re: RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
186 is System.out.println(_numbers); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/RadioChoice-what-s-wrong-tp2967576p2967903.html Sent from the Users forum mailing list archive at Nabble.com. - To

Re: RadioChoice - what's wrong?

2010-10-07 Thread Zeldor
your System or your System.out is null :) > > -igor > > On Thu, Oct 7, 2010 at 11:35 PM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=2967914&i=0>> > wrote: > > > > > 186 is System.out.println(_numbers); > > --

Re: RadioChoice - what's wrong?

2010-10-08 Thread Zeldor
ail: [hidden email]<http://user/SendEmail.jtp?type=node&node=2968370&i=0> > > > > On Thu, Oct 7, 2010 at 11:35 PM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=2968370&i=1>> > wrote: > > > > > 186 is System.out.pr

Re: RadioChoice - what's wrong?

2010-10-10 Thread Zeldor
So maybe someone could just show me working RadioChoice code with OnSubmit part? Just how to properly display it and grab data from it :) That should solve the problem, as I would compare and see what I'm doing wrong. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Ra

Re: RadioChoice - what's wrong?

2010-10-10 Thread Zeldor
561-152...@n4.nabble.com > wrote: > Hello Zeldor, > > I've red your code and it seems that you define variable rc two times: > the first time as form private field and the second time just below > between braces. When onSubmit method calls rc.getModelObject() it uses > p

MinimumValidator and Long problem

2010-10-12 Thread Zeldor
I have TextField that should take Long value, but on submit it does not really work... org.apache.wicket.RequestCycle logRuntimeException: Exception 'java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Long' occurred during validation org.apache.wicket.validation.validato

Re: MinimumValidator and Long problem

2010-10-12 Thread Zeldor
), you need to call setType(Long.class) on your > text > field. > > On Tue, Oct 12, 2010 at 1:23 PM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=2992772&i=0>> > wrote: > > > > > I have

Re: MinimumValidator and Long problem

2010-10-12 Thread Zeldor
I have nothing else really, just same more of same stuff, only a Form with Labels, TextFields and submit method. Anyway, deprecated NumberValidator.minimum(0) method works without any problems, are there any disadvantages of using that? On Wed, Oct 13, 2010 at 12:43 AM, jer...@wickettraining.com

ArrayList, Label and Model

2010-10-22 Thread Zeldor
Hi, I am trying to make an ArrayList, populate it and then display them [and do other stuff later, but I did not get so far]. It does not work though, so what I am missing? My code looks like that: ... ArrayList house_cost = new ArrayList(5); ... [adding some data here] [form]

Re: ArrayList, Label and Model

2010-10-22 Thread Zeldor
] < ml-node+3007899-704217102-152...@n4.nabble.com > wrote: > Hi, > > according to the API PropertyModel(this, "house_cost.4") should work: > > > http://wicket.apache.org/apidocs/1.4/org/apache/wicket/util/lang/PropertyResolver.html > > Sven > > Am

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
hat... On Sat, Oct 23, 2010 at 7:08 AM, Ernesto Reinaldo Barreiro-4 [via Apache Wicket] > wrote: > Can you try PropertyModel(this, "house_cost[4]")? > > Ernesto > > On Fri, Oct 22, 2010 at 10:39 PM, Zeldor <[hidden > email]<http://user/SendEmail.jt

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
blems with "house_cost". > > What is "this" in your example? Is "house_cost" a member variable of > your "this"? > > Sven > > On 10/23/2010 11:35 AM, Zeldor wrote: > > > Nope, still same error: > > > > org.apache.wi

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
ff using a > ListView for your situation if you're trying to show all the items in > the list. > > On Sat, Oct 23, 2010 at 10:59 AM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=3008486&i=0>> > wrote: > > > > > Ha! Goo

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
can do with a table. > > On Sat, Oct 23, 2010 at 11:09 AM, Zeldor <[hidden > email]<http://user/SendEmail.jtp?type=node&node=3008524&i=0>> > wrote: > > > > > It's a table with lots of data to display, with a mixture of plain text, > >

Re: ArrayList, Label and Model

2010-10-23 Thread Zeldor
one > > "set" of those labels and put it inside the populateItem() method. If > > you want headers, sorting, etc., then you might want to "upgrade" to a > > DefaultDataTable (or its ajax-based subclass). > > > > On Sat, Oct 23, 2010 at 11:51 AM, Z

DataView the easy way?

2011-06-06 Thread Zeldor
Hi, I am trying to make my first DataView and I found an example that does what I want. It's quite confusing though - it takes like 15 pages and classes to do it and I cannot decipher it. http://wicketstuff.org/wicket14/repeater/?wicket:bookmarkablePage=:org.apache.wicket.examples.repeater.Simple

Links blocked when I enter page

2011-06-06 Thread Zeldor
Hi, I have rather weird problem. I have a page with navigation panel [mostly bookmarkable links]. It works fine on all but one. On that one page when I enter it, some of my navigation links get blocked - 2 out of 5. Any idea what may be causing it? They turn fine when I click on submit button on t

Re: Links blocked when I enter page

2011-06-07 Thread Zeldor
Well, they don't do it in my case. Maybe because they are in panel... Anyway, I wouldn't have problem with that. It's that 2 other links are blocked, those that lead to other pages. I don't have problem like that on other pages and only thing here that is different is that additional submit button

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Right :) So I want to start with something like: add(new DataView("expedition", MySession.loggedInUser.colonisations) { }); I am confused how to implement populateItem though... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataView-the-easy-way-tp3578760

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Do I need to do anything special? Will it automatically go through all rows of my Map? When my map is HashMap then Expedition will be my ArrayList or whole row, together with int id? I could probably use just a list of ArrayLists if it'd be easier... -- View this message in cont

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Ok, I changed it to ArrayList>, but I still don't get how to use populateItem... Even testing just that add(new DataView("expedition", MySession.loggedInUser.colonisations) { }); Results in: internal error; cannot instantiate org. apache.wicket.markup

Re: Links blocked when I enter page

2011-06-07 Thread Zeldor
Nope, panel is separate. There should be no connection... I will rather paste some code, maybe it will give a hint... add(new FeedbackPanel("errorMsg")); // starting form private boolean col_approval = false; Button calculateColCo

Re: DataView the easy way?

2011-06-07 Thread Zeldor
I almost have it... I have my ArrayList of lists, so I guess my code should look smth like that: ArrayList> colonisations = MySession.loggedInUser.colonisations; add(new DataView("expeditionsView", new ListDataProvider(colonisations)) { @Over

Re: DataView the easy way?

2011-06-07 Thread Zeldor
Thanks a lot, it works :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DataView-the-easy-way-tp3578760p3579384.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e

Rounding values for display

2011-06-09 Thread Zeldor
Hi, I have labels showing data that is in Double format, but I don't need so much precision in UI. Can I easily make my page round those values [down] and display just numbers without fraction? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Rounding-values-for-displa

Major session problem [GAE]

2011-06-09 Thread Zeldor
Hi, I have really serious problems with my sessions - or rather getting and displaying data with it. It works great when tested locally, but when deployed to GAE it acts weird. In bad way. I have no idea if it's wicket or GAE issue, but maybe I can get some hints here. Problem is that: - it quite

Re: Rounding values for display

2011-06-09 Thread Zeldor
So I can use one converter in Application for all my Labels? That would be great :) P.S. I am really amazed how fast you can get responses here. It's hard not to love Wicket. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Rounding-values-for-display-tp3584858p3584914

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
Yeah, no idea why Static is there, must be some leftover from early code. It's good to have someone else take a look at your code and point the obvious :) I will check if it solves my problems. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Major-session-problem-GAE-t

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
norckon: Getting whole entity is good in my case. User can modify only his data and no one else can even access or see it. It speeds up things too. Anyway, how do you invoke the rest? Without static you of course get "non-static method cannot be referenced from a static context" compilation erro

Re: Major session problem [GAE]

2011-06-09 Thread Zeldor
So... MySession.get().getUser().getLand() to properly get a value from session? Looks like it could have some performance issues, or does it just look so scary? :) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Major-session-problem-GAE-tp3584894p3585657.html Sent

Users, sessions, data...

2011-06-14 Thread Zeldor
Hi, My last attempts to fix my session and advices here made me thinking if my approach is good. So I'm curious - how do you handle users and their data? In my case I have session, when user logs in entire entity gets loaded into session. Later I get user data from that session and when he changes

Re: Users, sessions, data...

2011-06-15 Thread Zeldor
But what are benefits of small session really? With entire user in session I can skip getting data from db and serve data faster... -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Users-sessions-data-tp3598626p3598945.html Sent from the Users forum mailing list archive

Re: Users, sessions, data...

2011-06-15 Thread Zeldor
Well, I'm hosting it on GAE and with new pricing model I have to worry about instances, not memcache or things like that. And I don't have to do load balancing. To be sure that data does not get lost between instances [which could happen probably with big traffic and longer inactivity from user] I

Re: Users, sessions, data...

2011-06-16 Thread Zeldor
Well, my app is a game which you could call Excel, but in fantasy settings :) Modifying lots of tables and simple calculations, lots of them. Some people call that building, attacking, spellcasting... I have most of stuff atm in User entity, over 100 variables, some of them ArrayLists and HashMaps

Guice and Wicket: using SessionScoped injections

2013-10-30 Thread Zeldor
I have a working Wicket [v6] application with Guice [v3] - I have used dependency injection for repository operations right now and I want to expend it into using services that are session scoped (one per user's session). I have read through official documentation, various blog posts and questions