wicket log4j MDC

2009-03-30 Thread daniel . lipski . pl
Hi

I would like to add MDC information(i.e. user login) to my loggs (log4j).
To do that I have to call MDC.put at the beggining of request
handling. Im looking for 'interception' functionality in Wicket to add
MDC code there. Where I should add such code ? RequestCycle ?

Regards
Daniel



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



Re: Multi-module applications in Wicket

2009-02-02 Thread Daniel Lipski

Thanks for your help. I havnt tried this yet becaouse this involves some
refactoring and I wanted to be sure that I'll choose correct solution.



Daniel Stoch-2 wrote:
 
 No, I don't say you need OSGi container, but in more complex
 environments it may be helpful.
 Of course you can, as you wrote, map WicketFilter multiple times and
 this should work - why you didn't try this yet? :)
 
 --
 Daniel
 
 On Mon, Feb 2, 2009 at 12:03 PM, Daniel Lipski
 daniel.lipski...@gmail.com wrote:

 Do I really need OSGi container ?(OSGi is great idea, but I would like to
 keep this simple)
 Why I cant just map WicketFilter multiple times ? I would like to stay
 with
 one war deployed on Tomcat container.


 Daniel Stoch-2 wrote:

 Maybe you should look at OSGi? Then each of your application can be
 defined inside a different bundle and runs on the same JVM. We are
 using such approach in our environment and it works very well. A small
 downside of such solution is that you have to learn what is it and how
 to use OSGi (unless you already know it ;)).

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

-- 
View this message in context: 
http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21788104.html
Sent from the Wicket - User 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: Multi-module applications in Wicket

2009-02-02 Thread Daniel Lipski

Do I really need OSGi container ?(OSGi is great idea, but I would like to
keep this simple) 
Why I cant just map WicketFilter multiple times ? I would like to stay with
one war deployed on Tomcat container.


Daniel Stoch-2 wrote:
 
 Maybe you should look at OSGi? Then each of your application can be
 defined inside a different bundle and runs on the same JVM. We are
 using such approach in our environment and it works very well. A small
 downside of such solution is that you have to learn what is it and how
 to use OSGi (unless you already know it ;)).
 
 --
 Daniel
 
 On Mon, Feb 2, 2009 at 10:39 AM, Daniel Lipski
 daniel.lipski...@gmail.com wrote:

 yes, they use the same service layer and the same caches. Whats more its
 easier to deploy  build one war insted of many. Does your question
 suggests
 that there are problems with few Wicket filters in one webapp ?


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

-- 
View this message in context: 
http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21787722.html
Sent from the Wicket - User 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: Multi-module applications in Wicket

2009-02-02 Thread Daniel Lipski

yes, they use the same service layer and the same caches. Whats more its
easier to deploy  build one war insted of many. Does your question suggests
that there are problems with few Wicket filters in one webapp ?


Thomas Mäder wrote:
 
 What you call modules really sounds like different web applications (in
 the java servlet sense). Is there a reason you cannot have multiple WARs?
 
 Thomas
 
 On Sun, Feb 1, 2009 at 2:09 PM, Daniel Lipski
 daniel.lipski...@gmail.comwrote:
 

 Hi

 Im working on web application divided into multiple 'modules' and Im
 wondering how to use Wicket in such
 scenario. Because 'module' means a lot, I'll specify what I would like to
 achive:
 1)diffrent home pages for each module
 2)diffrent session classes for each module (WebApplication.newSession)
 3)diffrent authentications (ie. module A - SSO, module B - web form)

 I can imagine two approaches:
 1)one Wicket application 'handling' both modules.But...:
 -because there is one appication I'll have to check logged user in
 WebApplication.newSession  WebApplication.getHomePage and return proper
 session object/home page class. Decision is taken on logged user, so in
 that
 methods Ill have to know which user has logged in. Is it possible to
 check
 logged user in this methods ? (arent they called before authentication ?)
 The other way is to make a decission not on logged user but on accessed
 Page
 (all pages in moduleA inherit from ModuleAWebPage and pages in moduleB
 inherit from ModuleBWebPage). But I doubt if requested page is avaliable
 in
 this two methods...
 -module A uses SSO to authenticate user, module B uses usual page, where
 should I choose how to authenticate user ? Which authenticating framework
 should I choose for this purpose ? (auth-roles, WASP ?)

 2)Two Wicket applications each 'handling' one module. Because there are
 two
 WebApplications there is no problem with determinig which session
 object/home page class return. There is no problem with diffrent
 authentications either.
 But...:
 -Is it possible  ? Can I map WicketFilter few times in web.xml ? I know
 that
 Wicket does a lots internal and I dont know if multiple Wicket
 'instances'
 can be run in one classloader. Are there any caveats/limitations when
 multiple Wicket instances work in parell (does Application.get() or other
 static methods still work - I saw that they are implemened with
 ThreadLocal
 but ...?)
 -How running multiple Wicket instances influences session size and other
 resources ?
 -Ther is a lot of settings (DI, mounting startegies, 'global' converters,
 global resources) that need to be shared beetweend this two modules. For
 majority of them I can make super class for both ModuleAWebApplication
 and
 ModuleBWebApplication and put common code there, but does moduleA can
 access
 shared by moduleB resources ?
 -It looks a little bit strange for me to create diffrent Wicket Web
 applications for each module. From the 'outside'(servlet container) its
 still one apllication (one war) so there is a little mismatch. Of course
 this is the least siginificant reason but I would like to use proper
 solutions rather then stretch the wrong one.

 For now Im closer to solution 2), but I worry about things which I havnt
 foreseen. Maybe there is general rule/pattern/solution for writing
 multi-module web applciaions ? Im sure its common issue and many of you
 could share some experience.

 Thanks for any help.
 Regards
 Daniel


 --
 View this message in context:
 http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21774998.html
 Sent from the Wicket - User 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


 
 
 -- 
 Thomas Mäder
 www.devotek-it.ch
 
 

