Wicket and Jetty Persistent Sessions not playing together

2008-12-05 Thread Joel Halbert
Hi,

Has anyone had issues when using wicket with Jetty and persistent
sessions?

Specifically when the server is restarted sessions are intialised before
servlets are ready, this causes an exception when wicket deserialises
the current page which was in session since the WicketApplication is
not yet ready since the Wicket Filter has not yet been loaded by the
server.

Thanks
Joel



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using annotation @AuthorizeInstantiation

2008-12-05 Thread Adriano dos Santos Fernandes

Bruno Borges escreveu:
Note that this is really type-safe, and these classes will never be 
instantiated.
I don't think this has any value in this context. Where will the roles x 
user will be? On the database, certainly...


So why declare dummy classes for them? If yon don't want to repeat 
strings, you could create static final constants somewhere...



Adriano


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IChainingModel

2008-12-05 Thread jWeekend

Jeremy,

People will find your blog entry useful, but this issue is a bit more
specific.

AbstractPropertyModel _should_ implement IChainingModel, that's how you know
it _should_ dig values out model objects which r themselves models.

Now try this:

public class TestPropertyModelsChainingImpl extends WebPage {
Point p = new Point(3,4);
Model m = new Model(p);
class Wrapper{Wrapper(Point p){this.object = p;}Point object;}
Wrapper w = new Wrapper(p);
public TestPropertyModelsChainingImpl() {
add(new Label(x, new PropertyModel(this, m.object.x)));
add(new Label(y, new PropertyModel(this, w.object.y)));
}
}

htmlbody,/body/html

That prints out 3,4 as expected. But my property expression has had to dig
into the nested model to get the object I'm after. What if my backing object
were more deeply nested?
In my opinion the firs line in the constructor should not need to worry
about the level of nestedness
but  add(new Label(x, new PropertyModel(this, x))); will not work with
the current implementation.

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 





Jeremy Thomerson-5 wrote:
 
 John, Cemal - that method in AbstractPropertyModel absolutely does abide
 by
 the contract - look at what it calls (getTarget()):
 
 public final Object getTarget()
 {
 Object object = target;
 while (object instanceof IModel)
 {
 Object tmp = ((IModel?)object).getObject();
 if (tmp == object)
 break;
 object = tmp;
 }
 return object;
 }
 John - I think you're right - it is unnecessary to implement
 IChainingModel
 since there is no code in the wicket core codebase that calls it's
 methods.
 Just make sure that if you nest models inside of other custom models, you
 do
 call detach properly or you can end up with a memory leak.  You can see
 this
 blog post as a simple example:
 http://www.jeremythomerson.com/blog/2008/11/06/wicket-the-power-of-nested-models/
 
 Hope this helps.
 
 -- 
 Jeremy Thomerson
 http://www.wickettraining.com
 
 
 On Thu, Dec 4, 2008 at 9:31 AM, jWeekend
 [EMAIL PROTECTED]wrote:
 

 John,

 Well spotted. AbstractPropertyModel implements IChainingModel but breaks
 its
 contract :
  * Models that implement this interface will support chaining of IModels.
 getObject() of a
  * IChainingModel should do something like:
  *
  * pre
  * if ( object instanceof IModel) { return ((IModel)object).getObject()}
  * else return object;
  * /pre

 Its getObject() implementation does not abide by this.
/**
 * @see org.apache.wicket.model.IModel#getObject()
 */
public Object getObject()
{
final String expression = propertyExpression();
if (Strings.isEmpty(expression))
{
// Return a meaningful value for an empty property
 expression
return getTarget();
}

final Object target = getTarget();
if (target != null)
{
return PropertyResolver.getValue(expression,
 target);
}
return null;
}

 Regards - Cemal
 http://www.jWeekend.co.uk http://www.jweekend.co.uk/
 http://jWeekend.co.uk http://jweekend.co.uk/



 John Patterson wrote:
 
  Hi,
 
  I'm messing about with nested models and see the IChainingModel
 interface
  which is implemented by the PropertyModels but its methods never
 actually
  seems to be used.
 
  So I'm just checking that I haven't missed anything... for nested
 models
 I
  don't actually need to implement this right?
 
  This is its def:
 
 
  public interface IChainingModelT extends IModelT
  {
/**
 * Sets the model that is chained inside this model.
 *
 * @param model
 */
public void setChainedModel(IModel ?  model);
 
/**
 * Returns the chained model if there is a chained model.
 *
 * @return The chained model
 */
public IModel ?  getChainedModel();
 
  }
 
  Thanks,
 
  John
 
 
 

 --
 View this message in context:
 http://www.nabble.com/IChainingModel-tp20835085p20835745.html
  Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/IChainingModel-tp20835085p20851816.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: SpringOne America 2008 in Hollywood, FL

2008-12-05 Thread shetc



shetc wrote:
 
 
 A colleague and I will be attending the SpringOne America 2008 next week
 in
 Hollywood, FL.
 Will any fellow Wicketeers be there as well?
 
 Steve
 -- 
 View this message in context:
 http://www.nabble.com/SpringOne-America-2008-in-Hollywood%2C-FL-tp20681833p20681833.html
 Sent from the Wicket - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/SpringOne-America-2008-in-Hollywood%2C-FL-tp20681891p20852371.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with Application getInitParameter()

2008-12-05 Thread Tauren Mills
Maybe I'm going nuts, but I can't figure out what is wrong.  It seems so
simple, but it isn't working.  I call getInitParameter in my application
twice.  One time it returns a value, the other it gets a null.  And the
correct xml is there in web.xml.

First, here is the pertinent application code (I've trimmed out unimportant
stuff):

public class DynamicApplication extends WicketeerBaseApplication {

private MerchantInfo merchantInfo;
private String siteBaseUrl;

public MerchantInfo getMerchantInfo() {
return merchantInfo;
}
public void setMerchantInfo(MerchantInfo merchantInfo) {
this.merchantInfo = merchantInfo;
}
public String getSiteBaseUrl() {
return siteBaseUrl;
}
public void setSiteBaseUrl(String siteBaseUrl) {
this.siteBaseUrl = siteBaseUrl;
}

@Override
protected void init() {
super.init();
this.siteBaseUrl = getInitParameter(site-base-url);
this.merchantInfo =
GoogleOrderService.loadMerchantInfo(getServletContext(),getInitParameter(checkout-config-file));
}
}

Now here are the pertinent parts from web.xml:

!-- Base URL of the website.  Used in linkbacks from google checkout.
--
context-param
param-namesite-base-url/param-name
param-valuehttp://localhost:8080//param-value
/context-param

!-- location of configuration file for google checkout with respect to
context
 root. Using the default path here. --
context-param
param-namecheckout-config-file/param-name
param-value/WEB-INF/checkout-config.xml/param-value
/context-param

So, when the application init() runs, merchantInfo gets properly populated
with the correct MerchantInfo instance based on the contents of
checkout-config.xml.  So the init param name and value were read correctly.

But, then when I try to just get a simple string value for site-base-url, I
get back a null.  I've looked for typos, tried retyping the web.xml section,
swapping the order of getInitParam in init(), restarting... all sorts of
stuff.  It just always gets null.

Any possible thoughts on what might cause this?  Using wicket-1.3.3.
Pulling my hair out.  Maybe its just late and I need to sleep.

Is there a better way to get the server name so I don't even need to hard
code it?  urlFor() only gives back the path, not the server.

Thanks,
Tauren


Re: SpringOne America 2008 in Hollywood, FL

2008-12-05 Thread Nino Saturnino Martinez Vazquez Wael
Hehe cool, I wonder if Martijn ever got around to post the picture he 
took of me, wearing my wicket merchandise. The Cap and T-shirt at his 
presentation :)


shetc wrote:
http://www.nabble.com/file/p20846846/spring.jpg 


Well, here I am at the SpringOne Conference, where the theme is Weapons for
the War on Java Complexity.

I felt like a Wicket partisan as I was surrounded by Spring MVC loyalists.
At meals, I did my best to
convince my fellow diners that they should give Wicket a try, and I think
they were really intrigued
especially as I believe Wicket definitely attacks Java complexity at the
presentation level.
By the way, it turns out that I wasn't the lone Wicketeer as I was spotted
by Peter Thomas (hey Peter!).
  


--
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using annotation @AuthorizeInstantiation

2008-12-05 Thread Casper Bang
Yeah, I asked about this last week or so when running into the same 
problem. I now also do it the class way, and although that does feel 
better than using strings, in my opinion it still isn't type safe. It 
gives no syntax lookup and people are free to write Object.class which 
will compile just fine. Marker interfaces are better for composability, 
however if you are going to make a truly role based system, chances are 
you'll want a  backing roles table and that can get tricky with inheritance.


I'll probably go back to the enum way, which works fine enough IF you 
are ok with having the role definitions mixed with the authorization 
code. It's a small price to pay, I rewrote some of the annotation stuff 
to make it easier to use anyway (AccessableTo, EnabledTo and VisibleTo ) 
which now just takes an array of values which means clean code like this:


@VisibleTo({Administrator.class, User.class})

...rather than:

|@AuthorizeAction(action = Action.RENDER, roles = {Roles.ADMIN, 
Roles.USER})|


Anyway, just my 2 cents on the topic.

/Casper



Jeremy Thomerson wrote:

If you were going to do this, it would be much better (IMHO) to use
interfaces...  This gives you interesting possibilities:

(Disclaimer - the following is not an original thought - Igor mentioned this
last week - give credit where it's due)

interface User

interface Admin extends User

interface ProjectManager extends Admin

interface SalesManager extends Admin

HERE'S THE KICKER:

interface TheBigBoss extends ProjectManager, SalesManager

Since those are just marker interfaces, I guess each of those would need
something like a single public static final implementation like:
public static final TheBigBoss INSTANCE = new TheBigBoss() {};

Something like that - anyway, MULTIPLE INHERITANCE FOR ROLES RULES!


  



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: using annotation @AuthorizeInstantiation

2008-12-05 Thread Bruno Borges

Yes Adriano, that's what I said on my last reply. :-)

 So, the only way, for now, to have type-safety is using that 
Class-thing. I don't vote for this though. A simple class with String 
constants does de job quite well. :-D


Cheers,
Bruno

Adriano dos Santos Fernandes wrote:

Bruno Borges escreveu:
Note that this is really type-safe, and these classes will never be 
instantiated.
I don't think this has any value in this context. Where will the roles 
x user will be? On the database, certainly...


So why declare dummy classes for them? If yon don't want to repeat 
strings, you could create static final constants somewhere...



Adriano


-
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]



