Wicket cookie timeout example?

2012-03-31 Thread kshitiz
Hi,

Is there any way to set cookie expiration time in Wicket? I am not able to
find any example related to that...like we can set session expiration time
in web.xml...

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-cookie-timeout-example-tp4521200p4521200.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Version Pages by default

2012-03-31 Thread Martin Grigorov
On Sat, Mar 31, 2012 at 12:29 AM, sudeivas sureshkumar@gmail.com wrote:
 Thanks for the information. I am currently using wicket 1.5.3.

 I hope this applies to wicket-1.5.3 as well.

Yes


 But in my case, everything works fine. But when our session management
 fails, then we run into the following exceptions:

 PageExpiredException
 ComponentNotFoundException
 StalePageException

This is normal. If there is no page with that version in the store
then PageExpiredException is thrown.


 Please let me know if enabling page version will fix any of these issues.
 Also in 6.x I see an API called
 setRecreateMountedPagesAfterExpiry()

 Is this option available already in wicket-1.5.3 (by default true) ? If not,
 what happens when a page expires?

It is available since 1.5.4.
When page is expired Wicket will create a new instance of this page as
its javadoc explains.


 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4520613.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Wicket cookie timeout example?

2012-03-31 Thread Martin Grigorov
Hi,

See javax.servlet.http.Cookie#setMaxAge().
Also see org.apache.wicket.util.cookies.CookieUtils

On Sat, Mar 31, 2012 at 8:25 AM, kshitiz k.agarw...@gmail.com wrote:
 Hi,

 Is there any way to set cookie expiration time in Wicket? I am not able to
 find any example related to that...like we can set session expiration time
 in web.xml...

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-cookie-timeout-example-tp4521200p4521200.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Version Pages by default

2012-03-31 Thread vineet semwal
for creation ,is it done like this in wicket if(page is creatable){
create}else{ throw pageexpiredexception}

else there can be a loop of pageexpiredexception just curious..


On Sat, Mar 31, 2012 at 12:53 PM, Martin Grigorov mgrigo...@apache.org wrote:
 On Sat, Mar 31, 2012 at 12:29 AM, sudeivas sureshkumar@gmail.com wrote:
 Thanks for the information. I am currently using wicket 1.5.3.

 I hope this applies to wicket-1.5.3 as well.

 Yes


 But in my case, everything works fine. But when our session management
 fails, then we run into the following exceptions:

 PageExpiredException
 ComponentNotFoundException
 StalePageException

 This is normal. If there is no page with that version in the store
 then PageExpiredException is thrown.


 Please let me know if enabling page version will fix any of these issues.
 Also in 6.x I see an API called
 setRecreateMountedPagesAfterExpiry()

 Is this option available already in wicket-1.5.3 (by default true) ? If not,
 what happens when a page expires?

 It is available since 1.5.4.
 When page is expired Wicket will create a new instance of this page as
 its javadoc explains.


 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4520613.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




-- 
thank you,

regards,
Vineet Semwal

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



Re: Version Pages by default

2012-03-31 Thread vineet semwal
 oh sorry corrected a bit

On Sat, Mar 31, 2012 at 1:50 PM, vineet semwal
vineetsemwal1...@gmail.com wrote:
 for creation ,is it done like this in wicket if(page is creatable){
 create}else{ /*throw pageexpiredexception*/ redirect to error page }

 else there can be a loop of pageexpiredexception just curious..


 On Sat, Mar 31, 2012 at 12:53 PM, Martin Grigorov mgrigo...@apache.org 
 wrote:
 On Sat, Mar 31, 2012 at 12:29 AM, sudeivas sureshkumar@gmail.com wrote:
 Thanks for the information. I am currently using wicket 1.5.3.

 I hope this applies to wicket-1.5.3 as well.

 Yes


 But in my case, everything works fine. But when our session management
 fails, then we run into the following exceptions:

 PageExpiredException
 ComponentNotFoundException
 StalePageException

 This is normal. If there is no page with that version in the store
 then PageExpiredException is thrown.


 Please let me know if enabling page version will fix any of these issues.
 Also in 6.x I see an API called
 setRecreateMountedPagesAfterExpiry()

 Is this option available already in wicket-1.5.3 (by default true) ? If not,
 what happens when a page expires?

 It is available since 1.5.4.
 When page is expired Wicket will create a new instance of this page as
 its javadoc explains.


 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4520613.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




 --
 thank you,

 regards,
 Vineet Semwal