-- 
View this message in context: 
http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21786663.html
Sent from the Wicket - User 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



Multi-module applications in Wicket

2009-02-01 Thread Daniel Lipski

Hi

Im working on web application divided into multiple 'modules' and Im
wondering how to use Wicket in such 
scenario. Because 'module' means a lot, I'll specify what I would like to
achive:
1)diffrent home pages for each module
2)diffrent session classes for each module (WebApplication.newSession)
3)diffrent authentications (ie. module A - SSO, module B - web form)

I can imagine two approaches:
1)one Wicket application 'handling' both modules.But...:
-because there is one appication I'll have to check logged user in
WebApplication.newSession  WebApplication.getHomePage and return proper
session object/home page class. Decision is taken on logged user, so in that
methods Ill have to know which user has logged in. Is it possible to check
logged user in this methods ? (arent they called before authentication ?)
The other way is to make a decission not on logged user but on accessed Page
(all pages in moduleA inherit from ModuleAWebPage and pages in moduleB
inherit from ModuleBWebPage). But I doubt if requested page is avaliable in
this two methods...
-module A uses SSO to authenticate user, module B uses usual page, where
should I choose how to authenticate user ? Which authenticating framework
should I choose for this purpose ? (auth-roles, WASP ?)

2)Two Wicket applications each 'handling' one module. Because there are two
WebApplications there is no problem with determinig which session
object/home page class return. There is no problem with diffrent
authentications either. 
But...:
-Is it possible  ? Can I map WicketFilter few times in web.xml ? I know that
Wicket does a lots internal and I dont know if multiple Wicket 'instances'
can be run in one classloader. Are there any caveats/limitations when
multiple Wicket instances work in parell (does Application.get() or other
static methods still work - I saw that they are implemened with ThreadLocal
but ...?)
-How running multiple Wicket instances influences session size and other
resources ?
-Ther is a lot of settings (DI, mounting startegies, 'global' converters,
global resources) that need to be shared beetweend this two modules. For
majority of them I can make super class for both ModuleAWebApplication and
ModuleBWebApplication and put common code there, but does moduleA can access
shared by moduleB resources ?
-It looks a little bit strange for me to create diffrent Wicket Web
applications for each module. From the 'outside'(servlet container) its
still one apllication (one war) so there is a little mismatch. Of course
this is the least siginificant reason but I would like to use proper
solutions rather then stretch the wrong one.

For now Im closer to solution 2), but I worry about things which I havnt
foreseen. Maybe there is general rule/pattern/solution for writing
multi-module web applciaions ? Im sure its common issue and many of you
could share some experience.

Thanks for any help.
Regards
Daniel 


-- 
View this message in context: 
http://www.nabble.com/Multi-module-applications-in-Wicket-tp21774998p21774998.html
Sent from the Wicket - User 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: testing borders with WicketTester

2008-11-03 Thread Daniel Lipski

I still dont get it, maybe I miss something but I think that borders also
have everything they need to render them selves. 
When you provide empty body to border it will render itself and you will be
able to test it (the same way you test panel). 
I know that sometimes it will be nesessery to provide some expected body to
border to test it(and then probably you are forced to write some panel/page)
but there are cases when you could test it with some stub, static, hardcoded
body.
I know that now it is possible to test such borders so its not limitation of
WicketTester but it would be conveniently if WicketTester could support
testing borders with some predefined body easiler.
Its not about limitation of WicketTester ,its about providing functionality
to easier test such borders.
What do you think about it ?

I know that it is possible to create a generic panel/page to test borders
but it is also easy to create generic page to work with panels, but despite
this WicketTester provides method to test panels but doesnt provide similar
method to test borders(borders which you could test with some stub body). 