Re: IChainingModel

2008-12-05 Thread jWeekend

... In my rush to get out I hit post instead of preview. Now I've come back
and reviewed it here's a completed and *corrected* version, hopefully a bit
clearer and precise. Excuse any confusion caused.

Jeremy,

AbstractPropertyModel _should_ implement IChainingModel; this tells us about
its type and that's how we know it _will_ dig into passed in models
nesting models to get to a buried ModelObject. Whether you think its methods
have been correctly implemented and/or utilised here is another matter.

People will find the blog entry useful, but the issue I was (dubiously)
looking at is a bit more specific to PropertyModel's property expressions.
You and Igor are of course right that the contract is _not_ broken (as in my
initial post) - I was looking at the property expressions specifically. 

public class TestPropertyModelsChainingImpl extends WebPage {
Point p = new Point(3,4);
Model m1 = new Model(p);
Model m2 = new Model(new Model(m1));
class Wrapper implements Serializable{Wrapper(Point p){this.object =
p;}Point object;}
Wrapper w = new Wrapper(p);
public TestPropertyModelsChainingImpl() {
add(new Label(x1, new PropertyModel(this, m1.object.x)));
add(new Label(y1, new PropertyModel(this, w.object.y)));
add(new Label(x2, new PropertyModel(m1, x)));
add(new Label(y2, new PropertyModel(m2, y)));
}
}
htmlbody{,},{,}/body/html
You may need to fix the above html if it doesn't show properly 
{[span wicket:id=x1/],[span wicket:id=y1/]},{[span
wicket:id=x2/],[span wicket:id=y2/]}

That gives {3,4},{3,4} as expected, and the chaining behaviour _is_ correct
when a model is passed in to the PropertyModel. 

Whether  
add(new Label(x, new PropertyModel(this, m2.x))); 
should also just work is in fact another matter.

Hopefully that's more sensible so I don't have to fix it again!

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


jWeekend wrote:
 
 Jeremy,
 
 People will find your blog entry useful, but this issue is a bit more
 specific.
 
 AbstractPropertyModel _should_ implement IChainingModel, that's how you
 know it _should_ dig values out model objects which r themselves models.
 
 Now try this:
 
 public class TestPropertyModelsChainingImpl extends WebPage {
 Point p = new Point(3,4);
 Model m = new Model(p);
 class Wrapper{Wrapper(Point p){this.object = p;}Point object;}
 Wrapper w = new Wrapper(p);
 public TestPropertyModelsChainingImpl() {
 add(new Label(x, new PropertyModel(this, m.object.x)));
 add(new Label(y, new PropertyModel(this, w.object.y)));
 }
 }
 
 htmlbody,/body/html
 
 
 
 
 
 
 
 Jeremy Thomerson-5 wrote:
 
 John, Cemal - that method in AbstractPropertyModel absolutely does abide
 by
 the contract - look at what it calls (getTarget()):
 
 public final Object getTarget()
 {
 Object object = target;
 while (object instanceof IModel)
 {
 Object tmp = ((IModel?)object).getObject();
 if (tmp == object)
 break;
 object = tmp;
 }
 return object;
 }
 John - I think you're right - it is unnecessary to implement
 IChainingModel
 since there is no code in the wicket core codebase that calls it's
 methods.
 Just make sure that if you nest models inside of other custom models, you
 do
 call detach properly or you can end up with a memory leak.  You can see
 this
 blog post as a simple example:
 http://www.jeremythomerson.com/blog/2008/11/06/wicket-the-power-of-nested-models/
 
 Hope this helps.
 
 -- 
 Jeremy Thomerson
 http://www.wickettraining.com
 
 
 On Thu, Dec 4, 2008 at 9:31 AM, jWeekend
 [EMAIL PROTECTED]wrote:
 

 John,

 Well spotted. AbstractPropertyModel implements IChainingModel but breaks
 its
 contract :
  * Models that implement this interface will support chaining of
 IModels.
 getObject() of a
  * IChainingModel should do something like:
  *
  * pre
  * if ( object instanceof IModel) { return ((IModel)object).getObject()}
  * else return object;
  * /pre

 Its getObject() implementation does not abide by this.
/**
 * @see org.apache.wicket.model.IModel#getObject()
 */
public Object getObject()
{
final String expression = propertyExpression();
if (Strings.isEmpty(expression))
{
// Return a meaningful value for an empty
 property
 expression
return getTarget();
}

final Object target = getTarget();
if (target != null)
{
return PropertyResolver.getValue(expression,
 target);
}
return null;
}

 Regards - Cemal
 http://www.jWeekend.co.uk http://www.jweekend.co.uk/
 http://jWeekend.co.uk http://jweekend.co.uk/



 John Patterson wrote:
 
  Hi,
 
  I'm messing about with nested models and see the IChainingModel
 interface
  which is implemented by the 

Re: IChainingModel

2008-12-05 Thread jWeekend

Igor,

You're right. See my corrected reply to Jeremy; I was looking for property
expressions being model-chaining aware.

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


igor.vaynberg wrote:
 
 when you give propertymodel anoter imodel do you have to begin the
 expression with object to get the value out?
 
 -igor
 
 On Thu, Dec 4, 2008 at 7:31 AM, jWeekend [EMAIL PROTECTED]
 wrote:

 John,

 Well spotted. AbstractPropertyModel implements IChainingModel but breaks
 its
 contract :
  * Models that implement this interface will support chaining of IModels.
 getObject() of a
  * IChainingModel should do something like:
  *
  * pre
  * if ( object instanceof IModel) { return ((IModel)object).getObject()}
  * else return object;
  * /pre

 Its getObject() implementation does not abide by this.
/**
 * @see org.apache.wicket.model.IModel#getObject()
 */
public Object getObject()
{
final String expression = propertyExpression();
if (Strings.isEmpty(expression))
{
// Return a meaningful value for an empty property
 expression
return getTarget();
}

final Object target = getTarget();
if (target != null)
{
return PropertyResolver.getValue(expression,
 target);
}
return null;
}

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk



 John Patterson wrote:

 Hi,

 I'm messing about with nested models and see the IChainingModel
 interface
 which is implemented by the PropertyModels but its methods never
 actually
 seems to be used.

 So I'm just checking that I haven't missed anything... for nested models
 I
 don't actually need to implement this right?

 This is its def:


 public interface IChainingModelT extends IModelT
 {
   /**
* Sets the model that is chained inside this model.
*
* @param model
*/
   public void setChainedModel(IModel ?  model);

   /**
* Returns the chained model if there is a chained model.
*
* @return The chained model
*/
   public IModel ?  getChainedModel();

 }

 Thanks,

 John




 --
 View this message in context:
 http://www.nabble.com/IChainingModel-tp20835085p20835745.html
 Sent from the Wicket - User mailing list archive at Nabble.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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/IChainingModel-tp20835085p20853320.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Hourglass during Ajax

2008-12-05 Thread Anton Veretennikov
Hello Wicket users,

I would like to know how to show some hourglass in a Wicket way
during Ajax so user will not click something else.
How to do this?

Thank you

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hourglass during Ajax

2008-12-05 Thread Cristi Manole
take a look on viel in wicketstuff, if it's still available. i used it, it's
nice and easy.

On Fri, Dec 5, 2008 at 10:04 AM, Anton Veretennikov 
[EMAIL PROTECTED] wrote:

 Hello Wicket users,

 I would like to know how to show some hourglass in a Wicket way
 during Ajax so user will not click something else.
 How to do this?

 Thank you

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Hourglass during Ajax

2008-12-05 Thread jWeekend

Anton,

See IndicatingAjaxLink (and other, similarly named components) and
IndicatingAjaxButton.

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 


Anton Veretennikov wrote:
 
 Hello Wicket users,
 
 I would like to know how to show some hourglass in a Wicket way
 during Ajax so user will not click something else.
 How to do this?
 
 Thank you
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hourglass during Ajax

2008-12-05 Thread Cristi Manole
[but if you need to _make sure_ the user doesn't click anything while the
request is processing use the viel]

On Fri, Dec 5, 2008 at 10:27 AM, jWeekend [EMAIL PROTECTED]wrote:


 Anton,

 See IndicatingAjaxLink (and other, similarly named components) and
 IndicatingAjaxButton.

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk


 Anton Veretennikov wrote:
 
  Hello Wicket users,
 
  I would like to know how to show some hourglass in a Wicket way
  during Ajax so user will not click something else.
  How to do this?
 
  Thank you
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: @SpringBean with page creation patterns

2008-12-05 Thread jWeekend

I assume the getCheese method in your code below is declared public static to
keep the example simple and to the point; you wouldn't normally expect to
get your cheeses from a Page class.
If you're comfortable with your page being coupled to the DAO interface
(without, for instance, a service layer in between), you can just inject the
DAO into your Component (Page) using 
http://cwiki.apache.org/WICKET/spring.html Wicket's @SpringBean annotation 
and have a 
private Cheese getCheese(String name)
method that uses the DAO (refactor out your getting the name form a
PageParameters into a separate method as well). 
Since you are following Wicket In Action, check out the sections on
detachable models and layered architectures.

@SpringBean
private ICheeseDao dao;

Regards - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 




