Re: prepulating a form and changing behaviour

2008-10-12 Thread Timo Rantalaiho
On Fri, 10 Oct 2008, miro wrote:
> I have  a Page which has a form   , I assume prepopulating is just  setting
> model object to my form which has the same properties as the form is this
> right ?

Well, more or less. Each FormComponent must resolve its 
modelObject to the desired default value. Read the wiki page
on models and try out for example by modifying the Form
examples from wicket-examples.

> Second   If I want to  change the   construction   of the page with
> extending this class   and overriding some methods   in this case do I have
> to create a new bookmark ?

What?-)

Best wishes,
Timo

-- 
Timo Rantalaiho   
Reaktor Innovations Oyhttp://www.ri.fi/ >

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



Re: Presentation web with some stateful components - removing jsessionid+ all PageExpired exceptions

2008-10-12 Thread igor . vaynberg
why is session created on the first request? If that page was
stateless there would be no session created...

-Igor


On 10/12/08, Stefan Simik <[EMAIL PROTECTED]> wrote:
>
> We are creating website. One part is standard presentation web, second part
> is administration site, where we take all advantages of wicket's state
> management.
>
> The important part here, is first presentation part.
> Here, all the URLs must be bookmarkable. On some special pages, we use
> stateful components (Gmap2). but URL of these pages are also bookmarkable.
> Usage of these stateful components forces http-session creation on these
> pages.
>
> AT THE VERY FIRST REQUEST - this makes all our bookmarkable pages
> not-bookmarkable,
> because of jsessionid added by servlet container.
>
> This is serious problem because of:
>   - At the very first page - all links have jsessionid, so if the
> user bookmarks any of the links, he gets Session-Expired error.
>
>   - Bots as Google bot, Yahoo remember pages with jsessionid, ... -> but
> solution for this is very easy:
>   - a) Use special filter,
>   - b) or use special Response
>   which cuts out the existing jsessionid string. No problem so far.
>
>
>
>
> After reading this article:
> http://www.nabble.com/Removing-the-jsessionid-for-SEO-td16464534i20.html#a16646137
> we thought about all possible solutions and we found this way as the best
> for our web site.
> Remember please, that it is for standard presentation web, where
>   - no jsessionid should appear
>   - no session-expired errors are acceptable
>
> I think, this will be common use case for many others.
>
>
> 1. use filter/response, that cuts off the jsessionid if bot is detected in
> User-Agent header
> This solves problem for all search result URLs.
>
> 2. use our custom SessionExpiredPage, which has its own logic:
> a) if it detects bookmarkable page -> cuts off jsessionid and redirects
> to the standard bookmarkable URL
> b) if it detects, that it is stateful page (by introspecting URL - for
> example contains ILinkListener and path
>to pagemap -> then redirect to the home page.
>
>We think that it is quite acceptable solution for presentation web-
> see example:
>You have a homepage. This page has bookmarkable URL, but has some
> stateful components - for example Gmap2 map,
>which is ajax component. This stateful components forces http-session
> creation and makes all links with jsessionid
>at the very first request. When user bookmarks some URL, he saves
> stateful bookmark (with jsessionid). When user
>clicks on the bookmark later, he gets Session expired error -> which
> causes calling of our custom Page-Expired page.
>This page introspects original Request, and detects, that it is
> standard bookmarkable page, so cuts off the jsessionid,
>and redirect to the normal URL, without problematic jsessionid.
>
>
>In case 2 - where the session actually expired on some stateful page
> with non-bookmarkable URL -> user will be redirected to the home page.
>In case 3 - where presentation web works with user accounts and user
> must be logged on some secure pages - here, session really expired -> then
> special UserNotLoggedException can be thrown, and
> handled by redirecting to the login page.
>
>
>
>What do you think about this solution (for eliminating PageExpired
> and jsessionid on presentation web sites) ?
>Are there any further pros and cons of this solution ?
>
> --
> View this message in context:
> http://www.nabble.com/Presentation-web-with-some-stateful-components---removing-jsessionid%2B-all-PageExpired-exceptions-tp19943729p19943729.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]



Developer.com product of the year nominations

2008-10-12 Thread Serkan Camurcuoglu
I don't know if it's too late but I've seen it today that developer.com is 
accepting nominations for its product of the year competition. Today is the 
last day of nomination. I've nominated Wicket for framework of the year. Maybe 
people would like to do so at 
http://solutions.internet.com/index.php/5176_default/01bdfa206250f2dab9169eb522bf46cf
 . Note that this is just the nomination phase, actual voting shall begin on 
November 3rd..


Presentation web with some stateful components - removing jsessionid+ all PageExpired exceptions

2008-10-12 Thread Stefan Simik

We are creating website. One part is standard presentation web, second part
is administration site, where we take all advantages of wicket's state
management.

The important part here, is first presentation part.
Here, all the URLs must be bookmarkable. On some special pages, we use
stateful components (Gmap2). but URL of these pages are also bookmarkable.
Usage of these stateful components forces http-session creation on these
pages. 

AT THE VERY FIRST REQUEST - this makes all our bookmarkable pages
not-bookmarkable,
because of jsessionid added by servlet container.

This is serious problem because of:
  - At the very first page - all links have jsessionid, so if the 
user bookmarks any of the links, he gets Session-Expired error.
  
  - Bots as Google bot, Yahoo remember pages with jsessionid, ... -> but
solution for this is very easy: 
  - a) Use special filter, 
  - b) or use special Response
  which cuts out the existing jsessionid string. No problem so far.


  
  