igor.vaynberg wrote:
 
 self contained in that the page and panel has everything they need to
 render themselves. a border is meant to be embedded in a page or
 panel, not work independently. anyways, its really easy to create a
 generic panel to facilitate the testing of borders.
 
 -igor
 
 On Sun, Nov 2, 2008 at 2:57 AM, Daniel Lipski
 [EMAIL PROTECTED] wrote:

 Sorry, but I dont get your point...
 What do you mean self contained (in terms of Wicket API) ?

 Im sure there is a lot of user created border components which contain a
 lot
 of surrounding markup and components and it is very desireble(at least
 for
 me :)) to be able to 'unit' test such components with Wicket tester,
 regardles (i.e with empty) to border body.
 Does method Im looking for was not provided because of technical problems
 ?
 If so what is the simplest way to test border components (surrounding
 markup
 and components) with i.e empty body ?

 Regards
 Daniel Lipski


 igor.vaynberg wrote:

 borders are not meant to be self-contained like panels. they are meant
 to be used within something that contains markup, eg page or panel.

 -igor

 On Fri, Oct 31, 2008 at 8:14 AM, dlipski [EMAIL PROTECTED]
 wrote:

 Hi

 Is it possible (if not why?) to test Border components in a way similar
 to
 testing Panels ?  -WicketTester.startPanel(TestPanelSource) ? Its
 strange
 but I cant find corresponding method for Borders.

 Thanks in advance.

 Daniel Lipski
 --
 View this message in context:
 http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20268028.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/testing-borders-with-WicketTester-tp20268028p20288374.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/testing-borders-with-WicketTester-tp20268028p20298543.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: testing borders with WicketTester

2008-11-02 Thread Daniel Lipski

Sorry, but I dont get your point...
What do you mean self contained (in terms of Wicket API) ?

Im sure there is a lot of user created border components which contain a lot
of surrounding markup and components and it is very desireble(at least for
me :)) to be able to 'unit' test such components with Wicket tester,
regardles (i.e with empty) to border body. 
Does method Im looking for was not provided because of technical problems ?
If so what is the simplest way to test border components (surrounding markup
and components) with i.e empty body ?

Regards
Daniel Lipski


igor.vaynberg wrote:
 
 borders are not meant to be self-contained like panels. they are meant
 to be used within something that contains markup, eg page or panel.
 
 -igor
 
 On Fri, Oct 31, 2008 at 8:14 AM, dlipski [EMAIL PROTECTED]
 wrote:

 Hi

 Is it possible (if not why?) to test Border components in a way similar
 to
 testing Panels ?  -WicketTester.startPanel(TestPanelSource) ? Its strange
 but I cant find corresponding method for Borders.

 Thanks in advance.

 Daniel Lipski
 --
 View this message in context:
 http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20268028.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/testing-borders-with-WicketTester-tp20268028p20288374.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: testing borders with WicketTester

2008-11-02 Thread Daniel Lipski

No, I think you misunderstood me, when I wrote about empty body I was
thinking about testing, I know that border without its body works like panel
and shouldnt be used in such case. 
I was writing about borders which have bodies, but during testing I was
interested in testing such borders with some 'stub' (ie empty) body.


jwcarman wrote:
 
 Are you sure you don't want to use markup inheritance rather than borders?
 
 On Sun, Nov 2, 2008 at 5:57 AM, Daniel Lipski
 [EMAIL PROTECTED] wrote:

 Sorry, but I dont get your point...
 What do you mean self contained (in terms of Wicket API) ?

 Im sure there is a lot of user created border components which contain a
 lot
 of surrounding markup and components and it is very desireble(at least
 for
 me :)) to be able to 'unit' test such components with Wicket tester,
 regardles (i.e with empty) to border body.
 Does method Im looking for was not provided because of technical problems
 ?
 If so what is the simplest way to test border components (surrounding
 markup
 and components) with i.e empty body ?

 Regards
 Daniel Lipski


 igor.vaynberg wrote:

 borders are not meant to be self-contained like panels. they are meant
 to be used within something that contains markup, eg page or panel.

 -igor

 On Fri, Oct 31, 2008 at 8:14 AM, dlipski [EMAIL PROTECTED]
 wrote:

 Hi

 Is it possible (if not why?) to test Border components in a way similar
 to
 testing Panels ?  -WicketTester.startPanel(TestPanelSource) ? Its
 strange
 but I cant find corresponding method for Borders.

 Thanks in advance.

 Daniel Lipski
 --
 View this message in context:
 http://www.nabble.com/testing-borders-with-WicketTester-tp20268028p20268028.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/testing-borders-with-WicketTester-tp20268028p20288374.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/testing-borders-with-WicketTester-tp20268028p20298317.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]