quizzical wrote:
 
 Hi Everyone,
 
 I'm just getting started with wicket and am learning by playing around
 with building an ecommerce application on top of wicket, spring and
 hibernate. I've been (Ha!) using @SpringBean to inject my spring
 dependencies and am very impressed with it.
 
 One thing I'm wondering about is how to use @SpringBean with a pattern in
 the 'wicket in action' book. Specifically, when creating a
 bookmarkablePageLink with pageparameters this pattern is used:
 
 public class CheeseDetailsPage extends WebPage {
 // bookmarkable constructor
 public CheeseDetailsPage(PageParameters parameters) {   #1
 this(getCheese(parameters));
 }
 // non-bookmarkable constructor
 public CheeseDetailsPage(Cheese cheese) { #2
 // do cheesy stuff with the cheese
 }
 /** Retrieves a cheese object based on the ‘name’ parameter. */
 public static Cheese getCheese(PageParameters parameters) { #3
 String name = parameters.getString(name, );
 if(.equals(name)) return null;
 CheeseDao dao = ...;
 return dao.getCheeseByName(name);
 }
 }
 
 I like this pattern but i'm having a problem with injecting my
 dependencies. The getCheese() method is static, which means that the
 CheeseDao would have to be static. I haven't delved into the code of the
 @SpringBean proxy or the wicket serialization code (I have read the wiki
 on @SpringBean) and I don't have an amazing understanding of proxies so
 maybe i'm just being obtuse but heres my question.
 
 Is there any reason not to make the DAO static?
 
 Cheers in advance
 
 

-- 
View this message in context: 
http://www.nabble.com/%40SpringBean-with-page-creation-patterns-tp20845794p20854319.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hourglass during Ajax

2008-12-05 Thread jWeekend

Cristi,

Right, but it's non-trivial to use the veil for this - you'll need to 
http://javathoughts.capesugarbird.com/2008/03/ajax-button-with-overlay-div-and-wait.html
do some work  to get it to do just what you need. Also, iirc, veil does not
address the IE6 problem with drop-downs being still clickable.

It would be nice to be able to easily use a ModalWindow (configured to
exclude its close decoration) for this purpose. Again this would involve
some work to get the prepended javascript right. Closing it would be easy
enough tough, so you're half way there! 

Regard - Cemal
http://www.jWeekend.co.uk http://jWeekend.co.uk 



Cristi Manole wrote:
 
 [but if you need to _make sure_ the user doesn't click anything while the
 request is processing use the viel]
 
 On Fri, Dec 5, 2008 at 10:27 AM, jWeekend
 [EMAIL PROTECTED]wrote:
 

 Anton,

 See IndicatingAjaxLink (and other, similarly named components) and
 IndicatingAjaxButton.

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk


 Anton Veretennikov wrote:
 
  Hello Wicket users,
 
  I would like to know how to show some hourglass in a Wicket way
  during Ajax so user will not click something else.
  How to do this?
 
  Thank you
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 

-- 
View this message in context: 
http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20854748.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: @SpringBean with page creation patterns

2008-12-05 Thread quizzical

Thanks, that was exactly what I was looking for.
-- 
View this message in context: 
http://www.nabble.com/%40SpringBean-with-page-creation-patterns-tp20845794p20854804.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hourglass during Ajax

2008-12-05 Thread Martin Makundi
Combine it nicely with generic busy indicator:
http://cwiki.apache.org/WICKET/generic-busy-indicator-for-both-ajax-and-non-ajax-submits.html

Just make the div pick the size from the screen and set it on top with
cursor type wait.

**
Martin

2008/12/5 Martijn Dashorst [EMAIL PROTECTED]:
 Why not make a div the ajax indicator, and let your page implement
 ajaxindicatoraware?


 html
head
titleWicket Quickstart Archetype Homepage/title
/head
body
a href=# wicket:id=linkShow veil/a
div id=veil
 style=display:none;position:absolute;top:0;left:0;z-index=9;background-color:black;width:100%;height:100%;color:whiteh1Can't
 touch this/h1/div
/body
 /html

 package com.mycompany;

 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.ajax.*;
 import org.apache.wicket.ajax.markup.html.*;

 public class HomePage extends WebPage implements IAjaxIndicatorAware {
public HomePage(final PageParameters parameters) {
add(new AjaxLink(link) {
public void onClick(AjaxRequestTarget t) {
try { Thread.sleep(5000); } catch(Exception e) 
 {}
}
});
}
public String getAjaxIndicatorMarkupId() {
return veil;
}
 }


 Martijn

 On Fri, Dec 5, 2008 at 3:22 PM, jWeekend [EMAIL PROTECTED] wrote:

 Cristi,

 Right, but it's non-trivial to use the veil for this - you'll need to
 http://javathoughts.capesugarbird.com/2008/03/ajax-button-with-overlay-div-and-wait.html
 do some work  to get it to do just what you need. Also, iirc, veil does not
 address the IE6 problem with drop-downs being still clickable.

 It would be nice to be able to easily use a ModalWindow (configured to
 exclude its close decoration) for this purpose. Again this would involve
 some work to get the prepended javascript right. Closing it would be easy
 enough tough, so you're half way there!

 Regard - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk



 Cristi Manole wrote:

 [but if you need to _make sure_ the user doesn't click anything while the
 request is processing use the viel]

 On Fri, Dec 5, 2008 at 10:27 AM, jWeekend
 [EMAIL PROTECTED]wrote:


 Anton,

 See IndicatingAjaxLink (and other, similarly named components) and
 IndicatingAjaxButton.

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk


 Anton Veretennikov wrote:
 
  Hello Wicket users,
 
  I would like to know how to show some hourglass in a Wicket way
  during Ajax so user will not click something else.
  How to do this?
 
  Thank you
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 View this message in context: 
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20854748.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 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]



Re: Hourglass during Ajax

2008-12-05 Thread jWeekend

Martijn,

That's nice and it would be ideal to do it with CSS; that is what I too
wanted to do when I first thought about a modal busy indicator. But, IE6
is, surprise surprise, the problem - the drop-downs still show through. Do
you know of a way to fix that? ModalWindow window seems to just put
something a bit more robust over them to keep them quiet.

Regards - Cemal
http://www.jWeekend.co.uk  http://jWeekend.co.uk  


Martijn Dashorst wrote:
 
 Why not make a div the ajax indicator, and let your page implement
 ajaxindicatoraware?
 
 
 html
 head
 titleWicket Quickstart Archetype Homepage/title
 /head
 body
# Show veil 
   div id=veil
 style=display:none;position:absolute;top:0;left:0;z-index=9;background-color:black;width:100%;height:100%;color:whiteh1Can't
 touch this/h1/div
 /body
 /html
 
 package com.mycompany;
 
 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.ajax.*;
 import org.apache.wicket.ajax.markup.html.*;
 
 public class HomePage extends WebPage implements IAjaxIndicatorAware {
 public HomePage(final PageParameters parameters) {
   add(new AjaxLink(link) {
   public void onClick(AjaxRequestTarget t) {
   try { Thread.sleep(5000); } catch(Exception e) 
 {}
   }
   });
 }
   public String getAjaxIndicatorMarkupId() {
   return veil;
   }
 }
 
 
 Martijn
 
 On Fri, Dec 5, 2008 at 3:22 PM, jWeekend [EMAIL PROTECTED]
 wrote:

 Cristi,

 Right, but it's non-trivial to use the veil for this - you'll need to
 http://javathoughts.capesugarbird.com/2008/03/ajax-button-with-overlay-div-and-wait.html
 do some work  to get it to do just what you need. Also, iirc, veil does
 not
 address the IE6 problem with drop-downs being still clickable.

 It would be nice to be able to easily use a ModalWindow (configured to
 exclude its close decoration) for this purpose. Again this would involve
 some work to get the prepended javascript right. Closing it would be easy
 enough tough, so you're half way there!

 Regard - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk



 Cristi Manole wrote:

 [but if you need to _make sure_ the user doesn't click anything while
 the
 request is processing use the viel]

 On Fri, Dec 5, 2008 at 10:27 AM, jWeekend
 [EMAIL PROTECTED]wrote:


 Anton,

 See IndicatingAjaxLink (and other, similarly named components) and
 IndicatingAjaxButton.

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk


 Anton Veretennikov wrote:
 
  Hello Wicket users,
 
  I would like to know how to show some hourglass in a Wicket way
  during Ajax so user will not click something else.
  How to do this?
 
  Thank you
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20854748.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 
 -- 
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20855644.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Hourglass during Ajax

2008-12-05 Thread Anton Veretennikov
Seems these methods are all acceptable, I'll try them all and choose
which to use in which case.

Thank you.


On Fri, Dec 5, 2008 at 10:04 PM, Martijn Dashorst
[EMAIL PROTECTED] wrote:
 This is just CSS hacking, I guess an iframe insertion is what is
 necessary which is the usual hack for this type of stuff. Nothing
 more.

 Martijn

 On Fri, Dec 5, 2008 at 4:02 PM, jWeekend [EMAIL PROTECTED] wrote:

 Martijn,

 That's nice and it would be ideal to do it with CSS; that is what I too
 wanted to do when I first thought about a modal busy indicator. But, IE6
 is, surprise surprise, the problem - the drop-downs still show through. Do
 you know of a way to fix that? ModalWindow window seems to just put
 something a bit more robust over them to keep them quiet.

 Regards - Cemal
 http://www.jWeekend.co.uk  http://jWeekend.co.uk


 Martijn Dashorst wrote:

 Why not make a div the ajax indicator, and let your page implement
 ajaxindicatoraware?


 html
 head
 titleWicket Quickstart Archetype Homepage/title
 /head
 body
# Show veil
   div id=veil
 style=display:none;position:absolute;top:0;left:0;z-index=9;background-color:black;width:100%;height:100%;color:whiteh1Can't
 touch this/h1/div
 /body
 /html

 package com.mycompany;

 import org.apache.wicket.PageParameters;
 import org.apache.wicket.markup.html.basic.Label;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.ajax.*;
 import org.apache.wicket.ajax.markup.html.*;

 public class HomePage extends WebPage implements IAjaxIndicatorAware {
 public HomePage(final PageParameters parameters) {
   add(new AjaxLink(link) {
   public void onClick(AjaxRequestTarget t) {
   try { Thread.sleep(5000); } catch(Exception 
 e) {}
   }
   });
 }
   public String getAjaxIndicatorMarkupId() {
   return veil;
   }
 }


 Martijn

 On Fri, Dec 5, 2008 at 3:22 PM, jWeekend [EMAIL PROTECTED]
 wrote:

 Cristi,

 Right, but it's non-trivial to use the veil for this - you'll need to
 http://javathoughts.capesugarbird.com/2008/03/ajax-button-with-overlay-div-and-wait.html
 do some work  to get it to do just what you need. Also, iirc, veil does
 not
 address the IE6 problem with drop-downs being still clickable.

 It would be nice to be able to easily use a ModalWindow (configured to
 exclude its close decoration) for this purpose. Again this would involve
 some work to get the prepended javascript right. Closing it would be easy
 enough tough, so you're half way there!

 Regard - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk



 Cristi Manole wrote:

 [but if you need to _make sure_ the user doesn't click anything while
 the
 request is processing use the viel]

 On Fri, Dec 5, 2008 at 10:27 AM, jWeekend
 [EMAIL PROTECTED]wrote:


 Anton,

 See IndicatingAjaxLink (and other, similarly named components) and
 IndicatingAjaxButton.

 Regards - Cemal
 http://www.jWeekend.co.uk http://jWeekend.co.uk


 Anton Veretennikov wrote:
 
  Hello Wicket users,
 
  I would like to know how to show some hourglass in a Wicket way
  during Ajax so user will not click something else.
  How to do this?
 
  Thank you
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20853733.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 View this message in context:
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20854748.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




 --
 View this message in context: 
 http://www.nabble.com/%22Hourglass%22-during-Ajax-tp20853368p20855644.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.3.4 is released
 Get it now: 

