Grouped ListView
I am looking to create a grouped listview where each group only contains a specific number of items. For example: I have a list of 5 items and I want each group to have 3 items in it. I would expect the html to look something like the following: div id=list div class=group div class=item div class=item div class=item /div div class=group div class=item div class=item /div /div Any ideas on how this can be done? I obviously can use a listview and get the entire list displayed without the grouping but I need to add the grouping. Is there a repeater that does such a thing? Thanks.
LDM - correct construction
Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } }
RE: LDM - correct construction
My service implementation uses hibernate dao objects which should be managing its own connections via the c3p0 connection pool. All my service objects and Dao objects are marked as singletons in my Spring applicationContext.xml file. I don't think any of my transactions are failing as it would most likely throw an exception if the there was a problem performing a transactions and all exceptions are logged (at least I believe they are). I will most likely put the following c3p0 settings in place and wait to see what comes out of this in production. c3p0.unreturnedConnectionTimeout=30 c3p0.debugUnreturnedConnectionStackTraces=true This should give me a stack trace of what checked out a connection, where that connection hasn't been returned to the pool in 30 seconds. It will be a slight performance hit on production but I should be able to find the problem very quickly. Thanks. Jeff -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:04 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction Jeffrey, That won't prevent a connection from being released. The LDM holds a reference to the page, and the page has a serializable proxy to the service implementation. No problem there. Injecting the service into the LDM is only an advantage if you want to share it among pages; then the LDM can be static and its page reference goes away. It sounds like your service implementation may have an issue. Does your service manage its own connections? If so, is it a singleton? Other than that, I'd guess there's a bug in your transaction management such that a transaction gets started but not finished. HTH, Dan On Wed, Mar 21, 2012 at 1:45 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: LDM - correct construction
The application is using the open-session-in-view pattern which is what makes this so troubling to figure out. -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:44 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction That sounds like a good strategy. Generally speaking, applications use an open-session-in-view pattern which makes it easy to ensure that the Hibernate session gets closed. As long as that happens, the (mis)handling of transactions shouldn't cause your symptoms. On Wed, Mar 21, 2012 at 2:31 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: My service implementation uses hibernate dao objects which should be managing its own connections via the c3p0 connection pool. All my service objects and Dao objects are marked as singletons in my Spring applicationContext.xml file. I don't think any of my transactions are failing as it would most likely throw an exception if the there was a problem performing a transactions and all exceptions are logged (at least I believe they are). I will most likely put the following c3p0 settings in place and wait to see what comes out of this in production. c3p0.unreturnedConnectionTimeout=30 c3p0.debugUnreturnedConnectionStackTraces=true This should give me a stack trace of what checked out a connection, where that connection hasn't been returned to the pool in 30 seconds. It will be a slight performance hit on production but I should be able to find the problem very quickly. Thanks. Jeff -Original Message- From: Dan Retzlaff [mailto:dretzl...@gmail.com] Sent: Wednesday, March 21, 2012 5:04 PM To: users@wicket.apache.org Subject: Re: LDM - correct construction Jeffrey, That won't prevent a connection from being released. The LDM holds a reference to the page, and the page has a serializable proxy to the service implementation. No problem there. Injecting the service into the LDM is only an advantage if you want to share it among pages; then the LDM can be static and its page reference goes away. It sounds like your service implementation may have an issue. Does your service manage its own connections? If so, is it a singleton? Other than that, I'd guess there's a bug in your transaction management such that a transaction gets started but not finished. HTH, Dan On Wed, Mar 21, 2012 at 1:45 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Is this the correct construction of a LDM where I need to use a service bean to access my database? The IMyService bean is injected on the page and passed to the LDM. Does this make the LDM hold a reference to the IMyService bean and possibly keep a connection from being put back into the c3p0 db connection pool? After some period of time my application is blocked with all threads waiting on a connection to the db. Should I be injected the IMyService bean into the LDM using the commented out code. Thanks for any help. public class MyLDM extends LoadableDetachableModelcom.example.MyObject { //@SpringBean private IMyService service; private String id; public MyLDM(String id, IMyService service) { this.id = id; this.service = service; } //public MyLDM(String id) { //this.id = id; //} @Override protected com.example.MyObject load() { //InjectorHolder.getInjector().inject(this); return service.getMyObject(this.id); } } - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Event handling and swapping panels
I want to swap panels using the event model in 1.5. This is very similar to the panel swapping code (wicket 1.4.x) found in the Apache Wicket Cookbook but uses the event model instead. The problem is I can't set the panel equal to its replacement, like you would in 1.4.x. This is found on the line marked * THIS IS NOT POSSIBLE *. How would you go about doing this? Is it even possible? Component workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyFirstPanel(this.getId()); break; default: replacement = this; break; } this.replaceWith(replacement); this. = replacement; // ** THIS IS NOT POSSIBLE - HOW WOULD I DO THIS *** this.setOutputMarkupId(true); AjaxRequestTarget target = e.getTarget(); target.add(this); } super.onEvent(event); } workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink firsttab = new AjaxLink(firsttab) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent (target, MyPanelEvent.PANEL1)); } }; firsttab.setOutputMarkupId(true); firsttab.setMarkupId(firsttab ); add(firsttab);
RE: Event handling and swapping panels
Thanks. But what does OuterPanelClass refer to in my example? I don't think either of these are right: MyEmptyPanel.this.panel.replaceWith(replacement); -or- MyPage.this.panel.replaceWith(replacement); Or do I need to define workingPanel as a private member of my page class and then have: MyPage.this.workingPanel.replaceWith(replacement); MyPage.this.workingPanel = replacement; -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:07 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels OuterPanelClass.this.panel.replaceWith(replacement); OuterPanelClass.this.panel=replacement; -igor On Wed, Mar 28, 2012 at 11:33 AM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: I want to swap panels using the event model in 1.5. This is very similar to the panel swapping code (wicket 1.4.x) found in the Apache Wicket Cookbook but uses the event model instead. The problem is I can't set the panel equal to its replacement, like you would in 1.4.x. This is found on the line marked * THIS IS NOT POSSIBLE *. How would you go about doing this? Is it even possible? Component workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyFirstPanel(this.getId()); break; default: replacement = this; break; } this.replaceWith(replacement); this. = replacement; // ** THIS IS NOT POSSIBLE - HOW WOULD I DO THIS *** this.setOutputMarkupId(true); AjaxRequestTarget target = e.getTarget(); target.add(this); } super.onEvent(event); } workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink firsttab = new AjaxLink(firsttab) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent (target, MyPanelEvent.PANEL1)); } }; firsttab.setOutputMarkupId(true); firsttab.setMarkupId(firsttab ); add(firsttab); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Event handling and swapping panels
Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyPanel1(this.getId()); break; case MyPanelEvent.PANEL2: replacement = new MyPanel2(this.getId()); break; case MyPanelEvent.PANEL3: replacement = new MyPanel3(this.getId()); break; default: replacement = Admin.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); // IS THIS RIGHT? Admin.this.workingPanel = replacement; // IS THIS RIGHT? this.setOutputMarkupId(true); target.add(this); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); // place-holder for future javascript to be called } super.onEvent(event); } }; workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:29 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels paste your entire panel/page class... -igor On Wed, Mar 28, 2012 at 12:15 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Thanks. But what does OuterPanelClass refer to in my example? I don't think either of these are right: MyEmptyPanel.this.panel.replaceWith(replacement); -or- MyPage.this.panel.replaceWith(replacement); Or do I need to define workingPanel as a private member of my page class and then have: MyPage.this.workingPanel.replaceWith(replacement); MyPage.this.workingPanel = replacement; -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:07 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels
RE: Event handling and swapping panels
Only problem is that it is not working. The panels never update to the new panels. I can see that the onEvent fires as the javascript alert is shown. But the javascript is only shown the first time I click a link. After the first click, all the links call their onClick method and send the event out but the event is never picked up. Does every panel need to have its own onEvent method to listen for the events. If so, I think the old method of handling ajax is going to be easier. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:49 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels that is correct -igor On Wed, Mar 28, 2012 at 12:41 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1: replacement = new MyPanel1(this.getId()); break; case MyPanelEvent.PANEL2: replacement = new MyPanel2(this.getId()); break; case MyPanelEvent.PANEL3: replacement = new MyPanel3(this.getId()); break; default: replacement = Admin.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); // IS THIS RIGHT? Admin.this.workingPanel = replacement; // IS THIS RIGHT? this.setOutputMarkupId(true); target.add(this); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); // place-holder for future javascript to be called } super.onEvent(event); } }; workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { send(getPage(), Broadcast.BREADTH, new MyPanelEvent(target, MyPanelEvent.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:29 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels paste your entire panel/page class... -igor
RE: Event handling and swapping panels
Thank you Igor and Francois!! This solved my problem and it is working perfectly now. -Original Message- From: Francois Meillet [mailto:qq...@gmail.com] Sent: Wednesday, March 28, 2012 4:45 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels Unless you override the onEvent method for each panel (MyPanel1, MyPanel2 and MyPanel3) , only the first working panel will manage the event. one solution would be : public class Admin extends WebPage { @Override public void onEvent(IEvent? event) { super.onEvent(event); if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent yourEvent = (MyPanelEvent) event.getPayload(); showSelectedPanel(yourEvent.getTarget(), yourEvent); } else { // your code here } } private void showSelectedPanel(AjaxRequestTarget target, MyPanelEvent e) { Component replacement; switch (e.getType()) { case PANEL1: replacement = new MyPanel1(workingPanel); // break; case PANEL2: replacement = new MyPanel2(workingPanel); break; case PANEL3: replacement = new MyPanel3(workingPanel); break; default: replacement = Test333.this.workingPanel; break; } Admin.this.workingPanel.replaceWith(replacement); Admin.this.workingPanel = replacement; replacement.setOutputMarkupId(true); target.add(replacement); target.appendJavaScript(alert('Panel changed to: + e.getType() + ');); } public void init() { workingPanel = new PanelAAA(workingPanel); workingPanel.setOutputMarkupId(true); add(workingPanel); AjaxLink p1Link = new AjaxLink(p1Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL1)); } }; p1Link.setOutputMarkupId(true); p1Link.setMarkupId(p1Link); add(p1Link); AjaxLink p2Link = new AjaxLink(p2Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL2)); } }; p2Link.setOutputMarkupId(true); p2Link.setMarkupId(p2Link); add(p2Link); AjaxLink p3Link = new AjaxLink(p3Link) { @Override public void onClick(AjaxRequestTarget target) { log.debug(onClick); send(getPage(), Broadcast.BREADTH, new YourEvent(target, YourEvent.Type.PANEL3)); } }; p3Link.setOutputMarkupId(true); p3Link.setMarkupId(p3Link); add(p3Link); } } François Le 28 mars 2012 à 22:35, Jeffrey Schneller a écrit : Only problem is that it is not working. The panels never update to the new panels. I can see that the onEvent fires as the javascript alert is shown. But the javascript is only shown the first time I click a link. After the first click, all the links call their onClick method and send the event out but the event is never picked up. Does every panel need to have its own onEvent method to listen for the events. If so, I think the old method of handling ajax is going to be easier. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Wednesday, March 28, 2012 3:49 PM To: users@wicket.apache.org Subject: Re: Event handling and swapping panels that is correct -igor On Wed, Mar 28, 2012 at 12:41 PM, Jeffrey Schneller jeffrey.schnel...@envisa.com wrote: Here it is: public class Admin extends WebPage { private Component workingPanel; public Admin() { super(); init(); } @Override public void renderHead(IHeaderResponse response) { response.renderCSSReference(css/admin.css); super.renderHead(response); } public void init() { workingPanel = new MyEmptyPanel(workingPanel) { @Override public void onEvent(IEvent? event) { if (event.getPayload() instanceof MyPanelEvent) { MyPanelEvent e = (MyPanelEvent) event.getPayload(); AjaxRequestTarget target = e.getTarget(); Component replacement; switch (e.getType()) { case MyPanelEvent.PANEL1
RE: Repalcement of servlets in wicket.
I would stop using 1.4.10 as it is very old at this point. If you are just starting out I would use 1.5.x where x is the latest revision. If you need to stay in the 1.4.x world then I would go with 1.4.20 which I think is the most current version. -Original Message- From: SudeepShakya [mailto:shakyasud...@live.com] Sent: Thursday, March 29, 2012 6:08 AM To: users@wicket.apache.org Subject: Re: Repalcement of servlets in wicket. I am using version 1.4.10 -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Repalcement-of-servlets-in-wicket-tp4514480p4514980.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Favicon best practice
I just put the favicon.ico at the root of the WebContent directory and don't specify anything in the HTML. I believe browsers look in the root unless specified differently in the html (like you are doing). BTW... app is on Apache + Tomcat and runs as the root app of the tomcat instance. -Original Message- From: Ian Marshall [mailto:ianmarshall...@gmail.com] Sent: Friday, March 30, 2012 4:14 PM To: users@wicket.apache.org Subject: Re: Favicon best practice With Wicket 1.5.5, I have tried: In the HTML of my base page I have: link rel=shortcut icon type=image/x-icon href=favicon.ico/ and in my WebApplication-descended application class, I have: @Override protected void init() { super.init(); ... PackageResourceReference prrFavicon = new PackageResourceReference( ResourcesLocator.class, favicon.ico); mountResource(favicon.ico, prrFavicon); } Sadly, the favicon shown remains that stored in web/favicon.ico, not the favicon.ico file stored in the same folder as my ResourcesLocator class. Oh well, I shall just live with the favicon in my web folder, and leave the other one in place just in case. Ian Marshall wrote Alas I am getting MidasTouchCodingExceptions. I tried protected void init() { super.init(); ... // New code ResourceReference rrefFavicon = new ResourceReference( ResourcesLocator.class, favicon.ico); IMountableRequestTargetUrlCodingStrategy mrtURLCodingStrategy = new SharedResourceRequestTargetUrlCodingStrategy(favicon.ico, rrefFavicon.getSharedResourceKey()); // One of: mount(mrtURLCodingStrategy); mountSharedResource(favicon.ico, mrtURLCodingStrategy.getMountPath()); } with link rel=shortcut icon href=[/]favicon.ico type=image/x-icon/ but to no avail. I shall try your suggestion when 1.5 comes out, which I am looking forward to. Thank you again for your suggestions. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Favicon-best-practice-tp3386789p4520242.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
wicketstuff.org - down
Wicketstuff.org appears to be down. Any ideas on when it will be back up?
RE: Built with Wicket: showcases for Wicket applications
Thanks for the reminder. FYI... whoever built ZipGrocery - you are running your site with the ajax debugger still on. -Original Message- From: Martijn Dashorst [mailto:martijn.dasho...@gmail.com] Sent: Thursday, April 12, 2012 5:49 AM To: users@wicket.apache.org Subject: Built with Wicket: showcases for Wicket applications Built with Wicket is Apache Wicket's portfolio blog showcasing what our community has created with your favorite web framework. But why only see what others are building when you can share your own creation? Submit your application to Built with Wicket. Your application doesn't necessarily need to be publicly accessible, but we do want a description of what your application does and a screenshot. http://builtwithwicket.tumblr.com Share the love, share your application at Built with Wicket! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Redirect to Wicket page with 301 Moved Permanently
Are you using Apache HTTPD in front of your app server? If so, you can just use a Rewrite Rule to send the 301 redirect with the new URL. You may want to look into your app server to see if url rewriting is an option. -Original Message- From: jarnis [mailto:jarnis.bertel...@exedio.com] Sent: Monday, May 14, 2012 5:56 AM To: users@wicket.apache.org Subject: Redirect to Wicket page with 301 Moved Permanently Hey guys I'm trying to make a redirect form an old url to a new one. The browser url should be changed to the new one and the response code for the original request to the old url should be 301 Moved permanently so search engines will forget the old url. Making the redirect by throwing a RestartResponseException works fine, except I can't change the response code from 302 Moved Temporarily to 301 Moved Permanetly I've also tried using the RedirectToUrlException, where setting the response code is easy, but I have problems getting it to construct a correct relative url so I don't have to hard code it to a specific host name. What is the best way to solve this? Thanks in advance Jarnis -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Redirect-to-Wicket-page-with-301-Moved-Permanently-tp4631888.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Anybody is having problems with Wicket and Facebook Like button?
We have been using the Like button on one of our client's sites. I have not been told of or noticed any problems with it. I believe we are removing the JSESSIONID as well. -Original Message- From: Alec Swan [mailto:alecs...@gmail.com] Sent: Thursday, July 05, 2012 2:47 PM To: users@wicket.apache.org Subject: Re: Anybody is having problems with Wicket and Facebook Like button? Sorry for pushing this again, but this is a huge issue for us. Is anybody having problems with Facebook Like button? On Tue, Jul 3, 2012 at 3:34 PM, Alec Swan alecs...@gmail.com wrote: Hello, We started receiving complaints from users saying that Facebook Like buttons don't work on our web site anymore. I don't know what happened on the Facebook side but now we are seeing the following errors when user clicks Like button, e.g. on http://galecsy.com:88/lrm/ms/oid/74989: The page at http://galecsy.com:88/lrm/ms/oid/../../ms/oid/74989.0;jsessionid=85C1F BAE4A7B21CA0FC7B8B10BB21EF1 could not be reached. I read SEO - Search Engine Optimization and overwrote newWebResponse to remove JSESSIONID, however it looks like JSESSIONID is still being added somewhere, probably Tomcat. I know this is not directly related to Wicket, but I am wondering how other Wicket users handled interaction with Facebook Like button. Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Appending to CSS url to prevent caching.
You could just add your own cache buster. You could do something like: String cachebuster = something that will always be unique - maybe time stamp; response.renderCSSReference(style/theme.css? + cachebuster); not sure if this will bust the cache because the file is really the same. -or- String cachebuster = something that will always be unique - maybe time stamp; response.renderCSSReference(style/theme- + cachebuster + .css); Then you just need a url rewrite rule to change it back to style/theme.css on the server. I use something similar to this and it works great. -Original Message- From: dickster [mailto:derek.i...@gmail.com] Sent: Tuesday, October 02, 2012 5:09 PM To: users@wicket.apache.org Subject: Re: Appending to CSS url to prevent caching. sorry, i didn't give a great example. here's something better. response.renderCSSReference(style/theme.css); it renders the link rel=stylesheet type=text/css href=style/theme.css/ html without the version parameter appended. maybe i need to do something like... response.renderCssReference(new CachingReference(style/theme.css))??? thanks, derek. On Tue, Oct 2, 2012 at 4:31 PM, Martin Grigorov-4 [via Apache Wicket] ml-node+s1842946n4652625...@n4.nabble.com wrote: On Tue, Oct 2, 2012 at 6:46 PM, dickster [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=0 wrote: i tried using... getResourceSettings().setCachingStrategy(new FilenameWithVersionResourceCachingStrategy(new MessageDigestResourceVersion())); ...but not all of my urls are rewritten. the wiquery ones are but the one's i've added via... renderHead(response) { response.renderCssReference(blah); What kind of CSS this produces ? I think this generates: style blah /style directly in the page markup. If I'm correct then there is no need to add anti-caching here because next render of the page will deliver whatever is needed. Only external file resources can be cached. } ...don't get appended with version MD5. do i have to use different technique for adding them? (is my current way of adding them not the preferred way?) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-pre vent-caching-tp4652508p4652618.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=1 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=2 -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=3 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=4652625i=4 -- If you reply to this email, your message will be added to the discussion below: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-pre vent-caching-tp4652508p4652625.html To unsubscribe from Appending to CSS url to prevent caching., click herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.j tp?macro=unsubscribe_by_codenode=4652508code=ZGVyZWsuaXBvZEBnbWFpbC5 jb218NDY1MjUwOHwtMjM5OTAwMTA0 . NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.j tp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabbl e.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamesp ace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscrib ers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_in stant_email%21nabble%3Aemail.naml -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Appending-to-CSS-url-to-prevent-caching-tp4652508p4652626.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org