-- 
thank you,

regards,
Vineet Semwal

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



Re: Version Pages by default

2012-03-31 Thread sudeivas
I believe the best solution for me is to update my project to the latest
version of wicket, but still I am worried about the following issue,

https://issues.apache.org/jira/browse/WICKET-4454

since lot of our code have nested components. Any idea when 1.5.6 will be
released? (so that I can wait for sometime and update to 1.5.6)

Below is my understanding, please let me know if I misunderstood something
here.
After 1.5.6, I need to version my pages (which is true by default) and also
setRecreateMountedPagesAfterExpiry(which is true by default). What wicket
does in the background is when session management fails or session expires,
instead of just throwing run time exception (like PageExpiredException)
wicket tries to reload the page (I am not sure how many times it retries
??). By this way we may not or may get only small number of run time
exceptions. Am I right?

Sorry for too many questions because I didn't find any thread regarding page
version in latest releases. 

Thanks,
Suresh



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4521893.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Version Pages by default

2012-03-31 Thread Martin Grigorov
On Sat, Mar 31, 2012 at 6:22 PM, sudeivas sureshkumar@gmail.com wrote:
 I believe the best solution for me is to update my project to the latest
 version of wicket, but still I am worried about the following issue,

 https://issues.apache.org/jira/browse/WICKET-4454

 since lot of our code have nested components. Any idea when 1.5.6 will be
 released? (so that I can wait for sometime and update to 1.5.6)

No specific date for now, but it will be around one month after 1.5.5
has been released.


 Below is my understanding, please let me know if I misunderstood something
 here.
 After 1.5.6, I need to version my pages (which is true by default) and also
 setRecreateMountedPagesAfterExpiry(which is true by default). What wicket
 does in the background is when session management fails or session expires,
 instead of just throwing run time exception (like PageExpiredException)
 wicket tries to reload the page (I am not sure how many times it retries
 ??). By this way we may not or may get only small number of run time
 exceptions. Am I right?

Right. But only for pages mounted with #mountPage() (i.e. with MountedMapper)


 Sorry for too many questions because I didn't find any thread regarding page
 version in latest releases.

 Thanks,
 Suresh



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4521893.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Version Pages by default