Thread.sleep() for only one session

2008-12-05 Thread Anton Veretennikov
Hello all Wicket users.

One more question today.
I need to implement appearence of sleep if user (session, IP
address) tries incorrect login many times.
Thread.sleep() seems to stop all sessions at once. Any ideas?

Thank you!

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Thread.sleep() for only one session

2008-12-05 Thread Jeremy Thomerson
You definitely do NOT want to intentionally sleep a thread - that halts the
request, and uses up your thread pool.  You instead want the request to
complete, but you don't want to allow them to continue trying.  So, that
being said, you could:

1 - add a value to their session like private long blockedFromSignInUntil
and when they've exceeded your threshold, set that for ten minutes future.
This isn't bulletproof since they could start a new session by using a new
window / browser / blowing away cookies.
2 - if it's on a per-username (rather than a per-session) basis, add a
similar value to the user - not allowed signin until  This is probably
better anyway, because if I'm nefarious guy and I'm trying to sign in to
mr nice guy account, you lock mr nice guy account because you are in
fact detecting an identity theft attempt.
3 - you could do a combo of the above so that I, nefarious guy when I get
blocked from mr nice guy account, can't move on to mr unsuspecting
account.

Then, just have your sign in form be aware of that value in session or user
and not allow a sign in to that account or from that session until the
timeout is expired.

But as a general rule of thumb, never use Thread.sleep in a web app -
especially somewhere in the request cycle.  It'll be shooting yourself in
the foot.

Hope this helps,

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
[EMAIL PROTECTED] wrote:

 Hello all Wicket users.

 One more question today.
 I need to implement appearence of sleep if user (session, IP
 address) tries incorrect login many times.
 Thread.sleep() seems to stop all sessions at once. Any ideas?

 Thank you!

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: using annotation @AuthorizeInstantiation

2008-12-05 Thread Jeremy Thomerson
I'm not, because as was mentioned elsewhere on the thread, you almost always
need to go back to some (or other - int) mechanism because in reality,
permissions typically end up being:

User has a Role (or multiple roles)
Those Role objects have Permission objects
User can also have Permission objects that are outside of his normal role.

For instance, I'm a regional manager, so I have that role and maybe others
that go with it, but the national manager gives me the extra permission to
view sales reports for while he's gone or because I'm assisting him.  I
don't get everything in his role - seeing salaries for instance, but I have
certain permissions in addition to my role-inherited permissions.

Anyway, the idea I gave below is certainly an intriguing one to me, and I
think it's interesting, but there are holes in it.  So - nino - I guess it's
your potato :)

On Fri, Dec 5, 2008 at 7:21 AM, Nino Saturnino Martinez Vazquez Wael 
[EMAIL PROTECTED] wrote:

 Yeah this is a much nicer way.. So whos gonna implement it? :)

 regards Nino

 Jeremy Thomerson wrote:

 If you were going to do this, it would be much better (IMHO) to use
 interfaces...  This gives you interesting possibilities:

 (Disclaimer - the following is not an original thought - Igor mentioned
 this
 last week - give credit where it's due)

 interface User

 interface Admin extends User

 interface ProjectManager extends Admin

 interface SalesManager extends Admin

 HERE'S THE KICKER:

 interface TheBigBoss extends ProjectManager, SalesManager

 Since those are just marker interfaces, I guess each of those would need
 something like a single public static final implementation like:
 public static final TheBigBoss INSTANCE = new TheBigBoss() {};

 Something like that - anyway, MULTIPLE INHERITANCE FOR ROLES RULES!






  -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: Wicket integration with good charts api

2008-12-05 Thread Ryan McKinley
I just started one with the implementation I have  we can make it  
better, or perhaps add it to wicketstuff...


http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html


On Nov 5, 2008, at 3:59 PM, Thies Edeling wrote:


Maarten Bosteels wrote:
I have a similar requirement and played a bit with Open Flash  
Charts. [1]

It took little effort to integrate wicket + ofc4j [2] + swfobject [3]

[1] http://teethgrinder.co.uk/open-flash-chart-2/glass-bar-chart.php
[2] http://code.google.com/p/ofcj/
[3] http://code.google.com/p/swfobject/

Another requirement was that the user could drag and drop charts  
around on

the page (à la iGoogle) so I tried something like
http://interface.eyecon.ro/demos/sort.html  but that failed  
miserably: half
the time the charts wouldn't show up correctly after dragging them  
around.
I still have to find out if I can solve this somehow. All pointers  
are

welcome.

Anyway, if you're interested, I can create a wiki page showing the  
wicket +

ofc4j + swfobject integration.

Wiki page would be nice, those open flash charts look a lot better  
than the jfreechart images.


-
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]



Re: Thread.sleep() for only one session

2008-12-05 Thread Maarten Bosteels
If you're trying to defend against a brute-force password guessing attack,
you could add a captcha to your logon form after x failed login attempts
from one IP address.

Maarten

On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
[EMAIL PROTECTED]wrote:

 You definitely do NOT want to intentionally sleep a thread - that halts the
 request, and uses up your thread pool.  You instead want the request to
 complete, but you don't want to allow them to continue trying.  So, that
 being said, you could:

 1 - add a value to their session like private long blockedFromSignInUntil
 and when they've exceeded your threshold, set that for ten minutes future.
 This isn't bulletproof since they could start a new session by using a new
 window / browser / blowing away cookies.
 2 - if it's on a per-username (rather than a per-session) basis, add a
 similar value to the user - not allowed signin until  This is probably
 better anyway, because if I'm nefarious guy and I'm trying to sign in to
 mr nice guy account, you lock mr nice guy account because you are in
 fact detecting an identity theft attempt.
 3 - you could do a combo of the above so that I, nefarious guy when I get
 blocked from mr nice guy account, can't move on to mr unsuspecting
 account.

 Then, just have your sign in form be aware of that value in session or user
 and not allow a sign in to that account or from that session until the
 timeout is expired.

 But as a general rule of thumb, never use Thread.sleep in a web app -
 especially somewhere in the request cycle.  It'll be shooting yourself in
 the foot.

 Hope this helps,

 --
 Jeremy Thomerson
 http://www.wickettraining.com


 On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
 [EMAIL PROTECTED] wrote:

  Hello all Wicket users.
 
  One more question today.
  I need to implement appearence of sleep if user (session, IP
  address) tries incorrect login many times.
  Thread.sleep() seems to stop all sessions at once. Any ideas?
 
  Thank you!
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 



Re: Wicket integration with good charts api

2008-12-05 Thread Maarten Bosteels
Oops, just started working on it :-)
Will see if I can add somet more info to the wiki page.

Maarten


On Fri, Dec 5, 2008 at 5:57 PM, Ryan McKinley [EMAIL PROTECTED] wrote:

 I just started one with the implementation I have  we can make it
 better, or perhaps add it to wicketstuff...

 http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html



 On Nov 5, 2008, at 3:59 PM, Thies Edeling wrote:

  Maarten Bosteels wrote:

 I have a similar requirement and played a bit with Open Flash Charts. [1]
 It took little effort to integrate wicket + ofc4j [2] + swfobject [3]

 [1] http://teethgrinder.co.uk/open-flash-chart-2/glass-bar-chart.php
 [2] http://code.google.com/p/ofcj/
 [3] http://code.google.com/p/swfobject/

 Another requirement was that the user could drag and drop charts around
 on
 the page (à la iGoogle) so I tried something like
 http://interface.eyecon.ro/demos/sort.html  but that failed miserably:
 half
 the time the charts wouldn't show up correctly after dragging them
 around.
 I still have to find out if I can solve this somehow. All pointers are
 welcome.

 Anyway, if you're interested, I can create a wiki page showing the wicket
 +
 ofc4j + swfobject integration.

  Wiki page would be nice, those open flash charts look a lot better than
 the jfreechart images.

 -
 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]




Re: Thread.sleep() for only one session

2008-12-05 Thread Anton Veretennikov
Thank you for valuable information!

Tony.

On Sat, Dec 6, 2008 at 12:36 AM, Maarten Bosteels
[EMAIL PROTECTED] wrote:
 If you're trying to defend against a brute-force password guessing attack,
 you could add a captcha to your logon form after x failed login attempts
 from one IP address.

 Maarten

 On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
 [EMAIL PROTECTED]wrote:

 You definitely do NOT want to intentionally sleep a thread - that halts the
 request, and uses up your thread pool.  You instead want the request to
 complete, but you don't want to allow them to continue trying.  So, that
 being said, you could:

 1 - add a value to their session like private long blockedFromSignInUntil
 and when they've exceeded your threshold, set that for ten minutes future.
 This isn't bulletproof since they could start a new session by using a new
 window / browser / blowing away cookies.
 2 - if it's on a per-username (rather than a per-session) basis, add a
 similar value to the user - not allowed signin until  This is probably
 better anyway, because if I'm nefarious guy and I'm trying to sign in to
 mr nice guy account, you lock mr nice guy account because you are in
 fact detecting an identity theft attempt.
 3 - you could do a combo of the above so that I, nefarious guy when I get
 blocked from mr nice guy account, can't move on to mr unsuspecting
 account.

 Then, just have your sign in form be aware of that value in session or user
 and not allow a sign in to that account or from that session until the
 timeout is expired.

 But as a general rule of thumb, never use Thread.sleep in a web app -
 especially somewhere in the request cycle.  It'll be shooting yourself in
 the foot.

 Hope this helps,

 --
 Jeremy Thomerson
 http://www.wickettraining.com


 On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
 [EMAIL PROTECTED] wrote:

  Hello all Wicket users.
 
  One more question today.
  I need to implement appearence of sleep if user (session, IP
  address) tries incorrect login many times.
  Thread.sleep() seems to stop all sessions at once. Any ideas?
 
  Thank you!
 
  -
  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]