After reading this article:
http://www.nabble.com/Removing-the-jsessionid-for-SEO-td16464534i20.html#a16646137
we thought about all possible solutions and we found this way as the best
for our web site.
Remember please, that it is for standard presentation web, where 
  - no jsessionid should appear
  - no session-expired errors are acceptable
  
I think, this will be common use case for many others.


1. use filter/response, that cuts off the jsessionid if bot is detected in
User-Agent header
This solves problem for all search result URLs.

2. use our custom SessionExpiredPage, which has its own logic:
a) if it detects bookmarkable page -> cuts off jsessionid and redirects
to the standard bookmarkable URL
b) if it detects, that it is stateful page (by introspecting URL - for
example contains ILinkListener and path
   to pagemap -> then redirect to the home page.

   We think that it is quite acceptable solution for presentation web-
see example:
   You have a homepage. This page has bookmarkable URL, but has some
stateful components - for example Gmap2 map,
   which is ajax component. This stateful components forces http-session
creation and makes all links with jsessionid
   at the very first request. When user bookmarks some URL, he saves
stateful bookmark (with jsessionid). When user
   clicks on the bookmark later, he gets Session expired error -> which
causes calling of our custom Page-Expired page. 
   This page introspects original Request, and detects, that it is
standard bookmarkable page, so cuts off the jsessionid, 
   and redirect to the normal URL, without problematic jsessionid.
   
  
   In case 2 - where the session actually expired on some stateful page
with non-bookmarkable URL -> user will be redirected to the home page.
   In case 3 - where presentation web works with user accounts and user
must be logged on some secure pages - here, session really expired -> then
special UserNotLoggedException can be thrown, and
handled by redirecting to the login page.



   What do you think about this solution (for eliminating PageExpired
and jsessionid on presentation web sites) ? 
   Are there any further pros and cons of this solution ?
  
-- 
View this message in context: 
http://www.nabble.com/Presentation-web-with-some-stateful-components---removing-jsessionid%2B-all-PageExpired-exceptions-tp19943729p19943729.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: Mount URL to another host?

2008-10-12 Thread Zach Cox

I'm sure calling setResponsePage with a new RedirectPage would work equally
well.


Uwe Schäfer-2 wrote:
> 
> doesn´t this work there?
> 
> class SomethingPage extends WebPage { // mounted accordingly
> public SomethingPage (){
> setResponsePage(new RedirectPage("http://othersite.com";));
> }}
> 
> cu uwe
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Mount-URL-to-another-host--tp19921980p19940933.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]



Howto assign ResourceBundle to component in unit-test?

2008-10-12 Thread Per Newgro
Hi *,

i try to test a component which displays some strings getting localized
by a higher ranking component. AFAIK wicket uses a hierarchical process
to get the appropriate string. Normally the component under test will
be added to a panel and this provides the appropriate properties file.
But for unit testing i don't want to add a dummy panel.

Is there a way (settings, global properties) to provide a properties file to
the application or wicket tester?

Thanks
Per

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



Re: Mount URL to another host?

2008-10-12 Thread Uwe Schäfer

Zach Cox schrieb:

I need the browser to actually redirect the user to http://othersite.com if
they go to http://mysite.com/something, regardless of if they click a link
or type it into the address bar.


doesn´t this work there?

class SomethingPage extends WebPage { // mounted accordingly
public SomethingPage (){
setResponsePage(new RedirectPage("http://othersite.com";));
}}

cu uwe

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