2012-03-31 Thread sudeivas
The problem in our application is there is no fixed path except for the home
page. From the home page the user will navigate to a different page after
clicking on a ajax link (we use setResponsePage(new PageB(Object x)).

In Page B we have lot of widgets getting populated dynamically based on
values in Object x. In most of our cases session expires when the user is in
Page B. Currently when we are in Page B, wicket shows something like this in
the url,

http://x/xxx/wicket/page?7

How can I mount these kinds of pages where there is no fixed path to mount. 

Thanks,
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522016.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: 1.4.7 migration to 1.5.5 failing on AWS Elastic Beanstalk caused by Form class

2012-03-31 Thread roddo123
I haven't been able to have much success with visualvm in that environment. 
But a test I did do was create a wicket quickstart program, add appropriate
jars, remove the wicket label and replace it with a wicket form.  

I then created a war, and deployed it to a new elastic beanstalk
environment.

I had the exact same environment failure within about 2 minutes.Just to
note, a similar test with an unmodified quickstart program worked fine.

I can't afford more time on this any further at this point, unless there is
a simple change I am informed about.  Instead I am simply upgrading to
1.4.9.  

Perhaps this is better taken as a heads up that there appears to be some
incompatibility issue introduced in 1.5 Form class.

thanks for your assistance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/1-4-7-migration-to-1-5-5-failing-on-AWS-Elastic-Beanstalk-caused-by-Form-class-tp4521002p4522023.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: 1.4.7 migration to 1.5.5 failing on AWS Elastic Beanstalk caused by Form class

2012-03-31 Thread Igor Vaynberg
we run a few 1.5.x apps in aws on tomcat and have not experienced a
problem like this. its probably something weird in your environment.

-igor

On Sat, Mar 31, 2012 at 10:58 AM, roddo123 rfr...@rogers.com wrote:
 I haven't been able to have much success with visualvm in that environment.
 But a test I did do was create a wicket quickstart program, add appropriate
 jars, remove the wicket label and replace it with a wicket form.

 I then created a war, and deployed it to a new elastic beanstalk
 environment.

 I had the exact same environment failure within about 2 minutes.    Just to
 note, a similar test with an unmodified quickstart program worked fine.

 I can't afford more time on this any further at this point, unless there is
 a simple change I am informed about.  Instead I am simply upgrading to
 1.4.9.

 Perhaps this is better taken as a heads up that there appears to be some
 incompatibility issue introduced in 1.5 Form class.

 thanks for your assistance.

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/1-4-7-migration-to-1-5-5-failing-on-AWS-Elastic-Beanstalk-caused-by-Form-class-tp4521002p4522023.html
 Sent from the Users forum mailing list archive at Nabble.com.

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


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



Re: Version Pages by default

2012-03-31 Thread Martin Grigorov
You need to mount PageB with mountPage(/pageb, PageB.class) and use
setResponsePage(PageB.class, parameters)

'parameters' should bring a key/value that will be used to create a
proper objectX, e.g. a key which will be used to load an entity from
DB.
And there is no need to use AjaxLink if you always redirect to another
page, use a normal Link/BookmarkablePageLink instead.

On Sat, Mar 31, 2012 at 7:53 PM, sudeivas sureshkumar@gmail.com wrote:
 The problem in our application is there is no fixed path except for the home
 page. From the home page the user will navigate to a different page after
 clicking on a ajax link (we use setResponsePage(new PageB(Object x)).

 In Page B we have lot of widgets getting populated dynamically based on
 values in Object x. In most of our cases session expires when the user is in
 Page B. Currently when we are in Page B, wicket shows something like this in
 the url,

 http://x/xxx/wicket/page?7

 How can I mount these kinds of pages where there is no fixed path to mount.

 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522016.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: Version Pages by default

2012-03-31 Thread sudeivas
This idea sounds good to me rather than just passing the whole JAVA object.
But this raises an another question. Since I am just passing PageParameters
to the page, in the beginning it will be a stateless page. But when I start
using Ajax components inside the page, then it becomes a stateful page and
it gets stored in the session. Please let me know if I misunderstood
something. 

Thanks,
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522200.html
Sent from the Users forum mailing list archive at Nabble.com.

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



isJavaEnabled does not work

2012-03-31 Thread Andre Schütz
Hello,

I use wicket 1.5.4 or 1.5.5 with Opera and Firefox. I checked with
the following lines:

Application:
-
protected void init() {
  super.init();
  getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
...
}

MyWebPage:
-
WebSession session = WebSession.get();
if (session.getClientInfo().getProperties().isJavaEnabled()) {
  System.out.println(enabled);
}
else {
  System.out.println(disabled);
}

With Opera 11.62 or Firefox 11 I always get disabled. I checked the 
settings and Javascript is enabled in both browsers.

Additionally, I tried the website:
http://wicketstuff.org/wicket/hellobrowser/howdy

The same result. JavaEnabled = false.

Any ideas?

-- 
Andre Schütz wic...@faustas.de

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



Re: Wicketstuff - Openlayers: not working with wicket 1.5.5?

2012-03-31 Thread Michael Allan
   final Layer layerOSMTilesAtHome = new OSM(Osmarender,
 OSMLayer.TilesAtHome);

The Osmarender renderer became unavailable recently (not sure why).
Comment out the lines that refer to it, and to layerOSMTilesAtHome.

This has nothing to do with Wicket.

-- 
Michael Allan

Toronto, +1 416-699-9528
http://zelea.com/


datazuul said:
 Hi I tried to embed an openstreetmap in my page with the code from
 SimpleOpenStreetMapPage (wicketstuff openlayers example):
 
 final ListLayer layers = new ArrayListLayer();
 
   final Layer layerOSMTilesAtHome = new OSM(Osmarender,
 OSMLayer.TilesAtHome);
   final Layer layerOSMMapnik = new OSM(Mapnik, OSMLayer.Mapnik);
   final Layer layerOSMCycleMap = new OSM(CycleMap, OSMLayer.CycleMap);
 
   layers.add(layerOSMMapnik);
   layers.add(layerOSMTilesAtHome);
   layers.add(layerOSMCycleMap);
 
   final HashMapString, String mapOptions = new HashMapString, 
 String();
   final Bounds boundsExtend = new Bounds(new LonLat(-20037508.34,
 -20037508.34), new LonLat(20037508.34,
   20037508.34));
   mapOptions.put(maxExtent, boundsExtend.getJSconstructor());
   mapOptions.put(projection, new 
 OpenLayers.Projection('EPSG:900913'));
   mapOptions.put(displayProjection, new
 OpenLayers.Projection('EPSG:4326'));
   mapOptions.put(units, 'meters');
   mapOptions.put(maxResolution, 156543);
   mapOptions.put(numZoomLevels, 18);
 
   final OpenLayersMap map = new OpenLayersMap(map, true, layers,
 mapOptions);
 
   map.addControl(Control.LayerSwitcher);
   map.addControl(Control.MousePosition);
   map.addControl(Control.KeyboardDefaults);
 
   // map.setCenter(new LonLat(10.2, 48.9));
   // map.setZoom(3);
 
   add(map);
 
 but nothing is rendered.
 
 Javascript error: 
 Error: OpenLayers.Layer.OSM.Osmarender is not a constructor
 Line: var osm26507926 =new OpenLayers.Layer.OSM.Osmarender('Osmarender');
 
 Anyone using OpenLayersMap and knows how to get it working?
 
 (I already tried this fix, mentioned by another user:
 private static final String OPEN_LAYERS_VERSION = 2.11; in OpenLayersMap,
 didn't help)

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



Re: Version Pages by default

2012-03-31 Thread Martin Grigorov
On Sat, Mar 31, 2012 at 10:05 PM, sudeivas sureshkumar@gmail.com wrote:
 This idea sounds good to me rather than just passing the whole JAVA object.
 But this raises an another question. Since I am just passing PageParameters
 to the page, in the beginning it will be a stateless page. But when I start
 using Ajax components inside the page, then it becomes a stateful page and
 it gets stored in the session. Please let me know if I misunderstood
 something.

Correct, Ajax component/behavior makes the page stateful.


 Thanks,
 Suresh

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Version-Pages-by-default-tp4520432p4522200.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: isJavaEnabled does not work

2012-03-31 Thread Martin Grigorov
The method says Java, not JavaScript.
The page that extracts the extra info uses JavaScript to do that, so
it is enabled.

2012/3/31 Andre Schütz wic...@faustas.de:
 Hello,

 I use wicket 1.5.4 or 1.5.5 with Opera and Firefox. I checked with
 the following lines:

 Application:
 -
 protected void init() {
  super.init();
  getRequestCycleSettings().setGatherExtendedBrowserInfo(true);
 ...
 }

 MyWebPage:
 -
 WebSession session = WebSession.get();
 if (session.getClientInfo().getProperties().isJavaEnabled()) {
  System.out.println(enabled);
 }
 else {
  System.out.println(disabled);
 }

 With Opera 11.62 or Firefox 11 I always get disabled. I checked the
 settings and Javascript is enabled in both browsers.

 Additionally, I tried the website:
 http://wicketstuff.org/wicket/hellobrowser/howdy

 The same result. JavaEnabled = false.

 Any ideas?

 --
 Andre Schütz wic...@faustas.de

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




-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



HOWTO to only skip required validators

2012-03-31 Thread Emmanouil Batsis (Manos)


I have a usecase for saving a draft of a form before actually submitting it.

I'm trying to figure out how to only skip the required validators 
using a save draft submit button in my form. Disabling default form 
processing sounds like using a bazooka to shoot down a fly considering 
my form has a dynamic number of fields etc.


My only thought so far is to keep a reference of mandatory fields and 
call their setRequired with false within the submit button's onSubmit.


Would that work? Is there a better way?

Cheers,

Maons

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



Re: HOWTO to only skip required validators

2012-03-31 Thread Jeff Schneller
Don't mark the fields as required and check the fields during the submit of the 
save and throw appropriate error message. The save as draft would not check the 
fields. It is not the most elegant solution but it works and is easy to 
implement. 


On Mar 31, 2012, at 10:18 PM, Emmanouil Batsis (Manos) ma...@abiss.gr wrote:

 
 I have a usecase for saving a draft of a form before actually submitting it.
 
 I'm trying to figure out how to only skip the required validators using a 
 save draft submit button in my form. Disabling default form processing 
 sounds like using a bazooka to shoot down a fly considering my form has a 
 dynamic number of fields etc.
 
 My only thought so far is to keep a reference of mandatory fields and call 
 their setRequired with false within the submit button's onSubmit.
 
 Would that work? Is there a better way?
 
 Cheers,
 
 Maons
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 

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