RE: Thread.sleep() for only one session

2008-12-05 Thread Bruno Cesar Borges
I'm totally against captcha. It's annoying for users and just one more obstacle 
for criminals - they will always find a way to break it. What I really suggest 
is: 

1) use HTTPS (obviously)
2) require your users a strong password
3) if your user tries login in more than X times, disable his/her account and 
redirect them to some Forgot your password? page. And they will have to 
answer some question related to their profile to get an email with a link to 
reset their password.

This is how I usually code websites with user/password support. The reason I 
don't like captcha is that I want to let power users to use browser's password 
remembering feature, and most of them hate having to type again some silly word 
drawed on some silly image. And I also don't want to annoy non-power users, but 
still protect them.

:-)

-Original Message-
From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2008 3:37 PM
To: users@wicket.apache.org
Subject: Re: Thread.sleep() for only one session


If you're trying to defend against a brute-force password guessing attack,
you could add a captcha to your logon form after x failed login attempts
from one IP address.

Maarten

On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
[EMAIL PROTECTED]wrote:

 You definitely do NOT want to intentionally sleep a thread - that halts the
 request, and uses up your thread pool.  You instead want the request to
 complete, but you don't want to allow them to continue trying.  So, that
 being said, you could:

 1 - add a value to their session like private long blockedFromSignInUntil
 and when they've exceeded your threshold, set that for ten minutes future.
 This isn't bulletproof since they could start a new session by using a new
 window / browser / blowing away cookies.
 2 - if it's on a per-username (rather than a per-session) basis, add a
 similar value to the user - not allowed signin until  This is probably
 better anyway, because if I'm nefarious guy and I'm trying to sign in to
 mr nice guy account, you lock mr nice guy account because you are in
 fact detecting an identity theft attempt.
 3 - you could do a combo of the above so that I, nefarious guy when I get
 blocked from mr nice guy account, can't move on to mr unsuspecting
 account.

 Then, just have your sign in form be aware of that value in session or user
 and not allow a sign in to that account or from that session until the
 timeout is expired.

 But as a general rule of thumb, never use Thread.sleep in a web app -
 especially somewhere in the request cycle.  It'll be shooting yourself in
 the foot.

 Hope this helps,

 --
 Jeremy Thomerson
 http://www.wickettraining.com


 On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
 [EMAIL PROTECTED] wrote:

  Hello all Wicket users.
 
  One more question today.
  I need to implement appearence of sleep if user (session, IP
  address) tries incorrect login many times.
  Thread.sleep() seems to stop all sessions at once. Any ideas?
 
  Thank you!
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 

***
Atenção: Esta mensagem foi enviada para uso exclusivo do(s) destinatários(s) 
acima identificado(s),
podendo conter informações e/ou documentos confidencias/privilegiados e seu 
sigilo é protegido por 
lei. Caso você tenha recebido por engano, por favor, informe o remetente e 
apague-a de seu sistema.
Notificamos que é proibido por lei a sua retenção, disseminação, distribuição, 
cópia ou uso sem 
expressa autorização do remetente. Opiniões pessoais do remetente não refletem, 
necessariamente, 
o ponto de vista da CETIP, o qual é divulgado somente por pessoas autorizadas.


Warning: This message was sent for exclusive use of the addressees above 
identified, possibly 
containing information and or privileged/confidential documents whose content 
is protected by law. 
In case you have mistakenly received it, please notify the sender and delete it 
from your system. 
Be noticed that the law forbids the retention, dissemination, distribution, 
copy or use without 
express authorization from the sender. Personal opinions of the sender do not 
necessarily reflect 
CETIP's point of view, which is only divulged by authorized personnel.
***


Re: Thread.sleep() for only one session

2008-12-05 Thread James Carman
But, if you only show the captcha after so many failed logins, wouldn't that
be okay?  You let them try a few times and if they are still failing, you
initiate the captcha.

On Fri, Dec 5, 2008 at 12:48 PM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I'm totally against captcha. It's annoying for users and just one more
 obstacle for criminals - they will always find a way to break it. What I
 really suggest is:

 1) use HTTPS (obviously)
 2) require your users a strong password
 3) if your user tries login in more than X times, disable his/her account
 and redirect them to some Forgot your password? page. And they will have
 to answer some question related to their profile to get an email with a link
 to reset their password.

 This is how I usually code websites with user/password support. The reason
 I don't like captcha is that I want to let power users to use browser's
 password remembering feature, and most of them hate having to type again
 some silly word drawed on some silly image. And I also don't want to annoy
 non-power users, but still protect them.

 :-)

 -Original Message-
 From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 05, 2008 3:37 PM
 To: users@wicket.apache.org
 Subject: Re: Thread.sleep() for only one session


 If you're trying to defend against a brute-force password guessing attack,
 you could add a captcha to your logon form after x failed login attempts
 from one IP address.

 Maarten

 On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
 [EMAIL PROTECTED]wrote:

  You definitely do NOT want to intentionally sleep a thread - that halts
 the
  request, and uses up your thread pool.  You instead want the request to
  complete, but you don't want to allow them to continue trying.  So, that
  being said, you could:
 
  1 - add a value to their session like private long
 blockedFromSignInUntil
  and when they've exceeded your threshold, set that for ten minutes
 future.
  This isn't bulletproof since they could start a new session by using a
 new
  window / browser / blowing away cookies.
  2 - if it's on a per-username (rather than a per-session) basis, add a
  similar value to the user - not allowed signin until  This is
 probably
  better anyway, because if I'm nefarious guy and I'm trying to sign in
 to
  mr nice guy account, you lock mr nice guy account because you are in
  fact detecting an identity theft attempt.
  3 - you could do a combo of the above so that I, nefarious guy when I
 get
  blocked from mr nice guy account, can't move on to mr unsuspecting
  account.
 
  Then, just have your sign in form be aware of that value in session or
 user
  and not allow a sign in to that account or from that session until the
  timeout is expired.
 
  But as a general rule of thumb, never use Thread.sleep in a web app -
  especially somewhere in the request cycle.  It'll be shooting yourself in
  the foot.
 
  Hope this helps,
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
  [EMAIL PROTECTED] wrote:
 
   Hello all Wicket users.
  
   One more question today.
   I need to implement appearence of sleep if user (session, IP
   address) tries incorrect login many times.
   Thread.sleep() seems to stop all sessions at once. Any ideas?
  
   Thank you!
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel.

 ***



RE: Thread.sleep() for only one session

2008-12-05 Thread Bruno Cesar Borges
Indeed.


-Original Message-
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Friday, December 05, 2008 3:52 PM
To: users@wicket.apache.org
Subject: Re: Thread.sleep() for only one session


But, if you only show the captcha after so many failed logins, wouldn't that
be okay?  You let them try a few times and if they are still failing, you
initiate the captcha.

On Fri, Dec 5, 2008 at 12:48 PM, Bruno Cesar Borges 
[EMAIL PROTECTED] wrote:

 I'm totally against captcha. It's annoying for users and just one more
 obstacle for criminals - they will always find a way to break it. What I
 really suggest is:

 1) use HTTPS (obviously)
 2) require your users a strong password
 3) if your user tries login in more than X times, disable his/her account
 and redirect them to some Forgot your password? page. And they will have
 to answer some question related to their profile to get an email with a link
 to reset their password.

 This is how I usually code websites with user/password support. The reason
 I don't like captcha is that I want to let power users to use browser's
 password remembering feature, and most of them hate having to type again
 some silly word drawed on some silly image. And I also don't want to annoy
 non-power users, but still protect them.

 :-)

 -Original Message-
 From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 05, 2008 3:37 PM
 To: users@wicket.apache.org
 Subject: Re: Thread.sleep() for only one session


 If you're trying to defend against a brute-force password guessing attack,
 you could add a captcha to your logon form after x failed login attempts
 from one IP address.

 Maarten

 On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
 [EMAIL PROTECTED]wrote:

  You definitely do NOT want to intentionally sleep a thread - that halts
 the
  request, and uses up your thread pool.  You instead want the request to
  complete, but you don't want to allow them to continue trying.  So, that
  being said, you could:
 
  1 - add a value to their session like private long
 blockedFromSignInUntil
  and when they've exceeded your threshold, set that for ten minutes
 future.
  This isn't bulletproof since they could start a new session by using a
 new
  window / browser / blowing away cookies.
  2 - if it's on a per-username (rather than a per-session) basis, add a
  similar value to the user - not allowed signin until  This is
 probably
  better anyway, because if I'm nefarious guy and I'm trying to sign in
 to
  mr nice guy account, you lock mr nice guy account because you are in
  fact detecting an identity theft attempt.
  3 - you could do a combo of the above so that I, nefarious guy when I
 get
  blocked from mr nice guy account, can't move on to mr unsuspecting
  account.
 
  Then, just have your sign in form be aware of that value in session or
 user
  and not allow a sign in to that account or from that session until the
  timeout is expired.
 
  But as a general rule of thumb, never use Thread.sleep in a web app -
  especially somewhere in the request cycle.  It'll be shooting yourself in
  the foot.
 
  Hope this helps,
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
  [EMAIL PROTECTED] wrote:
 
   Hello all Wicket users.
  
   One more question today.
   I need to implement appearence of sleep if user (session, IP
   address) tries incorrect login many times.
   Thread.sleep() seems to stop all sessions at once. Any ideas?
  
   Thank you!
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 

 ***
 Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
 destinatários(s) acima identificado(s),
 podendo conter informações e/ou documentos confidencias/privilegiados e seu
 sigilo é protegido por
 lei. Caso você tenha recebido por engano, por favor, informe o remetente e
 apague-a de seu sistema.
 Notificamos que é proibido por lei a sua retenção, disseminação,
 distribuição, cópia ou uso sem
 expressa autorização do remetente. Opiniões pessoais do remetente não
 refletem, necessariamente,
 o ponto de vista da CETIP, o qual é divulgado somente por pessoas
 autorizadas.


 Warning: This message was sent for exclusive use of the addressees above
 identified, possibly
 containing information and or privileged/confidential documents whose
 content is protected by law.
 In case you have mistakenly received it, please notify the sender and
 delete it from your system.
 Be noticed that the law forbids the retention, dissemination, distribution,
 copy or use without
 express authorization from the sender. Personal opinions of the sender do
 not necessarily reflect
 CETIP's point of view, which is only divulged by authorized personnel.

 

