Re: Assert that all models are detached at the end of the request?
Eelco is on http://chillenious.wordpress.com. The link you mentioned http://day-to-day-stuff.blogspot.com/ is from your's truly. Regards, Erik. Kaspar Fischer wrote: Matijn, thank you for your hint. I searched on your blog, http://martijndashorst.com/blog/, and Eelco's, http://day-to-day-stuff.blogspot.com/, but must have searched for the wrong thing (transient, entity, SerializableChecker)... -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Instance Variables in Web Page of Wicket Portlet
On Mon, 25 Aug 2008, prabha77 wrote: If instance variables are defined in a subclass of WebPage, would they be thread-safe? For convenience, we're passing a reference to the parent page to it's child components. We are seeing these instance variables overwritten by other users and then those changes are reflected in the original user's session. Is it incorrect to define any instance variables in a WebPage? I don't know about portlets, but normally the Component (including (Web)Page) instances should be specific to a session. So this sounds like strange. Recently some session leakage problems have come up on the mailing list, and something was fixed in version 1.3.4. You might want to search the mailing list to find the whole discussion. 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]
Re: build from the wicket-1.4-m3 source failing
On Tue, 26 Aug 2008, wicket user wrote: when i try to build the wicket from the wicket-1.4-m3 source its failing with the following message What Java version do you use to compile? In 1.5 there have been a lot of generics bugs, some of which are fixed in recent 1.5 versions. 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]
Re: StringResourceModel: use MessageFormat features without params array?
On Wed, 27 Aug 2008, pixologe wrote: Short question: if my interpretation of the source code is correct, it is not possible to use StringResourceModel's MessageFormat features just with a single model (without passing a params array). If this is right: would it be a good idea to make it possible or is there a good reason that it is not, which I am not aware of? I think that the best choice is to fix that with varargs in Wicket 1.4 or 1.5 (that use Java 5 that has varargs). The dependency on the order will stay though. 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]
Re: Clicking add to cart repeatedly
full stack trace please? Are you using persistent sessions in tomcat? On Sat, Aug 30, 2008 at 7:54 AM, wil2008 [EMAIL PROTECTED] wrote: I am new to Wicket (but not new to HTML, Java and Spring). I tried to follow the examples in the ebook of Wicket in Action. Everything is fine until Chapter 3. I followed the cheese application which demonstrates a plain shopping cart. I compiled and ran the front page successfully (including the Index.html and Index.java, up to page 60). I could add to cart and remove successfully. So far so good. When I clicked add to cart repeatedly and slowly, it was still good. But If I clicked quickly enough, the following bunch of Unexpected RuntimeException appeared. I am not sure this is particular to this specific example or is general for other Wicket components. Did I miss something? Does anyone come across something similar? This is important if I am to propose Wicket in a serious project. Thank you very much! Wicket version: 1.3.4 output Could not deserialize object using `org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory` object factory at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:411) Caused by: java.lang.ClassNotFoundException: [Lmycheese.Cheese; at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) . /output -- View this message in context: http://www.nabble.com/Clicking-%22add-to-cart%22-repeatedly-tp19232702p19232702.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]
DataTable - tfoot before tbody?
Hi, I have a customized DataTable. Here's what we have in the constructor: super(id, columns, dataProvider, rowsPerPage); add(HeaderContributor.forCss(/eurekify/style/EurekifyDataTable.css)); add(new AttributeAppender(class, true, new Model(eurekifyTable), )); addTopToolbar(newNavigationToolbar()); addTopToolbar(newHeadersToolbar(dataProvider)); addBottomToolbar(new NoRecordsToolbar(this)); addBottomToolbar(new EurekifyBottomTableToolbar(this, rowsPerPage, modalWindows, showSelectRecordsPerPage)); add(new AttributeAppender(class, true, new Model(emptyTable), ) { private static final long serialVersionUID = 1L; @Override public boolean isEnabled(Component component) { return dataProvider.size() == 0; } }); More info: newHeadersToolbar(...) returns AjaxFallbackHeadersToolbar (which is HeadersToolbar) newNavigationToolbar(...) returns StyledAjaxNavigationToolbar which inherits from AjaxNavigationToolbar (which is NavigationToolbar). EurekifyBottomTableToolbar inherits from AbstractToolbar. When I look at FireBug, I see that the tfoot section of the table is BEFORE the tbody. Has anyone encountered this? Do I do something wrong? - Eyal Golan [EMAIL PROTECTED] Visit: http://jvdrums.sourceforge.net/ JVDrums LinkedIn: http://www.linkedin.com/in/egolan74 LinkedIn -- View this message in context: http://www.nabble.com/DataTable---tfoot-before-tbody--tp19241603p19241603.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: GetModelObject returns null-filled Object?
On Wed, 27 Aug 2008, Markus wrote: Ok, figured out, that the Spring-injected Bean is the reason for this behavior! Works fine if I use u = new Users(); instead of the Spring-injected Users as Model. Any clues how to circumvent this behavior without instantiating the model myself?? It sounds like a strange idea to provide the model as a Spring bean; typically, the dependencies injected to components are more like services, such as Repositories. Could you post the code inlined in the message? 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]
Property that references property
Hi! Sometimes I think it would be useful to refer properties from properties. Example: WicketApplication.properties -file: myProperty=The maximum width allowed is ${property.maxWidth} pixels property.maxWidth=30 Now I would like to use the maxWidth simultaneously for both validation purposes and to display an instruction message that changes according to the parameter maxWidth. But Wicket does not seem to have the smarts of referring to a property from within a property. Has someone figured out a simple workaround trick or pattern to accomplish this, or does it require a serious add-on 'hack' on Wicket? ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Mount files outside container
You probably can do this by enclosing your images (and other resources) inside wicket:link and have custom resource loaded defined for your application, which will load from whatever path(s) you want. Mathias P.W Nilsson wrote: Thank you very much for the suggestion. By doing this I must add all my images from Wicket code. Let's say I want to server a logo, background image or something like that. And just do it via my markup file. Can this be achieved or do I have to use a servlet? -- View this message in context: http://www.nabble.com/Mount-files-outside-container-tp19232069p19243524.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: Clicking add to cart repeatedly
Sorry. The complete stack trace shown on the web page is as follows. I noted that they mirrored what have been logged by Tomcat. I was with Tomcat's default config. And I did not persist anything consciously yet. How to check if persistent sessions are in use in Tomcat? Thanks I am not sure if ClassNotFoundException is misleading somewhat. If really ClassNotFoundException, the same class should still not be found whether I repeat the click slowly or rapidly. But it seems to me that this exception appears only when I repeat the click rapidly enough. Tomcat version : 1.6.0.18 java version 1.6.0_07 Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode) Thank you very much Wilfred (I later assembled an application with Spring + Freemarker doing similar demonstration on the same Tomcat. When I repeatedly clicked add to cart, a cheese item did go to the cart on each click without breakdown no matter how quickly the repetition was. Weird) * Unexpected RuntimeException Root cause: java.lang.ClassNotFoundException: [Lmycheese.Cheese; at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.wicket.application.DefaultClassResolver.resolveClass(DefaultClassResolver.java:103) at org.apache.wicket.util.io.IObjectStreamFactory$1.resolveClass(IObjectStreamFactory.java:87) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480) at org.apache.wicket.Component.readObject(Component.java:4223) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) at org.apache.wicket.Session.getPage(Session.java:751) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1229) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:199) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at
Re: Property that references property
I havent tried this myself, but if its not working I guess you could pass getString(property.maxWidth) value as a parameter to however you are accessing myProperty (possibly StringResourceModel). Hope that helps. Martin Makundi wrote: Hi! Sometimes I think it would be useful to refer properties from properties. Example: WicketApplication.properties -file: myProperty=The maximum width allowed is ${property.maxWidth} pixels property.maxWidth=30 Now I would like to use the maxWidth simultaneously for both validation purposes and to display an instruction message that changes according to the parameter maxWidth. But Wicket does not seem to have the smarts of referring to a property from within a property. Has someone figured out a simple workaround trick or pattern to accomplish this, or does it require a serious add-on 'hack' on Wicket? ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Property-that-references-property-tp19241680p19243861.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: Property that references property
Also just found this in StringResourceModel javadoc... So I guess you can certainly do what I mentioned earlier. * liparameters - The parameters parameter allows an array of objects to be passed for * substitution on the found string resource (see below) using a standard * codejava.text.MessageFormat/code object. Each parameter may be an ordinary Object, in which * case it will be processed by the standard formatting rules associated with * codejava.text.MessageFormat/code. Alternatively, the parameter may be an instance of * codeIModel/code in which case the codegetObject()/code method will be applied prior * to the parameter being passed to the codejava.text.MessageFormat/code. This allows such * features dynamic parameters that are obtained using a codePropertyModel/code object or even * nested string resource models. Ritesh Trivedi wrote: I havent tried this myself, but if its not working I guess you could pass getString(property.maxWidth) value as a parameter to however you are accessing myProperty (possibly StringResourceModel). Hope that helps. Martin Makundi wrote: Hi! Sometimes I think it would be useful to refer properties from properties. Example: WicketApplication.properties -file: myProperty=The maximum width allowed is ${property.maxWidth} pixels property.maxWidth=30 Now I would like to use the maxWidth simultaneously for both validation purposes and to display an instruction message that changes according to the parameter maxWidth. But Wicket does not seem to have the smarts of referring to a property from within a property. Has someone figured out a simple workaround trick or pattern to accomplish this, or does it require a serious add-on 'hack' on Wicket? ** Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Property-that-references-property-tp19241680p19243889.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: DataTable - tfoot before tbody?
This happened to me when my HTML markup containing the table was little off. Make sure your HTML enclosing the table is proper XHTML and try it in IE or FF 3 (multiple browsers) to catch the problem. egolan74 wrote: Hi, I have a customized DataTable. Here's what we have in the constructor: super(id, columns, dataProvider, rowsPerPage); add(HeaderContributor.forCss(/eurekify/style/EurekifyDataTable.css)); add(new AttributeAppender(class, true, new Model(eurekifyTable), )); addTopToolbar(newNavigationToolbar()); addTopToolbar(newHeadersToolbar(dataProvider)); addBottomToolbar(new NoRecordsToolbar(this)); addBottomToolbar(new EurekifyBottomTableToolbar(this, rowsPerPage, modalWindows, showSelectRecordsPerPage)); add(new AttributeAppender(class, true, new Model(emptyTable), ) { private static final long serialVersionUID = 1L; @Override public boolean isEnabled(Component component) { return dataProvider.size() == 0; } }); More info: newHeadersToolbar(...) returns AjaxFallbackHeadersToolbar (which is HeadersToolbar) newNavigationToolbar(...) returns StyledAjaxNavigationToolbar which inherits from AjaxNavigationToolbar (which is NavigationToolbar). EurekifyBottomTableToolbar inherits from AbstractToolbar. When I look at FireBug, I see that the tfoot section of the table is BEFORE the tbody. Has anyone encountered this? Do I do something wrong? -- View this message in context: http://www.nabble.com/DataTable---tfoot-before-tbody--tp19241603p19243949.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: Clicking add to cart repeatedly
Does this happen under jetty too? To try this you can use mvn jetty:run or from your IDE run Start Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk wil2008 wrote: Sorry. The complete stack trace shown on the web page is as follows. I noted that they mirrored what have been logged by Tomcat. I was with Tomcat's default config. And I did not persist anything consciously yet. How to check if persistent sessions are in use in Tomcat? Thanks I am not sure if ClassNotFoundException is misleading somewhat. If really ClassNotFoundException, the same class should still not be found whether I repeat the click slowly or rapidly. But it seems to me that this exception appears only when I repeat the click rapidly enough. Tomcat version : 1.6.0.18 java version 1.6.0_07 Java(TM) SE Runtime Environment (build 1.6.0_07-b06) Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode) Thank you very much Wilfred (I later assembled an application with Spring + Freemarker doing similar demonstration on the same Tomcat. When I repeatedly clicked add to cart, a cheese item did go to the cart on each click without breakdown no matter how quickly the repetition was. Weird) * Unexpected RuntimeException Root cause: java.lang.ClassNotFoundException: [Lmycheese.Cheese; at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) at org.apache.wicket.application.DefaultClassResolver.resolveClass(DefaultClassResolver.java:103) at org.apache.wicket.util.io.IObjectStreamFactory$1.resolveClass(IObjectStreamFactory.java:87) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480) at org.apache.wicket.Component.readObject(Component.java:4223) at java.lang.reflect.Method.invoke(Method.java:597) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323) at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351) at org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:393) at org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:228) at org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:706) at org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:311) at org.apache.wicket.Session.getPage(Session.java:751) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448) at org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1229) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1349) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:387) at
Possibility of mounting multiple pages on / and Custom URL coding strategy?
Hi, As part of my requirement, I have to create a custom url coding strategy for bookmarkable pages. The URLs should be like e.g. http://domain.com/somestr_[id].html. The problem I am facing is all the bookmarkable pages need to have a static mount string, which makes the URL to be http://domain.com/mount/somestr_[id].html. This sort of dictates using some other solution such as (urlrewrite or apache mod_rewrite) on top of custom url coding strategy. Digging little into the code seems like it may be possible to relax the requirement of letting only 1 page be mounted on / and let the matches() and encode()/decode() methods of the coding strategy generate proper internal request target urls. Is this doable? Can this be added as a requirement to the future releases? -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19244108.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: DataTable - tfoot before tbody?
Hi Eyal, When I look at FireBug, I see that the tfoot section of the table is BEFORE the tbody. Has anyone encountered this? Do I do something wrong? this is intented and required by the HTML spec: http://www.w3.org/TR/html4/struct/tables.html#h-11.2.3 Best regards, --- Jan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Possibility of mounting multiple pages on / and Custom URL coding strategy?
this is already possible, create your own irequestcycleprocessor -igor On Sun, Aug 31, 2008 at 10:16 AM, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, As part of my requirement, I have to create a custom url coding strategy for bookmarkable pages. The URLs should be like e.g. http://domain.com/somestr_[id].html. The problem I am facing is all the bookmarkable pages need to have a static mount string, which makes the URL to be http://domain.com/mount/somestr_[id].html. This sort of dictates using some other solution such as (urlrewrite or apache mod_rewrite) on top of custom url coding strategy. Digging little into the code seems like it may be possible to relax the requirement of letting only 1 page be mounted on / and let the matches() and encode()/decode() methods of the coding strategy generate proper internal request target urls. Is this doable? Can this be added as a requirement to the future releases? -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19244108.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]
@SpringBean injection -- why pretend?
Dear All -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
@SpringBean injection -- why pretend?
Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @SpringBean injection -- why pretend?
Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/%40SpringBean-injectionwhy-pretend--tp19244802p19244850.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: @SpringBean injection -- why pretend?
Are you planning on serialising your DAOs? No -- I mark them as transient. How will you mock out your Locator for unit tests? I didn't provide the implementation in the parent, but it's pretty obvious: /** Use for unit tests */ public static class MockLocator extends Locator { HashMapString, Object map= new HashMapString, Object(); Object find(String name) { return map.get(name); } public void put(String name, Object value) { map.put(name, value); } } class MyTest extends TestCase { void setUp() { MockLocator mockLocator= new MockLocator(); MyDAO dao= new MyDAO(...); mockLocator.put(dao, dao); Locator.register(mockLocator); } } Hope this makes sense. jWeekend wrote: Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - 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: @SpringBean injection -- why pretend?
The problem is keeping a reference to the service. Right, actually I skipped the transient keyword I use in my code: class MyPage { ... transient MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } transient prevents the field from being serialized. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? So, I will have to tell them to use the above pattern, just like telling them to use @SpringBean? Regardless, it seems that every engineer working with Wicket have to hit their serialization bump one day, as you hint in your book. We'll find out :-) Thanks for the book by the way. It made me go much faster. Martijn Dashorst wrote: Did you read http://cwiki.apache.org/WICKET/spring.html and see why @SpringBean is important? The problem is keeping a reference to the service. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? Martijn On Sun, Aug 31, 2008 at 8:23 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - 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: @SpringBean injection -- why pretend?
what happens after your page is serialized and deserialized, then dao is null... The dao field is supposed to be initialized again in the class constructor. Igor Vaynberg wrote: what happens after your page is serialized and deserialized, then dao is null... -igor On Sun, Aug 31, 2008 at 12:09 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: The problem is keeping a reference to the service. Right, actually I skipped the transient keyword I use in my code: class MyPage { ... transient MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } transient prevents the field from being serialized. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? So, I will have to tell them to use the above pattern, just like telling them to use @SpringBean? Regardless, it seems that every engineer working with Wicket have to hit their serialization bump one day, as you hint in your book. We'll find out :-) Thanks for the book by the way. It made me go much faster. Martijn Dashorst wrote: Did you read http://cwiki.apache.org/WICKET/spring.html and see why @SpringBean is important? The problem is keeping a reference to the service. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? Martijn On Sun, Aug 31, 2008 at 8:23 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @SpringBean injection -- why pretend?
class constructor is not called after deserialization... -igor On Sun, Aug 31, 2008 at 12:31 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: what happens after your page is serialized and deserialized, then dao is null... The dao field is supposed to be initialized again in the class constructor. Igor Vaynberg wrote: what happens after your page is serialized and deserialized, then dao is null... -igor On Sun, Aug 31, 2008 at 12:09 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: The problem is keeping a reference to the service. Right, actually I skipped the transient keyword I use in my code: class MyPage { ... transient MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } transient prevents the field from being serialized. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? So, I will have to tell them to use the above pattern, just like telling them to use @SpringBean? Regardless, it seems that every engineer working with Wicket have to hit their serialization bump one day, as you hint in your book. We'll find out :-) Thanks for the book by the way. It made me go much faster. Martijn Dashorst wrote: Did you read http://cwiki.apache.org/WICKET/spring.html and see why @SpringBean is important? The problem is keeping a reference to the service. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? Martijn On Sun, Aug 31, 2008 at 8:23 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @SpringBean injection -- why pretend?
If you mark that DAO as transient, what will happen after deserialising your page? Will you implement your own serialisation strategy to go with your home-made dependency injection mechanism? Are you just trying to avoid using Spring or do you just not like @SpringBean and the underlying Wicket proxying beneath the covers? FYI, it has worked fine for us. You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). But at the end of the day, one of the key features of a framework like Wicket is that you can do anything that Java lets you - so the choice is always yours. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Are you planning on serialising your DAOs? No -- I mark them as transient. How will you mock out your Locator for unit tests? I didn't provide the implementation in the parent, but it's pretty obvious: /** Use for unit tests */ public static class MockLocator extends Locator { HashMapString, Object map= new HashMapString, Object(); Object find(String name) { return map.get(name); } public void put(String name, Object value) { map.put(name, value); } } class MyTest extends TestCase { void setUp() { MockLocator mockLocator= new MockLocator(); MyDAO dao= new MyDAO(...); mockLocator.put(dao, dao); Locator.register(mockLocator); } } Hope this makes sense. jWeekend wrote: Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/%40SpringBean-injectionwhy-pretend--tp19244802p19245428.html Sent from the Wicket - User mailing list archive at Nabble.com. -
Re: Browser multiple tabs and page expired/class not found issues
This should work find if you version your pages. Can you make an jira issue with a sample? On 8/29/08, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, I have tried opening 2 IE 7 tabs (in the same brower window obviously), loading the same bookmarkable url in both the tabs. I then did some action which triggered ajax submit on one of the tabs and got the response back correctly, URL in the browser tab remained the same. so far so good. Now I tried to do some other action on the tab2 - I get Wicket Runtime exception, which changes everytime but basically get component not found http://localhost:8080/cart?wicket:interface=:4:viewCartContainer:cartForm::IFormSubmitListener:: WicketMessage: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]Root cause:org.apache.wicket.WicketRuntimeException: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19226058.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser multiple tabs and page expired/class not found issues
Was it bookmarkable URL or hybrid? -Matej On Sun, Aug 31, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: This should work find if you version your pages. Can you make an jira issue with a sample? On 8/29/08, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, I have tried opening 2 IE 7 tabs (in the same brower window obviously), loading the same bookmarkable url in both the tabs. I then did some action which triggered ajax submit on one of the tabs and got the response back correctly, URL in the browser tab remained the same. so far so good. Now I tried to do some other action on the tab2 - I get Wicket Runtime exception, which changes everytime but basically get component not found http://localhost:8080/cart?wicket:interface=:4:viewCartContainer:cartForm::IFormSubmitListener:: WicketMessage: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]Root cause:org.apache.wicket.WicketRuntimeException: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19226058.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Browser multiple tabs and page expired/class not found issues
By versioning you mean assigning serial version id? if yes - I have declared serialVersionUID for all the classes that are serializeable. I do not update the version # when I change the page - not sure if that is what you mean by versioning my pages. This errors occurred for the same session (IE multiple tabs seem to share the session for some reason). so I would think whatever version # was for the tab - have to be same for both. Johan Compagner wrote: This should work find if you version your pages. Can you make an jira issue with a sample? On 8/29/08, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, I have tried opening 2 IE 7 tabs (in the same brower window obviously), loading the same bookmarkable url in both the tabs. I then did some action which triggered ajax submit on one of the tabs and got the response back correctly, URL in the browser tab remained the same. so far so good. Now I tried to do some other action on the tab2 - I get Wicket Runtime exception, which changes everytime but basically get component not found http://localhost:8080/cart?wicket:interface=:4:viewCartContainer:cartForm::IFormSubmitListener:: WicketMessage: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]Root cause:org.apache.wicket.WicketRuntimeException: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19226058.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19246358.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: Browser multiple tabs and page expired/class not found issues
Actually, I was doing setResponsePage(new BookmarkablePage(new Pagepamaeters()) on the form submission. I realized later I shouldnt, since this makes the URL to have ?wicket:interface.. Shouldnt mounted bookmarkable pages - even though they are created using constructor have the mounted url format? I will try to create a sample app to reproduce the issue. Matej Knopp-2 wrote: Was it bookmarkable URL or hybrid? -Matej On Sun, Aug 31, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: This should work find if you version your pages. Can you make an jira issue with a sample? On 8/29/08, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, I have tried opening 2 IE 7 tabs (in the same brower window obviously), loading the same bookmarkable url in both the tabs. I then did some action which triggered ajax submit on one of the tabs and got the response back correctly, URL in the browser tab remained the same. so far so good. Now I tried to do some other action on the tab2 - I get Wicket Runtime exception, which changes everytime but basically get component not found http://localhost:8080/cart?wicket:interface=:4:viewCartContainer:cartForm::IFormSubmitListener:: WicketMessage: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]Root cause:org.apache.wicket.WicketRuntimeException: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19226058.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19246416.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: Possibility of mounting multiple pages on / and Custom URL coding strategy?
To implement resolve() for requestcycleprocessor, unfortunately I cannot get list of mounted pages to resolve them to respective requesttargets since IRequestTargetMountsInfo is optional and CryptedUrlWebRequestCodingStrategy doesnt implement it. Is there a way to get mount list which works no matter what requestcodingstrategy is? Note: my urls have to be http://domain.com/somestr_id.html and I have to use regular expressions to parse somestr_id to get the request target as there is no mount path. The only way I can do that (I think) is if I had access to all mounted pages with this url strategy. igor.vaynberg wrote: this is already possible, create your own irequestcycleprocessor -igor On Sun, Aug 31, 2008 at 10:16 AM, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, As part of my requirement, I have to create a custom url coding strategy for bookmarkable pages. The URLs should be like e.g. http://domain.com/somestr_[id].html. The problem I am facing is all the bookmarkable pages need to have a static mount string, which makes the URL to be http://domain.com/mount/somestr_[id].html. This sort of dictates using some other solution such as (urlrewrite or apache mod_rewrite) on top of custom url coding strategy. Digging little into the code seems like it may be possible to relax the requirement of letting only 1 page be mounted on / and let the matches() and encode()/decode() methods of the coding strategy generate proper internal request target urls. Is this doable? Can this be added as a requirement to the future releases? -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19244108.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19246476.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: Browser multiple tabs and page expired/class not found issues
no. only if you mount the pages using HybridUrlCodingStrategy. -Matej On Sun, Aug 31, 2008 at 11:37 PM, Ritesh Trivedi [EMAIL PROTECTED] wrote: Actually, I was doing setResponsePage(new BookmarkablePage(new Pagepamaeters()) on the form submission. I realized later I shouldnt, since this makes the URL to have ?wicket:interface.. Shouldnt mounted bookmarkable pages - even though they are created using constructor have the mounted url format? I will try to create a sample app to reproduce the issue. Matej Knopp-2 wrote: Was it bookmarkable URL or hybrid? -Matej On Sun, Aug 31, 2008 at 11:05 PM, Johan Compagner [EMAIL PROTECTED] wrote: This should work find if you version your pages. Can you make an jira issue with a sample? On 8/29/08, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, I have tried opening 2 IE 7 tabs (in the same brower window obviously), loading the same bookmarkable url in both the tabs. I then did some action which triggered ajax submit on one of the tabs and got the response back correctly, URL in the browser tab remained the same. so far so good. Now I tried to do some other action on the tab2 - I get Wicket Runtime exception, which changes everytime but basically get component not found http://localhost:8080/cart?wicket:interface=:4:viewCartContainer:cartForm::IFormSubmitListener:: WicketMessage: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()]Root cause:org.apache.wicket.WicketRuntimeException: component viewCartContainer:cartForm not found on page com.neobits.web.pages.ViewCartPage[id = 4], listener interface = [RequestListenerInterface name=IFormSubmitListener, method=public abstract void org.apache.wicket.markup.html.form.IFormSubmitListener.onFormSubmitted()] at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveListenerInterfaceTarget(AbstractRequestCycleProcessor.java:416) at org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:461) -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19226058.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Browser-multiple-tabs-and-page-expired-class-not-found-issues-tp19226058p19246416.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: Possibility of mounting multiple pages on / and Custom URL coding strategy?
if you implement your own request cycle processor you dont need to mount anything, just check the url and resolve it to a request target of your choice. -igor On Sun, Aug 31, 2008 at 2:47 PM, Ritesh Trivedi [EMAIL PROTECTED] wrote: To implement resolve() for requestcycleprocessor, unfortunately I cannot get list of mounted pages to resolve them to respective requesttargets since IRequestTargetMountsInfo is optional and CryptedUrlWebRequestCodingStrategy doesnt implement it. Is there a way to get mount list which works no matter what requestcodingstrategy is? Note: my urls have to be http://domain.com/somestr_id.html and I have to use regular expressions to parse somestr_id to get the request target as there is no mount path. The only way I can do that (I think) is if I had access to all mounted pages with this url strategy. igor.vaynberg wrote: this is already possible, create your own irequestcycleprocessor -igor On Sun, Aug 31, 2008 at 10:16 AM, Ritesh Trivedi [EMAIL PROTECTED] wrote: Hi, As part of my requirement, I have to create a custom url coding strategy for bookmarkable pages. The URLs should be like e.g. http://domain.com/somestr_[id].html. The problem I am facing is all the bookmarkable pages need to have a static mount string, which makes the URL to be http://domain.com/mount/somestr_[id].html. This sort of dictates using some other solution such as (urlrewrite or apache mod_rewrite) on top of custom url coding strategy. Digging little into the code seems like it may be possible to relax the requirement of letting only 1 page be mounted on / and let the matches() and encode()/decode() methods of the coding strategy generate proper internal request target urls. Is this doable? Can this be added as a requirement to the future releases? -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19244108.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Possibility-of-mounting-multiple-pages-on---and-Custom-URL-coding-strategy--tp19244108p19246476.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]
[OT] Wicket in Action Woes
I called my local Barnes Noble today asking if they had a copy of WIA and the lady said that book is out of print; perhaps you can get one used through BN.com. The Waldenbooks in our mall said it was on back order (I'm assuming this is because of my two talks I gave to the Cincinnati Java Users Group). Is anyone else having issues getting a copy at brick and mortar stores? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: @SpringBean injection -- why pretend?
class constructor is not called after deserialization... Oops, I didn't know that :-$ In this case, I will need to use extra indirection; still pretty straightforward: class MyPage ... { ... LocatableMyDAO dao= new LocatableMyDAO(myDAO, MyDAO.class); ... dao.get().findSomething() }; I have JUnit test that successfully tests the serialization/deserialization of this thing. Can share the code if there is interest. Thanks for the feedback and for the great framework. Igor Vaynberg wrote: class constructor is not called after deserialization... -igor On Sun, Aug 31, 2008 at 12:31 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: what happens after your page is serialized and deserialized, then dao is null... The dao field is supposed to be initialized again in the class constructor. Igor Vaynberg wrote: what happens after yo ur page is serialized and deserialized, then dao is null... -igor On Sun, Aug 31, 2008 at 12:09 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: The problem is keeping a reference to the service. Right, actually I skipped the transient keyword I use in my code: class MyPage { ... transient MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } transient prevents the field from being serialized. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? So, I will have to tell them to use the above pattern, just like telling them to use @SpringBean? Regardless, it seems that every engineer working with Wicket have to hit their serialization bump one day, as you hint in your book. We'll find out :-) Thanks for the book by the way. It made me go much faster. Martijn Dashorst wrote: Did you read http://cwiki.apache.org/WICKET/spring.html and see why @SpringBean is important? The problem is keeping a reference to the service. You might be good enough to understand that, but how good do you trust your co-workers, and even new members joining your team? Martijn On Sun, Aug 31, 2008 at 8:23 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) { // TODO implement return null; } } public staticT T find(String name, ClassT clazz) { Object found= locator.find(name); if (found==null) return null; return clazz.cast(found); } } --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL
Re: @SpringBean injection -- why pretend?
On Sun, Aug 31, 2008 at 3:44 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). We will see, but so far I have a solution that is under 100 LOC, works for me and saves me from debugging in the internals of CGLib. how does springbean require you to debug cglib internals? LocatableMyDAO dao= new LocatableMyDAO(myDAO, MyDAO.class); LocatableMyDAO2 dao= new LocatableMyDAO2(myDAO2, MyDAO2.class); vs @SpringBean MyDAO dao; @SpringBean MyDAO2 dao2; i still like springbean :) also, considering most of the frameworks use cglib anyways (spring, hibernate, etc) you dont really win anything... -igor I will still report the parent problem when I have time to compose a test case. Thanks for your feedback, -- Sasha jWeekend wrote: If you mark that DAO as transient, what will happen after deserialising your page? Will you implement your own serialisation strategy to go with your home-made dependency injection mechanism? Are you just trying to avoid using Spring or do you just not like @SpringBean and the underlying Wicket proxying beneat h the covers? FYI, it has worked fine for us. You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). But at the end of the day, one of the key features of a framework like Wicket is that you can do anything that Java lets you - so the choice is always yours. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Are you planning on serialising your DAOs? No -- I mark them as transient. How will you mock out your Locator for unit tests? I didn't provide the implementation in the parent, but it's pretty obvious: /** Use for unit tests */ public static class MockLocator extends Locator { HashMapString, Object map= new HashMapString, Object(); Object find(String name) { return map.get(name); } public void put(String name, Object value) { map.put(name, value); } } class MyTest extends TestCase { void setUp() { MockLocator mockLocator= new MockLocator(); MyDAO dao= new MyDAO(...); mockLocator.put(dao, dao); Locator.register(mockLocator); } } Hope this makes sense. jWeekend wrote: Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator { @Override Object find(String name) {
Re: @SpringBean injection -- why pretend?
Igor -- Here is what I had: class Bean1 {...} class Bean2 { public Bean2(Bean1 bean1) {} } Spring config: bean name=bean1 class=Bean1/ bean name=bean2 class=Bean2 constructor-arg name=bean1 ref=bean1/ /bean class MyPanel extends Panel { ... @SpringBean Bean2 bean2; ... } The problem was that bean2 could not initialize, it was looking for empty constructor which the class didn't have and failed. I tried using property initialization but ended up with null value for Bean1 and methods of bean2 were failing with NPE. I had another group of beans like that in the program which was working fine. Another thing that got me scared was that the initializer for Bean1 got called twice: once on application initialization and once on initialization of the page. I spent some time within initialization code, CGLib and such and figured I needed much more time to figure out what's happening there. I will report more on this problem when I have time to assemble test case. I have workaround now and I am on to the next problem -- see my separate email. Thanks, -- Sasha Igor Vaynberg wrote: On Sun, Aug 31, 2008 at 3:44 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). We will see, but so far I have a solution that is under 100 LOC, works for me and saves me from debugging in the internals of CGLib. how does springbean require you to debug cglib internals? LocatableMyDAO dao= new LocatableMyDAO(myDAO, MyDAO.class); LocatableMyDAO2 dao= new LocatableMyDAO2(myDAO2, MyDAO2.class); vs @SpringBean MyDAO dao; @SpringBean MyDAO2 dao2; i still like springbean :) also, considering most of the frameworks use cglib anyways (spring, hibernate, etc) you dont really win anything... -igor I will still report the parent problem when I have time to compose a test case. Thanks for your feedback, -- Sasha jWeekend wrote: If you mark that DAO as transient, what will happen after deserialising your page? Will you implement your own serialisation strategy to go with your home-made dependency injection mechanism? Are you just trying to avoid using Spring or do you just not like @SpringBean and the underlying Wicket proxying beneat h the covers? FYI, it has worked fine for us. You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). But at the end of the day, one of the key features of a framework like Wicket is that you can do anything that Java lets you - so the choice is always yours. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Are you planning on serialising your DAOs? No -- I mark them as transient. How will you mock out your Locator for unit tests? I didn't provide the implementation in the parent, but it's pretty obvious: /** Use for unit tests */ public static class MockLocator extends Locator { HashMapString, Object map= new HashMapString, Object(); Object find(String name) { return map.get(name); } public void put(String name, Object value) { map.put(name, value); } } class MyTest extends TestCase { void setUp() { MockLocator mockLocator= new MockLocator(); MyDAO dao= new MyDAO(...); mockLocator.put(dao, dao); Locator.register(mockLocator); } } Hope this makes sense. jWeekend wrote: Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to
Re: AjaxFallbackDefaultDataTable - goto page number on return from another page
Anyone know how to solve this? Thanks. steviezz wrote: Wicket 1.3.4. I have a Page (ThingListing) containing an AjaxFallbackDefaultDataTable - created like: private WebMarkupContainer listContainer = new WebMarkupContainer(listContainer); private MySortableDealProvider dataProvider; private Thing thing = null; public ThingListing(PageParameters params) { // this is a reload from the CRUD page if (params != null) { setThing(getThingManager().findById(params.getString(thingId))); } // else load everything ... dataProvider = new SortableDealDataProvider(getThingManager(), thing); String sort = params.getString(sort); Boolean isAscending = params.getBoolean(ascending); dataProvider.setSort(sort, isAscending); ... listContainer.add(new AjaxFallbackDefaultDataTable(mything, columns, dataProvider, TABLE_ROWS)); I add an AbstractColumn to the AjaxFallbackDefaultDataTable to handle forwarding to a page to do CRUD work on the selected item from the table - like : columns.add(new AbstractColumn(new Model(Edit)) { public void populateItem(Item cellItem, String componentId, IModel model) { cellItem.add(new ActionPanel(componentId, model)); } public String getCssClass() { return edit; } }); class ActionPanel extends Panel { public ActionPanel(String id, IModel model) { super(id, model); add(new Link(edit) { public void onClick() { Integer thingId = ((Thing) getParent().getModelObject()).getId(); PageParameters params = new PageParameters(); params.put(thingId, thingId); params.put(sort, dataProvider.getSort().getProperty()); params.put(ascending, dataProvider.getSort().isAscending()); setResponsePage(ThingEdit.class, params); } }); } } Note - I am attempting to pass the id of the selected row in the table, plus the sort column, and the ascending direction to the CRUD page. The ThingEdit CRUD page takes all the page params from the ThingListing page, does normal CRUD work, then passes back all the params back into the main listing page constructor so that when the listing page reloads, it maintains its state (main selection criteria, sort column, sort order) from the page the user selected before triggering the CRUD page - eg: public class ThingEdit { private PageParameters pageParams; public ThingEdit(PageParameters p) { pageParams = p; ... } ... private void addCancelButton(Form form) { Button cancel = new Button(cancelbutton) { public void onSubmit() { setResponsePage(ThingListing.class, pageParams); } }; cancel.setDefaultFormProcessing(false); form.add(cancel); } However, I can't work out how to go back to the page number that the user was on before he loaded the CRUD page. That is, if the user was on page 3 of 20, then after clicking a record to edit goes to the CRUD page, then he goes back to the listing the correct order and sort are maintaine, but he's always at page 1 of 20 instead of page 3. I have tried manually setting the ThingSortableDataProvider.iterator() first and count and with additional page params - but this just ends up with it being called twice - once with my page params, and again by the default 0 and count. So, any way to make this work? I think am probably still missing the point with Wicket (can't really get my head around Models) and revert to attempting to use page params and manually adding to session to pass data from one page to another and back again. Steve -- View this message in context: http://www.nabble.com/AjaxFallbackDefaultDataTable---goto-page-number-on-return-from-another-page-tp18744983p19247459.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: @SpringBean injection -- why pretend?
Sasha, If you have time to make a minimal http://wicket.apache.org/quickstart.html quickstart project that demonstrates the issue you might find that you can save yourself 100 LOC, or at least that someone here will spot what's not right and then you can make your decision. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Cemal -- If you mark that DAO as transient, what will happen after deserialising your page? Will you implement your own serialisation strategy to go with your home-made dependency injection mechanism? By using little extra indirection we can solve this, too -- see my other email to the list. You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). We will see, but so far I have a solution that is under 100 LOC, works for me and saves me from debugging in the internals of CGLib. I will still report the parent problem when I have time to compose a test case. Thanks for your feedback, -- Sasha jWeekend wrote: If you mark that DAO as transient, what will happen after deserialising your page? Will you implement your own serialisation strategy to go with your home-made dependency injection mechanism? Are you just trying to avoid using Spring or do you just not like @SpringBean and the underlying Wicket proxying beneat h the covers? FYI, it has worked fine for us. You may end up with a solution that is quite convoluted, hard to learn/maintain, less elegant and hard to get just right in all cases (for example testing, serialization/deserialisation etc...). But at the end of the day, one of the key features of a framework like Wicket is that you can do anything that Java lets you - so the choice is always yours. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Are you planning on serialising your DAOs? No -- I mark them as transient. How will you mock out your Locator for unit tests? I didn't provide the implementation in the parent, but it's pretty obvious: /** Use for unit tests */ public static class MockLocator extends Locator { HashMapString, Object map= new HashMapString, Object(); Object find(String name) { return map.get(name); } public void put(String name, Object value) { map.put(name, value); } } class MyTest extends TestCase { void setUp() { MockLocator mockLocator= new MockLocator(); MyDAO dao= new MyDAO(...); mockLocator.put(dao, dao); Locator.register(mockLocator); } } Hope this makes sense. jWeekend wrote: Are you planning on serialising your DAOs? How will you mock out your Locator for unit tests? Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk Sasha O-2 wrote: Dear All -- I was having an issue with @SpringBean injection -- my dao class was not initialized properly with the dependent beans. I spent some time exploring internals of CGLib and Spring Injections and then a thought struck me: how really helpful is this injection? Consider this code: class MyPage extends Page { ... @SpringBean MyDAO dao; ... } vs. this code: class MyPage { ... MyDAO dao= Locator.find(myDAO, MyDAO.class); ... } The Locator is a pretty straightforward guy who pulls ApplicationContext out of thin air^ThreadLocal variable and looks up on it, see the example code below. The former uses annotations, CGLIB and delicate injection. The latter uses nothing and is a lot simpler and robust. Aside from marginal savings in typing I couldn't find any advantages of the former approach. Can you? Unless convinced otherwise, I am going to skip the @SpringBean altogether and use the Locator thing in my application. Thanks, -- Sasha --- public abstract class Locator { abstract Object find(String name); static Locator locator= null; public static Locator register(Locator inLocator) { Locator result= locator; locator= inLocator; return result; } public static class SpringLocator extends Locator { ApplicationContext context= WebApplicationContextUtils.getRequiredWebApplicationContext( WebApplication.get().getServletContext()); Object find(String name) { return context.getBean(name); } } /** To be called in the application initialization */ public static void registerSpringLocator() { register(new SpringLocator()); } /** Use for unit tests */ public static class MockLocator extends Locator
Re: Crystal Report
Hello, Yah, Cryastal Report has some concurrent process licensing issue. i just encountered it in the project where I'm supporting to. It is such pain in the ass that we don't know what going wrong until we found that freaking CPL issue. Nwei, im encouraging the PM of next project I'm into to use jasper instead but client is using crystal report for their current app's. So there is a struggle between. But just in case we use crystal report, i might post again for help. Thanks a lot. Cheers. msc65jap wrote: Yeah, I have with a Wicket app. that serves Crystal Reports XI reports. I scrapped using its J2EE business connector and, instead, wrote the reports in PDF format to the local filesystem and emailed them to user. I would recommend doing this asynchronously because of the expensive I/O costs. You don't have to email them but I had to do as it was my use case. Crystal Reports API is a big pain in the backside so good luck! Best, James. On Fri, Aug 29, 2008 at 11:24 AM, freak182 [EMAIL PROTECTED] wrote: Hello, Does anyone here had encountered using crystal report with wicket as a reporting tool? Any idea how to integrate crystal report? I already know how to integrate jasper. Thanks a lot. Cheers. -- View this message in context: http://www.nabble.com/Crystal-Report-tp19217374p19217374.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Crystal-Report-tp19217374p19247719.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: @SpringBean injection -- why pretend?
Sasha, Does the trace at the end of this note, in my PS, look familiar? Now try the following code (notice the addition and use of the IBean2 interface) - things should work once you make the type of the reference in your component (a Page in this case) the interface. If you can't do that on your project (eg Bean2 is from a 3rd party library) then we'll have to take another look. Does that help? bean id=bean1 class=scratch.springbean.Bean1/ bean id=bean2 class=scratch.springbean.Bean2constructor-arg ref=bean1//bean === public class SpringBeanPage extends WebPage{ @SpringBean IBean2 bean2; public SpringBeanPage() { add(new Label(sprung,bean2.getBean1().name)); } } public class Bean1 { public String name; @Override public String toString() { return name; } } === public class Bean2 implements IBean2 { public Bean1 bean1; protected Bean2(Bean1 bean1) { super(); this.bean1 = bean1; bean1.name = Sprung; } public Bean1 getBean1() { return bean1; } public void setBean1(Bean1 bean1) { this.bean1 = bean1; } } Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk PS Is this similar to the exception you saw? org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public scratch.springbean.SpringBeanPage() at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149) ... 29 more Caused by: java.lang.RuntimeException: error while injecting object [[Page class = scratch.springbean.SpringBeanPage, id = 0, version = 0]] of type [scratch.springbean.SpringBeanPage] at org.apache.wicket.injection.Injector.inject(Injector.java:118) at org.apache.wicket.injection.ConfigurableInjector.inject(ConfigurableInjector.java:39)
Re: @SpringBean injection problem
Cemal -- Thanks, the trace indeed looks familiar. I will try the suggestion to make Bean2 an interface. I will also try to distill a test from this problem. Will let you know. Thanks, -- Sasha jWeekend wrote: Sasha, Does the trace at the end of this note, in my PS, look familiar? Now try the following code (notice the addition and use of the IBean2 interface) - things should work once you make the type of the reference in your component (a Page in this case) the interface. If you can't do that on your project (eg Bean2 is from a 3rd party library) then we'll have to take another look. Does that help? bean id=bean1 class=scratch.springbean.Bean1/ bean id=bean2 class=scratch.springbean.Bean2constructor-arg ref=bean1//bean === public class SpringBeanPage extends WebPage{ @SpringBean IBean2 bean2; public SpringBeanPage() { add(new Label(sprung,bean2.getBean1().name)); } } public class Bean1 { public String name; @Override public String toString() { return name; } } === public class Bean2 implements IBean2 { public Bean1 bean1; protected Bean2(Bean1 bean1) { super(); this.bean1 = bean1; bean1.name = Sprung; } public Bean1 getBean1() { return bean1; } public void setBean1(Bean1 bean1) { this.bean1 = bean1; } } Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk PS Is this similar to the exception you saw? org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public scratch.springbean.SpringBeanPage() at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:149) ... 29 more Caused by: java.lang.RuntimeException: error while injecting object [[Page class = scratch.springbean.SpringBeanPage, id = 0, version
Re: @SpringBean injection problem
this isnt really wicket-specific. this is just something you need to be aware of when dealing with IOC containers. if you wanted to eg have transactional methods on this bean you would run into the same problem as spring would try to create a proxy of your class to manage transactions (unless you were using direct bytecode weaving...) -igor On Sun, Aug 31, 2008 at 6:45 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Cemal -- Thanks, the trace indeed looks familiar. I will try the suggestion to make Bean2 an interface. I will also try to distill a test from this problem. Will let you know. Thanks, -- Sasha jWeekend wrote: Sasha, Does the trace at the end of this note, in my PS, look familiar? Now try the following code (notice the addition and use of the IBean2 interface) - things should work once you make the type of the reference in your component (a Page in this case) the interface. If you can't do that on your project (eg Bean2 is from a 3rd party library) then we'll have to take another look. Does that help? bean id=bean1 class=scratch.springbean.Bean1/ bean id=bean2 class=scratch.springbean.Bean2constructor-arg ref=bean1//bean === public class SpringBeanPage extends WebPage{ @SpringBean IBean2 bean2; public SpringBeanPage() { add(new Label(sprung,bean2.getBean1().name)); } } public class Bean1 { public String name; @Override public String toString() { return name; } } === public class Bean2 implements IBean2 { public Bean1 bean1; protected Bean2(Bean1 bean1) { super(); this.bean1 = bean1; bean1.name = Sprung; } public Bean1 getBean1() { return bean1; } public void setBean1(Bean1 bean1) { this.bean1 = bean1; } } Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk PS Is this similar to the exception you saw? org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public scratch.springbean.SpringBeanPage() at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Re: ResourceStreamLocator is not testable using WicketTester?
Sasha, This was fixed recently. Try again with SNAPSHOT. Regards - Cemal http://jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Hi again -- I set custom ResourceStreamLocator in my application but when I test using WicketTester my custom ResourceStreamLocator is not getting called. As a result, I am not able to test my pages using JUnit. I enclose a project made from QuickStart which demonstrates the problem. Run the test case to see that the custom ResourceStreamLocator is not getting called. Thanks for any ideas/suggestions. -- Sasha - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/ResourceStreamLocator-is-not-testable-using-WicketTester--tp19248105p19248378.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: @SpringBean injection problem went away
Igor and all -- I also had this problem when using default constructor and initialization by properties. OTOH I have Hibernate DAO classes using transactions, and they work fine. Good news, the problem went away when I broke the Bean1-Bean2 chain because of application reasons. If/when the problem reappears, I will try to report in more detail. Thanks everyone for your help, -- Sasha Igor Vaynberg wrote: this isnt really wicket-specific. this is just something you need to be aware of when dealing with IOC containers. if you wanted to eg have transactional methods on this bean you would run into the same problem as spring would try to create a proxy of your class to manage transactions (unless you were using direct bytecode weaving...) -igor On Sun, Aug 31, 2008 at 6:45 PM, Sasha Ovsankin [EMAIL PROTECTED] wrote: Cemal -- Thanks, the trace indeed looks familiar. I will try the suggestion to make Bean2 an interface. I will also try to distill a test from this problem. Will let you know. Thanks, -- Sasha jWeekend wrote: Sasha, Does the trace at the end of this note, in my PS, look familiar? Now try the following code (notice the addition and use of the IBean2 interface) - things should work once you make the type of the reference in your component (a Page in this case) the interface. If you can't do that on your project (eg Bean2 is from a 3rd party library) then we'll have to take another look. Does that help? bean id=bean1 class=scratch.springbean.Bean1/ bean id=bean2 class=scratch.springbean.Bean2constructor-arg ref=bean1//bean === public class SpringBeanPage extends WebPage{ @SpringBean IBean2 bean2; public SpringBeanPage() { add(new Label(sprung,bean2.getBean1().name)); } } public class Bean1 { public String name; @Override public String toString() { return name; } } === public class Bean2 implements IBean2 { public Bean1 bean1; protected Bean2(Bean1 bean1) { super(); this.bean1 = bean1; bean1.name = Sprung; } public Bean1 getBean1() { return bean1; } public void setBean1(Bean1 bean1) { this.bean1 = bean1; } } Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk PS Is this similar to the exception you saw? org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor public scratch.springbean.SpringBeanPage() at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:168) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:58) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:262) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:283) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:210) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:91) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1166) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1243) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331) at org.apache.wicket.RequestCycle.request(RequestCycle.java:493) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at
how to mark wicket html response as cacheable?
i want to set my html with last modified date in order to allow client side caching how can we do that in wicket? or we need to manipulate the response header directly? -- View this message in context: http://www.nabble.com/how-to-mark-%22wicket-html-response%22-as-%22cacheable%22--tp19248592p19248592.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: how to mark wicket html response as cacheable?
One way is to override WebPage's setHeaders(WebResponse response) method and call setHeader on the passed in WebResponse. Regards - Cemal http://www.jWeekend.co.uk http://jWeekend.co.uk ywtsang wrote: i want to set my html with last modified date in order to allow client side caching how can we do that in wicket? or we need to manipulate the response header directly? -- View this message in context: http://www.nabble.com/how-to-mark-%22wicket-html-response%22-as-%22cacheable%22--tp19248592p19248671.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: ResourceStreamLocator is not testable using WicketTester?
Cemal -- Thanks, I found the https://issues.apache.org/jira/browse/WICKET-1737 . Will try to upgrade. Thanks, -- Sasha jWeekend wrote: Sasha, This was fixed recently. Try again with SNAPSHOT. Regards - Cemal http://jWeekend.co.uk http://jWeekend.co.uk Sasha Ovsankin wrote: Hi again -- I set custom ResourceStreamLocator in my application but when I test using WicketTester my custom ResourceStreamLocator is not getting called. As a result, I am not able to test my pages using JUnit. I enclose a project made from QuickStart which demonstrates the problem. Run the test case to see that the custom ResourceStreamLocator is not getting called. Thanks for any ideas/suggestions. -- Sasha - 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: [OT] Wicket in Action Woes
Amazon says that it ist to be published on Sept. 28. It's the seond time that the publishing date moved towards the end oft he year. Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von James Carman Gesendet: Montag, 1. September 2008 00:24 An: users@wicket.apache.org Betreff: [OT] Wicket in Action Woes I called my local Barnes Noble today asking if they had a copy of WIA and the lady said that book is out of print; perhaps you can get one used through BN.com. The Waldenbooks in our mall said it was on back order (I'm assuming this is because of my two talks I gave to the Cincinnati Java Users Group). Is anyone else having issues getting a copy at brick and mortar stores? - 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: [OT] Wicket in Action Woes
I have no idea. Martijn and I (or rather, my parents in Holland) received a bunch of paper copies, so the actual book *is* out. Eelco On Sun, Aug 31, 2008 at 9:56 PM, Stefan Lindner [EMAIL PROTECTED] wrote: Amazon says that it ist to be published on Sept. 28. It's the seond time that the publishing date moved towards the end oft he year. Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von James Carman Gesendet: Montag, 1. September 2008 00:24 An: users@wicket.apache.org Betreff: [OT] Wicket in Action Woes I called my local Barnes Noble today asking if they had a copy of WIA and the lady said that book is out of print; perhaps you can get one used through BN.com. The Waldenbooks in our mall said it was on back order (I'm assuming this is because of my two talks I gave to the Cincinnati Java Users Group). Is anyone else having issues getting a copy at brick and mortar stores? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Wicket in Action Woes
Why hasn't manning shipped the book then...? --rob Eelco Hillenius wrote: I have no idea. Martijn and I (or rather, my parents in Holland) received a bunch of paper copies, so the actual book *is* out. Eelco On Sun, Aug 31, 2008 at 9:56 PM, Stefan Lindner [EMAIL PROTECTED] wrote: Amazon says that it ist to be published on Sept. 28. It's the seond time that the publishing date moved towards the end oft he year. Stefan -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von James Carman Gesendet: Montag, 1. September 2008 00:24 An: users@wicket.apache.org Betreff: [OT] Wicket in Action Woes I called my local Barnes Noble today asking if they had a copy of WIA and the lady said that book is out of print; perhaps you can get one used through BN.com. The Waldenbooks in our mall said it was on back order (I'm assuming this is because of my two talks I gave to the Cincinnati Java Users Group). Is anyone else having issues getting a copy at brick and mortar stores? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]