Re: isVisible vs. setVisible
Never underestimate the power of the Dark Side! :) Jonathan Locke wrote: i imagine setVisible came from me. just because setters are evil and you should avoid them when you can does not mean you should not use them when you need them. Matthijs Wensveen-2 wrote: Of course I have a few things to learn, and I hope I never stop learning. The article you provide is interesting. My opinion is that for domain entity objects, getters and setters are certainly not evil. For classes that are more service-like, getters and setters could be useful but should be considered well. In case you choose not to have a getter and a setter one should be extra careful when choosing method names. I usually expect a setVisible method when there is also an isVisible method. Immutable classes, or classes with read-only properties can choose to only provide a getter for some properties. But if a method like isVisible is intended to be overridden something like public boolean visible() might be better. But I guess this is also a matter of style and taste. As for Component.set/isVisible, I like that I can do both, even if it gives me the possibility of ambiguous code like new Component() {isVisible() {return true;};}.setVisible(false) or something like that (it is actually not ambiguous at all of course, but you do have to read extra careful). So whatever reason you (core devs) originally had for providing a setter, I am thankful for that. Matthijs Jonathan Locke wrote: i think you may have a few things to learn and it is not exactly controversial to prefer immutability or encapsulation... setters break encapsulation and i think it is safe to say decades of experience with object systems is on my side, including industry luminaries like: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html Matthijs Wensveen-2 wrote: Jonathan Locke wrote: true. in the isVisible impl you could lazy-init cache a transient Boolean until end request where you set it null. setters are evil. ..but it's good to have choice. *And* setVisible is not a normal setter, because it returns the component, which makes it easy to add an initially invisible component like: add(new Label("profanity", "[EMAIL PROTECTED]").setVisible(false)); Also, with is/setVisible you van use the component with a propertymodel to have some other component toggle the visibility of another component. This way you have the best of both worlds. A little off-topic: It scares me a little when core developer make bold statements like: "setters are evil" and "I wouldn't mind final was the default in java". Maybe I'm just being paranoid here... Matthijs egolan74 wrote: Yes but ... isVisible may be triggered several times, while setVisible should only be called once (say if I do it only once after creating the component). Usually I prefer the state driven way, but what if the logic has a lot of overhead? Jonathan Locke wrote: isVisible is generally better imo because it is state driven. if you push instead of pull, the state can get stale. -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - 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] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible vs. setVisible
i imagine setVisible came from me. just because setters are evil and you should avoid them when you can does not mean you should not use them when you need them. Matthijs Wensveen-2 wrote: > > Of course I have a few things to learn, and I hope I never stop > learning. The article you provide is interesting. > > My opinion is that for domain entity objects, getters and setters are > certainly not evil. For classes that are more service-like, getters and > setters could be useful but should be considered well. In case you > choose not to have a getter and a setter one should be extra careful > when choosing method names. I usually expect a setVisible method when > there is also an isVisible method. Immutable classes, or classes with > read-only properties can choose to only provide a getter for some > properties. But if a method like isVisible is intended to be overridden > something like public boolean visible() might be better. But I guess > this is also a matter of style and taste. > > As for Component.set/isVisible, I like that I can do both, even if it > gives me the possibility of ambiguous code like new Component() > {isVisible() {return true;};}.setVisible(false) or something like that > (it is actually not ambiguous at all of course, but you do have to read > extra careful). So whatever reason you (core devs) originally had for > providing a setter, I am thankful for that. > > Matthijs > > Jonathan Locke wrote: >> i think you may have a few things to learn and it is not exactly >> controversial to prefer immutability or encapsulation... setters break >> encapsulation and i think it is safe to say decades of experience with >> object systems is on my side, including industry luminaries like: >> >> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html >> >> >> Matthijs Wensveen-2 wrote: >> >>> Jonathan Locke wrote: >>> true. in the isVisible impl you could lazy-init cache a transient Boolean until end request where you set it null. setters are evil. >>> ..but it's good to have choice. *And* setVisible is not a normal setter, >>> because it returns the component, which makes it easy to add an >>> initially invisible component like: add(new Label("profanity", >>> "[EMAIL PROTECTED]").setVisible(false)); >>> >>> Also, with is/setVisible you van use the component with a propertymodel >>> to have some other component toggle the visibility of another component. >>> This way you have the best of both worlds. >>> >>> A little off-topic: It scares me a little when core developer make bold >>> statements like: "setters are evil" and "I wouldn't mind final was the >>> default in java". Maybe I'm just being paranoid here... >>> >>> Matthijs >>> >>> egolan74 wrote: > Yes but ... > isVisible may be triggered several times, while setVisible should only > be > called once (say if I do it only once after creating the component). > Usually I prefer the state driven way, but what if the logic has a lot > of > overhead? > > > > Jonathan Locke wrote: > > >> isVisible is generally better imo because it is state driven. if you >> push instead of pull, the state can get stale. >> >> >> >> > > >>> -- >>> Matthijs Wensveen >>> Func. Internet Integration >>> W http://www.func.nl >>> T +31 20 423 >>> F +31 20 4223500 >>> >>> >>> - >>> 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/isVisible-vs.-setVisible-tp17860615p17879066.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: isVisible vs. setVisible
well, i think we simply live with a choice among evils. setters (and getters) are not good (in fact, mutable state in general is problematic) and other things are also bad, but java is not perfect and sometimes a non-ideal technique is needed to get something done. Eelco Hillenius wrote: > >> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html > > Personally, I think that article is a bit far fetched. For a whole > bunch of reasons, immutability should often be preferred, but at the > same time Wicket is an example of a framework where mutability plays a > big role (or we would have been fine providing a declarative > programming model). > > The best sentence from that article to me is 'My point is that you > should not program blindly.' :-) > > Eelco > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/isVisible-vs.-setVisible-tp17860615p17879044.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: Wicket NTLM/Single-sign-on integration Question
I have this: @Override public boolean authenticate(String username, String password) { Person person = new Person(); person.setAlias(username); person.setPassword(password); return dBDao.authorizePerson(person); } public boolean isAuthorized() { return authorized; } public void setAuthorized(boolean authorized) { this.authorized = authorized; if (authorized) { getPerson().setLoggedIn(true); } // Call below too! signIn(getPerson().getAlias(), getPerson().getPassword()); } @Override protected Class getSignInPageClass() { return LoginPage.class; } Which means that I use a custom page for loggin in, and sort of can login how I want to... Ravi_116 wrote: Nino - Thanks for the reply The AuthenticatedWebSession has the isSignedIn() method defined "final". So cannot extend and override it. /** * @return True if the user is signed in to this session */ public final boolean isSignedIn() { return signedIn; } Ravi Nino.Martinez wrote: Ravi_116 wrote: What is best way to integrate NTLM with Wicket authentication module ? Currently, we are migrating from Standard Login page implementation to a JCIF's NTLM (Windows domain credentials). JCIF's provides a convenient servlet filter to do the NTLM handshake. It sticks the username in the HttpServlet.getRemoteUser(). The current implementation of the wicket is to extend AuthenticatedWebSession and provide a MyAppWebSession authenticate method and a login page. @Override protected Class getSignInPageClass() { return LoginPage.class; } @Override protected Class getWebSessionClass() { return MyAppWebSession.class; } public class MyAppWebSession extends AuthenticatedWebSession { public boolean authenticate(String userName, String password) { // This is not the NTLM authentication, i need to get the username provided by NTLM here myAuthenticator.authenticate(username) } } How does wicket determine to show a login-page in the Wicket Application ? Seems like it's not using getHttpServletRequest().getRemoteUser() It's just using the information you provide above... So it should be a clean plug, you should just forward username and password in your above code... that's what I do using my own authenticator. I think it sets a simple property if youre signed in or not based on the above authenticate.. There seems to be a couple of ways to tackle this issue : 1. Use wicket's IAuthorizationStratergy and plugin NtlmAuthenticator (from JCIF's) into this and add the additional authentication to it. 2. Use Swarm authentication framework. 3. Propagate the username from getHttpServletRequest().getRemoteUser() to MyAppWebSession class and not show login page if JCIF's filter authenticates the user using NTLM. Any pointers/ideas are appreciated, Ravi -- -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] -- -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: isVisible vs. setVisible
Of course I have a few things to learn, and I hope I never stop learning. The article you provide is interesting. My opinion is that for domain entity objects, getters and setters are certainly not evil. For classes that are more service-like, getters and setters could be useful but should be considered well. In case you choose not to have a getter and a setter one should be extra careful when choosing method names. I usually expect a setVisible method when there is also an isVisible method. Immutable classes, or classes with read-only properties can choose to only provide a getter for some properties. But if a method like isVisible is intended to be overridden something like public boolean visible() might be better. But I guess this is also a matter of style and taste. As for Component.set/isVisible, I like that I can do both, even if it gives me the possibility of ambiguous code like new Component() {isVisible() {return true;};}.setVisible(false) or something like that (it is actually not ambiguous at all of course, but you do have to read extra careful). So whatever reason you (core devs) originally had for providing a setter, I am thankful for that. Matthijs Jonathan Locke wrote: i think you may have a few things to learn and it is not exactly controversial to prefer immutability or encapsulation... setters break encapsulation and i think it is safe to say decades of experience with object systems is on my side, including industry luminaries like: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html Matthijs Wensveen-2 wrote: Jonathan Locke wrote: true. in the isVisible impl you could lazy-init cache a transient Boolean until end request where you set it null. setters are evil. ..but it's good to have choice. *And* setVisible is not a normal setter, because it returns the component, which makes it easy to add an initially invisible component like: add(new Label("profanity", "[EMAIL PROTECTED]").setVisible(false)); Also, with is/setVisible you van use the component with a propertymodel to have some other component toggle the visibility of another component. This way you have the best of both worlds. A little off-topic: It scares me a little when core developer make bold statements like: "setters are evil" and "I wouldn't mind final was the default in java". Maybe I'm just being paranoid here... Matthijs egolan74 wrote: Yes but ... isVisible may be triggered several times, while setVisible should only be called once (say if I do it only once after creating the component). Usually I prefer the state driven way, but what if the logic has a lot of overhead? Jonathan Locke wrote: isVisible is generally better imo because it is state driven. if you push instead of pull, the state can get stale. -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - 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: Browser not jumping to Wicket Anchor
Not an issue I've come across but also not an area I've explored... A quick search through the mailing list did suggest one possible approach as below, but I've no idea how viable it might be! public Page extends WebPage implements IHeadContributor { @Override public void renderHead(IHeaderResponse r) { r.renderOnLoadJavascript("location.hash='YOUR-ANCHOR'"); } } /Gwyn On Mon, Jun 16, 2008 at 10:33 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > Yes - they do match - you're right, always check the basics first. The > problem is that even if I bookmark the anchored page (with the anchor > tagged on), and load the page it won't jump there. So, I don't think > it's the way I create the anchor (because the URL looks correct) - it's > all the other wicket AJAX stuff that somehow prevents the anchor from > being recognized on page load. Is there a work around for this? > > Thanks, > > Michael > > -Original Message- > From: Gwyn Evans [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 1:02 PM > To: users@wicket.apache.org > Subject: Re: Browser not jumping to Wicket Anchor > > Just looking at the HTML, do the anchor & the destination match > correctly? > Is the destination url just a normal page, or a form of some sort? > > /Gwyn > > On Mon, Jun 16, 2008 at 6:58 PM, Michael Mehrle <[EMAIL PROTECTED]> > wrote: > > > I created an Link to another page's anchor similar to the code shown > > below. The anchor actually gets tagged on to the bookmarkable URL. > > However, for some reason the browser does not jump to my anchor. > > > > > > > > Not sure what's going on - is there a particular way I have to create > an > > anchor in Wicket so that the URL causes the browser to scroll further > > down in the page? > > > > > > > > Thanks, > > > > > > > > Michael > > > > > > > > > > > > public class AnchoredBookmarkablePageLink extends BookmarkablePageLink > { > > > > > > > > private static final long serialVersionUID = 1L; > > > > > > > > private IModel stringAnchor; > > > > > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, > IModel > > > > > > anchor) { > > > >super(id, pageClass); > > > >this.stringAnchor = anchor; > > > > } > > > > > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, > > > > PageParameters params, IModel anchor) { > > > >super(id, pageClass, params); > > > >this.stringAnchor = anchor; > > > > } > > > > > > > > @Override > > > > protected CharSequence appendAnchor(ComponentTag tag, CharSequence > > url) { > > > >url = url + "#" + stringAnchor.getObject().toString(); > > > >return url; > > > > } > > > > > > > > } > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: Browser not jumping to Wicket Anchor
Yes - they do match - you're right, always check the basics first. The problem is that even if I bookmark the anchored page (with the anchor tagged on), and load the page it won't jump there. So, I don't think it's the way I create the anchor (because the URL looks correct) - it's all the other wicket AJAX stuff that somehow prevents the anchor from being recognized on page load. Is there a work around for this? Thanks, Michael -Original Message- From: Gwyn Evans [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2008 1:02 PM To: users@wicket.apache.org Subject: Re: Browser not jumping to Wicket Anchor Just looking at the HTML, do the anchor & the destination match correctly? Is the destination url just a normal page, or a form of some sort? /Gwyn On Mon, Jun 16, 2008 at 6:58 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I created an Link to another page's anchor similar to the code shown > below. The anchor actually gets tagged on to the bookmarkable URL. > However, for some reason the browser does not jump to my anchor. > > > > Not sure what's going on - is there a particular way I have to create an > anchor in Wicket so that the URL causes the browser to scroll further > down in the page? > > > > Thanks, > > > > Michael > > > > > > public class AnchoredBookmarkablePageLink extends BookmarkablePageLink { > > > > private static final long serialVersionUID = 1L; > > > > private IModel stringAnchor; > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel > > > anchor) { > >super(id, pageClass); > >this.stringAnchor = anchor; > > } > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, > > PageParameters params, IModel anchor) { > >super(id, pageClass, params); > >this.stringAnchor = anchor; > > } > > > > @Override > > protected CharSequence appendAnchor(ComponentTag tag, CharSequence > url) { > >url = url + "#" + stringAnchor.getObject().toString(); > >return url; > > } > > > > } > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Wicket NTLM/Single-sign-on integration Question
Using swarm, i usually let the default isAuthenticated methods intact and let the request be redirected to the loginpage where i check if a known third party has done the authentication for me, if so i automatically log the user in for wicket and redirect back to where i came from. You can override the isAuthenticated methods on the session or securitychecks but swarm still requires a subject with permissions. unless you only require an authenticated user and all users have the same permissions. So you have to translate the httpsession flag at somepoint to something swarm understands. As you would for any framework. Maurice On Mon, Jun 16, 2008 at 9:29 PM, Ravi_116 <[EMAIL PROTECTED]> wrote: > > Nino - Thanks for the reply > The AuthenticatedWebSession has the isSignedIn() method defined "final". So > cannot extend and override it. > >/** > * @return True if the user is signed in to this session > */ >public final boolean isSignedIn() >{ >return signedIn; >} > > > Ravi > > > Nino.Martinez wrote: >> >> >> >> Ravi_116 wrote: >>> What is best way to integrate NTLM with Wicket authentication module ? >>> >>> Currently, we are migrating from Standard Login page implementation to a >>> JCIF's NTLM (Windows domain credentials). >>> JCIF's provides a convenient servlet filter to do the NTLM handshake. It >>> sticks the username in the HttpServlet.getRemoteUser(). The current >>> implementation of the wicket is to extend AuthenticatedWebSession and >>> provide a MyAppWebSession authenticate method and a login page. >>> >>> >>> >>> @Override >>> protected Class getSignInPageClass() >>> { >>> return LoginPage.class; >>> } >>> >>> @Override >>> protected Class getWebSessionClass() >>> { >>> return MyAppWebSession.class; >>> } >>> >>> public class MyAppWebSession extends AuthenticatedWebSession >>> { >>> public boolean authenticate(String userName, String password) >>> { >>> // This is not the NTLM authentication, i need to get the username >>> provided >>> by NTLM here >>> myAuthenticator.authenticate(username) >>> } >>> } >>> >>> How does wicket determine to show a login-page in the Wicket Application >>> ? >>> Seems like it's not using getHttpServletRequest().getRemoteUser() >>> >>> >> It's just using the information you provide above... So it should be a >> clean plug, you should just forward username and password in your above >> code... that's what I do using my own authenticator. >> >> I think it sets a simple property if youre signed in or not based on the >> above authenticate.. >>> >>> There seems to be a couple of ways to tackle this issue : >>> 1. Use wicket's IAuthorizationStratergy and plugin NtlmAuthenticator >>> (from >>> JCIF's) into this and add the additional authentication to it. >>> 2. Use Swarm authentication framework. >>> 3. Propagate the username from getHttpServletRequest().getRemoteUser() to >>> MyAppWebSession class and not show login page if JCIF's filter >>> authenticates >>> the user using NTLM. >>> >>> Any pointers/ideas are appreciated, >>> >>> Ravi >>> >>> >> >> -- >> -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] >> >> >> > > -- > View this message in context: > http://www.nabble.com/Wicket-NTLM-Single-sign-on-integration-Question-tp17868669p17871702.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]
Re: Browser not jumping to Wicket Anchor
Just looking at the HTML, do the anchor & the destination match correctly? Is the destination url just a normal page, or a form of some sort? /Gwyn On Mon, Jun 16, 2008 at 6:58 PM, Michael Mehrle <[EMAIL PROTECTED]> wrote: > I created an Link to another page's anchor similar to the code shown > below. The anchor actually gets tagged on to the bookmarkable URL. > However, for some reason the browser does not jump to my anchor. > > > > Not sure what's going on - is there a particular way I have to create an > anchor in Wicket so that the URL causes the browser to scroll further > down in the page? > > > > Thanks, > > > > Michael > > > > > > public class AnchoredBookmarkablePageLink extends BookmarkablePageLink { > > > > private static final long serialVersionUID = 1L; > > > > private IModel stringAnchor; > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel > > > anchor) { > >super(id, pageClass); > >this.stringAnchor = anchor; > > } > > > > public AnchoredBookmarkablePageLink(String id, Class pageClass, > > PageParameters params, IModel anchor) { > >super(id, pageClass, params); > >this.stringAnchor = anchor; > > } > > > > @Override > > protected CharSequence appendAnchor(ComponentTag tag, CharSequence > url) { > >url = url + "#" + stringAnchor.getObject().toString(); > >return url; > > } > > > > } > > > >
Re: Wicket NTLM/Single-sign-on integration Question
Nino - Thanks for the reply The AuthenticatedWebSession has the isSignedIn() method defined "final". So cannot extend and override it. /** * @return True if the user is signed in to this session */ public final boolean isSignedIn() { return signedIn; } Ravi Nino.Martinez wrote: > > > > Ravi_116 wrote: >> What is best way to integrate NTLM with Wicket authentication module ? >> >> Currently, we are migrating from Standard Login page implementation to a >> JCIF's NTLM (Windows domain credentials). >> JCIF's provides a convenient servlet filter to do the NTLM handshake. It >> sticks the username in the HttpServlet.getRemoteUser(). The current >> implementation of the wicket is to extend AuthenticatedWebSession and >> provide a MyAppWebSession authenticate method and a login page. >> >> >> >> @Override >> protected Class getSignInPageClass() >> { >> return LoginPage.class; >> } >> >> @Override >> protected Class getWebSessionClass() >> { >> return MyAppWebSession.class; >> } >> >> public class MyAppWebSession extends AuthenticatedWebSession >> { >> public boolean authenticate(String userName, String password) >> { >> // This is not the NTLM authentication, i need to get the username >> provided >> by NTLM here >> myAuthenticator.authenticate(username) >> } >> } >> >> How does wicket determine to show a login-page in the Wicket Application >> ? >> Seems like it's not using getHttpServletRequest().getRemoteUser() >> >> > It's just using the information you provide above... So it should be a > clean plug, you should just forward username and password in your above > code... that's what I do using my own authenticator. > > I think it sets a simple property if youre signed in or not based on the > above authenticate.. >> >> There seems to be a couple of ways to tackle this issue : >> 1. Use wicket's IAuthorizationStratergy and plugin NtlmAuthenticator >> (from >> JCIF's) into this and add the additional authentication to it. >> 2. Use Swarm authentication framework. >> 3. Propagate the username from getHttpServletRequest().getRemoteUser() to >> MyAppWebSession class and not show login page if JCIF's filter >> authenticates >> the user using NTLM. >> >> Any pointers/ideas are appreciated, >> >> Ravi >> >> > > -- > -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] > > > -- View this message in context: http://www.nabble.com/Wicket-NTLM-Single-sign-on-integration-Question-tp17868669p17871702.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: NicEditTextAreaBehavior
Have you tried using this in a ajax based form in Wicket? It seems that it does not like ajax based submits but the "solutions" in the nicedit forums seems to be fail as well. The problem is that the model for the textarea you add the nic behavior to, never gets updated when you submit the form. In the scenario I was testing, it is AjaxButton for submission. francisco treacy-2 wrote: > > hi, > > i thought i'd like to share a simple behaviour for NicEdit > (http://nicedit.com/). > > to use it, just download nicedit and modify NICEDIT_JAVASCRIPT and > NICEDIT_ICONS accordingly. (i chose to put them together in the same > package). > if you download the basic version (without xhtml/ code view), when > adding the behaviour pass 'false' into the constructor, in order not > to use the full panel. > > of course, you can use it with multiple textareas in the same page. > > let me know if you run into some problem using it. should this belong > to the wiki as well? > > francisco > > > public class NicEditTextAreaBehavior extends AbstractBehavior { > > private Component> textArea; > private Boolean fullPanel = Boolean.TRUE; > > private static final ResourceReference NICEDIT_JAVASCRIPT = > new JavascriptResourceReference(NicEditTextAreaBehavior.class, > "nicEdit.js"); > > private static final ResourceReference NICEDIT_ICONS = new > ResourceReference(NicEditTextAreaBehavior.class, > "nicEditorIcons.gif"); > > public NicEditTextAreaBehavior() { > } > > public NicEditTextAreaBehavior(Boolean fullPanel) { > this.fullPanel = fullPanel; > } > > @Override @SuppressWarnings("unchecked") > public void bind(Component component) { > this.textArea = component; > component.setOutputMarkupId(true); > } > > @Override > public void renderHead(IHeaderResponse response) { > super.renderHead(response); > response.renderJavascriptReference(NICEDIT_JAVASCRIPT); > response.renderOnDomReadyJavascript("new nicEditor({iconsPath : > '"+ > RequestCycle.get().urlFor( > NICEDIT_ICONS) +"', fullPanel : "+ fullPanel > +"}).panelInstance('" > + textArea.getMarkupId() + "');"); > } > > } > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/NicEditTextAreaBehavior-tp17840648p17871532.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: Panels in a panel
Or the wicket-iolite maven archetype, which has a really simple example of this: http://wicketstuff.org/confluence/display/STUFFWIKI/Wicket-Iolite James Carman wrote: On Fri, Jun 13, 2008 at 11:51 AM, m_salman <[EMAIL PROTECTED]> wrote: Thanks for your reply. Unfortunately I need more information than that. Something like exactly what and how to use, with code. I have been trying to get this thing working for some days now and I really need help with this. My whole decision about moving my project to Wicket depends on this and I really do wan tto use Wicket. Why don't you check out this example? http://wicket.apache.org/exampleguestbook.html That should give you all you need to get up and running. I'd also suggest starting with a "quickstart" application and build from that (if you haven't already). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -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: Wicket NTLM/Single-sign-on integration Question
Ravi_116 wrote: What is best way to integrate NTLM with Wicket authentication module ? Currently, we are migrating from Standard Login page implementation to a JCIF's NTLM (Windows domain credentials). JCIF's provides a convenient servlet filter to do the NTLM handshake. It sticks the username in the HttpServlet.getRemoteUser(). The current implementation of the wicket is to extend AuthenticatedWebSession and provide a MyAppWebSession authenticate method and a login page. @Override protected Class getSignInPageClass() { return LoginPage.class; } @Override protected Class getWebSessionClass() { return MyAppWebSession.class; } public class MyAppWebSession extends AuthenticatedWebSession { public boolean authenticate(String userName, String password) { // This is not the NTLM authentication, i need to get the username provided by NTLM here myAuthenticator.authenticate(username) } } How does wicket determine to show a login-page in the Wicket Application ? Seems like it's not using getHttpServletRequest().getRemoteUser() It's just using the information you provide above... So it should be a clean plug, you should just forward username and password in your above code... that's what I do using my own authenticator. I think it sets a simple property if youre signed in or not based on the above authenticate.. There seems to be a couple of ways to tackle this issue : 1. Use wicket's IAuthorizationStratergy and plugin NtlmAuthenticator (from JCIF's) into this and add the additional authentication to it. 2. Use Swarm authentication framework. 3. Propagate the username from getHttpServletRequest().getRemoteUser() to MyAppWebSession class and not show login page if JCIF's filter authenticates the user using NTLM. Any pointers/ideas are appreciated, Ravi -- -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: isVisible vs. setVisible
> http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html Personally, I think that article is a bit far fetched. For a whole bunch of reasons, immutability should often be preferred, but at the same time Wicket is an example of a framework where mutability plays a big role (or we would have been fine providing a declarative programming model). The best sentence from that article to me is 'My point is that you should not program blindly.' :-) Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Browser not jumping to Wicket Anchor
I created an Link to another page's anchor similar to the code shown below. The anchor actually gets tagged on to the bookmarkable URL. However, for some reason the browser does not jump to my anchor. Not sure what's going on - is there a particular way I have to create an anchor in Wicket so that the URL causes the browser to scroll further down in the page? Thanks, Michael public class AnchoredBookmarkablePageLink extends BookmarkablePageLink { private static final long serialVersionUID = 1L; private IModel stringAnchor; public AnchoredBookmarkablePageLink(String id, Class pageClass, IModel anchor) { super(id, pageClass); this.stringAnchor = anchor; } public AnchoredBookmarkablePageLink(String id, Class pageClass, PageParameters params, IModel anchor) { super(id, pageClass, params); this.stringAnchor = anchor; } @Override protected CharSequence appendAnchor(ComponentTag tag, CharSequence url) { url = url + "#" + stringAnchor.getObject().toString(); return url; } }
Re: Localizer cache with 150.000+ entries causing OutOfMemory
ive committed the fix for 1.3 and 1.4. please test it out, there was a minor tweak for also putting page class into the cache key for wicket-1697. there is a little bit of syncing going on in localizer now that is used to translate class name to an integer in order to drastically shorten the cache key strings. this is not optimal in 1.3 so if anyone notices it is a hotspot we can fix that. -igor On Mon, Jun 16, 2008 at 2:05 AM, Juha Alatalo <[EMAIL PROTECTED]> wrote: > Hi, > > we have been using this patched version now in a production environment few > days. Seems to be working nicely. Memory problems disappeared. > > - Juha > > Igor Vaynberg wrote: >> >> if someone can confirm that the patch works in a production env i will >> be happy to commit it. i just havent had the time to test it myself >> yet. >> >> -igor >> >> On Tue, Jun 10, 2008 at 7:09 AM, Juha Alatalo >> <[EMAIL PROTECTED]> wrote: >>> >>> Hi All, >>> >>> I run our profiling tests (version 1.3.3) using Application.java and >>> Localizer.java patched by Stefan. Patch seems to be solving our memory >>> problems. >>> >>> Is this patch coming to 1.3.4 and do you have any idea when 1.3.4 will be >>> released? >>> >>> Best Regards >>> - Juha >>> >>> >>> Stefan Fußenegger wrote: Hi Daniel, I didn't put the patch into production yet, but I am quite confident, that it will help. As you can see in the example I attached to the JIRA issue (just attached a new version), the unpatched Localizer had 200 entries in his cache, the patched Localizer only four - which is a Good Thing (tm), as there are only 4 different cached values! Regards, Stefan Daniel Frisk wrote: > > So the patch did help? > > I too have observed this problem but it was at the moment less of a > problem than other heap eaters, now this is next in line. We have > added a > script which automatically restarts the server when repeated OOME > occurs > and are down to a couple of times per week without the patch. But > still, > who wouldn't want to see months of uptime... > > // Daniel > jalbum.net > > > On 2008-06-10, at 11:29, Stefan Fußenegger wrote: > >> Hi Igor, >> >> Thanks for your quick reply and the patch, sorry for not searching the >> mailinglist only but not JIRA. >> >> Your patch was for 1.4, I applied it to 1.3.3, created a quickstart >> including JUnit test and attached it to the JIRA issue. Hope this fix >> gets >> into the next maintenance release. I am to lazy to create a properly >> patched >> jar and a MVN repo for my team right now ;) >> >> Regards, Stefan >> >> >> >> igor.vaynberg wrote: >>> >>> try applying this patch and see if it helps >>> >>> https://issues.apache.org/jira/browse/WICKET-1667 >>> >>> -igor >>> >>> On Mon, Jun 9, 2008 at 8:11 AM, Stefan Fußenegger >>> <[EMAIL PROTECTED]> wrote: I am just analysing a heap dump (god bless the -XX:+HeapDumpOnOutOfMemoryError flag) of a recent application cache due to an OutOfMemoryError ("GC overhead limit exceeded" to be precise). Using jhat, the "175456 instances of class org.apache.wicket.util.concurrent.ConcurrentHashMap$Entry" immediately got my attention. While looking through the 107 instance of ConcurrentHashMap, I found one *really* big one: Localizer.cache has a hash table length of 262144, each of its 32 segments with about 5300 entries, where a hash key is a string, sometimes longer than 500 charactes, similar to (see Localizer.getCacheKey(String,Component)): fooTitle.bar- org.apache.wicket.markup.html.link.BookmarkablePageLink:fooLink- org.apache.wicket.markup.html.panel.Fragment:track- org.apache.wicket.markup.html.list.ListItem:14- my.company.FooListPanel$1:fooList-my.company.FooListPanel:foos- org.apache.wicket.markup.html.list.ListItem:0- my.company.BarListPanel$1:bars-my.company.FooListPanel:panel- my.company.boxes.BodyBox:2- org.apache.wicket.markup.repeater.RepeatingView:body- my.company.layout.Border:border-my.company.pages.music.FoobarPage: 43-de-null Those numbers pretty much convinced me: The localizer cache has blown away my application. Looking at this hash keys, I suspect the following problem: those strings are constructed from the "position" of a localized String on a page, which is quite a bad thing if you use nested list views or repeating views to construct your page. For instance, I have a panel with a
Re: Please check my fix to terracotta problem
i dont know how terracotta works so i will comment on wicket stuff only. looks like a good solution if you are looking to compress the page as far as the number of objects go. a cleaner way to do this might be to do it in sessionstore and share out that class through terracotta. -igor On Mon, Jun 16, 2008 at 6:20 AM, richardwilko <[EMAIL PROTECTED]> wrote: > > Hi, > > Just a little background, i've been trying to get my application clustered > with terracotta for a while and ran into a big problem. Basically wicket > was producing more garbage objects than terracotta could handle, as such > terracotta was using up loads of disk space (see my thread on terracotta > forum for more info http://forums.terracotta.org/forums/posts/list/1144.page > ) > To solve this I have decided to try and stop the page object being stored > 'as is' to avoid the number of objects being sent to the terracotta server. > My solution has been to replace the default IPageMapEntry with one that only > stores a serialized version of the page: > > public class NewPageMapEntry extends AbstractPageMapEntry > { >private transient Page page; >private byte[] data; > >public NewPageMapEntry(final Page page) >{ >this.page = page; > >data = Objects.objectToByteArray(page); > >setNumericId(page.getNumericId()); >} > >@Override >public Page getPage() >{ >if(this.page == null) >{ >page = (Page) Objects.byteArrayToObject(data); >} >return page; >} > } > > and use it in my base page (which all others extend) like this: > >@Override >public IPageMapEntry getPageMapEntry() >{ >return new NewPageMapEntry(this); >} > > Does this seem like a reasonable approach? > -- > View this message in context: > http://www.nabble.com/Please-check-my-fix-to-terracotta-problem-tp17864318p17864318.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]
Re: Using Guice with IInitializer?
Sorry, the reason I initially missed this option is that GuiceWebApplicationFactory was not saving the Injector into the servlet context. I've since fixed this and this now works. Thanks, Gili igor.vaynberg wrote: > > IInitializer.onInitializer(Application app) { > ServletContext sc=((WebApplication)app).getServletContext(); > > } > > -igor > > On Mon, Jun 16, 2008 at 9:04 AM, cowwoc <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> Can anyone think of a way to inject members into an IInitializer or at >> least >> gain access to an Injector instance inside it? As far as I can tell I >> can't >> even get access to the Servlet Context or Application from inside the >> IInitializer. I'm open to suggestions. >> >> Thanks, >> Gili >> -- >> View this message in context: >> http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.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/Using-Guice-with-IInitializer--tp17867744p17869212.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: Using Guice with IInitializer?
IInitializer.onInitializer(Application app) { ServletContext sc=((WebApplication)app).getServletContext(); } -igor On Mon, Jun 16, 2008 at 9:04 AM, cowwoc <[EMAIL PROTECTED]> wrote: > > Hi, > > Can anyone think of a way to inject members into an IInitializer or at least > gain access to an Injector instance inside it? As far as I can tell I can't > even get access to the Servlet Context or Application from inside the > IInitializer. I'm open to suggestions. > > Thanks, > Gili > -- > View this message in context: > http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.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]
Re: How do I pass back data from HTML (javascript) to my Java code
You could create an abstractDefaultAjaxBehaviour in your page, then do an ajax get onto it, appending your parameter as a url parameter, then get your parameter from the request in java. or you could have a wicket page, and do an ajax get on that, appending your parameter as a url parameter, and get your parameter from the page parameters. Admittedly both ways seem a little hacky but i cant think of another way. My presentation on google maps from the london wicket user group may be helpful, as may the one about a gallery (not mine): http://code.google.com/p/londonwicket/downloads/list hope that helps solled wrote: > > Hi, > > How do I get data generated by javascript functions to my Java code using > Wicket. For example, I have the following javascript code: > > > > var map; > var gdir; > var geocoder = null; > var addressMarker; > var mileage; > > function initialize() { > if (GBrowserIsCompatible()) { > map = new GMap2(document.getElementById("map_canvas")); > gdir = new GDirections(map, > document.getElementById("directions")); > GEvent.addListener(gdir, "load", onGDirectionsLoad); > GEvent.addListener(gdir, "error", handleErrors); > > setDirections("", "", "en_US"); > > onGDirectionsLoad(); > } > } > > function setDirections(fromAddress, toAddress, locale) { > gdir.load("from: " + fromAddress + " to: " + toAddress, > { "locale": locale }); > } > > function onGDirectionsLoad(){ > // Use this function to access information about the latest load() > // results. > > document.getElementById("getDistance").innerHTML = > gdir.getDistance().html; > > } > > > > > How do I pass the getDistance value in function onGDirectionsLoad() to my > java code? > > thanks for any help. > > -- View this message in context: http://www.nabble.com/How-do-I-pass-back-data-from-HTML-%28javascript%29-to-my-Java-code-tp17868387p17868825.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]
Wicket NTLM/Single-sign-on integration Question
What is best way to integrate NTLM with Wicket authentication module ? Currently, we are migrating from Standard Login page implementation to a JCIF's NTLM (Windows domain credentials). JCIF's provides a convenient servlet filter to do the NTLM handshake. It sticks the username in the HttpServlet.getRemoteUser(). The current implementation of the wicket is to extend AuthenticatedWebSession and provide a MyAppWebSession authenticate method and a login page. @Override protected Class getSignInPageClass() { return LoginPage.class; } @Override protected Class getWebSessionClass() { return MyAppWebSession.class; } public class MyAppWebSession extends AuthenticatedWebSession { public boolean authenticate(String userName, String password) { // This is not the NTLM authentication, i need to get the username provided by NTLM here myAuthenticator.authenticate(username) } } How does wicket determine to show a login-page in the Wicket Application ? Seems like it's not using getHttpServletRequest().getRemoteUser() There seems to be a couple of ways to tackle this issue : 1. Use wicket's IAuthorizationStratergy and plugin NtlmAuthenticator (from JCIF's) into this and add the additional authentication to it. 2. Use Swarm authentication framework. 3. Propagate the username from getHttpServletRequest().getRemoteUser() to MyAppWebSession class and not show login page if JCIF's filter authenticates the user using NTLM. Any pointers/ideas are appreciated, Ravi -- View this message in context: http://www.nabble.com/Wicket-NTLM-Single-sign-on-integration-Question-tp17868669p17868669.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: wicket training/consulting in the SF Bay Area
I could help aswell, please mail me directly with requirements. On Mon, Jun 16, 2008 at 5:02 PM, jWeekend <[EMAIL PROTECTED]> wrote: > > Mohammad, > > We may be able to help. > Contact us http://jweekend.co.uk/dev/ContactUsBody/ here to discuss your > requirements. > > Regards - Cemal > http://jWeekend.co.uk http://jWeekend.co.uk > > < > > quote author="m_salman"> > Hi, > > Is there any one available to provide Wicket training and/or consulting in > the SF Bay area? > I need help urgently. Off hours is fine. Or if you are not in the Bay > Area > but willing to do it via email. > > Thanks, > > -Mohammad > > > > > -- > View this message in context: > http://www.nabble.com/wicket-training-consulting-in-the-SF-Bay-Area-tp17859255p17866413.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] > >
How do I pass back data from HTML (javascript) to my Java code
Hi, How do I get data generated by javascript functions to my Java code using Wicket. For example, I have the following javascript code: var map; var gdir; var geocoder = null; var addressMarker; var mileage; function initialize() { if (GBrowserIsCompatible()) { map = new GMap2(document.getElementById("map_canvas")); gdir = new GDirections(map, document.getElementById("directions")); GEvent.addListener(gdir, "load", onGDirectionsLoad); GEvent.addListener(gdir, "error", handleErrors); setDirections("", "", "en_US"); onGDirectionsLoad(); } } function setDirections(fromAddress, toAddress, locale) { gdir.load("from: " + fromAddress + " to: " + toAddress, { "locale": locale }); } function onGDirectionsLoad(){ // Use this function to access information about the latest load() // results. document.getElementById("getDistance").innerHTML = gdir.getDistance().html; } How do I pass the getDistance value in function onGDirectionsLoad() to my java code? thanks for any help. -- View this message in context: http://www.nabble.com/How-do-I-pass-back-data-from-HTML-%28javascript%29-to-my-Java-code-tp17868387p17868387.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]
Using Guice with IInitializer?
Hi, Can anyone think of a way to inject members into an IInitializer or at least gain access to an Injector instance inside it? As far as I can tell I can't even get access to the Servlet Context or Application from inside the IInitializer. I'm open to suggestions. Thanks, Gili -- View this message in context: http://www.nabble.com/Using-Guice-with-IInitializer--tp17867744p17867744.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: Wicket 1.2 -> 1.3 upgrade question
Wouldn't surrounding your tag with help? On Mon, Jun 16, 2008 at 11:23 AM, Igor Vaynberg <[EMAIL PROTECTED]> wrote: > javadoc > > -igor > > On Mon, Jun 16, 2008 at 8:21 AM, Frank Silbermann > <[EMAIL PROTECTED]> wrote: >> Do any of the examples (or other documentation) illustrate its use? >> >> -Original Message- >> From: Martijn Dashorst [mailto:[EMAIL PROTECTED] >> Sent: Monday, June 16, 2008 10:15 AM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >> >> see ContextImage. >> >> Martijn >> >> On Mon, Jun 16, 2008 at 5:07 PM, Frank Silbermann >> <[EMAIL PROTECTED]> wrote: >>> I did a few more experiments with static images in Wicket 1.3 and >>> narrowed the problem down to my use of AttributeModifier: >>> >>> Consider a Wicket home page with no components that displays a static >>> image via the following HTML: >>> >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>> >>> >>> >>> >>> The image appears, and with the QuickStart's filter URL of "/*" the >>> HTML delivered to my browser is essentially the same as the HTML of my >> >>> Wicket home page. However, when I changed the Wicket filter's URL >>> from "/*" to "/test/*" then the source HTML of the delivered page >>> changes the tag to: >>> >>> >>> >>> Notice the "../" prepended to "imageName.png". >>> >>> The code that gives me trouble sets the image name via >>> AttributeModifier and WebComponent. Change the home page HTML to: >>> >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>>>> src="imageNameGoesHere.png"/> >>> >>> >>> >>> Adding a component, the constructor of my HomePage becomes: >>> >>>public HomePage(final PageParameters parameters) { >>>WebComponent wmc = new WebComponent("picture"); >>>wmc.add( new AttributeModifier( "src", true, new >>> Model("imageName.png") ) ); >>>add( wmc ); >>>} >>> >>> Whether or not I re-map the filter's URL, the HTML delivered to my >>> browser is: >>> >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>> >>>Wicket Quickstart Archetype Homepage >>> >>> >>> >>> >>> >>> The image is found using the "/*" URL that comes with the QuickStart, >>> but if I change the URL of the filter to "/test/*" then it no longer >>> finds the image -- because no "../" is prepended to "imageName.png", >>> as was the case with the purely static reference. >>> >>> However, re-mapping the Wicket filter to "/test/*", I can get the >>> image to appear if I change the model of my AttributeModifier as >> follows: >>> >>>public HomePage(final PageParameters parameters) { >>>WebComponent wmc = new WebComponent("picture"); >>>wmc.add( new AttributeModifier( "src", true, new >>> Model("../imageName.png") ) ); >>>add( wmc ); >>>} >>> >>> Now, the HTML is delivered with an image source of "../imageName.png". >>> >>> With Wicket 1.2, my use of AttributeModifier worked no matter what URL >> >>> I used to deploy the application. Is there an better way of coding >>> this that will work with whatever URL I use in my web.xml, or do I >>> still need to create a JIRA issue? >>> >>> -Original Message- >>> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >>> Sent: Friday, June 13, 2008 4:52 PM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >>> >>> well, package an example project that demonstrates it and attach it to >> >>> jira >>> >>> -igor >>> >>> On Fri, Jun 13, 2008 at 1:19 PM, Frank Silbermann >>> <[EMAIL PROTECTED]> wrote: Adding the filterMappingUrlPattern didn't seem to make any >> difference. When both are set to "/*" I see the image; when both are set to "/test/*" then I don't see the image. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 3:10 PM To: users@wicket.apache.org Subject: Re: Wicket 1.2 -> 1.3 upgrade question guess so -igor On Fri, Jun 13, 2008 at 1:04 PM, Frank Silbermann <[EMAIL PROTECTED]> wrote: > Like this? > > xmlns="http://java.sun.com/xml/ns/j2ee"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> > >myproject > > >wicket.myproject > > org.apache.wicket.protocol.http.WicketFilter l > a > ss >> > >applicationClassName > > com.mycompany.WicketApplication > > > filterMappingUrlPattern >/test/* > >
Re: Wicket 1.2 -> 1.3 upgrade question
javadoc -igor On Mon, Jun 16, 2008 at 8:21 AM, Frank Silbermann <[EMAIL PROTECTED]> wrote: > Do any of the examples (or other documentation) illustrate its use? > > -Original Message- > From: Martijn Dashorst [mailto:[EMAIL PROTECTED] > Sent: Monday, June 16, 2008 10:15 AM > To: users@wicket.apache.org > Subject: Re: Wicket 1.2 -> 1.3 upgrade question > > see ContextImage. > > Martijn > > On Mon, Jun 16, 2008 at 5:07 PM, Frank Silbermann > <[EMAIL PROTECTED]> wrote: >> I did a few more experiments with static images in Wicket 1.3 and >> narrowed the problem down to my use of AttributeModifier: >> >> Consider a Wicket home page with no components that displays a static >> image via the following HTML: >> >> >> >>Wicket Quickstart Archetype Homepage >> >> >>Wicket Quickstart Archetype Homepage >> >> >> >> >> >> The image appears, and with the QuickStart's filter URL of "/*" the >> HTML delivered to my browser is essentially the same as the HTML of my > >> Wicket home page. However, when I changed the Wicket filter's URL >> from "/*" to "/test/*" then the source HTML of the delivered page >> changes the tag to: >> >> >> >> Notice the "../" prepended to "imageName.png". >> >> The code that gives me trouble sets the image name via >> AttributeModifier and WebComponent. Change the home page HTML to: >> >> >> >>Wicket Quickstart Archetype Homepage >> >> >>Wicket Quickstart Archetype Homepage >> >>> src="imageNameGoesHere.png"/> >> >> >> >> Adding a component, the constructor of my HomePage becomes: >> >>public HomePage(final PageParameters parameters) { >>WebComponent wmc = new WebComponent("picture"); >>wmc.add( new AttributeModifier( "src", true, new >> Model("imageName.png") ) ); >>add( wmc ); >>} >> >> Whether or not I re-map the filter's URL, the HTML delivered to my >> browser is: >> >> >> >>Wicket Quickstart Archetype Homepage >> >> >>Wicket Quickstart Archetype Homepage >> >> >> >> >> >> The image is found using the "/*" URL that comes with the QuickStart, >> but if I change the URL of the filter to "/test/*" then it no longer >> finds the image -- because no "../" is prepended to "imageName.png", >> as was the case with the purely static reference. >> >> However, re-mapping the Wicket filter to "/test/*", I can get the >> image to appear if I change the model of my AttributeModifier as > follows: >> >>public HomePage(final PageParameters parameters) { >>WebComponent wmc = new WebComponent("picture"); >>wmc.add( new AttributeModifier( "src", true, new >> Model("../imageName.png") ) ); >>add( wmc ); >>} >> >> Now, the HTML is delivered with an image source of "../imageName.png". >> >> With Wicket 1.2, my use of AttributeModifier worked no matter what URL > >> I used to deploy the application. Is there an better way of coding >> this that will work with whatever URL I use in my web.xml, or do I >> still need to create a JIRA issue? >> >> -Original Message- >> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >> Sent: Friday, June 13, 2008 4:52 PM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >> >> well, package an example project that demonstrates it and attach it to > >> jira >> >> -igor >> >> On Fri, Jun 13, 2008 at 1:19 PM, Frank Silbermann >> <[EMAIL PROTECTED]> wrote: >>> Adding the filterMappingUrlPattern didn't seem to make any > difference. >>> When both are set to "/*" I see the image; when both are set to >>> "/test/*" then I don't see the image. >>> >>> -Original Message- >>> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >>> Sent: Friday, June 13, 2008 3:10 PM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >>> >>> guess so >>> >>> -igor >>> >>> On Fri, Jun 13, 2008 at 1:04 PM, Frank Silbermann >>> <[EMAIL PROTECTED]> wrote: Like this? >>> xmlns="http://java.sun.com/xml/ns/j2ee"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> myproject wicket.myproject org.apache.wicket.protocol.http.WicketFilter>>> l a ss > applicationClassName com.mycompany.WicketApplication >>> filterMappingUrlPattern /test/* wicket.myproject /test/* -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 2:45 PM To: users@wicket.apache.org Subject: Re: Wicket 1.2 -> 1.3 upgrade questi
RE: Wicket 1.2 -> 1.3 upgrade question
Do any of the examples (or other documentation) illustrate its use? -Original Message- From: Martijn Dashorst [mailto:[EMAIL PROTECTED] Sent: Monday, June 16, 2008 10:15 AM To: users@wicket.apache.org Subject: Re: Wicket 1.2 -> 1.3 upgrade question see ContextImage. Martijn On Mon, Jun 16, 2008 at 5:07 PM, Frank Silbermann <[EMAIL PROTECTED]> wrote: > I did a few more experiments with static images in Wicket 1.3 and > narrowed the problem down to my use of AttributeModifier: > > Consider a Wicket home page with no components that displays a static > image via the following HTML: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > > > > > The image appears, and with the QuickStart's filter URL of "/*" the > HTML delivered to my browser is essentially the same as the HTML of my > Wicket home page. However, when I changed the Wicket filter's URL > from "/*" to "/test/*" then the source HTML of the delivered page > changes the tag to: > > > > Notice the "../" prepended to "imageName.png". > > The code that gives me trouble sets the image name via > AttributeModifier and WebComponent. Change the home page HTML to: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > src="imageNameGoesHere.png"/> > > > > Adding a component, the constructor of my HomePage becomes: > >public HomePage(final PageParameters parameters) { >WebComponent wmc = new WebComponent("picture"); >wmc.add( new AttributeModifier( "src", true, new > Model("imageName.png") ) ); >add( wmc ); >} > > Whether or not I re-map the filter's URL, the HTML delivered to my > browser is: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > > > > > The image is found using the "/*" URL that comes with the QuickStart, > but if I change the URL of the filter to "/test/*" then it no longer > finds the image -- because no "../" is prepended to "imageName.png", > as was the case with the purely static reference. > > However, re-mapping the Wicket filter to "/test/*", I can get the > image to appear if I change the model of my AttributeModifier as follows: > >public HomePage(final PageParameters parameters) { >WebComponent wmc = new WebComponent("picture"); >wmc.add( new AttributeModifier( "src", true, new > Model("../imageName.png") ) ); >add( wmc ); >} > > Now, the HTML is delivered with an image source of "../imageName.png". > > With Wicket 1.2, my use of AttributeModifier worked no matter what URL > I used to deploy the application. Is there an better way of coding > this that will work with whatever URL I use in my web.xml, or do I > still need to create a JIRA issue? > > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2008 4:52 PM > To: users@wicket.apache.org > Subject: Re: Wicket 1.2 -> 1.3 upgrade question > > well, package an example project that demonstrates it and attach it to > jira > > -igor > > On Fri, Jun 13, 2008 at 1:19 PM, Frank Silbermann > <[EMAIL PROTECTED]> wrote: >> Adding the filterMappingUrlPattern didn't seem to make any difference. >> When both are set to "/*" I see the image; when both are set to >> "/test/*" then I don't see the image. >> >> -Original Message- >> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >> Sent: Friday, June 13, 2008 3:10 PM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >> >> guess so >> >> -igor >> >> On Fri, Jun 13, 2008 at 1:04 PM, Frank Silbermann >> <[EMAIL PROTECTED]> wrote: >>> Like this? >>> >>> >> xmlns="http://java.sun.com/xml/ns/j2ee"; >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> >>> >>>myproject >>> >>> >>>wicket.myproject >>> >>> org.apache.wicket.protocol.http.WicketFilter>> l >>> a >>> ss >>> >>>applicationClassName >>> >>> com.mycompany.WicketApplication >>> >>> >>> >> filterMappingUrlPattern >>>/test/* >>> >>> >>> >>> >>> wicket.myproject >>>/test/* >>> >>> >>> >>> >>> -Original Message- >>> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >>> Sent: Friday, June 13, 2008 2:45 PM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >>> >>> the filter itself takes a configuration param where you have to >>> repeat >> >>> the mapping... >>> >>> class WicketFilter { >>> /** >>> * The name of the root path parameter that specifies the >>> root > >>> dir of the app. >>>
Re: Wicket 1.2 -> 1.3 upgrade question
see ContextImage. Martijn On Mon, Jun 16, 2008 at 5:07 PM, Frank Silbermann <[EMAIL PROTECTED]> wrote: > I did a few more experiments with static images in Wicket 1.3 and > narrowed the problem down to my use of AttributeModifier: > > Consider a Wicket home page with no components that displays a static > image via the following HTML: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > > > > > The image appears, and with the QuickStart's filter URL of "/*" the HTML > delivered to my browser is essentially the same as the HTML of my Wicket > home page. However, when I changed the Wicket filter's URL from "/*" to > "/test/*" then the source HTML of the delivered page changes the > tag to: > > > > Notice the "../" prepended to "imageName.png". > > The code that gives me trouble sets the image name via AttributeModifier > and WebComponent. Change the home page HTML to: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > src="imageNameGoesHere.png"/> > > > > Adding a component, the constructor of my HomePage becomes: > >public HomePage(final PageParameters parameters) { >WebComponent wmc = new WebComponent("picture"); >wmc.add( new AttributeModifier( "src", true, new > Model("imageName.png") ) ); >add( wmc ); >} > > Whether or not I re-map the filter's URL, the HTML delivered to my > browser is: > > > >Wicket Quickstart Archetype Homepage > > >Wicket Quickstart Archetype Homepage > > > > > > The image is found using the "/*" URL that comes with the QuickStart, > but if I change the URL of the filter to "/test/*" then it no longer > finds the image -- because no "../" is prepended to "imageName.png", as > was the case with the purely static reference. > > However, re-mapping the Wicket filter to "/test/*", I can get the image > to appear if I change the model of my AttributeModifier as follows: > >public HomePage(final PageParameters parameters) { >WebComponent wmc = new WebComponent("picture"); >wmc.add( new AttributeModifier( "src", true, new > Model("../imageName.png") ) ); >add( wmc ); >} > > Now, the HTML is delivered with an image source of "../imageName.png". > > With Wicket 1.2, my use of AttributeModifier worked no matter what URL I > used to deploy the application. Is there an better way of coding this > that will work with whatever URL I use in my web.xml, or do I still need > to create a JIRA issue? > > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2008 4:52 PM > To: users@wicket.apache.org > Subject: Re: Wicket 1.2 -> 1.3 upgrade question > > well, package an example project that demonstrates it and attach it to > jira > > -igor > > On Fri, Jun 13, 2008 at 1:19 PM, Frank Silbermann > <[EMAIL PROTECTED]> wrote: >> Adding the filterMappingUrlPattern didn't seem to make any difference. >> When both are set to "/*" I see the image; when both are set to >> "/test/*" then I don't see the image. >> >> -Original Message- >> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >> Sent: Friday, June 13, 2008 3:10 PM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >> >> guess so >> >> -igor >> >> On Fri, Jun 13, 2008 at 1:04 PM, Frank Silbermann >> <[EMAIL PROTECTED]> wrote: >>> Like this? >>> >>> >> xmlns="http://java.sun.com/xml/ns/j2ee"; >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >>> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> >>> >>>myproject >>> >>> >>>wicket.myproject >>> >>> org.apache.wicket.protocol.http.WicketFilter>> a >>> ss >>> >>>applicationClassName >>> >>> com.mycompany.WicketApplication >>> >>> >>> >> filterMappingUrlPattern >>>/test/* >>> >>> >>> >>> >>> wicket.myproject >>>/test/* >>> >>> >>> >>> >>> -Original Message- >>> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >>> Sent: Friday, June 13, 2008 2:45 PM >>> To: users@wicket.apache.org >>> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >>> >>> the filter itself takes a configuration param where you have to >>> repeat >> >>> the mapping... >>> >>> class WicketFilter { >>> /** >>> * The name of the root path parameter that specifies the root > >>> dir of the app. >>> */ >>>public static final String FILTER_MAPPING_PARAM = >>> "filterMappingUrlPattern"; >>> >>> String filterMapping = >>> filterConfig.getInitParameter(WicketFilter.FILTER_MAPPING_PARAM); >>> } >>> >>> -igor >>> >>> On Fri, Jun 13, 2008 at 11:09 AM, Frank Silbermann >>> <[EMAI
RE: Wicket 1.2 -> 1.3 upgrade question
I did a few more experiments with static images in Wicket 1.3 and narrowed the problem down to my use of AttributeModifier: Consider a Wicket home page with no components that displays a static image via the following HTML: Wicket Quickstart Archetype Homepage Wicket Quickstart Archetype Homepage The image appears, and with the QuickStart's filter URL of "/*" the HTML delivered to my browser is essentially the same as the HTML of my Wicket home page. However, when I changed the Wicket filter's URL from "/*" to "/test/*" then the source HTML of the delivered page changes the tag to: Notice the "../" prepended to "imageName.png". The code that gives me trouble sets the image name via AttributeModifier and WebComponent. Change the home page HTML to: Wicket Quickstart Archetype Homepage Wicket Quickstart Archetype Homepage Adding a component, the constructor of my HomePage becomes: public HomePage(final PageParameters parameters) { WebComponent wmc = new WebComponent("picture"); wmc.add( new AttributeModifier( "src", true, new Model("imageName.png") ) ); add( wmc ); } Whether or not I re-map the filter's URL, the HTML delivered to my browser is: Wicket Quickstart Archetype Homepage Wicket Quickstart Archetype Homepage The image is found using the "/*" URL that comes with the QuickStart, but if I change the URL of the filter to "/test/*" then it no longer finds the image -- because no "../" is prepended to "imageName.png", as was the case with the purely static reference. However, re-mapping the Wicket filter to "/test/*", I can get the image to appear if I change the model of my AttributeModifier as follows: public HomePage(final PageParameters parameters) { WebComponent wmc = new WebComponent("picture"); wmc.add( new AttributeModifier( "src", true, new Model("../imageName.png") ) ); add( wmc ); } Now, the HTML is delivered with an image source of "../imageName.png". With Wicket 1.2, my use of AttributeModifier worked no matter what URL I used to deploy the application. Is there an better way of coding this that will work with whatever URL I use in my web.xml, or do I still need to create a JIRA issue? -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Friday, June 13, 2008 4:52 PM To: users@wicket.apache.org Subject: Re: Wicket 1.2 -> 1.3 upgrade question well, package an example project that demonstrates it and attach it to jira -igor On Fri, Jun 13, 2008 at 1:19 PM, Frank Silbermann <[EMAIL PROTECTED]> wrote: > Adding the filterMappingUrlPattern didn't seem to make any difference. > When both are set to "/*" I see the image; when both are set to > "/test/*" then I don't see the image. > > -Original Message- > From: Igor Vaynberg [mailto:[EMAIL PROTECTED] > Sent: Friday, June 13, 2008 3:10 PM > To: users@wicket.apache.org > Subject: Re: Wicket 1.2 -> 1.3 upgrade question > > guess so > > -igor > > On Fri, Jun 13, 2008 at 1:04 PM, Frank Silbermann > <[EMAIL PROTECTED]> wrote: >> Like this? >> >> > xmlns="http://java.sun.com/xml/ns/j2ee"; >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; >> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee >> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"; version="2.4"> >> >>myproject >> >> >>wicket.myproject >> >> org.apache.wicket.protocol.http.WicketFilter> a >> ss >>> >> >>applicationClassName >> >> com.mycompany.WicketApplication >> >> >> > filterMappingUrlPattern >>/test/* >> >> >> >> >> wicket.myproject >>/test/* >> >> >> >> >> -Original Message- >> From: Igor Vaynberg [mailto:[EMAIL PROTECTED] >> Sent: Friday, June 13, 2008 2:45 PM >> To: users@wicket.apache.org >> Subject: Re: Wicket 1.2 -> 1.3 upgrade question >> >> the filter itself takes a configuration param where you have to >> repeat > >> the mapping... >> >> class WicketFilter { >> /** >> * The name of the root path parameter that specifies the root >> dir of the app. >> */ >>public static final String FILTER_MAPPING_PARAM = >> "filterMappingUrlPattern"; >> >> String filterMapping = >> filterConfig.getInitParameter(WicketFilter.FILTER_MAPPING_PARAM); >> } >> >> -igor >> >> On Fri, Jun 13, 2008 at 11:09 AM, Frank Silbermann >> <[EMAIL PROTECTED]> wrote: >>> Yes, there is a element that maps to >>> . >>> >>> However, as I mentioned in >>> http://www.nabble.com/Re%3A-%28Class%3C--extends-Page%3C-%3E%3E%29-c >>> a s ti ng-troubles-td17640954i40.html#a17824049, when I changed the >>> from "/*" to "/something/*" -- my static images >>> (referenced by the HTML such as >>> >>>
Re: wicket training/consulting in the SF Bay Area
Mohammad, We may be able to help. Contact us http://jweekend.co.uk/dev/ContactUsBody/ here to discuss your requirements. Regards - Cemal http://jWeekend.co.uk http://jWeekend.co.uk < quote author="m_salman"> Hi, Is there any one available to provide Wicket training and/or consulting in the SF Bay area? I need help urgently. Off hours is fine. Or if you are not in the Bay Area but willing to do it via email. Thanks, -Mohammad -- View this message in context: http://www.nabble.com/wicket-training-consulting-in-the-SF-Bay-Area-tp17859255p17866413.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: isVisible vs. setVisible
i think you may have a few things to learn and it is not exactly controversial to prefer immutability or encapsulation... setters break encapsulation and i think it is safe to say decades of experience with object systems is on my side, including industry luminaries like: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html Matthijs Wensveen-2 wrote: > > Jonathan Locke wrote: >> true. >> >> in the isVisible impl you could lazy-init cache a transient Boolean until >> end request where you set it null. >> >> setters are evil. >> > > ..but it's good to have choice. *And* setVisible is not a normal setter, > because it returns the component, which makes it easy to add an > initially invisible component like: add(new Label("profanity", > "[EMAIL PROTECTED]").setVisible(false)); > > Also, with is/setVisible you van use the component with a propertymodel > to have some other component toggle the visibility of another component. > This way you have the best of both worlds. > > A little off-topic: It scares me a little when core developer make bold > statements like: "setters are evil" and "I wouldn't mind final was the > default in java". Maybe I'm just being paranoid here... > > Matthijs > >> >> egolan74 wrote: >> >>> Yes but ... >>> isVisible may be triggered several times, while setVisible should only >>> be >>> called once (say if I do it only once after creating the component). >>> Usually I prefer the state driven way, but what if the logic has a lot >>> of >>> overhead? >>> >>> >>> >>> Jonathan Locke wrote: >>> isVisible is generally better imo because it is state driven. if you push instead of pull, the state can get stale. >>> >> >> > > > -- > Matthijs Wensveen > Func. Internet Integration > W http://www.func.nl > T +31 20 423 > F +31 20 4223500 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/isVisible-vs.-setVisible-tp17860615p17866358.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: isVisible vs. setVisible
On Mon, Jun 16, 2008 at 4:15 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: > I disagree that you expose internal state. It's hardly internal when there > is a public setter. You are contradicting yourself: the sole purpose of a public setter is to expose internal state. Therefore setters are evil. In the very least it allows for confusing semantics when overrides are allowed. A setter is nice for a data object, but that is it. IMO setting the any property outside the owning object breaks the encapsulation of the object, but I'm pragmatic enough to consider setting visible to false when I feel like it :) Setters push people into an interaction driven design, where testing is made considerably difficult, because the internal state is made public. I'd love to create objects where I modify the state through actions on the objects, but frameworks such as hibernate and others 'force' me into providing getters and setters. It also takes somewhat longer to get the object model right when trying to not use setters/getters. Martijn > But I agree that it is often very useful to override the > getter (isser for booleans?) when there is a hard dependency between the > component visibility and some other state. As I said: it's good to have > choice. >> >> Martijn >> >> > > > -- > Matthijs Wensveen > Func. Internet Integration > W http://www.func.nl > T +31 20 423 > F +31 20 4223500 > > - > 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.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chaining components
AbstractReadOnlyModel> { should work iirc -igor On Mon, Jun 16, 2008 at 7:08 AM, Martin Makundi <[EMAIL PROTECTED]> wrote: >>> What is your idea of nice chaining? >> >> http://wicketstuff.org/wicket13/ajax/choice > > I am using 1.4-m1 and I tried to make > > public abstract class AbstractListChoiceModel extends > AbstractReadOnlyModel> { > @Override > public final List getObject() { >return getChoices(); > } > > protected abstract List getChoices(); > } > > The compiler complains AbstractListChoiceModel is not > compatible with IModel> > > Does this make sense? > > AbstractListChoiceModel availableCustomElementsModel > = new AbstractListChoiceModel() { > ... >}; > > final DropDownChoice selection = new > DropDownChoice(SELECTION, > new PropertyModel(dto, CustomElement.SELECTION)), > availableCustomElementsModel, new IChoiceRenderer() { > ... > > ** > Martin > > - > 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 portles in Sun Portal
Got it to work after building portlet-bridges-common from the trunk source. - The change I made to PortletWindowUtils which seems to work (so far *crosses fingers*): public static String getPortletWindowId(PortletSession session) { final Object tmp = session.getAttribute(PORTLET_WINDOW_ID); String portletWindowId = null; if (tmp != null) { portletWindowId = tmp.toString(); } if ( portletWindowId == null ) { synchronized (session) { String value = String.valueOf(Math.random()); session.setAttribute(PORTLET_WINDOW_ID, value); - Some of the Maven 2 dependencies for the bridge projects were... absent. Mostly due to deprecated/old groupIds (non-hierarchical like castor/castor instead of the hierarchical ids). Worked around it by building/installing portlet-bridges-common explicitly then adding an exclusion of the parent project to the dependency in my POM so that I wasn't dependent on e.g. the perl bridge failing to build because of these rotten dependencies. - I was surpried the trunk source's POMs did not use 1.0-SNAPSHOT or the like for version now, if 1.0.4 is actually released. Don't the portlet-bridge developers use Maven 2 and thus do not release using mvn which would have updated the version numbers in the pom.xml files? Med vennlig hilsen TOR IVER WILHELMSEN Senior systemutvikler Arrive AS T (+47) 48 16 06 18 E-post: [EMAIL PROTECTED] http://servicedesk.arrive.no - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible vs. setVisible
That's why I almost always override isVisible like @Override boolean isVisible() { return super.isVisible() && myVisibilityConstraints; } Thus I can go for both approches (push and / or pull state). Maybe this could be added to the Javadoc of isVisible ? Just my 2 cents, Antoine. Matthijs Wensveen wrote: Martijn Dashorst wrote: On Mon, Jun 16, 2008 at 3:48 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: A little off-topic: It scares me a little when core developer make bold statements like: "setters are evil" and "I wouldn't mind final was the default in java". Maybe I'm just being paranoid here... Why? Are we not allowed an opinion? Why off-course! Am I not allowed to be scared? ;P And from an OO point of view, I can see how setters break encapsulation: they expose the internal state of an object. In the case of setVisible this is exacerbated because the semantics of the following are vague: Label l = new Label("l", "foo") { @Override boolean isVisible() { return false; } }; l.setVisible(true); add(l); So either you'd want final to be the default, or you'd consider setters evil. :-D Hehe. Maybe in that case you should override setVisible as well to throw an UnsupportedOperationException? I disagree that you expose internal state. It's hardly internal when there is a public setter. But I agree that it is often very useful to override the getter (isser for booleans?) when there is a hard dependency between the component visibility and some other state. As I said: it's good to have choice. Martijn -- Antoine Angénieux Associé Clinigrid 5, avenue Mozart 75016 Paris, France +336 60 21 09 18 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible vs. setVisible
Martijn Dashorst wrote: On Mon, Jun 16, 2008 at 3:48 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: A little off-topic: It scares me a little when core developer make bold statements like: "setters are evil" and "I wouldn't mind final was the default in java". Maybe I'm just being paranoid here... Why? Are we not allowed an opinion? Why off-course! Am I not allowed to be scared? ;P And from an OO point of view, I can see how setters break encapsulation: they expose the internal state of an object. In the case of setVisible this is exacerbated because the semantics of the following are vague: Label l = new Label("l", "foo") { @Override boolean isVisible() { return false; } }; l.setVisible(true); add(l); So either you'd want final to be the default, or you'd consider setters evil. :-D Hehe. Maybe in that case you should override setVisible as well to throw an UnsupportedOperationException? I disagree that you expose internal state. It's hardly internal when there is a public setter. But I agree that it is often very useful to override the getter (isser for booleans?) when there is a hard dependency between the component visibility and some other state. As I said: it's good to have choice. Martijn -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chaining components
>> What is your idea of nice chaining? > > http://wicketstuff.org/wicket13/ajax/choice I am using 1.4-m1 and I tried to make public abstract class AbstractListChoiceModel extends AbstractReadOnlyModel> { @Override public final List getObject() { return getChoices(); } protected abstract List getChoices(); } The compiler complains AbstractListChoiceModel is not compatible with IModel> Does this make sense? AbstractListChoiceModel availableCustomElementsModel = new AbstractListChoiceModel() { ... }; final DropDownChoice selection = new DropDownChoice(SELECTION, new PropertyModel(dto, CustomElement.SELECTION)), availableCustomElementsModel, new IChoiceRenderer() { ... ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible vs. setVisible
On Mon, Jun 16, 2008 at 3:48 PM, Matthijs Wensveen <[EMAIL PROTECTED]> wrote: > A little off-topic: It scares me a little when core developer make bold > statements like: "setters are evil" and "I wouldn't mind final was the > default in java". Maybe I'm just being paranoid here... Why? Are we not allowed an opinion? And from an OO point of view, I can see how setters break encapsulation: they expose the internal state of an object. In the case of setVisible this is exacerbated because the semantics of the following are vague: Label l = new Label("l", "foo") { @Override boolean isVisible() { return false; } }; l.setVisible(true); add(l); So either you'd want final to be the default, or you'd consider setters evil. :-D Martijn -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session parameters and back button
yes I have. As I understood, breadcrum is something like a Panel. All of our links direct to Pages. Do you know of a way to use breadcrumbs with pages? It's not possible for us to change the whole structure of our application. One more thing, the XML structure is also used to filter a legacy filtering . unfortunately I can't change these constraints. On Mon, Jun 16, 2008 at 4:43 PM, James Carman <[EMAIL PROTECTED]> wrote: > Have you looked at the breadcrumb support? Will that solve what > you're trying to accomplish? > > On Mon, Jun 16, 2008 at 7:53 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > > I am not :) > > > > The back button work perfect (thanks to Wicket :) ). > > > > The thing that I call "pageId" is something that indicates our structure > of > > hierarchy pages. > > It's not Wicket's page Id. > > > > My question actually is, if there is a way to set values in the Session > when > > pressing the back button? > > > > On Mon, Jun 16, 2008 at 2:43 PM, Martijn Dashorst < > > [EMAIL PROTECTED]> wrote: > > > >> Why are you building wicket in wicket? > >> > >> Wicket keeps track of the last page already and detects back button > >> usage perfectly by itself. > >> > >> Martijn > >> > >> On Mon, Jun 16, 2008 at 1:26 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > >> > Hello, > >> > I have in my Session a field called pageId. > >> > I have Link that in the onClick I set in the session the page id and > then > >> go > >> > to a new page using setResponsePage. > >> >@Override > >> >public void onClick() { > >> >PortalSession session = ((SecuredBasePage) > >> > getPage()).getEurekifySession(); > >> >session.setCurrentPageId(pageId); > >> >setResponsePage(pageClass, pageParameters); > >> >} > >> > > >> > > >> > > >> > In my base page's constructor I do this: > >> > ... > >> >String pageId = getEurekifySession().getCurrentPageId(); > >> >LinksHeaderPanel linksPanel = new > LinksHeaderPanel("linksPanel", > >> > pageId); > >> > ... > >> > > >> > everything goes well until I press the back button. > >> > When I press BACK button, naturally the Session still has the last > >> pageId, > >> > because it is not set (to the old page id). > >> > Is there a way to fix this problem? > >> > > >> > *I cannot use PageParameters to keep the pageId. > >> > > >> > Thanks. > >> > > >> > > >> > -- > >> > Eyal Golan > >> > [EMAIL PROTECTED] > >> > > >> > Visit: http://jvdrums.sourceforge.net/ > >> > LinkedIn: http://www.linkedin.com/in/egolan74 > >> > > >> > >> > >> > >> -- > >> Become a Wicket expert, learn from the best: http://wicketinaction.com > >> Apache Wicket 1.3.3 is released > >> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 > >> > >> - > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > -- > > Eyal Golan > > [EMAIL PROTECTED] > > > > Visit: http://jvdrums.sourceforge.net/ > > LinkedIn: http://www.linkedin.com/in/egolan74 > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: isVisible vs. setVisible
Jonathan Locke wrote: true. in the isVisible impl you could lazy-init cache a transient Boolean until end request where you set it null. setters are evil. ..but it's good to have choice. *And* setVisible is not a normal setter, because it returns the component, which makes it easy to add an initially invisible component like: add(new Label("profanity", "[EMAIL PROTECTED]").setVisible(false)); Also, with is/setVisible you van use the component with a propertymodel to have some other component toggle the visibility of another component. This way you have the best of both worlds. A little off-topic: It scares me a little when core developer make bold statements like: "setters are evil" and "I wouldn't mind final was the default in java". Maybe I'm just being paranoid here... Matthijs egolan74 wrote: Yes but ... isVisible may be triggered several times, while setVisible should only be called once (say if I do it only once after creating the component). Usually I prefer the state driven way, but what if the logic has a lot of overhead? Jonathan Locke wrote: isVisible is generally better imo because it is state driven. if you push instead of pull, the state can get stale. -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session parameters and back button
Have you looked at the breadcrumb support? Will that solve what you're trying to accomplish? On Mon, Jun 16, 2008 at 7:53 AM, Eyal Golan <[EMAIL PROTECTED]> wrote: > I am not :) > > The back button work perfect (thanks to Wicket :) ). > > The thing that I call "pageId" is something that indicates our structure of > hierarchy pages. > It's not Wicket's page Id. > > My question actually is, if there is a way to set values in the Session when > pressing the back button? > > On Mon, Jun 16, 2008 at 2:43 PM, Martijn Dashorst < > [EMAIL PROTECTED]> wrote: > >> Why are you building wicket in wicket? >> >> Wicket keeps track of the last page already and detects back button >> usage perfectly by itself. >> >> Martijn >> >> On Mon, Jun 16, 2008 at 1:26 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: >> > Hello, >> > I have in my Session a field called pageId. >> > I have Link that in the onClick I set in the session the page id and then >> go >> > to a new page using setResponsePage. >> >@Override >> >public void onClick() { >> >PortalSession session = ((SecuredBasePage) >> > getPage()).getEurekifySession(); >> >session.setCurrentPageId(pageId); >> >setResponsePage(pageClass, pageParameters); >> >} >> > >> > >> > >> > In my base page's constructor I do this: >> > ... >> >String pageId = getEurekifySession().getCurrentPageId(); >> >LinksHeaderPanel linksPanel = new LinksHeaderPanel("linksPanel", >> > pageId); >> > ... >> > >> > everything goes well until I press the back button. >> > When I press BACK button, naturally the Session still has the last >> pageId, >> > because it is not set (to the old page id). >> > Is there a way to fix this problem? >> > >> > *I cannot use PageParameters to keep the pageId. >> > >> > Thanks. >> > >> > >> > -- >> > Eyal Golan >> > [EMAIL PROTECTED] >> > >> > Visit: http://jvdrums.sourceforge.net/ >> > LinkedIn: http://www.linkedin.com/in/egolan74 >> > >> >> >> >> -- >> Become a Wicket expert, learn from the best: http://wicketinaction.com >> Apache Wicket 1.3.3 is released >> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > Eyal Golan > [EMAIL PROTECTED] > > Visit: http://jvdrums.sourceforge.net/ > LinkedIn: http://www.linkedin.com/in/egolan74 > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chaining components
That's what I said ;) Johan Compagner wrote: i think they are pointing to this one: https://issues.apache.org/jira/browse/WICKET-1312 On Mon, Jun 16, 2008 at 9:21 AM, Jonathan Locke <[EMAIL PROTECTED]> wrote: what bug # is that one? igor.vaynberg wrote: On Sun, Jun 15, 2008 at 11:38 AM, Martin Makundi <[EMAIL PROTECTED]> wrote: Hi! When I chain components, comboboxes and tables etc., I find myself repeatedly solving the same problem: * the parent component causes a data reload if you chain your models properly (make child's model depend on parent's model) this should work transparently. * the parent component causes an ajax refresh if the parent component repaints itself then all child components are repainted as well... Has someone found a generic eventlistener-like solution to this? there is a patch in jira for a generic event/listener mechanism, but it wont happen until 1.5 because it requires api breaks. -igor My current inline implementations have become quite messy to follow and I must make some major refactoring soon, as I am beginning to understand how the Wicket framework operates - and it would not hurt to plug in some neat ready solution you have come up with that keeps the code clean and structured. I am thinking something along the lines of a hashmap, I would just push the reloaders and refreshers there out of sight ... ** Martin - 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/Chaining-components-tp17853298p17859174.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] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please check my fix to terracotta problem
Hi, Just a little background, i've been trying to get my application clustered with terracotta for a while and ran into a big problem. Basically wicket was producing more garbage objects than terracotta could handle, as such terracotta was using up loads of disk space (see my thread on terracotta forum for more info http://forums.terracotta.org/forums/posts/list/1144.page ) To solve this I have decided to try and stop the page object being stored 'as is' to avoid the number of objects being sent to the terracotta server. My solution has been to replace the default IPageMapEntry with one that only stores a serialized version of the page: public class NewPageMapEntry extends AbstractPageMapEntry { private transient Page page; private byte[] data; public NewPageMapEntry(final Page page) { this.page = page; data = Objects.objectToByteArray(page); setNumericId(page.getNumericId()); } @Override public Page getPage() { if(this.page == null) { page = (Page) Objects.byteArrayToObject(data); } return page; } } and use it in my base page (which all others extend) like this: @Override public IPageMapEntry getPageMapEntry() { return new NewPageMapEntry(this); } Does this seem like a reasonable approach? -- View this message in context: http://www.nabble.com/Please-check-my-fix-to-terracotta-problem-tp17864318p17864318.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: Using relative path with HeaderContributor
So now things are actually working as they should. Forget this thread, I am an idiot. Thanks and keep up the good work. - Juha Juha Alatalo wrote: Now browser does never find my css-file. What is the "trick" to make things work again? James Carman wrote: This is not a bug. The $up$ stuff was put in there to "trick" the browser into not trying to automatically resolve the ".." for you. This is necessary for resources. On Mon, Jun 16, 2008 at 7:02 AM, Juha Alatalo <[EMAIL PROTECTED]> wrote: Hi, We started to use 1.3.X because https://issues.apache.org/jira/browse/WICKET-1667 will be probably fixed soon in 1.3.X. There seems to be some changes in public static String resourceKey(final String path, final Locale locale, final String style) in SharedResources. We have been using following reference to a css-file public static final CompressedResourceReference MES_CSS = new CompressedResourceReference(MesFunc.class, "../../../somePath/main.css"); public MeasurementDataPage() { super(); add(HeaderContributor.forCss( MES_CSS )); } In 1.3.3 source looked like this: href="resources/syncrontech.paroc.mes.common.MesFunc/../../../syncrontech/paroc/mes/themes/main.css" /> Now in 1.3.X it looks like this: href="resources/syncrontech.paroc.mes.common.MesFunc/$up$/$up$/$up$/syncrontech/paroc/mes/themes/main.css" /> Is this a bug or do I have to move all my css files to a such location where .. is not needed? - Juha - 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] - 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: Session parameters and back button
I am not :) The back button work perfect (thanks to Wicket :) ). The thing that I call "pageId" is something that indicates our structure of hierarchy pages. It's not Wicket's page Id. My question actually is, if there is a way to set values in the Session when pressing the back button? On Mon, Jun 16, 2008 at 2:43 PM, Martijn Dashorst < [EMAIL PROTECTED]> wrote: > Why are you building wicket in wicket? > > Wicket keeps track of the last page already and detects back button > usage perfectly by itself. > > Martijn > > On Mon, Jun 16, 2008 at 1:26 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > > Hello, > > I have in my Session a field called pageId. > > I have Link that in the onClick I set in the session the page id and then > go > > to a new page using setResponsePage. > >@Override > >public void onClick() { > >PortalSession session = ((SecuredBasePage) > > getPage()).getEurekifySession(); > >session.setCurrentPageId(pageId); > >setResponsePage(pageClass, pageParameters); > >} > > > > > > > > In my base page's constructor I do this: > > ... > >String pageId = getEurekifySession().getCurrentPageId(); > >LinksHeaderPanel linksPanel = new LinksHeaderPanel("linksPanel", > > pageId); > > ... > > > > everything goes well until I press the back button. > > When I press BACK button, naturally the Session still has the last > pageId, > > because it is not set (to the old page id). > > Is there a way to fix this problem? > > > > *I cannot use PageParameters to keep the pageId. > > > > Thanks. > > > > > > -- > > Eyal Golan > > [EMAIL PROTECTED] > > > > Visit: http://jvdrums.sourceforge.net/ > > LinkedIn: http://www.linkedin.com/in/egolan74 > > > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > Apache Wicket 1.3.3 is released > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: Session parameters and back button
Why are you building wicket in wicket? Wicket keeps track of the last page already and detects back button usage perfectly by itself. Martijn On Mon, Jun 16, 2008 at 1:26 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > Hello, > I have in my Session a field called pageId. > I have Link that in the onClick I set in the session the page id and then go > to a new page using setResponsePage. >@Override >public void onClick() { >PortalSession session = ((SecuredBasePage) > getPage()).getEurekifySession(); >session.setCurrentPageId(pageId); >setResponsePage(pageClass, pageParameters); >} > > > > In my base page's constructor I do this: > ... >String pageId = getEurekifySession().getCurrentPageId(); >LinksHeaderPanel linksPanel = new LinksHeaderPanel("linksPanel", > pageId); > ... > > everything goes well until I press the back button. > When I press BACK button, naturally the Session still has the last pageId, > because it is not set (to the old page id). > Is there a way to fix this problem? > > *I cannot use PageParameters to keep the pageId. > > Thanks. > > > -- > Eyal Golan > [EMAIL PROTECTED] > > Visit: http://jvdrums.sourceforge.net/ > LinkedIn: http://www.linkedin.com/in/egolan74 > -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.3 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using relative path with HeaderContributor
Now browser does never find my css-file. What is the "trick" to make things work again? James Carman wrote: This is not a bug. The $up$ stuff was put in there to "trick" the browser into not trying to automatically resolve the ".." for you. This is necessary for resources. On Mon, Jun 16, 2008 at 7:02 AM, Juha Alatalo <[EMAIL PROTECTED]> wrote: Hi, We started to use 1.3.X because https://issues.apache.org/jira/browse/WICKET-1667 will be probably fixed soon in 1.3.X. There seems to be some changes in public static String resourceKey(final String path, final Locale locale, final String style) in SharedResources. We have been using following reference to a css-file public static final CompressedResourceReference MES_CSS = new CompressedResourceReference(MesFunc.class, "../../../somePath/main.css"); public MeasurementDataPage() { super(); add(HeaderContributor.forCss( MES_CSS )); } In 1.3.3 source looked like this: Now in 1.3.X it looks like this: Is this a bug or do I have to move all my css files to a such location where .. is not needed? - Juha - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Session parameters and back button
Hello, I have in my Session a field called pageId. I have Link that in the onClick I set in the session the page id and then go to a new page using setResponsePage. @Override public void onClick() { PortalSession session = ((SecuredBasePage) getPage()).getEurekifySession(); session.setCurrentPageId(pageId); setResponsePage(pageClass, pageParameters); } In my base page's constructor I do this: ... String pageId = getEurekifySession().getCurrentPageId(); LinksHeaderPanel linksPanel = new LinksHeaderPanel("linksPanel", pageId); ... everything goes well until I press the back button. When I press BACK button, naturally the Session still has the last pageId, because it is not set (to the old page id). Is there a way to fix this problem? *I cannot use PageParameters to keep the pageId. Thanks. -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: Using relative path with HeaderContributor
This is not a bug. The $up$ stuff was put in there to "trick" the browser into not trying to automatically resolve the ".." for you. This is necessary for resources. On Mon, Jun 16, 2008 at 7:02 AM, Juha Alatalo <[EMAIL PROTECTED]> wrote: > Hi, > > We started to use 1.3.X because > https://issues.apache.org/jira/browse/WICKET-1667 will be probably fixed > soon in 1.3.X. > > There seems to be some changes in > public static String resourceKey(final String path, final Locale locale, > final String style) in SharedResources. > We have been using following reference to a css-file > > public static final CompressedResourceReference MES_CSS = new > CompressedResourceReference(MesFunc.class, "../../../somePath/main.css"); > > public MeasurementDataPage() > { >super(); >add(HeaderContributor.forCss( MES_CSS )); > } > > In 1.3.3 source looked like this: > href="resources/syncrontech.paroc.mes.common.MesFunc/../../../syncrontech/paroc/mes/themes/main.css" > /> > > Now in 1.3.X it looks like this: > href="resources/syncrontech.paroc.mes.common.MesFunc/$up$/$up$/$up$/syncrontech/paroc/mes/themes/main.css" > /> > > Is this a bug or do I have to move all my css files to a such location where > .. is not needed? > > - Juha > > > > - > 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: Chaining components
> If you just need a reference to the AjaxRequestTarget then you can do > RequestCycle.get().getRequestTarget() and do an instanceof with > AjaxRequestTarget. Well, I need the ajax event too so I suppose I can equally well pick up the target from there. I will post my brain later if I am succesful. ** Martin >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > > -- > Matthijs Wensveen > Func. Internet Integration > W http://www.func.nl > T +31 20 423 > F +31 20 4223500 > > - > 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: Chaining components
Martin Makundi wrote: I've been thinking about writing aspects that fire Component.onModelChanged even when the model's object changed (possibly deep within an object hierarchy). Do you have a demo about this? Unfortunately no, I didn't have the time to convert my brain contents to java code... I am about to write a HierarchicalAjaxRefreshTargetPropagator soon just to get a feeling if it is a bad idea... I will let subscribers know. If you just need a reference to the AjaxRequestTarget then you can do RequestCycle.get().getRequestTarget() and do an instanceof with AjaxRequestTarget. Matthijs ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Matthijs Wensveen Func. Internet Integration W http://www.func.nl T +31 20 423 F +31 20 4223500 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using relative path with HeaderContributor
Hi, We started to use 1.3.X because https://issues.apache.org/jira/browse/WICKET-1667 will be probably fixed soon in 1.3.X. There seems to be some changes in public static String resourceKey(final String path, final Locale locale, final String style) in SharedResources. We have been using following reference to a css-file public static final CompressedResourceReference MES_CSS = new CompressedResourceReference(MesFunc.class, "../../../somePath/main.css"); public MeasurementDataPage() { super(); add(HeaderContributor.forCss( MES_CSS )); } In 1.3.3 source looked like this: href="resources/syncrontech.paroc.mes.common.MesFunc/../../../syncrontech/paroc/mes/themes/main.css" /> Now in 1.3.X it looks like this: href="resources/syncrontech.paroc.mes.common.MesFunc/$up$/$up$/$up$/syncrontech/paroc/mes/themes/main.css" /> Is this a bug or do I have to move all my css files to a such location where .. is not needed? - Juha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session question
Eyal wrote: > isn't volatile will create overhead on the Session? > Read this: http://www.javaperformancetuning.com/news/qotm030.shtml Any overhead is essential, Eyal. You *want* threads to flush their memory caches, when accessing session variables. Otherwise, variable changes by one thread might be invisible to others. (Alternatively, you can sync. But the overhead is probably higher.) -- Michael Allan http://zelea.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isVisible vs. setVisible
true. in the isVisible impl you could lazy-init cache a transient Boolean until end request where you set it null. setters are evil. egolan74 wrote: > > Yes but ... > isVisible may be triggered several times, while setVisible should only be > called once (say if I do it only once after creating the component). > Usually I prefer the state driven way, but what if the logic has a lot of > overhead? > > > > Jonathan Locke wrote: >> >> >> isVisible is generally better imo because it is state driven. if you >> push instead of pull, the state can get stale. >> >> > > -- View this message in context: http://www.nabble.com/isVisible-vs.-setVisible-tp17860615p17861099.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: isVisible vs. setVisible
Yes but ... isVisible may be triggered several times, while setVisible should only be called once (say if I do it only once after creating the component). Usually I prefer the state driven way, but what if the logic has a lot of overhead? Jonathan Locke wrote: > > > isVisible is generally better imo because it is state driven. if you push > instead of pull, the state can get stale. > > - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/isVisible-vs.-setVisible-tp17860615p17860930.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: Chaining components
> I've been thinking about writing aspects that fire Component.onModelChanged > even when the model's object changed (possibly deep within an object > hierarchy). Do you have a demo about this? I am about to write a HierarchicalAjaxRefreshTargetPropagator soon just to get a feeling if it is a bad idea... I will let subscribers know. ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Wicket portles in Sun Portal
Thijs Vonk wrote: > Ate Douma wrote: Thanks to both of you! > Note though that you have to build a svn copy of the > portlet-container. > RC2 contains a bug I found which prevents Ajax to work correctly. Will try that. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session question
thanks Michael, That's what I thought. BTW, isn't volatile will create overhead on the Session? Read this: http://www.javaperformancetuning.com/news/qotm030.shtml Eyal G On Mon, Jun 16, 2008 at 11:31 AM, Michael Allan <[EMAIL PROTECTED]> wrote: > > Is putting a field in a Session and call it makes the session "work to > > hard"? > > I'm not a web expert so maybe my question is naive, but does calling for > a > > field in a Wicket Session creates overload in the net? > > No, it is common practice, in general. Search the list for 'session' > and 'field'. (And maybe for 'thread-safe'. You probably want the > field to be volatile.) > > -- > Michael Allan > > http://zelea.com/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: isVisible vs. setVisible
isVisible is generally better imo because it is state driven. if you push instead of pull, the state can get stale. Eyal Golan wrote: > > This is a "Best Practice" question. > Suppose I have a component and I want to set its visibility according to > certain parameters. > Suppose I can do it by overriding the isVisible but I can also use the > setVisible after creating the constructor. > > Is there a preferable way? > Does it depend on the parameters I check? > > thanks > > -- > Eyal Golan > [EMAIL PROTECTED] > > Visit: http://jvdrums.sourceforge.net/ > LinkedIn: http://www.linkedin.com/in/egolan74 > > -- View this message in context: http://www.nabble.com/isVisible-vs.-setVisible-tp17860615p17860647.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]
isVisible vs. setVisible
This is a "Best Practice" question. Suppose I have a component and I want to set its visibility according to certain parameters. Suppose I can do it by overriding the isVisible but I can also use the setVisible after creating the constructor. Is there a preferable way? Does it depend on the parameters I check? thanks -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: Localizer cache with 150.000+ entries causing OutOfMemory
Hi, we have been using this patched version now in a production environment few days. Seems to be working nicely. Memory problems disappeared. - Juha Igor Vaynberg wrote: if someone can confirm that the patch works in a production env i will be happy to commit it. i just havent had the time to test it myself yet. -igor On Tue, Jun 10, 2008 at 7:09 AM, Juha Alatalo <[EMAIL PROTECTED]> wrote: Hi All, I run our profiling tests (version 1.3.3) using Application.java and Localizer.java patched by Stefan. Patch seems to be solving our memory problems. Is this patch coming to 1.3.4 and do you have any idea when 1.3.4 will be released? Best Regards - Juha Stefan Fußenegger wrote: Hi Daniel, I didn't put the patch into production yet, but I am quite confident, that it will help. As you can see in the example I attached to the JIRA issue (just attached a new version), the unpatched Localizer had 200 entries in his cache, the patched Localizer only four - which is a Good Thing (tm), as there are only 4 different cached values! Regards, Stefan Daniel Frisk wrote: So the patch did help? I too have observed this problem but it was at the moment less of a problem than other heap eaters, now this is next in line. We have added a script which automatically restarts the server when repeated OOME occurs and are down to a couple of times per week without the patch. But still, who wouldn't want to see months of uptime... // Daniel jalbum.net On 2008-06-10, at 11:29, Stefan Fußenegger wrote: Hi Igor, Thanks for your quick reply and the patch, sorry for not searching the mailinglist only but not JIRA. Your patch was for 1.4, I applied it to 1.3.3, created a quickstart including JUnit test and attached it to the JIRA issue. Hope this fix gets into the next maintenance release. I am to lazy to create a properly patched jar and a MVN repo for my team right now ;) Regards, Stefan igor.vaynberg wrote: try applying this patch and see if it helps https://issues.apache.org/jira/browse/WICKET-1667 -igor On Mon, Jun 9, 2008 at 8:11 AM, Stefan Fußenegger <[EMAIL PROTECTED]> wrote: I am just analysing a heap dump (god bless the -XX:+HeapDumpOnOutOfMemoryError flag) of a recent application cache due to an OutOfMemoryError ("GC overhead limit exceeded" to be precise). Using jhat, the "175456 instances of class org.apache.wicket.util.concurrent.ConcurrentHashMap$Entry" immediately got my attention. While looking through the 107 instance of ConcurrentHashMap, I found one *really* big one: Localizer.cache has a hash table length of 262144, each of its 32 segments with about 5300 entries, where a hash key is a string, sometimes longer than 500 charactes, similar to (see Localizer.getCacheKey(String,Component)): fooTitle.bar- org.apache.wicket.markup.html.link.BookmarkablePageLink:fooLink- org.apache.wicket.markup.html.panel.Fragment:track- org.apache.wicket.markup.html.list.ListItem:14- my.company.FooListPanel$1:fooList-my.company.FooListPanel:foos- org.apache.wicket.markup.html.list.ListItem:0- my.company.BarListPanel$1:bars-my.company.FooListPanel:panel- my.company.boxes.BodyBox:2- org.apache.wicket.markup.repeater.RepeatingView:body- my.company.layout.Border:border-my.company.pages.music.FoobarPage: 43-de-null Those numbers pretty much convinced me: The localizer cache has blown away my application. Looking at this hash keys, I suspect the following problem: those strings are constructed from the "position" of a localized String on a page, which is quite a bad thing if you use nested list views or repeating views to construct your page. For instance, I have a panel with a long (pageable) list of entries, might be > 5000 entries which might appear on various positions in a repeating view I use as a container for most of my pages. Let's say there are 5 possible positions, this would cause 2500 thousand cached entries, each with a key of 300+ characters plus some more characters for the cached message - feel free to do the maths. From a quick estimate I'd say: No wonder, this has blown away my app. As a quick fix, I'd suggest to regularly clear the localizer cache, use a more sophisticated cache (that expires old entries once in a while!!) or to disable the cache completely. However, don't try to overwrite Localizer.newCache() and clear the cache regularly: clearCache() will replace your cache with a ConcurrentHashMap (not using Localizer.newCache()). However, quite unlikely, that this will happen as newCache() is private anyway ;) I am going to add some code to clear the cache regularly. Best regards, Stefan PS: I'll also create a JIRA issue, but I am really short on time right now. - --- Stefan Fußenegger http://talk-on-tech.blogspot.com // looking for a nicer domain ;) -- View this message in context: http://www.nabble.com/Localizer-cache-with-150.000%2B-entries-causing-OutOfMemory-tp17734931p17734931.html Sent from the Wicket - User mailing list archive at Nabble.
Re: self refreshing table with effects
create a jira with a test case. On Mon, Jun 16, 2008 at 2:56 AM, mfs <[EMAIL PROTECTED]> wrote: > > And surprisingly, this issue comes in IE and Safari but not in Mozilla.. > > > > mfs wrote: > > > > Any update on this issue, i am facing an issue somewhat related, where > > clicking on an ajaxlink once the session expiry has reached, gives a > > nullpointer exception at > > BookmarkableListenerInterfaceRequestTarget.processEvents ...(Below is the > > exception stack-trace), btw i am using QueryStringUrlCodingStrategy url > > coding strategy to mount the pagesThe behavior is fine for non-ajax > > component, where i am taken to the session-expiry page... > > > > Thanks in advance.. > > > > ERROR - RequestCycle - > > java.lang.NullPointerException > > at > > > org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:131) > > at > > > org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) > > at > > > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1188) > > at org.apache.wicket.RequestCycle.step(RequestCycle.java:1265) > > at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1366) > > at org.apache.wicket.RequestCycle.request(RequestCycle.java:499) > > at > > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387) > > at > > > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) > > at > > > com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:623) > > at > > > com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) > > at > > > com.evermind.server.http.HttpRequestHandler.handleNotFound(HttpRequestHandler.java:1041) > > at > > > com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:911) > > at > > > com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) > > at > > > com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:302) > > at > > > com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:190) > > at > > > oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) > > at > > > com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) > > at java.lang.Thread.run(Thread.java:595) > > > > > > > > > > Johan Compagner wrote: > >> > >> Please make a jira issue for this with an example > >> > >> On 2/20/08, okrohne <[EMAIL PROTECTED]> wrote: > >>> > >>> Hi, > >>> > >>> I tried QueryStringUrlCodingStrategy and MixedParamUrlCodingStrategy > and > >>> both are throwing > >>> exceptions. I looked at the example in chapter 15.2 , I don't get the > >>> point > >>> of: > >>> > >>> ((WebApplication)getApplication()).unmount("cheeses"); > >>> ((WebApplication)getApplication()).mountBookmarkablePage("cheeses", > >>> CheeseDetailsPage.class); > >>> ((WebApplication)getApplication()).unmount("cheeses"); > >>> ((WebApplication)getApplication()).mount(new > >>> QueryStringUrlCodingStrategy("cheeses", CheeseDetailsPage.class)); > >>> ((WebApplication)getApplication()).unmount("cheeses"); > >>> ((WebApplication)getApplication()).mount(new > >>> MixedParamUrlCodingStrategy("cheeses", CheeseDetailsPage.class, new > >>> String[]{})); > >>> > >>> why mount and unmount? > >>> > >>> The exceptions are thrown after the first on timer event. > >>> > >>> > >>> QueryStringUrlCodingStrategy gives: > >>> > >>> Root cause: > >>> > >>> java.lang.NullPointerException > >>> at > >>> > org.apache.wicket.request.target.component.BookmarkableListenerInterfaceRequestTarget.processEvents(BookmarkableListenerInterfaceRequestTarget.java:131) > >>> at > >>> > org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:90) > >>> at > >>> > org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) > >>> at org.apache.wicket.RequestCycle.step(RequestCycle.java:1241) > >>> at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1316) > >>> at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) > >>> at > >>> > org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:354) > >>> at > >>> > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) > >>> at > >>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) > >>> at > >>> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) > >>> at > >>> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) > >>> at > >>> > org.apache.catalina.core.
Re: Session question
> Is putting a field in a Session and call it makes the session "work to > hard"? > I'm not a web expert so maybe my question is naive, but does calling for a > field in a Wicket Session creates overload in the net? No, it is common practice, in general. Search the list for 'session' and 'field'. (And maybe for 'thread-safe'. You probably want the field to be volatile.) -- Michael Allan http://zelea.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Chaining components
i think they are pointing to this one: https://issues.apache.org/jira/browse/WICKET-1312 On Mon, Jun 16, 2008 at 9:21 AM, Jonathan Locke <[EMAIL PROTECTED]> wrote: > > > what bug # is that one? > > > igor.vaynberg wrote: > > > > On Sun, Jun 15, 2008 at 11:38 AM, Martin Makundi > > <[EMAIL PROTECTED]> wrote: > >> Hi! > >> > >> When I chain components, comboboxes and tables etc., I find myself > >> repeatedly solving the same problem: > >> * the parent component causes a data reload > > > > if you chain your models properly (make child's model depend on > > parent's model) this should work transparently. > > > >> * the parent component causes an ajax refresh > > > > if the parent component repaints itself then all child components are > > repainted as well... > > > >> Has someone found a generic eventlistener-like solution to this? > > > > there is a patch in jira for a generic event/listener mechanism, but > > it wont happen until 1.5 because it requires api breaks. > > > > -igor > > > >> > >> My current inline implementations have become quite messy to follow > >> and I must make some major refactoring soon, as I am beginning to > >> understand how the Wicket framework operates - and it would not hurt > >> to plug in some neat ready solution you have come up with that keeps > >> the code clean and structured. I am thinking something along the lines > >> of a hashmap, I would just push the reloaders and refreshers there out > >> of sight ... > >> > >> ** > >> Martin > >> > >> - > >> 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/Chaining-components-tp17853298p17859174.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: HTTP Session creating at home page
Many thanks from me also. I just had the problem with a login from a stateless page, where the userinformation was lost on the next request. Following the list in readonly mode save me some time again ;) Bert On Sun, Jun 15, 2008 at 2:32 PM, Stefan Simik <[EMAIL PROTECTED]> wrote: > > Great, it works :) > Maurice, thank you very much for your help! > Stefan > > > Mr Mean wrote: >> >> It seems that you homepage is stateless, wicket does not create a >> session for stateless pages to preserve server resources. You can >> force wicket to create a session for you by calling >> Session.get().bind() in your constructor (or any other place that is >> executed during a requestcycle). >> >> Maurice >> >> On Sat, Jun 14, 2008 at 9:48 PM, Stefan Simik <[EMAIL PROTECTED]> >> wrote: >>> >>> Hi boys, >>> >>> I would like to ask, how can I force creation of HTTP session >>> when first request comes to server. >>> >>> I have this problem: >>> 1. user requests home page (wicket session is created) for example: >>> www.server.com/app >>> 2. I set some data into the wicket session >>> 3. server responds with redirect to some random bookmarkable page: >>> www.server.com/app/pc >>> >>> 4. At the next request - HERE IS THE PROBLEM - there are no previously >>> stored data in the session. >>> >>> At the second and next requests, there is no problem with session. What I >>> save into the session, >>> I can find in later requests. The problem is in the first roundtrip, so >>> it >>> seems, that >>> the real HTTP session is not created in the first request. >>> >>> Where should I look for some solution please? >>> -- >>> View this message in context: >>> http://www.nabble.com/HTTP-Session-creating-at-home-page-tp17843162p17843162.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/HTTP-Session-creating-at-home-page-tp17843162p17849458.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]
Session question
Hi, we have our own customized session. We have a field called pageId. We set it whenever the user clicks a subclass of Link. We call the getter in the linksTo of a link. we have more than a few such links. My question: Is putting a field in a Session and call it makes the session "work to hard"? I'm not a web expert so maybe my question is naive, but does calling for a field in a Wicket Session creates overload in the net? Thanks -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Exception: URL fragment has unmatched key/value pair:
wicket 1.3.3 I request a url (http://www.splashnote.com/myHome/test),but this url is not mountBookmarkablePage. then page is throw exception.I don't it throw exception -- View this message in context: http://www.nabble.com/Exception%3A-URL-fragment-has-unmatched-key-value-pair%3A-tp17859509p17859509.html Sent from the Wicket - User mailing list archive at Nabble.com.
Exception: URL fragment has unmatched key/value pair:
I put some u wicket 1.3.3 I request a url (http://www.splashnote.com/myHome/test),but this url is not mountBookmarkablePage. then page is throw exception.I don't it throw exception -- View this message in context: http://www.nabble.com/Exception%3A-URL-fragment-has-unmatched-key-value-pair%3A-tp17859480p17859480.html Sent from the Wicket - User mailing list archive at Nabble.com.
wicket training/consulting in the SF Bay Area
Hi, Is there any one available to provide Wicket training and/or consulting in the SF Bay area? I need help urgently. Off hours is fine. Thanks, -Mohammad -- View this message in context: http://www.nabble.com/wicket-training-consulting-in-the-SF-Bay-Area-tp17859255p17859255.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: Chaining components
what bug # is that one? igor.vaynberg wrote: > > On Sun, Jun 15, 2008 at 11:38 AM, Martin Makundi > <[EMAIL PROTECTED]> wrote: >> Hi! >> >> When I chain components, comboboxes and tables etc., I find myself >> repeatedly solving the same problem: >> * the parent component causes a data reload > > if you chain your models properly (make child's model depend on > parent's model) this should work transparently. > >> * the parent component causes an ajax refresh > > if the parent component repaints itself then all child components are > repainted as well... > >> Has someone found a generic eventlistener-like solution to this? > > there is a patch in jira for a generic event/listener mechanism, but > it wont happen until 1.5 because it requires api breaks. > > -igor > >> >> My current inline implementations have become quite messy to follow >> and I must make some major refactoring soon, as I am beginning to >> understand how the Wicket framework operates - and it would not hurt >> to plug in some neat ready solution you have come up with that keeps >> the code clean and structured. I am thinking something along the lines >> of a hashmap, I would just push the reloaders and refreshers there out >> of sight ... >> >> ** >> Martin >> >> - >> 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/Chaining-components-tp17853298p17859174.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: "override" onClick of BookmarkablePageLink
Thanks guys, You know when sometimes you take a hammer and try to get into this small mosquito? well, I looked into PageLink and IPageLink and tried to be over creative :) eventually, I used a normal Link with onClick The thing is that I was very confused with how to pass the PageParameters to the page. I keep in my Link a PageParameters instance and add to it the key-value as needed. Then I do: setResponsePage(pageClass, pageParameters); Easy, no? :) On Mon, Jun 16, 2008 at 9:48 AM, Johan Compagner <[EMAIL PROTECTED]> wrote: > So if you want to be stateless then onClick only works if you use a > StatelessLink and then you should push yourself the params in the url. > > But what do you want to do in the onclick? That cant be done in the > constructor or the target page? > > On 6/15/08, Eyal Golan <[EMAIL PROTECTED]> wrote: > > One more thing. > > I am working with Bookmarkable Pages that are stateless and have only > > PageParameters. > > This is another reason why using the BookmarkableLink. > > > > On Sun, Jun 15, 2008 at 2:58 PM, Eyal Golan <[EMAIL PROTECTED]> wrote: > > > >> i meant nicer code :) > >> anyway, I am trying to change it to Link or PageLink. > >> It looked a small task, which it is except that now I need to set all > >> parameters to the page instead of the BookmarkableLink which it was > >> before. > >> > >> BTW, why doesn't the Page link have a constructor that accepts > >> PageParameters? > >> (I use 1.3.3) > >> > >> Thank > >> > >> > >> On Sun, Jun 15, 2008 at 1:34 PM, Frank Bille <[EMAIL PROTECTED]> > >> wrote: > >> > >>> When you say it's easier and nicer what do you mean? nicer URL? > >>> > >>> The problem is that if you use bookmarkable page link, then the request > >>> goes > >>> directly to that new page (of cause) and doesn't go through your > calling > >>> page first. This means that you have to do your work on the page > instead, > >>> perhaps based on the page parameters. And that doesn't sound nicer to > me. > >>> > >>> Frank > >>> > >>> > >>> On Sun, Jun 15, 2008 at 12:17 PM, Eyal Golan <[EMAIL PROTECTED]> > wrote: > >>> > >>> > I thought about this option and it's possible, BUT, I still prefer > >>> > using > >>> a > >>> > BookmarkablePageLink as it is easier and nicer (to me anyway). I have > >>> > PageParameters that are set to the Link (yes I know, I can set them > to > >>> the > >>> > page). > >>> > The default linksTo is good for me. > >>> > > >>> > So, > >>> > any idea or should I really use a simple Link ? > >>> > > >>> > On Sun, Jun 15, 2008 at 1:08 PM, Frank Bille <[EMAIL PROTECTED]> > >>> > wrote: > >>> > > >>> > > If you want to do it in the calling code, use a normal Link and do > a > >>> > > redirect to the bookmarkable page afterwords. > >>> > > > >>> > > Frank > >>> > > > >>> > > On Sun, Jun 15, 2008 at 12:03 PM, Eyal Golan <[EMAIL PROTECTED]> > >>> wrote: > >>> > > > >>> > > > Hi, > >>> > > > I want to "override" the onClick of a BookmarkablePageLink. > >>> > > > What I actually want is to subclass a BookmarkablePageLink so > >>> whenever > >>> > > the > >>> > > > user clicks, I will do something an then will call the actual > >>> obClick. > >>> > > > > >>> > > > after checking in the API I saw that: > >>> > > >/** > >>> > > > * THIS METHOD IS NOT USED! Bookmarkable links do not have a > >>> click > >>> > > > handler. It is here to > >>> > > > * satisfy the interface only, as bookmarkable links will be > >>> > > dispatched > >>> > > > by the handling servlet. > >>> > > > * > >>> > > > * @see org.apache.wicket.markup.html.link.Link#onClick() > >>> > > > */ > >>> > > >public final void onClick() > >>> > > >{ > >>> > > >// Bookmarkable links do not have a click handler. > >>> > > >// Instead they are dispatched by the request handling > >>> servlet. > >>> > > >} > >>> > > > > >>> > > > So how do I do a specific task whenever it is clicked? > >>> > > > > >>> > > > thanks > >>> > > > > >>> > > > -- > >>> > > > Eyal Golan > >>> > > > [EMAIL PROTECTED] > >>> > > > > >>> > > > Visit: http://jvdrums.sourceforge.net/ > >>> > > > LinkedIn: http://www.linkedin.com/in/egolan74 > >>> > > > > >>> > > > >>> > > >>> > > >>> > > >>> > -- > >>> > Eyal Golan > >>> > [EMAIL PROTECTED] > >>> > > >>> > Visit: http://jvdrums.sourceforge.net/ > >>> > LinkedIn: http://www.linkedin.com/in/egolan74 > >>> > > >>> > >> > >> > >> > >> -- > >> Eyal Golan > >> [EMAIL PROTECTED] > >> > >> Visit: http://jvdrums.sourceforge.net/ > >> LinkedIn: http://www.linkedin.com/in/egolan74 > >> > > > > > > > > -- > > Eyal Golan > > [EMAIL PROTECTED] > > > > Visit: http://jvdrums.sourceforge.net/ > > LinkedIn: http://www.linkedin.com/in/egolan74 > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: validation message
Thanks for reply. Maybe I didn't explain clearly. I knew how to override in myPage.properties and myForm.properties. But I mean if I want to override in myApplication.properties, is it possible to do and how's the hierarchies? richardwilko wrote: > > > If yo have a Required validator on a TextField with > wicket:id="mytextfield" in a form with wicket:id="myform" in a Page called > MyPage.java in a package called com.mypackage then > > create a file called MyPage.properties in the package com.mypackage > > in this properties file is where you override the validation messages for > anything in the page, so in this example you would add the line > > myform.mytextfield.Required=My required message > > see how the hierarchies match and the Required is the same name as your > validator class (so if you used an EmailAddressValidator you would put > myform.mytextfield.EmailAddressValidator) > > If your form was in its own java file called MyForm.java then you would > put the properties file in the same package as MyForm.java and you would > call your properties file MyForm.properties > > and it would look like this > > mytextfield.Required=My required message > > note how you dont need the myform. bit. > > Also see this page: > http://cwiki.apache.org/WICKET/form-validation-messages.html > > Hope that explains it > > Richard > > > wenm wrote: >> >> I try to validate component by using setRequired(). and I would like to >> define the feedback messages in application level properties file. >> >> For example, the application structure is like >> myApplication >> -basePage >> -myPage extends basePage >> -myForm >> -myTextField >> >> I tried to overwrite the default message in myApplication.properties >> like: >> myPage.myForm.myTextField.Required = something is missing >> But it is not succeful. >> >> I don't know whether I do something wrong or I have to set up something >> in myApplication? >> Thanks. >> > > -- View this message in context: http://www.nabble.com/validation-message-tp17821088p17858907.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]