Re: Thread.sleep() for only one session

2008-12-05 Thread James Carman
That's what Maarten was suggesting, I believe.  I agree that captchas are no
fun for your users, but if you don't turn them on all the time, I think they
can be useful for blocking brute-force attacks.  I would think that even
with captcha turned on, if the login fails a number of times more that you
should probably just disable the account (as you suggested).  Perhaps send
them a link via email that says your account password has been because of
too many failed login attempts...

On Fri, Dec 5, 2008 at 1:00 PM, Bruno Cesar Borges [EMAIL PROTECTED]
 wrote:

 Indeed.


 -Original Message-
 From: James Carman [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 05, 2008 3:52 PM
 To: users@wicket.apache.org
 Subject: Re: Thread.sleep() for only one session


 But, if you only show the captcha after so many failed logins, wouldn't
 that
 be okay?  You let them try a few times and if they are still failing, you
 initiate the captcha.

 On Fri, Dec 5, 2008 at 12:48 PM, Bruno Cesar Borges 
 [EMAIL PROTECTED] wrote:

  I'm totally against captcha. It's annoying for users and just one more
  obstacle for criminals - they will always find a way to break it. What I
  really suggest is:
 
  1) use HTTPS (obviously)
  2) require your users a strong password
  3) if your user tries login in more than X times, disable his/her account
  and redirect them to some Forgot your password? page. And they will
 have
  to answer some question related to their profile to get an email with a
 link
  to reset their password.
 
  This is how I usually code websites with user/password support. The
 reason
  I don't like captcha is that I want to let power users to use browser's
  password remembering feature, and most of them hate having to type again
  some silly word drawed on some silly image. And I also don't want to
 annoy
  non-power users, but still protect them.
 
  :-)
 
  -Original Message-
  From: Maarten Bosteels [mailto:[EMAIL PROTECTED]
  Sent: Friday, December 05, 2008 3:37 PM
  To: users@wicket.apache.org
  Subject: Re: Thread.sleep() for only one session
 
 
  If you're trying to defend against a brute-force password guessing
 attack,
  you could add a captcha to your logon form after x failed login attempts
  from one IP address.
 
  Maarten
 
  On Fri, Dec 5, 2008 at 5:20 PM, Jeremy Thomerson
  [EMAIL PROTECTED]wrote:
 
   You definitely do NOT want to intentionally sleep a thread - that halts
  the
   request, and uses up your thread pool.  You instead want the request to
   complete, but you don't want to allow them to continue trying.  So,
 that
   being said, you could:
  
   1 - add a value to their session like private long
  blockedFromSignInUntil
   and when they've exceeded your threshold, set that for ten minutes
  future.
   This isn't bulletproof since they could start a new session by using a
  new
   window / browser / blowing away cookies.
   2 - if it's on a per-username (rather than a per-session) basis, add a
   similar value to the user - not allowed signin until  This is
  probably
   better anyway, because if I'm nefarious guy and I'm trying to sign in
  to
   mr nice guy account, you lock mr nice guy account because you are
 in
   fact detecting an identity theft attempt.
   3 - you could do a combo of the above so that I, nefarious guy when I
  get
   blocked from mr nice guy account, can't move on to mr unsuspecting
   account.
  
   Then, just have your sign in form be aware of that value in session or
  user
   and not allow a sign in to that account or from that session until the
   timeout is expired.
  
   But as a general rule of thumb, never use Thread.sleep in a web app -
   especially somewhere in the request cycle.  It'll be shooting yourself
 in
   the foot.
  
   Hope this helps,
  
   --
   Jeremy Thomerson
   http://www.wickettraining.com
  
  
   On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
   [EMAIL PROTECTED] wrote:
  
Hello all Wicket users.
   
One more question today.
I need to implement appearence of sleep if user (session, IP
address) tries incorrect login many times.
Thread.sleep() seems to stop all sessions at once. Any ideas?
   
Thank you!
   
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   
   
  
 
 
 ***
  Atenção: Esta mensagem foi enviada para uso exclusivo do(s)
  destinatários(s) acima identificado(s),
  podendo conter informações e/ou documentos confidencias/privilegiados e
 seu
  sigilo é protegido por
  lei. Caso você tenha recebido por engano, por favor, informe o remetente
 e
  apague-a de seu sistema.
  Notificamos que é proibido por lei a sua retenção, disseminação,
  distribuição, cópia ou uso sem
  expressa autorização do remetente. Opiniões pessoais do remetente não
  refletem, 

Re: Wicket and Jetty Persistent Sessions not playing together

2008-12-05 Thread Igor Vaynberg
not sure if we can do much about this. on the one hand jetty is quirky
because it initializes objects that belong to the webapp before
actually initializing the webapp itself. on the other hand wicket is
quirky because it stores things in session that depend on objects
outside the session. try getting in touch with jetty people and see if
they are willing to add a setting to control this, and please keep us
informed.

-igor

On Thu, Dec 4, 2008 at 11:59 PM, Joel Halbert [EMAIL PROTECTED] wrote:
 Hi,

 Has anyone had issues when using wicket with Jetty and persistent
 sessions?

 Specifically when the server is restarted sessions are intialised before
 servlets are ready, this causes an exception when wicket deserialises
 the current page which was in session since the WicketApplication is
 not yet ready since the Wicket Filter has not yet been loaded by the
 server.

 Thanks
 Joel



 -
 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]



Possible to retrieve previous page from PageMap

2008-12-05 Thread pixologe

Hi there,

is there a way to retrieve the previous page from the PageMap? Or at least
its class?

I can see that it is in there (private), but as I see it the API does not
seem to let me access it... or did I miss something?

In our current case we would need to display a specific info only if the
user came from a specific page.
We are using BookmarkablePageLink with mounts and are keen on keeping our
URLs as clean as possible, thus we would like to avoid passing a page
classname around with every request or similar. 

Thanks a lot for any hints.

Best regards.

-- 
View this message in context: 
http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p20861106.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Possible to retrieve previous page from PageMap

2008-12-05 Thread pixologe

For once, I can answer my own question.

I just realized that I can cast the PageMap to SecondLevelCachePageMap,
which lets me access lastPage.

Don't know if this is the best solution, but it should work as long as I do
not provide another PageMap myself.

If there is a more elegant solution, I'd still like to hear it though.
Cheers.
-- 
View this message in context: 
http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p20861258.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Possible to retrieve previous page from PageMap

2008-12-05 Thread Jeremy Thomerson
Here's a post from Jon Locke about this:
http://web.mac.com/jonathan.locke/iWeb/JonathanLocke/Blog/C68818AE-E983-4D7A-B6BF-E95CD886BFF2.html

On Fri, Dec 5, 2008 at 1:40 PM, pixologe [EMAIL PROTECTED] wrote:


 Hi there,

 is there a way to retrieve the previous page from the PageMap? Or at least
 its class?

 I can see that it is in there (private), but as I see it the API does not
 seem to let me access it... or did I miss something?

 In our current case we would need to display a specific info only if the
 user came from a specific page.
 We are using BookmarkablePageLink with mounts and are keen on keeping our
 URLs as clean as possible, thus we would like to avoid passing a page
 classname around with every request or similar.

 Thanks a lot for any hints.

 Best regards.

 --
 View this message in context:
 http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p20861106.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-- 
Jeremy Thomerson
http://www.wickettraining.com


Re: Adding jquery effects to paging navigator

2008-12-05 Thread Daniel Peters
Serkan Camurcuoglu wrote:

 just noticed I forgot to add the behavior to the link, but still the
 javascript does not show up..
I know your mail was some time ago, but I just had the same problem and found a 
solution. Maybe it helps somebody else
in future... The problem is that the fadeOut() method doesnt block. It 
executes and immediately afterwards the wicket
ajax-code is called. Which means you never see your wanted effects. Solution: 
use the jQuery callback-parameter.

let newValue return for example:
String.format($('#%s').fadeOut('normal', function(){ %s });, 
topContainer.getMarkupId(), current);


regards,
Daniel

 Serkan Camurcuoglu wrote:
 How can I modify the onclick attribute of the links in the
 AjaxPagingNavigator? I override newPagingNavigationLink in my ajax
 paging navigator as shown below, but my javascript is not prepended. I
 want to add JQuery fadeout code before wicketAjaxGet:

 @Override
protected Link newPagingNavigationLink(String arg0, IPageable arg1,
 int arg2) {
AjaxPagingNavigationLink l = (AjaxPagingNavigationLink)
 super.newPagingNavigationLink(arg0, arg1, arg2);
String onClickJavascript =
 jQuery('#+topContainer.getMarkupId()+').fadeOut('slow');;
AttributeModifier am = new AttributeModifier(onclick, new
 Model(onClickJavascript)) {
@Override
protected String newValue(String current, String
 replacement) {
// prepend javascript before ajax call..
return replacement + current;
}
};
return l;
}


 Serkan Camurcuoglu wrote:
 Hi all,
 I want to add some decoration to AjaxPagingNavigator. I want the
 current page to fade out and the new page to fade in when the user
 clicks next. I'm thinking of using JQuery for effects. Can anybody
 show me some pointers to achieve this?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with Application getInitParameter()

2008-12-05 Thread Nav Che
Maybe you want to try this :


((WebRequest)getRequestCycle().getRequest()).getHttpServletRequest().getServerName()

