Spring's AbstractMessageSource : read new label from DB
Hello, I don't know if my question is Spring related or wicket related, but i guess it's wicket related so... If not, my apologies, but please tell me so i can post my question to the correct mailinglist. I use the org.springframework.context.support.AbstractMessageSource to read my labels from a database (in the method resolveCode I use my dao to get the correct label). In the application-context, I use the bean with name messageSource to link my AbstractMessageSource implementation in wicket. Now my question: The labels are only readed once from the database. They are cached somewhere in wicket, i guess. But when deploying my application, most labels are not translated yet. Is it possible to delete the cached labels somehow? Thanks ! -- View this message in context: http://www.nabble.com/Spring%27s-AbstractMessageSource-%3A-read-new-label-from-DB-tp18064364p18064364.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: Spring's AbstractMessageSource : read new label from DB
Hello again, maybe some more clarification why I guess this is wicket related. org.apache.wicket.resource.loader.IStringResourceLoader is the implementation that is used in wicket to get the label from the DB, because there the necessary function of the Spring MessageSource is called. The function loadStringResource in IStringResourceLoader is only called once for a label. Only when redeploying the application, the message is again retreived with the loadStringResource. Is there any way to clear that cache manually or something? Thanks again ! Marieke Vandamme wrote: Hello, I don't know if my question is Spring related or wicket related, but i guess it's wicket related so... If not, my apologies, but please tell me so i can post my question to the correct mailinglist. I use the org.springframework.context.support.AbstractMessageSource to read my labels from a database (in the method resolveCode I use my dao to get the correct label). In the application-context, I use the bean with name messageSource to link my AbstractMessageSource implementation in wicket. Now my question: The labels are only readed once from the database. They are cached somewhere in wicket, i guess. But when deploying my application, most labels are not translated yet. Is it possible to delete the cached labels somehow? Thanks ! -- View this message in context: http://www.nabble.com/Spring%27s-AbstractMessageSource-%3A-read-new-label-from-DB-tp18064364p18064730.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]
Confused
Hi, I have a page that holds a list (of Strings). In the constructor, I initialize the list. Then I call a Panel with this list to create a ListView of something. In a Modal window I set the list to have data in. The problem is that the list is initialized whenever I refresh the page (F5) (the Page's constructor is called). How can I pass this problem. Where should I keep a model that holds the list data? Some code: ... Class members: private ListString linksIds; private final LinksPanel linksPanel; ... In the constructor: super(id); setOutputMarkupId(true); linksIds = new LinkedListString(); ... linksPanel = new LinksPanel(links, getLinksIds()); ... The getters and setters: public ListString getLinksIds() { return linksIds; } public void setLinksIds(ListString linksIds) { this.linksIds = linksIds; linksPanel.setLinksByIds(linksIds); } The setter is called when the user press OK in a Modal window. The list is changed and the UI changes Ajax-ly. So this is OK. The only problem is refreshing the Page. Thanks for any help, - 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/Confused-tp18064846p18064846.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: Confused
Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the first place? } } ); 2008/6/23 egolan74 [EMAIL PROTECTED]: Hi, I have a page that holds a list (of Strings). In the constructor, I initialize the list. Then I call a Panel with this list to create a ListView of something. In a Modal window I set the list to have data in. The problem is that the list is initialized whenever I refresh the page (F5) (the Page's constructor is called). How can I pass this problem. Where should I keep a model that holds the list data? Some code: ... Class members: private ListString linksIds; private final LinksPanel linksPanel; ... In the constructor: super(id); setOutputMarkupId(true); linksIds = new LinkedListString(); ... linksPanel = new LinksPanel(links, getLinksIds()); ... The getters and setters: public ListString getLinksIds() { return linksIds; } public void setLinksIds(ListString linksIds) { this.linksIds = linksIds; linksPanel.setLinksByIds(linksIds); } The setter is called when the user press OK in a Modal window. The list is changed and the UI changes Ajax-ly. So this is OK. The only problem is refreshing the Page. Thanks for any help, - 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/Confused-tp18064846p18064846.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: Regarding Loacale
When I, on the fly, change the language to something else (de_CH), the Locale in my application is not changed. Looking at Wicket 1.3 and 1.4 sources, the locale is picked up in the Session constructor, so presumably you need to nuke the Wicket session or let it expire before trying a new locale based on Accept-Language. - Tor Iver - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket servlet mapping to subdirectory
Thanks Igor ! I removed the filter init params, tried with a fresh 1.3.x from subversion, still did not work. But :-), it's not wicket's fault, it's f* oc4j. The redirect after the login page (I am using the acegi+wicket approach from the wiki) is not handled right.. oc4j does a redirect with a relative url the wrong way, it's relative to the webapp context, but not including the servlet path. I am playing around to find a workaround, if I am lucky I'll post the solution here, in case other unlucky oc4j users are out there :-). Thanks again, Tom Igor Vaynberg schrieb: interesting 1) you can remove filter init params, when wicket servlet is used the path can be determined from servletrequest 2) can you try with wicket-1.3.x branch to see if we have already fixed it 3) if its still broken file a jira issue -igor On Fri, Jun 20, 2008 at 5:19 AM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi again ! I've tried to solve my issue, but had no luck so far. Here is the web.xml snippet I use: servlet servlet-nameACSWebapp/servlet-name servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-namefilterPath/param-name param-valueapp/*/param-value /init-param init-param param-namefilterMappingUrlPattern/param-name param-valueapp/*/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameACSWebapp/servlet-name url-pattern/app/*/url-pattern /servlet-mapping I am not sure if I need the filterPath and filterMappingUrlPattern init parameters, but I left them in. My application is deployed with an application.xml containing module web web-uriACS.war/web-uri context-rootACS/context-root /web /module When I call http://ip:port/ACS/app/ I am redirected to http://ip:port/ACS/;jsessionid=d5a0c3193157101e4c749c214a05985eb6afb0ce6bc9.e34RaxuNah4Rai0LahqTaNuRa34Te6fznA5Pp7ftolbGmkTy?wicket:bookmarkablePage=%3Aat.schnirkel.acs.MySignInPage which of course does not work. Mapping the servlet to /* works, but then my Acegi filter is not invoked, because OC4J seems to ignore urls without a page in front of the ?, although I've configured the filter with a /* Any ideas on this ? Thanks a lot, Tom My environment is OC4J, java 4 and wicket 1.3.3. Mattom schrieb: Hi ! No, sorry, maybe i was not precise enough, when i have the /app/* mapping, i can access my HomePage directly, but all links from the HomePage as well as the style sheet link and some image links (all within wicket:link) don't work, as the /app/ part is missing. The only images working are the one from the tree I use as menu. Basically I don't need the /app/ subdirectory, but servlet filters in oc4j seem to be rather buggy, and they are not called, if you don't have either a page or a directory, just ip:port/context/?... does not work, as the filters are not called. So I tried to trick the filter (acegi) by adding a subdirectory... I guess I have to add some filterPath or filterMappingPath flag to the init-params of the servlet, but so far nothing worked. I'll dig into the sources deeper tomorrow. Thanks ! Tom Original-Nachricht Datum: Thu, 19 Jun 2008 21:42:45 +0100 Von: Gwyn Evans [EMAIL PROTECTED] An: users@wicket.apache.org Betreff: Re: wicket servlet mapping to subdirectory When you say I always get redirected to the root of the webapp, do you mean when first trying to access your app, you have to go via a redirect or some such that takes you to http://www.mysite.com/; or similar? The 'traditional' trick was to have an index.html that redirected to app/ as below - any uise? html head meta http-equiv=Refresh content=0; url=app /head /html /Gwyn On Thu, Jun 19, 2008 at 5:30 PM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi list ! I am forced to use the wicket servlet (1.3.3) instead of the filter because of oc4j. I mapped the servlet to servlet-mapping servlet-nameWicket Webapp/servlet-name url-pattern/app/*/url-pattern /servlet-mapping This does not work, I always get redirected to the root of the webapp, and therefore none of my pages shows up. If I map to /*, everything works fine, but then my acegi filters to not work... Is there any parameter I need to set to tell wicket about the different location ? Or, is it possible to configure some fake name in front of the request strings ? ? Thanks a lot, Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Confused
Thanks Martin, That really helped. Though I did something else and now I have a new problem. It's an Ajax problem now. Here's what I did: In the constructor: idsModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; @Override protected Object load() { ListString ids = new ArrayListString(); ListProperty properties = sageDal.getPreference(userId, SETTINGS_GROUP, HomePageSectionPanel.this.sectionId); for (Property property : properties) { ids.add(property.getValue()); } return ids; } }; linksPanel = new LinksPanel(links, idsModel); I am adding the ListView in LinksPanel: private void init(final ListLinkContainer links) { add(new LinksListView(listview, new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { return links; } })); } (I have a method that changes the String ids to the LinkContainer). My problem is when setting new list. Here is my code: public void setLinksIds(ListString linksIds) { sageDal.setPreference(userId, SETTINGS_GROUP, sectionId, linksIds.toArray(new String[0])); } It works and I actually see the change in the database. When refreshing (or checking in the DB) I see changes. BUT, it doesn't change automatically. I use a ModalWindow and here's where I add my panel to the modal: setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { target.addComponent(homePageSectionPanel); } }); I'm sure I need to add something else somewhere. But what? and where ? Thanks, Eyal Martin Makundi wrote: Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the first place? } } ); - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 href=http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/Confused-tp18064846p18066913.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: Confused
I did not quite follow nor grasp what you are trying to do... my only question is, are you using the same object instance on two different pages? That does not work (serialization breaks the connection). ** Martin 2008/6/23 egolan74 [EMAIL PROTECTED]: Thanks Martin, That really helped. Though I did something else and now I have a new problem. It's an Ajax problem now. Here's what I did: In the constructor: idsModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; @Override protected Object load() { ListString ids = new ArrayListString(); ListProperty properties = sageDal.getPreference(userId, SETTINGS_GROUP, HomePageSectionPanel.this.sectionId); for (Property property : properties) { ids.add(property.getValue()); } return ids; } }; linksPanel = new LinksPanel(links, idsModel); I am adding the ListView in LinksPanel: private void init(final ListLinkContainer links) { add(new LinksListView(listview, new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { return links; } })); } (I have a method that changes the String ids to the LinkContainer). My problem is when setting new list. Here is my code: public void setLinksIds(ListString linksIds) { sageDal.setPreference(userId, SETTINGS_GROUP, sectionId, linksIds.toArray(new String[0])); } It works and I actually see the change in the database. When refreshing (or checking in the DB) I see changes. BUT, it doesn't change automatically. I use a ModalWindow and here's where I add my panel to the modal: setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { target.addComponent(homePageSectionPanel); } }); I'm sure I need to add something else somewhere. But what? and where ? Thanks, Eyal Martin Makundi wrote: Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the first place? } } ); - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 href=http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/Confused-tp18064846p18066913.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: Confused
OK, I'll try to explain. 1. I have a page that has a list of links. 2. The list is taken from the database the sageDal.getPreference(..) method that I showed. 3. This list can be configured by the user. 4. I made a Modal window that shows the user all available links (also taken from the DB). 5. When he selects the links he wants, he presses OK. 6. Then I update the DB. The sageDal.setPreference(...) method. As for passing Objects. I pass the model to the LinksPanel. LinksPanel ha a ListView that uses a different AbstarctReadOnlyModel. So my problem is that when I set the DB with new values, I need to inform the Model (in the original panel) somehow that the DB was changed. Eyal On Mon, Jun 23, 2008 at 3:26 PM, Martin Makundi [EMAIL PROTECTED] wrote: I did not quite follow nor grasp what you are trying to do... my only question is, are you using the same object instance on two different pages? That does not work (serialization breaks the connection). ** Martin 2008/6/23 egolan74 [EMAIL PROTECTED]: Thanks Martin, That really helped. Though I did something else and now I have a new problem. It's an Ajax problem now. Here's what I did: In the constructor: idsModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; @Override protected Object load() { ListString ids = new ArrayListString(); ListProperty properties = sageDal.getPreference(userId, SETTINGS_GROUP, HomePageSectionPanel.this.sectionId); for (Property property : properties) { ids.add(property.getValue()); } return ids; } }; linksPanel = new LinksPanel(links, idsModel); I am adding the ListView in LinksPanel: private void init(final ListLinkContainer links) { add(new LinksListView(listview, new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { return links; } })); } (I have a method that changes the String ids to the LinkContainer). My problem is when setting new list. Here is my code: public void setLinksIds(ListString linksIds) { sageDal.setPreference(userId, SETTINGS_GROUP, sectionId, linksIds.toArray(new String[0])); } It works and I actually see the change in the database. When refreshing (or checking in the DB) I see changes. BUT, it doesn't change automatically. I use a ModalWindow and here's where I add my panel to the modal: setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { target.addComponent(homePageSectionPanel); } }); I'm sure I need to add something else somewhere. But what? and where ? Thanks, Eyal Martin Makundi wrote: Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the first place? } } ); - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 href=http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/Confused-tp18064846p18066913.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] -- Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74
Re: Confused
Ok. I do not have experience with Modal windows in wicket, but do you actually repaint the original page to even reflect the changes? If you repaint it, and your model loads the data from DB, and the data still does not show the changes (try to use breakpoints and debugger to confirm this), you might have a problem with committing the changes to your DB. ** Martin 2008/6/23 Eyal Golan [EMAIL PROTECTED]: OK, I'll try to explain. 1. I have a page that has a list of links. 2. The list is taken from the database the sageDal.getPreference(..) method that I showed. 3. This list can be configured by the user. 4. I made a Modal window that shows the user all available links (also taken from the DB). 5. When he selects the links he wants, he presses OK. 6. Then I update the DB. The sageDal.setPreference(...) method. As for passing Objects. I pass the model to the LinksPanel. LinksPanel ha a ListView that uses a different AbstarctReadOnlyModel. So my problem is that when I set the DB with new values, I need to inform the Model (in the original panel) somehow that the DB was changed. Eyal On Mon, Jun 23, 2008 at 3:26 PM, Martin Makundi [EMAIL PROTECTED] wrote: I did not quite follow nor grasp what you are trying to do... my only question is, are you using the same object instance on two different pages? That does not work (serialization breaks the connection). ** Martin 2008/6/23 egolan74 [EMAIL PROTECTED]: Thanks Martin, That really helped. Though I did something else and now I have a new problem. It's an Ajax problem now. Here's what I did: In the constructor: idsModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; @Override protected Object load() { ListString ids = new ArrayListString(); ListProperty properties = sageDal.getPreference(userId, SETTINGS_GROUP, HomePageSectionPanel.this.sectionId); for (Property property : properties) { ids.add(property.getValue()); } return ids; } }; linksPanel = new LinksPanel(links, idsModel); I am adding the ListView in LinksPanel: private void init(final ListLinkContainer links) { add(new LinksListView(listview, new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { return links; } })); } (I have a method that changes the String ids to the LinkContainer). My problem is when setting new list. Here is my code: public void setLinksIds(ListString linksIds) { sageDal.setPreference(userId, SETTINGS_GROUP, sectionId, linksIds.toArray(new String[0])); } It works and I actually see the change in the database. When refreshing (or checking in the DB) I see changes. BUT, it doesn't change automatically. I use a ModalWindow and here's where I add my panel to the modal: setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { target.addComponent(homePageSectionPanel); } }); I'm sure I need to add something else somewhere. But what? and where ? Thanks, Eyal Martin Makundi wrote: Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the first place? } } ); - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 href=http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/Confused-tp18064846p18066913.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]
Invisible fields in wicket
Hi everybody, this is my first post in the list. I would like to ask for advice on the following topic: I am developing a view with wicket, which contains a somewhat intensive logic behind. For instance, when I select an option in a drop down choice, some fields are disabled, while other fields are hidden, and when I select some radio button, other set of fields get disabled or hidden, or are otherwise shown. With disabled/enabled fields everything went alright, but when I started to hide fields I discovered the following problem: if the initial situation indicates that the field must be hidden, then the logic in the behaviors tried to show them but it was not possible to do so, since the initial markup never referenced those hidden fields (I discovered that with Ajax Debug under Mozilla FireFox). It is important to say that, in the AjaxRequestTarget, I was only adding the fields I changed. So a co-worker told me I should add to the AjaxRequestTarget the panel or form where the hidden/shown components lie (in my case it is the form) so they could be correctly rendered. I tried it and, as he said, the logic started to work: fields get hidden/shown properly everytime I choose the correct drop down choices/radios. But this brought me another problem: if I enter some text on the fields and then activate one of these logics, all the fields are cleared. This is so because the behaviors I was using (AjaxFormChoiceComponentUpdatingBehavior for the radios and OnChangeAjaxBehavior for the drop down choices) do not submit the form when activated. Since I now set the whole form in the AjaxRequestTarget, this causes the data clear problem, because the model is not updated at the time the logic executes, and then the whole form comes back to the browser discarding the values entered by the user. So, I made a fix by using AjaxFormSubmitBehavior (with some modifications because I don't want validations to get executed when a radio button is selected, for instance). But the real question is: am I on the right way? perhaps the original problem with the hidden fields could have been solved in another, more standard way? Any help will be really appreciated. Best regards, Andrés -- View this message in context: http://www.nabble.com/Invisible-fields-in-wicket-tp18069101p18069101.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: Confused
Well, my problem is more of an Ajax one (I think). The database is changing. I have a setter in my original Panel that is executed when the Modal is pressed OK. It stopped in the breakpoint. I looked in the DB and saw the changes. When pressing F5, I got the updated list. So the problem is: how can I tell my Model (detachable) that there was change in the database? I also add the Panel (original) to the Ajax Target. On Mon, Jun 23, 2008 at 4:08 PM, Martin Makundi [EMAIL PROTECTED] wrote: Ok. I do not have experience with Modal windows in wicket, but do you actually repaint the original page to even reflect the changes? If you repaint it, and your model loads the data from DB, and the data still does not show the changes (try to use breakpoints and debugger to confirm this), you might have a problem with committing the changes to your DB. ** Martin 2008/6/23 Eyal Golan [EMAIL PROTECTED]: OK, I'll try to explain. 1. I have a page that has a list of links. 2. The list is taken from the database the sageDal.getPreference(..) method that I showed. 3. This list can be configured by the user. 4. I made a Modal window that shows the user all available links (also taken from the DB). 5. When he selects the links he wants, he presses OK. 6. Then I update the DB. The sageDal.setPreference(...) method. As for passing Objects. I pass the model to the LinksPanel. LinksPanel ha a ListView that uses a different AbstarctReadOnlyModel. So my problem is that when I set the DB with new values, I need to inform the Model (in the original panel) somehow that the DB was changed. Eyal On Mon, Jun 23, 2008 at 3:26 PM, Martin Makundi [EMAIL PROTECTED] wrote: I did not quite follow nor grasp what you are trying to do... my only question is, are you using the same object instance on two different pages? That does not work (serialization breaks the connection). ** Martin 2008/6/23 egolan74 [EMAIL PROTECTED]: Thanks Martin, That really helped. Though I did something else and now I have a new problem. It's an Ajax problem now. Here's what I did: In the constructor: idsModel = new LoadableDetachableModel() { private static final long serialVersionUID = 1L; @Override protected Object load() { ListString ids = new ArrayListString(); ListProperty properties = sageDal.getPreference(userId, SETTINGS_GROUP, HomePageSectionPanel.this.sectionId); for (Property property : properties) { ids.add(property.getValue()); } return ids; } }; linksPanel = new LinksPanel(links, idsModel); I am adding the ListView in LinksPanel: private void init(final ListLinkContainer links) { add(new LinksListView(listview, new AbstractReadOnlyModel() { private static final long serialVersionUID = 1L; @Override public Object getObject() { return links; } })); } (I have a method that changes the String ids to the LinkContainer). My problem is when setting new list. Here is my code: public void setLinksIds(ListString linksIds) { sageDal.setPreference(userId, SETTINGS_GROUP, sectionId, linksIds.toArray(new String[0])); } It works and I actually see the change in the database. When refreshing (or checking in the DB) I see changes. BUT, it doesn't change automatically. I use a ModalWindow and here's where I add my panel to the modal: setWindowClosedCallback(new ModalWindow.WindowClosedCallback() { private static final long serialVersionUID = 1L; public void onClose(AjaxRequestTarget target) { target.addComponent(homePageSectionPanel); } }); I'm sure I need to add something else somewhere. But what? and where ? Thanks, Eyal Martin Makundi wrote: Hi! Here is a good example of a list model: public abstract class AbstractListChoiceModelS extends AbstractReadOnlyModelList? extends S { @Override public final ListS getObject() { return getChoices(); } public abstract ListS getChoices(); } Now change your code as follows: linksPanel = new LinksPanel(links, new AbstractListChoiceModelString() { @Override public ListString getChoices() { // Where did you get your choices in the
RE: Session end method
Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: wicket:head and HeaderContributors
On Sun, Jun 22, 2008 at 11:50 PM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, Igor Vaynberg wrote: you can put the javascript that uses your library into window's onload or ondomready event, so it will be executed later. wicket-event.js and WicketEventReference class make it easy. would sound promising if I would not try to use jQuery that provides me with the abstractions for doing onload stuff. Unfortunately, I need the library for that :-) like i said, use wicket's event javascript to do that.. -igor another approach is to simply output the javascript that uses the lib via a headercontributor as well. there is a nice one that works with TextTemplate class. I think that will be the way to go. Thanks for your help. J. -igor On Sun, Jun 22, 2008 at 10:10 AM, Jürgen Lind [EMAIL PROTECTED] wrote: Ok, I understand your point and perhaps my whole setup is wrong. Here is my line of thinking: 1. I have a component that needs some Javascript. 2. The Javascript relies on an external library. 3. There may be several instances of the component on the page. 4. Other components on the page may have some Javascript as well and may also need the same library. 5. I want to make sure that the library is loaded only once (which I can achieve nicely with a HeaderContributor) Is there some other way to handle this situation? J. Igor Vaynberg wrote: if we switch the ordering then someone else will complain :) maybe they add a javascript library via wickethead and have a contributor spitting out some dynamic javascript. point is its a bad idea to depend on the ordering, whichever way it currently is. -igor On Sun, Jun 22, 2008 at 9:52 AM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, as far as I noticed, Wicket first writes the code fragments of wicket:head into the page and then the parts provided by the HeaderContributors. Is there a way of changing that ordering? The background is that I want to load a javascript library with a HeaderContributor and then use that library within the wicket:head section. Regards, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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: Spring's AbstractMessageSource : read new label from DB
application.get().getresourcesettings().getlocalizer().clearcache(); -igor On Mon, Jun 23, 2008 at 1:27 AM, Marieke Vandamme [EMAIL PROTECTED] wrote: Hello again, maybe some more clarification why I guess this is wicket related. org.apache.wicket.resource.loader.IStringResourceLoader is the implementation that is used in wicket to get the label from the DB, because there the necessary function of the Spring MessageSource is called. The function loadStringResource in IStringResourceLoader is only called once for a label. Only when redeploying the application, the message is again retreived with the loadStringResource. Is there any way to clear that cache manually or something? Thanks again ! Marieke Vandamme wrote: Hello, I don't know if my question is Spring related or wicket related, but i guess it's wicket related so... If not, my apologies, but please tell me so i can post my question to the correct mailinglist. I use the org.springframework.context.support.AbstractMessageSource to read my labels from a database (in the method resolveCode I use my dao to get the correct label). In the application-context, I use the bean with name messageSource to link my AbstractMessageSource implementation in wicket. Now my question: The labels are only readed once from the database. They are cached somewhere in wicket, i guess. But when deploying my application, most labels are not translated yet. Is it possible to delete the cached labels somehow? Thanks ! -- View this message in context: http://www.nabble.com/Spring%27s-AbstractMessageSource-%3A-read-new-label-from-DB-tp18064364p18064730.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: Confused
So the problem is: how can I tell my Model (detachable) that there was change in the database? Ok. I haven't worked with detachable models, but I would guess you just detach it so that it has to re-initialize itself? ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Regarding Loacale
no. session also has setlocale(locale) so you can call that on every request if you wanted to... -igor On Mon, Jun 23, 2008 at 3:39 AM, Wilhelmsen Tor Iver [EMAIL PROTECTED] wrote: When I, on the fly, change the language to something else (de_CH), the Locale in my application is not changed. Looking at Wicket 1.3 and 1.4 sources, the locale is picked up in the Session constructor, so presumably you need to nuke the Wicket session or let it expire before trying a new locale based on Accept-Language. - Tor Iver - 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]
Including wicket in JSPs?
Hello ! We are using a JSP-based content management system for navigation, page layout etc. Now we're evaluating Wicket as our application framework: A Wicket application should appear in the center of the JSP based layout and navigation. Has somebody already included a wicket page via jsp:include or other ways? It seems to me a Page would be the wrong Wicket component to include, since no body or header should be rendered. Best regards Jan
Re: wicket servlet mapping to subdirectory
hmm, i remember some people were complaining about oracle server before as well. you might want to search the mailing list. -igor On Mon, Jun 23, 2008 at 4:48 AM, Thomas Lutz [EMAIL PROTECTED] wrote: Thanks Igor ! I removed the filter init params, tried with a fresh 1.3.x from subversion, still did not work. But :-), it's not wicket's fault, it's f* oc4j. The redirect after the login page (I am using the acegi+wicket approach from the wiki) is not handled right.. oc4j does a redirect with a relative url the wrong way, it's relative to the webapp context, but not including the servlet path. I am playing around to find a workaround, if I am lucky I'll post the solution here, in case other unlucky oc4j users are out there :-). Thanks again, Tom Igor Vaynberg schrieb: interesting 1) you can remove filter init params, when wicket servlet is used the path can be determined from servletrequest 2) can you try with wicket-1.3.x branch to see if we have already fixed it 3) if its still broken file a jira issue -igor On Fri, Jun 20, 2008 at 5:19 AM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi again ! I've tried to solve my issue, but had no luck so far. Here is the web.xml snippet I use: servlet servlet-nameACSWebapp/servlet-name servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-namefilterPath/param-name param-valueapp/*/param-value /init-param init-param param-namefilterMappingUrlPattern/param-name param-valueapp/*/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameACSWebapp/servlet-name url-pattern/app/*/url-pattern /servlet-mapping I am not sure if I need the filterPath and filterMappingUrlPattern init parameters, but I left them in. My application is deployed with an application.xml containing module web web-uriACS.war/web-uri context-rootACS/context-root /web /module When I call http://ip:port/ACS/app/ I am redirected to http://ip:port/ACS/;jsessionid=d5a0c3193157101e4c749c214a05985eb6afb0ce6bc9.e34RaxuNah4Rai0LahqTaNuRa34Te6fznA5Pp7ftolbGmkTy?wicket:bookmarkablePage=%3Aat.schnirkel.acs.MySignInPage which of course does not work. Mapping the servlet to /* works, but then my Acegi filter is not invoked, because OC4J seems to ignore urls without a page in front of the ?, although I've configured the filter with a /* Any ideas on this ? Thanks a lot, Tom My environment is OC4J, java 4 and wicket 1.3.3. Mattom schrieb: Hi ! No, sorry, maybe i was not precise enough, when i have the /app/* mapping, i can access my HomePage directly, but all links from the HomePage as well as the style sheet link and some image links (all within wicket:link) don't work, as the /app/ part is missing. The only images working are the one from the tree I use as menu. Basically I don't need the /app/ subdirectory, but servlet filters in oc4j seem to be rather buggy, and they are not called, if you don't have either a page or a directory, just ip:port/context/?... does not work, as the filters are not called. So I tried to trick the filter (acegi) by adding a subdirectory... I guess I have to add some filterPath or filterMappingPath flag to the init-params of the servlet, but so far nothing worked. I'll dig into the sources deeper tomorrow. Thanks ! Tom Original-Nachricht Datum: Thu, 19 Jun 2008 21:42:45 +0100 Von: Gwyn Evans [EMAIL PROTECTED] An: users@wicket.apache.org Betreff: Re: wicket servlet mapping to subdirectory When you say I always get redirected to the root of the webapp, do you mean when first trying to access your app, you have to go via a redirect or some such that takes you to http://www.mysite.com/; or similar? The 'traditional' trick was to have an index.html that redirected to app/ as below - any uise? html head meta http-equiv=Refresh content=0; url=app /head /html /Gwyn On Thu, Jun 19, 2008 at 5:30 PM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi list ! I am forced to use the wicket servlet (1.3.3) instead of the filter because of oc4j. I mapped the servlet to servlet-mapping servlet-nameWicket Webapp/servlet-name url-pattern/app/*/url-pattern /servlet-mapping This does not work, I always get redirected to the root of the webapp, and therefore none of my pages shows up. If I map to /*, everything works fine, but then my acegi filters to not work... Is there any parameter I need to set to tell wicket about the different location ? Or, is it possible to configure some fake name in front of the request strings ? ? Thanks a lot, Tom
RE: Session end method
I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL
Re: Palette within a ModalWindow
Hi, Can you send a code example of how you have used the setContent , ModalWindow and Pallete all together? I used the same as the examples of ModalWindow with a Page. And the Page has the Pallete. There aren't many examples of Palette. Thanks, Eyal Kai Mütz (Old) wrote: Hi, I want to realize a palette within a ModalWindow. I have subclassed the ModalWindow and added a palette with the setContent() method. This works actually, the model is updated with the selected choices after closing the modal window and submitting the form. - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ http://jvdrums.sourceforge.net/ LinkedIn: http://www.linkedin.com/in/egolan74 href=http://www.linkedin.com/in/egolan74 -- View this message in context: http://www.nabble.com/Palette-within-a-ModalWindow-tp15829096p18071792.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: Session end method
Regarding the cleaning Session issue. Suppose I set expire time to very long time. Suppose the user didn't log out, but just turned off the computer. Is the Session still alive? Until it is expired? If so, I guess I'll make a mechanism for using the same Session if the user comes again. On Mon, Jun 23, 2008 at 6:29 PM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ The information contained in this message
Re: Confused
Got it!! The problem was in the LinksPanel: In the constructor I got the Model and did this: final ListLinkContainer links = new ArrayListLinkContainer(); ListString linksIds = (ListString) linksIdsModel.getObject(); for (String linkId : linksIds) { links.add(portalStructureManager.getLinkById(linkId)); } init(links); In init I created the ListView with an AbstractReadOnlyModel. Instead, the fix is that the original model is THE SAME that is passed to the list view. Now, like magic, it works. The only thing I need to do now (which is an application logic issue) is casting the models. It's not a Wicket issue anymore. Thanks, Eyal On Mon, Jun 23, 2008 at 5:53 PM, Martin Makundi [EMAIL PROTECTED] wrote: So the problem is: how can I tell my Model (detachable) that there was change in the database? Ok. I haven't worked with detachable models, but I would guess you just detach it so that it has to re-initialize itself? ** Martin - 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: Including wicket in JSPs?
Hi Jan, I have a legacy home-grown jsp application where I'm showing wicket pages in the content area using an inframe tag. Initially I had a problem that turned out to be caused by not using the closing tag for the iframe. Here's an example that works in IE6/7: head style type=text/css iframe{ float:left; height:500px; width:100%; display:block; frameborder:0;} /style /head body jsp:include page=/leftside.jsp flush=true / jsp:include page=/top.jsp flush=true / iframe src=http://someserver/WicketDemoPage?someparm=somevalue; frameborder=0/iframe jsp:include page=/bottom.jsp flush=true / jsp:include page=/rightside.jsp flush=true / /body This technique works for me with bookmarkable pages, so in the above case the following would be put in the init() method of the Application class: mountBookmarkablePage( /WicketDemoPage, WicketDemoPage.class ); HTH, Jim Jan.Koops wrote: Hello ! We are using a JSP-based content management system for navigation, page layout etc. Now we're evaluating Wicket as our application framework: A Wicket application should appear in the center of the JSP based layout and navigation. Has somebody already included a wicket page via jsp:include or other ways? It seems to me a Page would be the wrong Wicket component to include, since no body or header should be rendered. Best regards Jan -- View this message in context: http://www.nabble.com/Including-wicket-in-JSPs--tp18071635p18072855.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 servlet mapping to subdirectory
I searched the list, but I guess nobody tried to map to a subdirectory so far... or combine it with acegi. I've made some progress, though, basically the only solution yet was removing the filter, and handle the filter stuff in my customized wicket session. not very beautiful, but it works. More detailed in case anybody has the same problem: I followed http://cwiki.apache.org/WICKET/acegi-and-wicket-auth-roles.html but removed HttpSessionContextIntegrationFilter and remebered the SecurityContext in the wicket session. Thanks for your help, and thanks for this great framework, Tom Igor Vaynberg schrieb: hmm, i remember some people were complaining about oracle server before as well. you might want to search the mailing list. -igor On Mon, Jun 23, 2008 at 4:48 AM, Thomas Lutz [EMAIL PROTECTED] wrote: Thanks Igor ! I removed the filter init params, tried with a fresh 1.3.x from subversion, still did not work. But :-), it's not wicket's fault, it's f* oc4j. The redirect after the login page (I am using the acegi+wicket approach from the wiki) is not handled right.. oc4j does a redirect with a relative url the wrong way, it's relative to the webapp context, but not including the servlet path. I am playing around to find a workaround, if I am lucky I'll post the solution here, in case other unlucky oc4j users are out there :-). Thanks again, Tom Igor Vaynberg schrieb: interesting 1) you can remove filter init params, when wicket servlet is used the path can be determined from servletrequest 2) can you try with wicket-1.3.x branch to see if we have already fixed it 3) if its still broken file a jira issue -igor On Fri, Jun 20, 2008 at 5:19 AM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi again ! I've tried to solve my issue, but had no luck so far. Here is the web.xml snippet I use: servlet servlet-nameACSWebapp/servlet-name servlet-classorg.apache.wicket.protocol.http.WicketServlet/servlet-class init-param param-nameapplicationFactoryClassName/param-name param-valueorg.apache.wicket.spring.SpringWebApplicationFactory/param-value /init-param init-param param-namefilterPath/param-name param-valueapp/*/param-value /init-param init-param param-namefilterMappingUrlPattern/param-name param-valueapp/*/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameACSWebapp/servlet-name url-pattern/app/*/url-pattern /servlet-mapping I am not sure if I need the filterPath and filterMappingUrlPattern init parameters, but I left them in. My application is deployed with an application.xml containing module web web-uriACS.war/web-uri context-rootACS/context-root /web /module When I call http://ip:port/ACS/app/ I am redirected to http://ip:port/ACS/;jsessionid=d5a0c3193157101e4c749c214a05985eb6afb0ce6bc9.e34RaxuNah4Rai0LahqTaNuRa34Te6fznA5Pp7ftolbGmkTy?wicket:bookmarkablePage=%3Aat.schnirkel.acs.MySignInPage which of course does not work. Mapping the servlet to /* works, but then my Acegi filter is not invoked, because OC4J seems to ignore urls without a page in front of the ?, although I've configured the filter with a /* Any ideas on this ? Thanks a lot, Tom My environment is OC4J, java 4 and wicket 1.3.3. Mattom schrieb: Hi ! No, sorry, maybe i was not precise enough, when i have the /app/* mapping, i can access my HomePage directly, but all links from the HomePage as well as the style sheet link and some image links (all within wicket:link) don't work, as the /app/ part is missing. The only images working are the one from the tree I use as menu. Basically I don't need the /app/ subdirectory, but servlet filters in oc4j seem to be rather buggy, and they are not called, if you don't have either a page or a directory, just ip:port/context/?... does not work, as the filters are not called. So I tried to trick the filter (acegi) by adding a subdirectory... I guess I have to add some filterPath or filterMappingPath flag to the init-params of the servlet, but so far nothing worked. I'll dig into the sources deeper tomorrow. Thanks ! Tom Original-Nachricht Datum: Thu, 19 Jun 2008 21:42:45 +0100 Von: Gwyn Evans [EMAIL PROTECTED] An: users@wicket.apache.org Betreff: Re: wicket servlet mapping to subdirectory When you say I always get redirected to the root of the webapp, do you mean when first trying to access your app, you have to go via a redirect or some such that takes you to http://www.mysite.com/; or similar? The 'traditional' trick was to have an index.html that redirected to app/ as below - any uise? html head meta http-equiv=Refresh content=0; url=app /head /html /Gwyn On Thu, Jun 19, 2008 at 5:30 PM, Thomas Lutz [EMAIL PROTECTED] wrote: Hi list ! I am forced to use the wicket servlet (1.3.3) instead of the filter
Re: Session end method
what resources are those? like i said before, by the time you get notification that the session is expired you can no longer access attributes within session. -igor On Mon, Jun 23, 2008 at 8:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Sent from Gmail for mobile | mobile.google.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
Re: Including wicket in JSPs?
http://herebebeasties.com/2007-03-01/jsp-and-wicket-sitting-in-a-tree/ google is your friend -igor On Mon, Jun 23, 2008 at 8:24 AM, [EMAIL PROTECTED] wrote: Hello ! We are using a JSP-based content management system for navigation, page layout etc. Now we're evaluating Wicket as our application framework: A Wicket application should appear in the center of the JSP based layout and navigation. Has somebody already included a wicket page via jsp:include or other ways? It seems to me a Page would be the wrong Wicket component to include, since no body or header should be rendered. Best regards Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Invisible fields in wicket
Thanks Igor, I'll try it out igor.vaynberg wrote: see component.setOutputMarkupPlaceHolderTag(true). that should cure your ailment. -igor -- View this message in context: http://www.nabble.com/Invisible-fields-in-wicket-tp18069101p18073249.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: Session end method
Say for instance the session contains a resource such as a database connection or a thread (Eyal's original question) that needs to be freed when the session is invalidated. Is there (or should there) be a more intuitive way to handle this use case than Nino's solution of providing a custom ISessionStore? Perhaps some other callback on Session such as onUnbind. Maybe this isn't a common enough use case to warrant a new method though. Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 12:48 PM To: users@wicket.apache.org Subject: Re: Session end method what resources are those? like i said before, by the time you get notification that the session is expired you can no longer access attributes within session. -igor On Mon, Jun 23, 2008 at 8:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you. _ - To
Re: Session end method
well. a session cannot contain a thing like a thread or a database connection because everything in session must be serializable. -igor On Mon, Jun 23, 2008 at 10:14 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Say for instance the session contains a resource such as a database connection or a thread (Eyal's original question) that needs to be freed when the session is invalidated. Is there (or should there) be a more intuitive way to handle this use case than Nino's solution of providing a custom ISessionStore? Perhaps some other callback on Session such as onUnbind. Maybe this isn't a common enough use case to warrant a new method though. Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 12:48 PM To: users@wicket.apache.org Subject: Re: Session end method what resources are those? like i said before, by the time you get notification that the session is expired you can no longer access attributes within session. -igor On Mon, Jun 23, 2008 at 8:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -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] __ The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition,
RE: Session end method
Sorry, contains was too strong of a word. Let's say when the session is invalidated that a heavyweight object contained in a global repository must be freed. Come to think of it, even something as simple as logging information about the session when it is invalidated fits this description. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 1:22 PM To: users@wicket.apache.org Subject: Re: Session end method well. a session cannot contain a thing like a thread or a database connection because everything in session must be serializable. -igor On Mon, Jun 23, 2008 at 10:14 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Say for instance the session contains a resource such as a database connection or a thread (Eyal's original question) that needs to be freed when the session is invalidated. Is there (or should there) be a more intuitive way to handle this use case than Nino's solution of providing a custom ISessionStore? Perhaps some other callback on Session such as onUnbind. Maybe this isn't a common enough use case to warrant a new method though. Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 12:48 PM To: users@wicket.apache.org Subject: Re: Session end method what resources are those? like i said before, by the time you get notification that the session is expired you can no longer access attributes within session. -igor On Mon, Jun 23, 2008 at 8:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to keep some information in the session and persist it when the session terminates. Is it legal to create a Thread (as a member in the Session / Application) that every X minutes will get information from the Session and do something with it? -- -Wicket for love Nino Martinez Wael Java Specialist @ Jayway DK http://www.jayway.dk +45 2936 7684
Re: Session end method
it is impossible to have this method on Session. session is stored within httpsession and like i said, when that times out you can no longer access its attributes - eg the Session object. if you want to know when a session times out add httpsessionlistener to your webapp. -igor On Mon, Jun 23, 2008 at 10:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Sorry, contains was too strong of a word. Let's say when the session is invalidated that a heavyweight object contained in a global repository must be freed. Come to think of it, even something as simple as logging information about the session when it is invalidated fits this description. -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 1:22 PM To: users@wicket.apache.org Subject: Re: Session end method well. a session cannot contain a thing like a thread or a database connection because everything in session must be serializable. -igor On Mon, Jun 23, 2008 at 10:14 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Say for instance the session contains a resource such as a database connection or a thread (Eyal's original question) that needs to be freed when the session is invalidated. Is there (or should there) be a more intuitive way to handle this use case than Nino's solution of providing a custom ISessionStore? Perhaps some other callback on Session such as onUnbind. Maybe this isn't a common enough use case to warrant a new method though. Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 12:48 PM To: users@wicket.apache.org Subject: Re: Session end method what resources are those? like i said before, by the time you get notification that the session is expired you can no longer access attributes within session. -igor On Mon, Jun 23, 2008 at 8:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: I see. So then would the best place to do session cleanup be in WebApplication.sessionDestroyed? I guess the question really boils down to: where is the best place to clean up session related resources to ensure that they are freed in all instances regardless of which ISessionStore implementation is used? Thanks, Larry -Original Message- From: Igor Vaynberg [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2008 11:11 AM To: users@wicket.apache.org Subject: Re: Session end method session.invalidate() triggers the invalidation, just like it does in httpsession. you might want to read the javadoc. -igor On Mon, Jun 23, 2008 at 6:29 AM, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Ah, I see that now. I didn't dig deep enough. When I first started working with Wicket sessions I was assuming (bad I know!) that Session.invalidate would be called when the HttpSession timed out. I noticed that it actually wasn't, so I then assumed (again!) that Wicket wasn't handling any HttpSession time outs. Would it make sense to have Wicket call Session.invalidate when the HttpSession times out to simplify this use case and not require implementing ISessionStore? -Original Message- From: Johan Compagner [mailto:[EMAIL PROTECTED] Sent: Saturday, June 21, 2008 3:23 AM To: users@wicket.apache.org Subject: Re: Session end method Wicket doea that for you, unbind is called when session is terminarted by the container On 6/20/08, Zappaterrini, Larry [EMAIL PROTECTED] wrote: Assuming this is backed by an HttpSession, wouldn't you also have to register an implementation of HttpSessionListener via web.xml to handle the situation where the HttpSession times out? Correct me if I'm wrong, but in that instance, onUnbind will not be called and the Thread would never be stopped. -Original Message- From: Nino Saturnino Martinez Vazquez Wael [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:03 AM To: users@wicket.apache.org Subject: Re: Session end method Theres also an unsecure way of doing it, namely this(from applicationclass): @Override protected ISessionStore newSessionStore() { return new SecondLevelCacheSessionStore(this, new DiskPageStore()) { @Override protected void onBind(Request request, Session newSession) { sessionMap.put(newSession.getId(), (ZeuzSession) newSession); super.onBind(request, newSession); } @Override protected void onUnbind(String sessionId) { ZeuzSession session = (ZeuzSession) sessionMap.get(sessionId); session.onBeforeDestroy(); sessionMap.remove(sessionId); super.onUnbind(sessionId); } }; } Eyal Golan wrote: Hello, Is there a method in Session that is called when the Session is ended? Ended = user logs out (invalidate) or time-out (or anything else that can do that) My goal is to
Re: Invisible fields in wicket
Thanks a lot, Igor. It worked really great! igor.vaynberg wrote: see component.setOutputMarkupPlaceHolderTag(true). that should cure your ailment. -igor -- View this message in context: http://www.nabble.com/Invisible-fields-in-wicket-tp18069101p18074714.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]
PageableListView and Detachable Models
Hi, I a currently a bit stuck in dealing with a PageableListView and a detachable model. I have build my own model that wraps a list of search results that should exists as long as the page remains the same, i.e. across all requests that go to the same page such as for navigation or sort actions. As soon as the page is left, e.g. when the user navigates to the details page of a certain result, the search result list is cleared. However, it appears that the detach method is called immediately after the PageableListView is rendered, i.e. at the end of each request. Is this observation correct? And how would I deal with a requirement as described above? Cheers, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
detach() is indeed called in the end of every request. what exactly is your requirement? you want to run the query once, upon page entry, and then always reuse the same resultset without doing another query? in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -igor On Mon, Jun 23, 2008 at 11:25 AM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, I a currently a bit stuck in dealing with a PageableListView and a detachable model. I have build my own model that wraps a list of search results that should exists as long as the page remains the same, i.e. across all requests that go to the same page such as for navigation or sort actions. As soon as the page is left, e.g. when the user navigates to the details page of a certain result, the search result list is cleared. However, it appears that the detach method is called immediately after the PageableListView is rendered, i.e. at the end of each request. Is this observation correct? And how would I deal with a requirement as described above? Cheers, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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]
howto query which domain?
Hi I have a vhost which has several serveraliases, how can I check for which one is being triggered? Something like this: if serveralias=myalias then{ RequestHeadder add domain myalias } I've tried location, but it does not seem to be the thing.. -- -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]
What is DateTextFields Max and Min date or range?
Hey guys I have been looking and I wanted to know what the DateTextField max and min dates were. so if my user wanted to click back to say December 1950 could they? I know it is not very practical and I do not think this will happen but I wanted to see how far back they could go and how far ahead they could go. Thanks T -- View this message in context: http://www.nabble.com/What-is-DateTextFields-Max-and-Min-date-or-range--tp18076245p18076245.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]
relative location for css/javascript
Hi, I place my html files and css/javascript in different folders under the web root dir: /pages /templates /css /javascript /images I use this structure outside the java packages as we use Adobe GoLive for designing the pages. I followed the Wiki suggestions to add resource folders and to use a ResourceStreamLocator but the problem is that Wicket changes the relative reference from ../css/styles.css to ../../css/styles.css , the same for javascript/ images. If I use absolute pathes like /css/styles.css then everthing works but I can not see the html files properly in Adobe GoLive. What do I wrong? Can anyone explain me how to use relative pathes? Thanks, Oliver -- View this message in context: http://www.nabble.com/relative-location-for-css-javascript-tp18077090p18077090.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: PageableListView and Detachable Models
Hi Igor, thanks for your reply. Igor Vaynberg wrote: detach() is indeed called in the end of every request. what exactly is your requirement? you want to run the query once, upon page entry, and then always reuse the same resultset without doing another query? This is indeed what I would like to do. However, my current approach is to keep to original result list in memory and do the paging on the list without further database queries. I might try that option later, currently I am doing some kind of exploration of how to do things in wicket to derive a more or less generic architecture for our wicket projects. Cheers, J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -igor On Mon, Jun 23, 2008 at 11:25 AM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, I a currently a bit stuck in dealing with a PageableListView and a detachable model. I have build my own model that wraps a list of search results that should exists as long as the page remains the same, i.e. across all requests that go to the same page such as for navigation or sort actions. As soon as the page is left, e.g. when the user navigates to the details page of a certain result, the search result list is cleared. However, it appears that the detach method is called immediately after the PageableListView is rendered, i.e. at the end of each request. Is this observation correct? And how would I deal with a requirement as described above? Cheers, J. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DropDownChoice setting other DropDownChoice using AJAX results in null at submit
Hello, I have a page in which there are 2 DropDownChoices. Both have to be set with an initial value. The first DDC called mapCategory is populated from a simple List. The second DDC, chosenArmy is populated by a List of objects (Army) that can change, based on the value of the first DDC and other options. I used AJAX to change the value of the second DDC based on the first DDC. In addition, the default value of the second DDC is also set when the user selects the value of the first DDC. stwMatchPrefs is the property model set to the form. When the user sets the value on the first DDC, the value of the second DDC is set without problems, even the selected value is set correctly. The problem is that if the user changes the value on the first DDC (mapCategory) and then submits, the value passed on the second DDC (chosenArmy) is always null, so the value received by stwMatchPrefs is null. If the user submits without changing the value on the first DDC, everything work and the value of stwMatchPrefs is set correctly. If the user changes the value on the first DDC (mapCategory) and then submits twice, the first time the value of chosenArmy is null, but the second submit has the right value. Can anyone help me? Thanks in advance. Here's the page, with both DDC I'm using wicket 1.3.3. Lines 57-65 have the AJAX code. public class StwFrontPage extends BasePage { @SpringBean(name=armyServices) private ArmyServices armyServices; StwData stwData; StwMatchPrefs stwMatchPrefs; public StwFrontPage() { stwMatchPrefs = new StwMatchPrefs(); CompoundPropertyModel userProfileModel = new CompoundPropertyModel(stwMatchPrefs); Form stwPrefsForm = new StwPrefForm(StwPrefsForm,userProfileModel); add(stwPrefsForm); stwMatchPrefs.setMapCategory(StwMapCategory.SMALL); DropDownChoice mapCategory = new DropDownChoice(mapCategory, new PropertyModel(stwMatchPrefs, mapCategory), StwMapCategory.getList()); stwPrefsForm.add(mapCategory); IChoiceRenderer armyChoicesRenderer = new IChoiceRenderer() { public Object getDisplayValue(Object o) { return ((Army)o).getName(); } public String getIdValue(Object o, int i) { return Integer.toString(i); } }; stwData = AbismoWicketWebSession.get().getNewAbismoUser().getStwData(); if(stwData == null){ stwData = new StwData(); } if(!stwData.isInitialized()){ stwData.init(AbismoWicketWebSession.get().getNewAbismoUser(), armyServices.getBasicArmy(StwMapCategory.SMALL), armyServices.getBasicArmy(StwMapCategory.MEDIUM), armyServices.getBasicArmy(StwMapCategory.LARGE) ); } IModel armyChoices = new AbstractReadOnlyModel() { public Object getObject() { List Army armys = new ArrayList Army (); armys.add(stwData.getArmyByCategory(StwMapCategory.SMALL)); armys.add(stwData.getArmyByCategory(StwMapCategory.MEDIUM)); armys.add(stwData.getArmyByCategory(StwMapCategory.LARGE)); stwMatchPrefs.setChosenArmy(stwData.getArmyByCategory(stwMatchPrefs.getMapCategory())); return armys; } }; final DropDownChoice chosenArmy = new DropDownChoice(chosenArmy, new PropertyModel(stwMatchPrefs, chosenArmy), armyChoices, armyChoicesRenderer ); chosenArmy.setOutputMarkupId(true); stwPrefsForm.add(chosenArmy); mapCategory.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { stwMatchPrefs.setChosenArmy(stwData.getArmyByCategory(stwMatchPrefs.getMapCategory())); chosenArmy.setModelObject(stwMatchPrefs.getChosenArmy()); target.addComponent(chosenArmy); } }); } public ArmyServices getArmyServices() { return armyServices; } public void setArmyServices(ArmyServices armyServices) { this.armyServices = armyServices; } class StwPrefForm extends BaseForm { // PropertyModel is an IModel implementation public StwPrefForm(String id, IModel model) { super(id, model); } @Override public void onSubmit() { StwMatchPrefs stwMatchPrefs = (StwMatchPrefs)getModelObject(); System.out.println(stwMatchPrefs.getMapCategory() = + stwMatchPrefs.getMapCategory()); System.out.println(stwMatchPrefs.getChosenArmy() = + stwMatchPrefs.getChosenArmy()); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
render PageParameters
Is there code available to me to generate the the http get parameter string that corresponds to a PageParameters instance? I am generating links from our confirmation e-mail back to bookmarkable pages in our application. Thank you, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
the model can be aware that it is used by the listview. the separation here is that the listview is unaware of where or how its list is built. for database stuff i prefer using dataview, it has database semantics more closely built into it. -igor On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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: PageableListView and Detachable Models
Ok, but since I pass the model into the constructor of the listview, how is the model informed which part of the data to load? Is there a method that I have been missing? J. Igor Vaynberg wrote: the model can be aware that it is used by the listview. the separation here is that the listview is unaware of where or how its list is built. for database stuff i prefer using dataview, it has database semantics more closely built into it. -igor On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PageableListView and Detachable Models
well, thats part of the problem with listview :) see idataprovider and dataview if you do want to use listview then you have to implement your own List interface that loads windows of data at a time depending on which get(index) is used. -igor On Mon, Jun 23, 2008 at 2:16 PM, Jürgen Lind [EMAIL PROTECTED] wrote: Ok, but since I pass the model into the constructor of the listview, how is the model informed which part of the data to load? Is there a method that I have been missing? J. Igor Vaynberg wrote: the model can be aware that it is used by the listview. the separation here is that the listview is unaware of where or how its list is built. for database stuff i prefer using dataview, it has database semantics more closely built into it. -igor On Mon, Jun 23, 2008 at 1:55 PM, Jürgen Lind [EMAIL PROTECTED] wrote: Hi, I am still a bit confused about one thing in the remark below: how can the model of the list view return the required items? Should not the model be unaware that it is used by a list view? J. in that case store the list of ids in your resultset as a property of the page. the model of the listview can then retrieve the subset of this list (based on the current page and number of items needed) and do a select from foo where id in ( subset of id list ) query to retrieve the current window of data. -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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] -- Mit freundlichen Grüßen, Jürgen Lind -- Dr. Jürgen Lind iteratec GmbHFon: +49 (0)89 614551-44 Inselkammerstrasse 4 Fax: +49 (0)89 614551-10 82008 Unterhaching Web: www.iteratec.de Sitz und Registergericht der iteratec GmbH: München HRB 113 519 Geschäftsführer: Klaus Eberhardt, Mark Goerke, Inge Hanschke, Ralf Menzel - 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]
SubmitLink enter listener
Hi! How can I get SubmitLink , AjaxSubmitLink and preferrably Link, AjaxLink to respond to enter? I'd hoped that submit did this but maybe this requires javascript? -- View this message in context: http://www.nabble.com/SubmitLink-enter-listener-tp18078769p18078769.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: render PageParameters
You could do something like: WebRequestEncoder encoder = new WebRequestEncoder(new AppendingStringBuffer(your-url)); for (Iterator it = parameters.entrySet().iterator(); it.hasNext(); ) { Entry entry = (Entry) it.next(); encoder.addValue((String) entry.getKey(), (String) entry.getValue()); } I haven't tested that exact code, but basically this was taken from code in: URIRequestTargetUrlCodingStrategy -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jun 23, 2008 at 4:01 PM, Scott Swank [EMAIL PROTECTED] wrote: Is there code available to me to generate the the http get parameter string that corresponds to a PageParameters instance? I am generating links from our confirmation e-mail back to bookmarkable pages in our application. Thank you, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Google friendly urls
Hi! I'm trying to get my wicket urls to work with google spiders. Right now I have the ?wicket:interface=:1 and I was just wondering. Do I have to use PageParameters to get urls like ?Brand=34 I now pass objects to a pages constructor. Thanks Like ListItemFilter filters = new LinkedListItemFilter(); filters.add( new StoreFilter( 1 ) ); filters.add( new BalanceFilter( 1 ) ); filters.add( new BrandFilter( 34 ) ); setResponsePage( new ItemPage( filters ) ) ; -- View this message in context: http://www.nabble.com/Google-friendly-urls-tp18079064p18079064.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: SubmitLink enter listener
form.setdefaultbutton(link) -igor On Mon, Jun 23, 2008 at 2:21 PM, Mathias P.W Nilsson [EMAIL PROTECTED] wrote: Hi! How can I get SubmitLink , AjaxSubmitLink and preferrably Link, AjaxLink to respond to enter? I'd hoped that submit did this but maybe this requires javascript? -- View this message in context: http://www.nabble.com/SubmitLink-enter-listener-tp18078769p18078769.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: SubmitLink enter listener
Ahh thanks. :) -- View this message in context: http://www.nabble.com/SubmitLink-enter-listener-tp18078769p18079153.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: Google friendly urls
setResponsePage( new ItemPage( filters ) ) ; that wont work because it does not generate a bookmarkable url. you have to encode filters in pageparameters and use bookmarkable page links, such as: add(new bookmarkablepagelink(ItemPage.class, filtersPageParameters)); you can also use StatelessLink/Form which also generate bookmarkable urls and allow you to have onclick handlers. -igor On Mon, Jun 23, 2008 at 2:37 PM, Mathias P.W Nilsson [EMAIL PROTECTED] wrote: Hi! I'm trying to get my wicket urls to work with google spiders. Right now I have the ?wicket:interface=:1 and I was just wondering. Do I have to use PageParameters to get urls like ?Brand=34 I now pass objects to a pages constructor. Thanks Like ListItemFilter filters = new LinkedListItemFilter(); filters.add( new StoreFilter( 1 ) ); filters.add( new BalanceFilter( 1 ) ); filters.add( new BrandFilter( 34 ) ); setResponsePage( new ItemPage( filters ) ) ; -- View this message in context: http://www.nabble.com/Google-friendly-urls-tp18079064p18079064.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: render PageParameters
That should do it. Thank you Jeremy. On Mon, Jun 23, 2008 at 2:29 PM, Jeremy Thomerson [EMAIL PROTECTED] wrote: You could do something like: WebRequestEncoder encoder = new WebRequestEncoder(new AppendingStringBuffer(your-url)); for (Iterator it = parameters.entrySet().iterator(); it.hasNext(); ) { Entry entry = (Entry) it.next(); encoder.addValue((String) entry.getKey(), (String) entry.getValue()); } I haven't tested that exact code, but basically this was taken from code in: URIRequestTargetUrlCodingStrategy -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jun 23, 2008 at 4:01 PM, Scott Swank [EMAIL PROTECTED] wrote: Is there code available to me to generate the the http get parameter string that corresponds to a PageParameters instance? I am generating links from our confirmation e-mail back to bookmarkable pages in our application. Thank you, Scott - 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: Google friendly urls
Thanks! But this you meen I need to check for every parameter that could be excepted. @SuppressWarnings( unchecked ) public ItemInterceptor( PageParameters parameters ){ filters = new LinkedListItemFilter(); Sort sort = null; Translator translator = new Translator( getStore() ); Iterator iter = parameters.keySet().iterator(); while( iter.hasNext() ){ String key = (String)iter.next(); if( key.equalsIgnoreCase( brand )){ String id = parameters.getString( key, ); try{ Long brandId = Long.parseLong( id ); Brand brand = getBrandDao().getBrand( brandId ); if( brand == null ) throw new RestartResponseAtInterceptPageException(Base.class); removeFilter( BrandFilter.class ); filters.add( new BrandFilter( brand )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( category )){ String id = parameters.getString( key, ); try{ Long categoryId = Long.parseLong( id ); Category category = getCategoryDao().getById( categoryId ); if( category == null ) throw new RestartResponseAtInterceptPageException(Base.class); translator.translate( category ); removeFilter( CategoryFilter.class ); filters.add( new CategoryFilter( category )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( department )){ String id = parameters.getString( key, ); try{ Long departmentId = Long.parseLong( id ); Department department = getDepartmentDao().getDepartment(departmentId); if( department == null ) throw new RestartResponseAtInterceptPageException(Base.class); translator.translate( department ); removeFilter( DepartmentFilter.class ); filters.add( new DepartmentFilter( department )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( refills )){ filters.add( new RefilledFilter()); sort = Sort.REFILLED ; } if( key.equalsIgnoreCase( latest )){ filters.add( new LatestAddedFilter()); sort = Sort.NEW_COMING ; } if( key.equalsIgnoreCase( outlet )){ filters.add( new OutletFilter( true )); } if( key.equalsIgnoreCase( female )){ removeFilter( GenderFilter.class ); filters.add( new GenderFilter( Gender.FEMALE )); } if( key.equalsIgnoreCase( male )){ removeFilter( GenderFilter.class ); filters.add( new GenderFilter( Gender.MALE )); }
Re: Google friendly urls
pretty much. once you have to go this route you lose wicket's automagic state management ability and have to marshal objects to url and back yourself like you would in struts, etc. -igor On Mon, Jun 23, 2008 at 3:22 PM, Mathias P.W Nilsson [EMAIL PROTECTED] wrote: Thanks! But this you meen I need to check for every parameter that could be excepted. @SuppressWarnings( unchecked ) public ItemInterceptor( PageParameters parameters ){ filters = new LinkedListItemFilter(); Sort sort = null; Translator translator = new Translator( getStore() ); Iterator iter = parameters.keySet().iterator(); while( iter.hasNext() ){ String key = (String)iter.next(); if( key.equalsIgnoreCase( brand )){ String id = parameters.getString( key, ); try{ Long brandId = Long.parseLong( id ); Brand brand = getBrandDao().getBrand( brandId ); if( brand == null ) throw new RestartResponseAtInterceptPageException(Base.class); removeFilter( BrandFilter.class ); filters.add( new BrandFilter( brand )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( category )){ String id = parameters.getString( key, ); try{ Long categoryId = Long.parseLong( id ); Category category = getCategoryDao().getById( categoryId ); if( category == null ) throw new RestartResponseAtInterceptPageException(Base.class); translator.translate( category ); removeFilter( CategoryFilter.class ); filters.add( new CategoryFilter( category )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( department )){ String id = parameters.getString( key, ); try{ Long departmentId = Long.parseLong( id ); Department department = getDepartmentDao().getDepartment(departmentId); if( department == null ) throw new RestartResponseAtInterceptPageException(Base.class); translator.translate( department ); removeFilter( DepartmentFilter.class ); filters.add( new DepartmentFilter( department )); }catch( NumberFormatException nex ){ throw new RestartResponseAtInterceptPageException(Base.class); } } if( key.equalsIgnoreCase( refills )){ filters.add( new RefilledFilter()); sort = Sort.REFILLED ; } if( key.equalsIgnoreCase( latest )){ filters.add( new LatestAddedFilter()); sort = Sort.NEW_COMING ; } if( key.equalsIgnoreCase( outlet )){ filters.add( new OutletFilter( true )); } if( key.equalsIgnoreCase( female )){ removeFilter( GenderFilter.class ); filters.add( new GenderFilter( Gender.FEMALE )); } if( key.equalsIgnoreCase( male )){ removeFilter( GenderFilter.class ); filters.add( new GenderFilter( Gender.MALE )); } if( key.equalsIgnoreCase( junior )){ removeFilter( GenderFilter.class ); filters.add( new GenderFilter( Gender.JUNIOR
Re: Google friendly urls
Ok thanks. So If I need a google friendly website I need to go with the parsing of PageParameters. That makes sense of course. -- View this message in context: http://www.nabble.com/Google-friendly-urls-tp18079064p18079925.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: Google friendly urls
Of course, you can make your code below significantly smaller by doing something like (I haven't checked this code for 100% accuracy): Long brandId = params.getLong(brand) if (StringUtils.isEmpty(brandId) == false) { brand = yourDao.getBrand(brandId); } You get the point - remove the big loop and just pull what you need from the parameters. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jun 23, 2008 at 5:35 PM, Mathias P.W Nilsson [EMAIL PROTECTED] wrote: Ok thanks. So If I need a google friendly website I need to go with the parsing of PageParameters. That makes sense of course. -- View this message in context: http://www.nabble.com/Google-friendly-urls-tp18079064p18079925.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 to create a cacheable image resource for a image file?
In my web app there are a bunch of static image files that live outside the WAR in various places on the host's file system (also outside the purview of the httpd server too). To serve up these images within my Wicket app, I've been reading their bytes via a File object and returning those bytes to an Image via a DynamicImageResource. As usual, the Image is added to the page in the page's constructor. This works great except for one problem... Each time the user reloads the page, the HTML img gets a new src attribute because a new DynamicImageResource is created each time the page is instantiated. Thus, the browser can't cache the image. This is bad because I want the image to be cached. My question is: How can I provide a non-changing URL for the image resource so the image is cacheable? Many thanks for any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a cacheable image resource for a image file?
I'm pretty sure you'll find an answer in the archives. For instance, there's a bunch of suggestions here: http://www.nabble.com/Image-from-resource-outside-tomcat-container-to17276444.html#a17276444 -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jun 23, 2008 at 7:04 PM, Justin Morgan - Logic Sector [EMAIL PROTECTED] wrote: In my web app there are a bunch of static image files that live outside the WAR in various places on the host's file system (also outside the purview of the httpd server too). To serve up these images within my Wicket app, I've been reading their bytes via a File object and returning those bytes to an Image via a DynamicImageResource. As usual, the Image is added to the page in the page's constructor. This works great except for one problem... Each time the user reloads the page, the HTML img gets a new src attribute because a new DynamicImageResource is created each time the page is instantiated. Thus, the browser can't cache the image. This is bad because I want the image to be cached. My question is: How can I provide a non-changing URL for the image resource so the image is cacheable? Many thanks for any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DropDownChoice setting other DropDownChoice using AJAX results in null at submit
On Mon, 23 Jun 2008, Giuliano Caliari wrote: When the user sets the value on the first DDC, the value of the second DDC is set without problems, even the selected value is set correctly. The problem is that if the user changes the value on the first DDC (mapCategory) and then submits, the value passed on the second DDC (chosenArmy) is always null, so the value received by stwMatchPrefs is null. Hi, I haven't completely understood what is happening here, but will try to give some ideas below. There is something strange happening with the models there. Have you read the models wiki page? You could also try removing PropertyModel and CompoundPropertyModel usage for now, because they might obfuscate the problem. IModel armyChoices = new AbstractReadOnlyModel() { public Object getObject() { ListArmy armys = new ArrayListArmy(); armys.add(stwData.getArmyByCategory(StwMapCategory.SMALL)); armys.add(stwData.getArmyByCategory(StwMapCategory.MEDIUM)); armys.add(stwData.getArmyByCategory(StwMapCategory.LARGE)); stwMatchPrefs.setChosenArmy(stwData.getArmyByCategory(stwMatchPrefs.getMapCategory())); return armys; } }; This seems like a strange side effect -- whenever a component with armyChoices as its model is rendered, stwMatchPrefs.setChosenArmy() is called. Because this is the model of the chosenArmy DropDownChoice, whenever the DropDownChoice is rendered, this getObject() method is evaluated. But then again final DropDownChoice chosenArmy = new DropDownChoice(chosenArmy, new PropertyModel(stwMatchPrefs, chosenArmy), armyChoices, armyChoicesRenderer ); chosenArmy.setOutputMarkupId(true); stwPrefsForm.add(chosenArmy); mapCategory.add(new AjaxFormComponentUpdatingBehavior(onchange) { protected void onUpdate(AjaxRequestTarget target) { stwMatchPrefs.setChosenArmy(stwData.getArmyByCategory(stwMatchPrefs.getMapCategory())); chosenArmy.setModelObject(stwMatchPrefs.getChosenArmy()); target.addComponent(chosenArmy); } }); } Here you give a PropertyModel to chosenArmy DropDownChoice, and it operates directly with the chosenArmy property of stwMatchPrefs. This means that the chosenArmy DropDownChoice selection and stwMatchPrefs.chosenArmy property are bound to each other: when one changes, the other one changes as well. In this light, it is absurd that you change both values in the onUpdate method. stwMatchPrefs.setChosenArmy() should be enough. What is even stranger is that because of the armyChoices model, stwMatchPres.setChosenArmy() is getting a competing call during rendering :) public ArmyServices getArmyServices() { return armyServices; } public void setArmyServices(ArmyServices armyServices) { this.armyServices = armyServices; } BTW, what are these methods here for? Best wishes, Timo -- Timo Rantalaiho Reaktor Innovations OyURL: http://www.ri.fi/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
generics
development of the 1.4 branch has been quiet lately, this is because the core team has been busy working on an alternative way of generifiing the framework. an early result of that effort can be found here [1]. The key difference in [1] is that we have decoupled the component from the type of the model. here is the list of major differences: (1) only components that use their model have a generic type (components you are likely to call getmodel/getmodelobject on as a user). so far these are link,form,formcomponent subclasses,listview,listitem,(other repeaters will follow soon). this allows for typesafety where it makes sense, and eliminates a ton of noise from code. we will generify others upon request if a good usecase is provided and we think it is widely applicable. (2) non-generified components do not have IModelT get/setModel and T get/setModelObject, instead they have IModel?get/setDefaultModel and Object get/setDefaultModelObject. this clearly expresses that the default component model is not tied to the type of component. this is a bit of a pain from the code migration point of view, but we think is worth the effort. generifyed components are free to implement the old IModelT get/setModel, etc, but have to keep the unsafe cast inside. see ListItem for an example. basically we feel this is a much cleaner way then what is 1.4m2. this is a call for confirmation/discussion from our user base. do try to port a small project or a part of a larger project you are working on to the [1] branch to see how the new api feels. if we do like this more the new branch will be merged into what will be 1.4m3. [1] https://svn.apache.org/repos/asf/wicket/sandbox/ivaynberg/generics -igor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]