//Naveen
On Fri, Dec 5, 2008 at 6:58 AM, Tauren Mills [EMAIL PROTECTED] wrote:

 Maybe I'm going nuts, but I can't figure out what is wrong.  It seems so
 simple, but it isn't working.  I call getInitParameter in my application
 twice.  One time it returns a value, the other it gets a null.  And the
 correct xml is there in web.xml.

 First, here is the pertinent application code (I've trimmed out unimportant
 stuff):

 public class DynamicApplication extends WicketeerBaseApplication {

private MerchantInfo merchantInfo;
private String siteBaseUrl;

public MerchantInfo getMerchantInfo() {
return merchantInfo;
}
public void setMerchantInfo(MerchantInfo merchantInfo) {
this.merchantInfo = merchantInfo;
}
public String getSiteBaseUrl() {
return siteBaseUrl;
}
public void setSiteBaseUrl(String siteBaseUrl) {
this.siteBaseUrl = siteBaseUrl;
}

@Override
protected void init() {
super.init();
this.siteBaseUrl = getInitParameter(site-base-url);
this.merchantInfo =

 GoogleOrderService.loadMerchantInfo(getServletContext(),getInitParameter(checkout-config-file));
}
 }

 Now here are the pertinent parts from web.xml:

!-- Base URL of the website.  Used in linkbacks from google checkout.
 --
context-param
param-namesite-base-url/param-name
param-valuehttp://localhost:8080//param-value
/context-param

!-- location of configuration file for google checkout with respect to
 context
 root. Using the default path here. --
context-param
param-namecheckout-config-file/param-name
param-value/WEB-INF/checkout-config.xml/param-value
/context-param

 So, when the application init() runs, merchantInfo gets properly populated
 with the correct MerchantInfo instance based on the contents of
 checkout-config.xml.  So the init param name and value were read correctly.

 But, then when I try to just get a simple string value for site-base-url, I
 get back a null.  I've looked for typos, tried retyping the web.xml
 section,
 swapping the order of getInitParam in init(), restarting... all sorts of
 stuff.  It just always gets null.

 Any possible thoughts on what might cause this?  Using wicket-1.3.3.
 Pulling my hair out.  Maybe its just late and I need to sleep.

 Is there a better way to get the server name so I don't even need to hard
 code it?  urlFor() only gives back the path, not the server.

 Thanks,
 Tauren



RE: Thread.sleep() for only one session

2008-12-05 Thread Hoover, William
If you need to do these kind things at least utilize
java.util.concurrent.*

class MyCallable implements CallableMyReturnObject {
final public MyReturnObject call() {
// calling the another thread; do something and return
your object
}
}
final ExecutorService es = Executors.newSingleThreadExecutor();
final FutureMyReturnObject f = es.submit(new MyCallable());
// now we know if something went wrong in our thread and can act
accordingly
final MyReturnObject mro = f.get();

-Original Message-
From: Jeremy Thomerson [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 05, 2008 11:21 AM
To: users@wicket.apache.org
Subject: Re: Thread.sleep() for only one session

You definitely do NOT want to intentionally sleep a thread - that halts
the request, and uses up your thread pool.  You instead want the request
to complete, but you don't want to allow them to continue trying.  So,
that being said, you could:

1 - add a value to their session like private long
blockedFromSignInUntil
and when they've exceeded your threshold, set that for ten minutes
future.
This isn't bulletproof since they could start a new session by using a
new window / browser / blowing away cookies.
2 - if it's on a per-username (rather than a per-session) basis, add a
similar value to the user - not allowed signin until  This is
probably better anyway, because if I'm nefarious guy and I'm trying to
sign in to mr nice guy account, you lock mr nice guy account because
you are in fact detecting an identity theft attempt.
3 - you could do a combo of the above so that I, nefarious guy when I
get blocked from mr nice guy account, can't move on to mr
unsuspecting
account.

Then, just have your sign in form be aware of that value in session or
user and not allow a sign in to that account or from that session until
the timeout is expired.

But as a general rule of thumb, never use Thread.sleep in a web app -
especially somewhere in the request cycle.  It'll be shooting yourself
in the foot.

Hope this helps,

--
Jeremy Thomerson
http://www.wickettraining.com


On Fri, Dec 5, 2008 at 9:46 AM, Anton Veretennikov 
[EMAIL PROTECTED] wrote:

 Hello all Wicket users.

 One more question today.
 I need to implement appearence of sleep if user (session, IP
 address) tries incorrect login many times.
 Thread.sleep() seems to stop all sessions at once. Any ideas?

 Thank you!

 -
 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]



Re: Wicket integration with good charts api

2008-12-05 Thread Maarten Bosteels
Hello Ryan,

I have just added some more code to the wiki page, and a working quickstart
project.

http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html

My OpenFlashChart implementation is almost exactly the same as yours.

Only differences I found:
* You use an *ofc4j.model.Chart* as model, and I use a plain String.
   Using the Chart itself as model is cool, because then you could change
the chart on-the-fly.
   Unfortunately Chart is not serializable and I get
WicketNotSerializableException's.
   I will update my code and the quickstart as soon as I get rid of these
exceptions.

* Your constructor takes width and height but they're not used :-)

* I don't call  swf.setParam( allowScriptAccess, sameDomain );
  It doesn't seem to be necessary ?

It's only two classes, so I am not sure it's 'big' enough to add to
wicket-stuff ?
Perhaps it could be added to minis ?

Maarten

On Fri, Dec 5, 2008 at 6:38 PM, Maarten Bosteels [EMAIL PROTECTED]wrote:

 Oops, just started working on it :-)
 Will see if I can add somet more info to the wiki page.

 Maarten



 On Fri, Dec 5, 2008 at 5:57 PM, Ryan McKinley [EMAIL PROTECTED] wrote:

 I just started one with the implementation I have  we can make it
 better, or perhaps add it to wicketstuff...

 http://cwiki.apache.org/WICKET/open-flash-chart-and-wicket.html



 On Nov 5, 2008, at 3:59 PM, Thies Edeling wrote:

  Maarten Bosteels wrote:

 I have a similar requirement and played a bit with Open Flash Charts.
 [1]
 It took little effort to integrate wicket + ofc4j [2] + swfobject [3]

 [1] http://teethgrinder.co.uk/open-flash-chart-2/glass-bar-chart.php
 [2] http://code.google.com/p/ofcj/
 [3] http://code.google.com/p/swfobject/

 Another requirement was that the user could drag and drop charts around
 on
 the page (à la iGoogle) so I tried something like
 http://interface.eyecon.ro/demos/sort.html  but that failed miserably:
 half
 the time the charts wouldn't show up correctly after dragging them
 around.
 I still have to find out if I can solve this somehow. All pointers are
 welcome.

 Anyway, if you're interested, I can create a wiki page showing the
 wicket +
 ofc4j + swfobject integration.

  Wiki page would be nice, those open flash charts look a lot better than
 the jfreechart images.

 -
 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]





Re: Possible to retrieve previous page from PageMap

2008-12-05 Thread pixologe

Ah - I see, SLCPM is private :(
Thanks for the link, this solution works fine :)


Jeremy Thomerson-5 wrote:
 
 Here's a post from Jon Locke about this:
 http://web.mac.com/jonathan.locke/iWeb/JonathanLocke/Blog/C68818AE-E983-4D7A-B6BF-E95CD886BFF2.html
 
 On Fri, Dec 5, 2008 at 1:40 PM, pixologe [EMAIL PROTECTED] wrote:
 

 Hi there,

 is there a way to retrieve the previous page from the PageMap? Or at
 least
 its class?

 I can see that it is in there (private), but as I see it the API does not
 seem to let me access it... or did I miss something?

 In our current case we would need to display a specific info only if the
 user came from a specific page.
 We are using BookmarkablePageLink with mounts and are keen on keeping our
 URLs as clean as possible, thus we would like to avoid passing a page
 classname around with every request or similar.

 Thanks a lot for any hints.

 Best regards.

 --
 View this message in context:
 http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p20861106.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 Jeremy Thomerson
 http://www.wickettraining.com
 
 

-- 
View this message in context: 
http://www.nabble.com/Possible-to-retrieve-previous-page-from-PageMap-tp20861106p20863091.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



CheckGroupSelector not working at all in a Wizard

2008-12-05 Thread jchappelle

I have followed the example exactly(from what I can see) and when I click my
Select All button nothing happens to the other buttons. Here is the code:

This is in the constructor of a WizardStep:

Form form = new Form(form)
{
private static final long serialVersionUID = 1L;

@Override
protected void onSubmit()
{
super.onSubmit();
}

};
LoadableDetachableModel contactsModel = new 
LoadableDetachableModel()
{
private static final long serialVersionUID = 1L;

@Override
protected Object load()
{
ContactSession sess = new 
ContactSessionImpl();
ListContact result = new 
ArrayListContact();
try
{
result = 
sess.getContacts(contactsLogin.getLoginName(),
contactsLogin.getPassword(), contactsLogin.getService());
}
catch(ContactsRetrievalException e)
{
//TODO:
e.printStackTrace();
}
return result;
}

};
CheckGroup group = new CheckGroup(group, new 
ArrayList());
group.add(new CheckGroupSelector(groupselector));
ListView contacts = new ListView(contacts, 
contactsModel)
{
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem item)
{
Contact contact = 
(Contact)item.getModelObject();
CheckBox contactCheckBox = new 
CheckBox(contactCheckBox, new
Model());//TODO: (JBC)
Model titleModel = null;
if(contact.getName() == null || 
contact.getName().trim().length() == 0)
{
titleModel = new 
Model(contact.getEmailAddress());
}
else
{
titleModel = new 
Model(contact.getName());
}
Label contactTitle = new 
Label(contactTitle, titleModel);
Label contactEmail = new 
Label(contactEmail, new
Model(contact.getEmailAddress()));
item.add(contactCheckBox);
item.add(contactTitle);
item.add(contactEmail);
}
};
group.add(contacts);

form.add(group);
add(form);


Could someone please tell me what I am doing wrong?

Thanks,

Josh
-- 
View this message in context: 
http://www.nabble.com/CheckGroupSelector-not-working-at-all-in-a-Wizard-tp20863784p20863784.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



create clickable icons (serving as external links) - Sends server into a endless loop

2008-12-05 Thread Ed _

I am trying to create clickable icons that would link to an external page. 

I came across - 
http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html - But the 
server just goes into an endless loop. 

pointers?

Ed


ExternalLink link = new ExternalLink(partnerLink, partnerLink);
StaticImage sImg = new StaticImage(partnerIcon, new 
Model(partnerIconUrl));
link.add(sImg);
add(link);


html xmlns:wicket
wicket:panel
div class=partner_panel
a href=# wicket:id=partnerLink
 img wicket:id=partnerIcon width=50 height=35 src=# /
/a
/div
/wicket:panel
/html


class StaticImage extends WebComponent {

public StaticImage(String id, IModel model) {
super(id, model);
}

protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}

}


_
Suspicious message? There’s an alert for that. 
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008

Re: create clickable icons (serving as external links) - Sends server into a endless loop

2008-12-05 Thread Jeremy Thomerson
I don't see anything right away wrong with your code below.   So, maybe a
couple questions will help:

Goes into an endless loop when?  When it's rendering?  When loading image?
When clicking on link?
Also - what HTML does your code below produce?

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Fri, Dec 5, 2008 at 4:49 PM, Ed _ [EMAIL PROTECTED] wrote:


 I am trying to create clickable icons that would link to an external page.

 I came across -
 http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html - But
 the server just goes into an endless loop.

 pointers?

 Ed


 ExternalLink link = new ExternalLink(partnerLink, partnerLink);
StaticImage sImg = new StaticImage(partnerIcon, new
 Model(partnerIconUrl));
link.add(sImg);
add(link);


 html xmlns:wicket
 wicket:panel
div class=partner_panel
a href=# wicket:id=partnerLink
 img wicket:id=partnerIcon width=50 height=35 src=# /
/a
/div
 /wicket:panel
 /html


 class StaticImage extends WebComponent {

public StaticImage(String id, IModel model) {
super(id, model);
}

protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
checkComponentTag(tag, img);
tag.put(src, getModelObjectAsString());
}

 }


 _
 Suspicious message? There's an alert for that.

 http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008



RE: create clickable icons (serving as external links) - Sends server into a endless loop

2008-12-05 Thread Ed _

The problem occers when it is rendering. 


The images / page render fine when the src is hardcoded in the html file.

It also works when I use the web markupcontainer and manipulate the src 
attribute as shown below.

ExternalLink link = new ExternalLink(partnerLink, partnerLink);
final String imageUrl = partnerIconUrl;
WebMarkupContainer srcTag = new WebMarkupContainer(partnerIcon);
IModel mediaSrc = new AbstractReadOnlyModel(){
@Override
public String getObject(){
return imageUrl;
}
};
srcTag.add(new AttributeModifier(src, mediaSrc));

link.add(srcTag);
add(link);

 Date: Fri, 5 Dec 2008 16:59:17 -0600
 From: [EMAIL PROTECTED]
 To: users@wicket.apache.org
 Subject: Re: create clickable icons (serving as external links) - Sends 
 server into a endless loop
 
 I don't see anything right away wrong with your code below.   So, maybe a
 couple questions will help:
 
 Goes into an endless loop when?  When it's rendering?  When loading image?
 When clicking on link?
 Also - what HTML does your code below produce?
 
 -- 
 Jeremy Thomerson
 http://www.wickettraining.com
 
 
 On Fri, Dec 5, 2008 at 4:49 PM, Ed _ [EMAIL PROTECTED] wrote:
 
 
  I am trying to create clickable icons that would link to an external page.
 
  I came across -
  http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html - But
  the server just goes into an endless loop.
 
  pointers?
 
  Ed
 
 
  ExternalLink link = new ExternalLink(partnerLink, partnerLink);
 StaticImage sImg = new StaticImage(partnerIcon, new
  Model(partnerIconUrl));
 link.add(sImg);
 add(link);
 
 
  html xmlns:wicket
  wicket:panel
 div class=partner_panel
 a href=# wicket:id=partnerLink
  img wicket:id=partnerIcon width=50 height=35 src=# /
 /a
 /div
  /wicket:panel
  /html
 
 
  class StaticImage extends WebComponent {
 
 public StaticImage(String id, IModel model) {
 super(id, model);
 }
 
 protected void onComponentTag(ComponentTag tag) {
 super.onComponentTag(tag);
 checkComponentTag(tag, img);
 tag.put(src, getModelObjectAsString());
 }
 
  }
 
 
  _
  Suspicious message? There's an alert for that.
 
  http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008
 

_
You live life online. So we put Windows on the web. 
http://clk.atdmt.com/MRT/go/127032869/direct/01/

Re: create clickable icons (serving as external links) - Sends server into a endless loop

2008-12-05 Thread Jeremy Thomerson
Help me out a little more...

If it's truly while rendering (on the server), and enters an infinite
loop - must be a stack overflow, in which case, send the stack trace.

I think you mean that it's while rendering **in the browser**, for
instance by requesting the page again and again, etc.. If this is the case,
send us the generated HTML using a tool like tamper data in Firefox, for
example.

Also, just for kicks, try it without the # in the image tag and see if
that changes anything.
-- 
Jeremy Thomerson
http://www.wickettraining.com


On Fri, Dec 5, 2008 at 5:38 PM, Ed _ [EMAIL PROTECTED] wrote:


 The problem occers when it is rendering.


 The images / page render fine when the src is hardcoded in the html file.

 It also works when I use the web markupcontainer and manipulate the src
 attribute as shown below.

 ExternalLink link = new ExternalLink(partnerLink, partnerLink);
final String imageUrl = partnerIconUrl;
WebMarkupContainer srcTag = new WebMarkupContainer(partnerIcon);
IModel mediaSrc = new AbstractReadOnlyModel(){
@Override
public String getObject(){
return imageUrl;
}
};
srcTag.add(new AttributeModifier(src, mediaSrc));

link.add(srcTag);
add(link);

  Date: Fri, 5 Dec 2008 16:59:17 -0600
  From: [EMAIL PROTECTED]
  To: users@wicket.apache.org
  Subject: Re: create clickable icons (serving as external links) - Sends
 server into a endless loop
  
  I don't see anything right away wrong with your code below.   So, maybe a
  couple questions will help:
 
  Goes into an endless loop when?  When it's rendering?  When loading
 image?
  When clicking on link?
  Also - what HTML does your code below produce?
 
  --
  Jeremy Thomerson
  http://www.wickettraining.com
 
 
  On Fri, Dec 5, 2008 at 4:49 PM, Ed _ [EMAIL PROTECTED] wrote:
 
  
   I am trying to create clickable icons that would link to an external
 page.
  
   I came across -
   http://cwiki.apache.org/WICKET/how-to-load-an-external-image.html -
 But
   the server just goes into an endless loop.
  
   pointers?
  
   Ed
  
  
   ExternalLink link = new ExternalLink(partnerLink, partnerLink);
  StaticImage sImg = new StaticImage(partnerIcon, new
   Model(partnerIconUrl));
  link.add(sImg);
  add(link);
  
  
   html xmlns:wicket
   wicket:panel
  div class=partner_panel
  a href=# wicket:id=partnerLink
   img wicket:id=partnerIcon width=50 height=35 src=#
 /
  /a
  /div
   /wicket:panel
   /html
  
  
   class StaticImage extends WebComponent {
  
  public StaticImage(String id, IModel model) {
  super(id, model);
  }
  
  protected void onComponentTag(ComponentTag tag) {
  super.onComponentTag(tag);
  checkComponentTag(tag, img);
  tag.put(src, getModelObjectAsString());
  }
  
   }
  
  
   _
   Suspicious message? There's an alert for that.
  
  
 http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad2_122008
  

 _
 You live life online. So we put Windows on the web.
 http://clk.atdmt.com/MRT/go/127032869/direct/01/


how to invoke javascript method after form validation?

2008-12-05 Thread novotny

Hi,

I have markup like li class=noerrorEnter textinput type=text
wicket:id=sometext/

And I'm using FeedbackPanel currently, but instead of showing all the errors
at the top, we want to change class=noerror to class=error which seems
easier to do in javascript. But how can I indicate to wicket to invoke this
javascript function which changes class=noerror to class=error for those
fields that have errrors?
I'm open to other ideas, but I have lots of wicket panels and don't want to
have to add a lot more wicket code to every class e.g. doing li
wicket:id=... in markup and adding RepeatingView/Label solutions seems like
more work.

Thanks, Jason
-- 
View this message in context: 
http://www.nabble.com/how-to-invoke-javascript-method-after-form-validation--tp20865454p20865454.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



CheckGroup model only has one element

2008-12-05 Thread jchappelle

I have a CheckGroup inside of a WizardStep panel. In the constructor I am
giving it a PropertyModel like this:

final CheckGroup group = new CheckGroup(group, new
PropertyModel(RegistrationWizard.this, contacts));

My wizard class has a setContacts and a getContacts that take a Set and
return a Set respectively. I add a ListView to this group:

Form form = new Form(form);
group.add(new CheckGroupSelector(groupselector));
ListView contacts = new ListView(contacts, 
contactsModel)
{
private static final long serialVersionUID = 1L;

@Override
protected void populateItem(ListItem item)
{
Contact contact = 
(Contact)item.getModelObject();
Check contactCheckBox = new 
Check(contactCheckBox, item.getModel());

Model titleModel = null;
if(contact.getName() == null || 
contact.getName().trim().length() == 0)
{
titleModel = new 
Model(contact.getEmailAddress());
}
else
{
titleModel = new 
Model(contact.getName());
}
Label contactTitle = new 
Label(contactTitle, titleModel);
Label contactEmail = new 
Label(contactEmail, new
Model(contact.getEmailAddress()));
item.add(contactCheckBox);
item.add(contactTitle);
item.add(contactEmail);
}
};


The top checked contact is always the one returned. It never has the full
collection of selections in my contacts Set. I have been beating my head
over this for hours. Could someone please help!!! I am using wicket 1.3.4

Thanks,

Josh
-- 
View this message in context: 
http://www.nabble.com/CheckGroup-model-only-has-one-element-tp20865674p20865674.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]