Unauthorized page instantiation, why does it occur and how to prevent it?
Hi! I get lots of these exceptions when persumably people use our application in produciton from bookmarks pointing to dynamic links and their session is out. How can this happen? The particular page requires authentiacation which is handled via AbstractPageAuthorizationStrategy#isPageAuthorized(java.lang.Class) It should not be possible to instantiate this page at all because the nullpointer is caused by session.getPerson().getStatus() and authentication is determined via session.getPerson() != null. So this page by definition cannot be authorized to a user without session. How is this exception possible? 010-07-09 09:36:46,388 60568417 [17723...@qtp-7525870-352] ERROR RequestCycle - unexpected exception when handling another exception: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] at org.apache.wicket.Component.renderComponent(Component.java:2658) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:80) at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) at org.apache.wicket.Page.onRender(Page.java:1565) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.Page.renderPage(Page.java:914) at org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1267) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1334) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389) 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:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.NullPointerException at com.mycompany.application.PanelOnMainPage.renderHead(PanelOnMainPage.java:357) at org.apache.wicket.Component.renderHead(Component.java:2692) at org.apache.wicket.markup.html.panel.Panel.renderHead(Panel.java:138) at org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:231) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:878) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:918) at org.apache.wicket.markup.html.internal.HtmlHeaderContainer.renderHeaderSections(HtmlHeaderContainer.java:222) at
Re: Unauthorized page instantiation, why does it occur and how to prevent it?
Or is it possible that this is an OLD instance of a page (in PAGEMAP) and it is being rendered even if user is no longer authorized??? How can this be legal? Is it a bug or am I missing a setting somewhere? ** Martin 2010/7/9 Martin Makundi martin.maku...@koodaripalvelut.com: Hi! I get lots of these exceptions when persumably people use our application in produciton from bookmarks pointing to dynamic links and their session is out. How can this happen? The particular page requires authentiacation which is handled via AbstractPageAuthorizationStrategy#isPageAuthorized(java.lang.Class) It should not be possible to instantiate this page at all because the nullpointer is caused by session.getPerson().getStatus() and authentication is determined via session.getPerson() != null. So this page by definition cannot be authorized to a user without session. How is this exception possible? 010-07-09 09:36:46,388 60568417 [17723...@qtp-7525870-352] ERROR RequestCycle - unexpected exception when handling another exception: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] at org.apache.wicket.Component.renderComponent(Component.java:2658) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:80) at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) at org.apache.wicket.Page.onRender(Page.java:1565) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.Page.renderPage(Page.java:914) at org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1267) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1334) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389) 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:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by: java.lang.NullPointerException at com.mycompany.application.PanelOnMainPage.renderHead(PanelOnMainPage.java:357) at org.apache.wicket.Component.renderHead(Component.java:2692) at org.apache.wicket.markup.html.panel.Panel.renderHead(Panel.java:138) at org.apache.wicket.markup.html.internal.HtmlHeaderContainer$1.component(HtmlHeaderContainer.java:231) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:878) at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:893) at
Re Refreshing a DropDownChoice - CRUD Pattern
Hi All, I have an issue with refreshing a DropDownChoice control. I would like the dropdown to have the Choose One option aevery time I want to a particular action like Create new account etc. I think it is how I designed my CRUD pattern, that I have this issue. Would like to get your ideas/suggestions on a standard pattern for CRUD. The one I am using now is as follows. Please comment on it so I can correct it. The hierarchy of the controls are as follows. *ContainerPanel*: Acts as a container to house the *SearchPanel* When the *ContainerPanel* is constructed, I create an instance of * SearchPanel*. As part of the *SearchPanel* construction a) I create instances of *DetailPanel* and set the visibility to false. b) I create an instance of *SearchResultListPanel* c) The *DetailPanel* and *SearchResultListPanel* instances are added into * SearchPanel*'s SearchForm(extends Form) instance . When I click on *New* button on *SearchPanel* and as part of the onSubmit() event I make the *DetailsPanel* visible.On the Details panel for the first time the DropDownChoice is renderd correctly with *Choose One* as the default option. - After I create an entity via the *DetailsPanel*, I click on *New* again on the *SearchPanel*,i.e to create a another entity. This time the dropdown choice control does not have the Choose One option. I understand that the list is not in a refreshed state. How can I get around this problem other than re-populating it. I had a similar issue on the SearchPanel when I clicked Reset button, but resolved it using *clearInput*() followed by *updateFormComponentModels()*;, now this is within the particular Form constructor so I was able to access the updateFormComponentModels(). Whereas now, the DropdownChoice is part of the DetailsPanel form instance and updateFormComponentModel is protected.( its not visible from SearchPanel) Appreicate your time, Thank you Regards Niv
AW: AW: Serialization of injected EJBs
Ok, I see what you mean and I think that would work. Only I'm not so sure about the couple of hours (have you looked at CDI BeanManager...?) and with that approach, I would end up having 3 proxies between my Wicket component and my EJB. Anyway, this is probably faster to implement than waiting for a solution from Glassfish... Best regards, Harald -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 8. Juli 2010 21:45 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs hrm, if thats the case you can always use wicket-ioc module to build the proxy yourself just like we do for spring and guice, it should only be a couple of hours effort. -igor On Thu, Jul 8, 2010 at 10:34 AM, Harald Wellmann harald.wellm...@multi-m.de wrote: In theory, yes... The proxies returned by Weld 1.0.1.SP3 (the version used in Glassfish 3.0.1) are serializable, but after serializing and deserializing the proxy, the method handler is broken and you get a null pointer exception when invoking any method of the proxy. i verified this in a simple test case, independent of Wicket. This looks like the problem fixed in https://jira.jboss.org/browse/JASSIST-97, though I'm not fully sure that this is exactly the same issue. Anyway, I patched my Glassfish version with the most recent release of Javassist containing the bugfix. With this fix, I already get a NotSerializableException from Wicket when the current page is about to be moved to the page store: protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] - field that is not serializable It seems that the stateless session bean implementation is wrapped in at least two proxies, one generated by Glassfish (for getting the session bean into the CDI context, equivalent to @EJB injection) and another one, generated by Weld using Javassist, filling the @Inject injection point in my Wicket component. The outer proxy is ok with the newer Javassist version, but the inner proxy simply is not serializable because of EJBLocalObjectInvocationHandlerDelegate. Using @EJB instead of @Inject, I just get the inner proxy, with the same problem caused by EJBLocalObjectInvocationHandlerDelegate. So my impression is that Glassfish simply breaks the contract of my serializable session bean interface. On the other hand, I wouldn't be surprised if there was a paragraph somewhere in the Java EE specs stating that EJBs shall not be serialized by the application (i.e. Wicket) because the container takes care of passivation anyway... Has anybody tried Wicket+CDI+EJB on other app servers? (There aren't so many supporting Java EE 6) Regards, Harald Von: Igor Vaynberg [igor.vaynb...@gmail.com] Gesendet: Donnerstag, 8. Juli 2010 17:54 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs im not sure if this is in a CDI spec or not, but afaik Weld will return serializable proxies when you manually inject objects. so that should work out of the box. -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: Serialization of injected EJBs
I am not sure if this is related but AFAIR we faced a similar problem with GlassFish V2.1 and determined the root cause of this to https://issues.apache.org/jira/browse/WICKET-2416 The exception stack trace may be different in V3 so I am not sure if it is same issue. Regards, Kulbhushan -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Serialization-of-injected-EJBs-tp2281001p2283172.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Serialization of injected EJBs
Thanks for pointing this out, however, I think it's a related but different issue. I did not notice any classloader problems in my case, and anyway, we deploy our entire application (web pages, EJBs and entity classes) in a single WAR. Regards, Harald -Ursprüngliche Nachricht- Von: kbs [mailto:kbs_kulbhus...@yahoo.com] Gesendet: Freitag, 9. Juli 2010 09:17 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs I am not sure if this is related but AFAIR we faced a similar problem with GlassFish V2.1 and determined the root cause of this to https://issues.apache.org/jira/browse/WICKET-2416 The exception stack trace may be different in V3 so I am not sure if it is same issue. Regards, Kulbhushan - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket wicket-contrib-tinymce populate Styles drop-down
I'm sort of dubious about your suggestion as I don't see any direct connection between this DropDownChoice and TinyMCE editor from wicket-contrib-tinymce. Would you care to explain little more about integration? Peter From: Pedro Santos pedros...@gmail.com To: users@wicket.apache.org Sent: Thu, July 8, 2010 5:09:08 PM Subject: Re: Wicket wicket-contrib-tinymce populate Styles drop-down Hi, you can use an DropDownChoice to present the available styles for your app, and allow user to select one. Example: public class StyleSelect extends DropDownChoice { public StyleSelect(String id, List options) { super(id, options); setModel(new IModel() { public Object getObject() { return getSession().getStyle(); } public void setObject(Object object) { getSession().setStyle(object == null ? null : object.toString()); } public void detach() {} }); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } } On Thu, Jul 8, 2010 at 11:53 AM, Peter Miklosko peter_b...@yahoo.comwrote: Can somebody please help me populate drop down menu for Styles? Customer decided to use this option and I have difficulties to figure out how to do it. Even in the wicket-contrib-tinymce examples this is not active. Peter -- Pedro Henrique Oliveira dos Santos
SV: Wicket wicket-contrib-tinymce populate Styles drop-down
I'm sort of dubious about your suggestion as I don't see any direct connection between this DropDownChoice and TinyMCE editor from wicket-contrib- tinymce. I think Pedro misunderstood you and therefore posted code for changing the Wicket style which is something else. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: about treeLink
thank you. 2010/7/9 Jeremy Thomerson jer...@wickettraining.com http://www.wicket-library.com/wicket-examples/nested/ On Thu, Jul 8, 2010 at 9:09 PM, 蔡茂昌 caimaochang.c...@gmail.com wrote: is there any complete sample or demo of the treeLink thank you. - -- Jeremy Thomerson http://www.wickettraining.com
Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible
vov wrote: But question is still open:) Look to example public static boolean visibleFlag = true; public VisibilityButtonTest() { FormVoid form = new FormVoid(form); add(form); AjaxButton ajaxButton = new AjaxButton(button1) { @Override public boolean isVisible() { return visibleFlag; } @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { // do nothing } }; form.add(ajaxButton); form.add(new AjaxButton(button2) { @Override protected void onSubmit(AjaxRequestTarget target, Form? form) { visibleFlag = false; } }); } after open this page press to button2 and after to button1 In that case Sven's solution should work. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2283188.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to combine a form and a link that submit the same page?
Thanks for the pointers Martin. Nope, I'm not parsing parameters manually. I don't have paging buttons, just links that are not part of a form. I decided to sidestep the whole issue by using the DataView and DataProvider classes. I was hoping to do things in a more stateless way but I guess that's more trouble than its worth for now. Thanks for the help. On 9 July 2010 00:21, Martin Makundi martin.maku...@koodaripalvelut.comwrote: Hi! Few points to consider: 1. I hope you do not parse pageParameters manually, let wicket handle that for simple cases. 2. Don't allow your paging buttons to submit data, set button.setDefaultFormProcessing(false); 3. Separate your search form and other forms from each other: form search form search criteria /form div other content form some other forms.../form /div ** Martin 2010/7/9 Kevin Stembridge kevin.stembri...@gmail.com: Hi folks, I'm trying to write a page that displays search results. The page contains a form allowing the user to input search criteria. It also displays the list of results with links for paging back and forth through the result set. I'm having a bit of trouble because the pageParameters coming from the form can be in conflict with the pageParameters coming from the paging navigation links. For example: A user enters a name in the form, submits it and the results are displayed. If they then use the paging navigation link to display the second page, the query parameters will contain the name first entered in the form. If the user enters a new name in the form and submits it again, the page parameters will contain both names. So the question is, when I submit the form, how do I ignore any pageParameters that weren't actually from the form? Cheers, Kevin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to combine a form and a link that submit the same page?
If you want to make dataview stateless I believe you can achieve it with some url encoding scheme... ;] 2010/7/9 Kevin Stembridge kevin.stembri...@gmail.com: Thanks for the pointers Martin. Nope, I'm not parsing parameters manually. I don't have paging buttons, just links that are not part of a form. I decided to sidestep the whole issue by using the DataView and DataProvider classes. I was hoping to do things in a more stateless way but I guess that's more trouble than its worth for now. Thanks for the help. On 9 July 2010 00:21, Martin Makundi martin.maku...@koodaripalvelut.comwrote: Hi! Few points to consider: 1. I hope you do not parse pageParameters manually, let wicket handle that for simple cases. 2. Don't allow your paging buttons to submit data, set button.setDefaultFormProcessing(false); 3. Separate your search form and other forms from each other: form search form search criteria /form div other content form some other forms.../form /div ** Martin 2010/7/9 Kevin Stembridge kevin.stembri...@gmail.com: Hi folks, I'm trying to write a page that displays search results. The page contains a form allowing the user to input search criteria. It also displays the list of results with links for paging back and forth through the result set. I'm having a bit of trouble because the pageParameters coming from the form can be in conflict with the pageParameters coming from the paging navigation links. For example: A user enters a name in the form, submits it and the results are displayed. If they then use the paging navigation link to display the second page, the query parameters will contain the name first entered in the form. If the user enters a new name in the form and submits it again, the page parameters will contain both names. So the question is, when I submit the form, how do I ignore any pageParameters that weren't actually from the form? Cheers, Kevin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible
It can't work. Please, see org.apache.wicket.Component.internalBeforeRender() method. Method onBeforeRendering() colling only in case when visibility of component is true. In our example boolean variable 'available' false by default. This mean that component never be rendered. Can someone explain what I do not understand? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/org-apache-wicket-WicketRuntimeException-Submit-Button-is-not-visible-tp2282413p2283191.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
OT: Trying to temporary unsubscribe...
... but keep getting stopped in the spam filters when sending confirmation. Any trick to make it actually get through? Med vennlig hilsen TOR IVER WILHELMSEN Senior systemutvikler Arrive AS T (+47) 48 16 06 18 E-post: toriv...@arrive.no http://www.arrive.no http://servicedesk.arrive.no
Re: Wicket wicket-contrib-tinymce populate Styles drop-down
Hi, I misunderstood your question. I was think you are asking about session style. On Fri, Jul 9, 2010 at 5:30 AM, Peter Miklosko peter_b...@yahoo.com wrote: I'm sort of dubious about your suggestion as I don't see any direct connection between this DropDownChoice and TinyMCE editor from wicket-contrib-tinymce. Would you care to explain little more about integration? Peter From: Pedro Santos pedros...@gmail.com To: users@wicket.apache.org Sent: Thu, July 8, 2010 5:09:08 PM Subject: Re: Wicket wicket-contrib-tinymce populate Styles drop-down Hi, you can use an DropDownChoice to present the available styles for your app, and allow user to select one. Example: public class StyleSelect extends DropDownChoice { public StyleSelect(String id, List options) { super(id, options); setModel(new IModel() { public Object getObject() { return getSession().getStyle(); } public void setObject(Object object) { getSession().setStyle(object == null ? null : object.toString()); } public void detach() {} }); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } } On Thu, Jul 8, 2010 at 11:53 AM, Peter Miklosko peter_b...@yahoo.com wrote: Can somebody please help me populate drop down menu for Styles? Customer decided to use this option and I have difficulties to figure out how to do it. Even in the wicket-contrib-tinymce examples this is not active. Peter -- Pedro Henrique Oliveira dos Santos -- Pedro Henrique Oliveira dos Santos
Re: Wicket wicket-contrib-tinymce populate Styles drop-down
I think you could do that like this: TinyMCESettings settings = new TinyMCESettings(); settings.register(new Plugin(style_formats) { @Override protected void definePluginSettings(StringBuffer buffer) { define(buffer, style_formats, [ + {title : 'Bold text', inline : 'b'}, + {title : 'Red text', inline : 'span', styles : {color : '#ff'}}, + {title : 'Red header', block : 'h1', styles : {color : '#ff'}}, + {title : 'Example 1', inline : 'span', classes : 'example1'}, + {title : 'Example 2', inline : 'span', classes : 'example2'}, + {title : 'Table styles'}, + {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} + ]); } }); Also see: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/style_formats http://tinymce.moxiecode.com/examples/example_24.php 2010/7/9 Pedro Santos pedros...@gmail.com Hi, I misunderstood your question. I was think you are asking about session style. On Fri, Jul 9, 2010 at 5:30 AM, Peter Miklosko peter_b...@yahoo.com wrote: I'm sort of dubious about your suggestion as I don't see any direct connection between this DropDownChoice and TinyMCE editor from wicket-contrib-tinymce. Would you care to explain little more about integration? Peter From: Pedro Santos pedros...@gmail.com To: users@wicket.apache.org Sent: Thu, July 8, 2010 5:09:08 PM Subject: Re: Wicket wicket-contrib-tinymce populate Styles drop-down Hi, you can use an DropDownChoice to present the available styles for your app, and allow user to select one. Example: public class StyleSelect extends DropDownChoice { public StyleSelect(String id, List options) { super(id, options); setModel(new IModel() { public Object getObject() { return getSession().getStyle(); } public void setObject(Object object) { getSession().setStyle(object == null ? null : object.toString()); } public void detach() {} }); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } } On Thu, Jul 8, 2010 at 11:53 AM, Peter Miklosko peter_b...@yahoo.com wrote: Can somebody please help me populate drop down menu for Styles? Customer decided to use this option and I have difficulties to figure out how to do it. Even in the wicket-contrib-tinymce examples this is not active. Peter -- Pedro Henrique Oliveira dos Santos -- Pedro Henrique Oliveira dos Santos
Re: Question - Does Wicket really initialize a page instance once?
But a different page instance for each person or browser section is expected by any Java developer. What is not so much expected is that for the same person, in the same browser session, you can't rely on natural object identity, like Martin said, thanks to serialization... But you can rely on object values, so if you correctly implement hash and equals it should be fine. On Wed, Jul 7, 2010 at 10:48 PM, Martin Makundi [via Apache Wicket] ml-node+2281423-751388596-293...@n4.nabble.comml-node%2b2281423-751388596-293...@n4.nabble.com wrote: Also yes ;) 2010/7/7 James Carman [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=0: 2010/7/7 Martin Makundi [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=1: But remember... not being reconstructed does not mean that you won't have MULTIPLE INSTANCES of the same page. ... thanks to serialization ;)) so be warned if you code something that depends on instances. It's not just serialization. A new page instance will be constructed for each person that hits it. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=2 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=3 - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=4 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=5 -- View message @ http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2281423.html To start a new topic under Wicket - User, email ml-node+1842947-1647783149-293...@n4.nabble.comml-node%2b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc=. -- []'s Avraham Rosenzweig avrah...@gmail.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283205.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Question - Does Wicket really initialize a page instance once?
The equals()/hashCode() should already work as expected for components On Jul 9, 2010 8:28 AM, avrahamr avrah...@gmail.com wrote: But a different page instance for each person or browser section is expected by any Java developer. What is not so much expected is that for the same person, in the same browser session, you can't rely on natural object identity, like Martin said, thanks to serialization... But you can rely on object values, so if you correctly implement hash and equals it should be fine. On Wed, Jul 7, 2010 at 10:48 PM, Martin Makundi [via Apache Wicket] ml-node+2281423-751388596-293...@n4.nabble.comml-node%2b2281423-751388596-293...@n4.nabble.com ml-node%2b2281423-751388596-293...@n4.nabble.comml-node%252b2281423-751388596-293...@n4.nabble.com wrote: Also yes ;) 2010/7/7 James Carman [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=0: 2010/7/7 Martin Makundi [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=1: But remember... not being reconstructed does not mean that you won't have MULTIPLE INSTA... To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=2 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=3 - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=4 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=5 -- View message @ http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2281423.html To start a new topic under Wicket - User, email ml-node+1842947-1647783149-293...@n4.nabble.comml-node%2b1842947-1647783149-293...@n4.nabble.com ml-node%2b1842947-1647783149-293...@n4.nabble.comml-node%252b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click here http://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc= . -- []'s Avraham Rosenzweig avrah...@gmail.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283205.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Question - Does Wicket really initialize a page instance once?
But changes will not propagate. You might think that you are transferring money from account A to account B but are transferring money from account A' to account B' so you need to consider this when implementing. Ofcourse it's a dumb example nobody implements such transactions in session memory (I hope ;)) but somebody might try similar things for more lightweight transactions. ** Martin 2010/7/9 James Carman ja...@carmanconsulting.com: The equals()/hashCode() should already work as expected for components On Jul 9, 2010 8:28 AM, avrahamr avrah...@gmail.com wrote: But a different page instance for each person or browser section is expected by any Java developer. What is not so much expected is that for the same person, in the same browser session, you can't rely on natural object identity, like Martin said, thanks to serialization... But you can rely on object values, so if you correctly implement hash and equals it should be fine. On Wed, Jul 7, 2010 at 10:48 PM, Martin Makundi [via Apache Wicket] ml-node+2281423-751388596-293...@n4.nabble.comml-node%2b2281423-751388596-293...@n4.nabble.com ml-node%2b2281423-751388596-293...@n4.nabble.comml-node%252b2281423-751388596-293...@n4.nabble.com wrote: Also yes ;) 2010/7/7 James Carman [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=0: 2010/7/7 Martin Makundi [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=1: But remember... not being reconstructed does not mean that you won't have MULTIPLE INSTA... To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=2 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=3 - To unsubscribe, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=4 For additional commands, e-mail: [hidden email] http://user/SendEmail.jtp?type=nodenode=2281423i=5 -- View message @ http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2281423.html To start a new topic under Wicket - User, email ml-node+1842947-1647783149-293...@n4.nabble.comml-node%2b1842947-1647783149-293...@n4.nabble.com ml-node%2b1842947-1647783149-293...@n4.nabble.comml-node%252b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click here http://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc= . -- []'s Avraham Rosenzweig avrah...@gmail.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283205.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket wicket-contrib-tinymce populate Styles drop-down
I got following error from it ERROR - Objects- Error serializing object class com.admin.item.EditItemPage [object=[Page class = com.admin.item.EditItemPage, id = 4, version = 0]] org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException: Unable to serialize class: com.util.TinymceUtil Field hierarchy is: 4 [class=com.admin.item.EditItemPage, path=4] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] java.lang.Object org.apache.wicket.Component.data[9] [class=com.admin.item.panel.EditPanel, path=4:editPanel] private java.lang.Object org.apache.wicket.MarkupContainer.children [class=[Ljava.lang.Object;] private java.lang.Object org.apache.wicket.markup.html.form.FormComponent.validators[2] [class=org.apache.wicket.markup.html.form.TextArea, path=4:editPanel:item_editor] java.lang.Object org.apache.wicket.Component.data [class=[Ljava.lang.Object;] java.lang.Object org.apache.wicket.Component.data[0][1] [class=wicket.contrib.tinymce.TinyMceBehavior] private wicket.contrib.tinymce.settings.TinyMCESettings wicket.contrib.tinymce.TinyMceBehavior.settings [class=wicket.contrib.tinymce.settings.TinyMCESettings] private java.util.Set wicket.contrib.tinymce.settings.TinyMCESettings.plugins [class=org.apache.commons.collections.set.ListOrderedSet] protected final java.util.List org.apache.commons.collections.set.ListOrderedSet.setOrder [class=java.util.ArrayList] private java.lang.String wicket.contrib.tinymce.settings.Plugin.pluginPath[write:2][write:3] [class=com.util.TinymceUtil$1] final com.util.TinymceUtil com.util.TinymceUtil$1.this$0 [class=com.util.TinymceUtil] - field that is not serializable From: sander v F sandervanfaas...@gmail.com To: users@wicket.apache.org Sent: Fri, July 9, 2010 12:39:29 PM Subject: Re: Wicket wicket-contrib-tinymce populate Styles drop-down I think you could do that like this: TinyMCESettings settings = new TinyMCESettings(); settings.register(new Plugin(style_formats) { @Override protected void definePluginSettings(StringBuffer buffer) { define(buffer, style_formats, [ + {title : 'Bold text', inline : 'b'}, + {title : 'Red text', inline : 'span', styles : {color : '#ff'}}, + {title : 'Red header', block : 'h1', styles : {color : '#ff'}}, + {title : 'Example 1', inline : 'span', classes : 'example1'}, + {title : 'Example 2', inline : 'span', classes : 'example2'}, + {title : 'Table styles'}, + {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'} + ]); } }); Also see: http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/style_formats http://tinymce.moxiecode.com/examples/example_24.php 2010/7/9 Pedro Santos pedros...@gmail.com Hi, I misunderstood your question. I was think you are asking about session style. On Fri, Jul 9, 2010 at 5:30 AM, Peter Miklosko peter_b...@yahoo.com wrote: I'm sort of dubious about your suggestion as I don't see any direct connection between this DropDownChoice and TinyMCE editor from wicket-contrib-tinymce. Would you care to explain little more about integration? Peter From: Pedro Santos pedros...@gmail.com To: users@wicket.apache.org Sent: Thu, July 8, 2010 5:09:08 PM Subject: Re: Wicket wicket-contrib-tinymce populate Styles drop-down Hi, you can use an DropDownChoice to present the available styles for your app, and allow user to select one. Example: public class StyleSelect extends DropDownChoice { public StyleSelect(String id, List options) { super(id, options); setModel(new IModel() { public Object getObject() { return getSession().getStyle(); } public void setObject(Object object) { getSession().setStyle(object == null ? null : object.toString()); } public void detach() {} }); } @Override protected boolean wantOnSelectionChangedNotifications() { return true; } } On Thu, Jul 8, 2010 at 11:53 AM, Peter Miklosko peter_b...@yahoo.com wrote: Can somebody please help me populate drop down menu for Styles? Customer decided to use this option and I have difficulties to figure out how to do it. Even in the wicket-contrib-tinymce examples this is not active. Peter -- Pedro Henrique Oliveira dos Santos -- Pedro Henrique Oliveira dos Santos
Re: Question - Does Wicket really initialize a page instance once?
I understand by doing the way Jeremy Thomerson suggests (onSubmit or onClick), Wicket will not create a new page instance upon request. But, I am experiencing this not so much expected scenario that for the same person, in the same browser session, click the browser's Refresh Button, or F5, a new page instance is created. Is the latter behavior expected? Thanks On Fri, Jul 9, 2010 at 8:28 AM, avrahamr avrah...@gmail.com wrote: But a different page instance for each person or browser section is expected by any Java developer. What is not so much expected is that for the same person, in the same browser session, you can't rely on natural object identity, like Martin said, thanks to serialization... But you can rely on object values, so if you correctly implement hash and equals it should be fine. On Wed, Jul 7, 2010 at 10:48 PM, Martin Makundi [via Apache Wicket] ml-node+2281423-751388596-293...@n4.nabble.comml-node%2b2281423-751388596-293...@n4.nabble.com wrote: Also yes ;) 2010/7/7 James Carman [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=0: 2010/7/7 Martin Makundi [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=1: But remember... not being reconstructed does not mean that you won't have MULTIPLE INSTANCES of the same page. ... thanks to serialization ;)) so be warned if you code something that depends on instances. It's not just serialization. A new page instance will be constructed for each person that hits it. - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=2 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=3 - To unsubscribe, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=4 For additional commands, e-mail: [hidden email]http://user/SendEmail.jtp?type=nodenode=2281423i=5 -- View message @ http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2281423.html To start a new topic under Wicket - User, email ml-node+1842947-1647783149-293...@n4.nabble.comml-node%2b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc=. -- []'s Avraham Rosenzweig avrah...@gmail.com -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283205.html Sent from the Wicket - User mailing list archive at Nabble.com. -- Simon 西门烧雪 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
SV: Question - Does Wicket really initialize a page instance once?
But, I am experiencing this not so much expected scenario that for the same person, in the same browser session, click the browser's Refresh Button, or F5, a new page instance is created. Is the latter behavior expected? For bookmarkable page URLs: Yes. Look into how versioned-setting and statefulness affects this behavior, though... - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using comet to find all clients using a page
you can solve this yourself by managing a Map where you put in the users in the constructor of the page on session expiration, you remove the user from the Map 2010/7/9 fachhoch [via Apache Wicket] ml-node+2283204-669277367-232...@n4.nabble.comml-node%2b2283204-669277367-232...@n4.nabble.com using comet will I be able to get total number of clients using some page ? -- View message @ http://apache-wicket.1842946.n4.nabble.com/using-comet-to-find-all-clients-using-a-page-tp2283204p2283204.html To start a new topic under Wicket - User, email ml-node+1842947-1066186228-232...@n4.nabble.comml-node%2b1842947-1066186228-232...@n4.nabble.com To unsubscribe from Wicket - User, click herehttp://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=bWV1bGVtYW5zLmRhdmlkQGdtYWlsLmNvbXwxODQyOTQ3fC0xOTcyOTcxMjQ2. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-comet-to-find-all-clients-using-a-page-tp2283204p2283210.html Sent from the Wicket - User mailing list archive at Nabble.com.
Re: Question - Does Wicket really initialize a page instance once?
For session-level stuff, store the values in the session, not a component/page instance. On Jul 9, 2010 8:36 AM, Martin Makundi martin.maku...@koodaripalvelut.com wrote: But changes will not propagate. You might think that you are transferring money from account A to account B but are transferring money from account A' to account B' so you need to consider this when implementing. Ofcourse it's a dumb example nobody implements such transactions in session memory (I hope ;)) but somebody might try similar things for more lightweight transactions. ** Martin 2010/7/9 James Carman ja...@carmanconsulting.com: The equals()/hashCode() should already work as expected for components On Jul 9, 2010 8:28 AM,... ml-node%2b2281423-751388596-293...@n4.nabble.comml-node%252b2281423-751388596-293...@n4.nabble.com ml-node%252b2281423-751388596-293...@n4.nabble.comml-node%25252b2281423-751388596-293...@n4.nabble.com wrote: Also yes ;) 2010/7/7 James Carman [hidden email] http://user/SendEmail.j... ml-node%2b1842947-1647783149-293...@n4.nabble.comml-node%252b1842947-1647783149-293...@n4.nabble.com ml-node%252b1842947-1647783149-293...@n4.nabble.comml-node%25252b1842947-1647783149-293...@n4.nabble.com To unsubscribe from Wicket - User, click here http://apache-wicket.1842946.n4.nabble.com/su... - To unsubscribe, e-mail: users-...
Re: Question - Does Wicket really initialize a page instance once?
I have found only this link http://www.systemmobile.com/?p=249 and I will try find my Wicket in Action book for the terms you mentioned. Any good links for explaining the versioned-setting and statefulness concepts? Thanks On Fri, Jul 9, 2010 at 8:51 AM, Wilhelmsen Tor Iver toriv...@arrive.no wrote: But, I am experiencing this not so much expected scenario that for the same person, in the same browser session, click the browser's Refresh Button, or F5, a new page instance is created. Is the latter behavior expected? For bookmarkable page URLs: Yes. Look into how versioned-setting and statefulness affects this behavior, though... - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Simon 西门烧雪 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxButton documentation error?
sounds like a bug, file a jira. -igor On Thu, Jul 8, 2010 at 6:48 PM, Chris Colman chr...@stepaheadsoftware.com wrote: The JavaDoc for AjaxButton (and AjaxSubmitButton) says: A button that submits the form via ajax. Since this button takes the form as a constructor argument it does not need to be added to it unlike the Button component. Well I've just spent a good amount of time putting that theory to the test. I use the constructor that takes the form as its second parameter. Basically the form fails with an error saying wicket can't find the button component unless I explicitly add the AjaxButton object to the form object, seemingly contradicting the above doco quote. The Wicket example explicitly adds the button to the form too - which also seems to go against the above doco declaration. Maybe it's a rare case where reading the documentation is not a good idea =} - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Question - Does Wicket really initialize a page instance once?
avrahamr wrote: But you can rely on object values, so if you correctly implement hash and equals it should be fine. I too have a problem with multiple calls to a WebPage constructor I have a bookmarkable page, a link to which can be followed from a verification E-mail which the app has sent. Following the link results in my page constructor being called: in it I check the parameters for correct values and then update my persistent datastore, if appropriate. During developer testing I find that the constructor is often called twice. I have a basic silly question to ask: how can I use hash and equals (or any other approach) to ensure that my parameter checking and datastore update code is called once only? Extract of my code -- public class PageVerifyEMail extends PageBase// extends WebPage { private static final long serialVersionUID = 1L; private static final Logger g_logger = Logger.getLogger(PageVerifyEMail.class.getName()); private int g_nConstructCount = 0; public PageVerifyEMail(PageParameters params) { super(); g_nConstructCount++; g_logger.log(Level.FINE, String.format(g_nConstructCount = %d., g_nConstructCount)); // // Check parameters. // If appropriate then update the persistent datastore. // Set appropriate feedback text in the page's components. // } // // Add components to the page // } -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Question-Does-Wicket-really-initialize-a-page-instance-once-tp2281200p2283235.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: Serialization of injected EJBs
well, i recently wrote a wicket-ioc module for seam and it took me a couple of hours :) -igor On Fri, Jul 9, 2010 at 12:52 AM, Harald Wellmann harald.wellm...@multi-m.de wrote: Ok, I see what you mean and I think that would work. Only I'm not so sure about the couple of hours (have you looked at CDI BeanManager...?) and with that approach, I would end up having 3 proxies between my Wicket component and my EJB. Anyway, this is probably faster to implement than waiting for a solution from Glassfish... Best regards, Harald -Ursprüngliche Nachricht- Von: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Gesendet: Donnerstag, 8. Juli 2010 21:45 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs hrm, if thats the case you can always use wicket-ioc module to build the proxy yourself just like we do for spring and guice, it should only be a couple of hours effort. -igor On Thu, Jul 8, 2010 at 10:34 AM, Harald Wellmann harald.wellm...@multi-m.de wrote: In theory, yes... The proxies returned by Weld 1.0.1.SP3 (the version used in Glassfish 3.0.1) are serializable, but after serializing and deserializing the proxy, the method handler is broken and you get a null pointer exception when invoking any method of the proxy. i verified this in a simple test case, independent of Wicket. This looks like the problem fixed in https://jira.jboss.org/browse/JASSIST-97, though I'm not fully sure that this is exactly the same issue. Anyway, I patched my Glassfish version with the most recent release of Javassist containing the bugfix. With this fix, I already get a NotSerializableException from Wicket when the current page is about to be moved to the page store: protected java.lang.reflect.InvocationHandler java.lang.reflect.Proxy.h [class=com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate] - field that is not serializable It seems that the stateless session bean implementation is wrapped in at least two proxies, one generated by Glassfish (for getting the session bean into the CDI context, equivalent to @EJB injection) and another one, generated by Weld using Javassist, filling the @Inject injection point in my Wicket component. The outer proxy is ok with the newer Javassist version, but the inner proxy simply is not serializable because of EJBLocalObjectInvocationHandlerDelegate. Using @EJB instead of @Inject, I just get the inner proxy, with the same problem caused by EJBLocalObjectInvocationHandlerDelegate. So my impression is that Glassfish simply breaks the contract of my serializable session bean interface. On the other hand, I wouldn't be surprised if there was a paragraph somewhere in the Java EE specs stating that EJBs shall not be serialized by the application (i.e. Wicket) because the container takes care of passivation anyway... Has anybody tried Wicket+CDI+EJB on other app servers? (There aren't so many supporting Java EE 6) Regards, Harald Von: Igor Vaynberg [igor.vaynb...@gmail.com] Gesendet: Donnerstag, 8. Juli 2010 17:54 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs im not sure if this is in a CDI spec or not, but afaik Weld will return serializable proxies when you manually inject objects. so that should work out of the box. -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: Serialization of injected EJBs
And Seam uses CDI/Weld, right? So your module might solve my problems... Is it public? Regards, Harald Von: Igor Vaynberg [igor.vaynb...@gmail.com] Gesendet: Freitag, 9. Juli 2010 18:06 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs well, i recently wrote a wicket-ioc module for seam and it took me a couple of hours :) -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AW: Serialization of injected EJBs
no, the module is for seam 2.1 which does not use weld. -igor On Fri, Jul 9, 2010 at 10:55 AM, Harald Wellmann harald.wellm...@multi-m.de wrote: And Seam uses CDI/Weld, right? So your module might solve my problems... Is it public? Regards, Harald Von: Igor Vaynberg [igor.vaynb...@gmail.com] Gesendet: Freitag, 9. Juli 2010 18:06 An: users@wicket.apache.org Betreff: Re: AW: Serialization of injected EJBs well, i recently wrote a wicket-ioc module for seam and it took me a couple of hours :) -igor - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Unauthorized page instantiation, why does it occur and how to prevent it?
Ok. My authentication scheme was not strict enough, this fixed the problem: /** * @see org.apache.wicket.authorization.strategies.page.AbstractPageAuthorizationStrategy#isActionAuthorized(org.apache.wicket.Component, org.apache.wicket.authorization.Action) */ @Override public boolean isActionAuthorized(Component component, Action action) { if (instanceOf(component.getClass(), Page.class)) { return isPageAuthorized(component.getClass()); } return super.isActionAuthorized(component, action); } 2010/7/9 Martin Makundi martin.maku...@koodaripalvelut.com: Or is it possible that this is an OLD instance of a page (in PAGEMAP) and it is being rendered even if user is no longer authorized??? How can this be legal? Is it a bug or am I missing a setting somewhere? ** Martin 2010/7/9 Martin Makundi martin.maku...@koodaripalvelut.com: Hi! I get lots of these exceptions when persumably people use our application in produciton from bookmarks pointing to dynamic links and their session is out. How can this happen? The particular page requires authentiacation which is handled via AbstractPageAuthorizationStrategy#isPageAuthorized(java.lang.Class) It should not be possible to instantiate this page at all because the nullpointer is caused by session.getPerson().getStatus() and authentication is determined via session.getPerson() != null. So this page by definition cannot be authorized to a user without session. How is this exception possible? 010-07-09 09:36:46,388 60568417 [17723...@qtp-7525870-352] ERROR RequestCycle - unexpected exception when handling another exception: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] org.apache.wicket.WicketRuntimeException: Exception in rendering component: [MarkupContainer [Component id = _header_2474]] at org.apache.wicket.Component.renderComponent(Component.java:2658) at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1512) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.MarkupContainer.autoAdd(MarkupContainer.java:229) at org.apache.wicket.markup.resolver.HtmlHeaderResolver.resolve(HtmlHeaderResolver.java:80) at org.apache.wicket.markup.resolver.ComponentResolvers.resolve(ComponentResolvers.java:81) at org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1418) at org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1528) at org.apache.wicket.Page.onRender(Page.java:1565) at org.apache.wicket.Component.render(Component.java:2450) at org.apache.wicket.Page.renderPage(Page.java:914) at org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63) at org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105) at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1267) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1334) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479) at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:389) 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:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:417) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:864) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:520) Caused by:
Re: org.apache.wicket.WicketRuntimeException: Submit Button ... is not visible
callOnBeforeRenderIfNotVisible() ? On 07/09/2010 12:26 PM, vov wrote: It can't work. Please, see org.apache.wicket.Component.internalBeforeRender() method. Method onBeforeRendering() colling only in case when visibility of component is true. In our example boolean variable 'available' false by default. This mean that component never be rendered. Can someone explain what I do not understand? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: using comet to find all clients using a page
In my case I have to refresh some pages based on some business logic, mine is a workflow applicaiton , workflow creates tasks for user.I show users tasks, these user task pages are implemented in wicket. we also have some admin functionality where admin can delete the task ,supposeadmin deletes a task , what i want is find if any session has currently has the deleted task page and bring a popup telling this task is deleted , can I do this ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/using-comet-to-find-all-clients-using-a-page-tp2283204p2283963.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Issues with form submit, not retaining values from session without ajax
I have a page that has a html components like a select list and radio buttons. And those components will invoke the onchange event to submit the form or move to the next page. It doesn't look like I am moving to the next page. My model values dont' seem to be retained, at least they aren't retained in for the radio buttons, text boxes. For example, I was thinking like Struts or Spring, I would call onchange on a radio button, the page would reload and all of my values would be retained. The values are NOT retained. Here are two radio buttons. I want to select one, do an onchange and have retain the value of radiogroup2. That is not happening: Also, I am losing the values of my textfields. What would I need to to keep the values of the widgets regardless if I submit the page or do an onchange. Source in a paste bin: http://paste.lisp.org/display/112321 = Snippet, two radio buttons. Radio two loses its values. final RadioChoice radioGroupYesNo2 = new RadioChoice(radioGroup2, new PropertyModel(bean, yesNo2), Arrays.asList(YES_NO)) { @Override public boolean wantOnSelectionChangedNotifications() { return true; } @Override public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } @Override public boolean isVisible() { return true; } }; // End of add radio group // radioGroupYesNo2.setPrefix(); radioGroupYesNo2.setSuffix(); form.add(radioGroupYesNo2); // Add Link // this.add(new SubmitLink(linkSubmit, form) { @Override public void onSubmit() { // Here what is the difference between the Class and the Object this.setResponsePage(TestPage.class); } }); } public final DropDownChoice createDropDown(final String str) { // Add list select elements. final ChoiceRenderer choiceRenderer = new ChoiceRenderer(name, value); final ListSelect list1 = new ArrayListSelect(); list1.add(new Select(select1, select1)); list1.add(new Select(select2, select2)); final DropDownChoice dropDown = new DropDownChoice(str, list1, choiceRenderer) { private static final long serialVersionUID = 3169945459254179351L; @Override protected boolean wantOnSelectionChangedNotifications() { return false; } @Override protected void onSelectionChanged(Object newSelection) { this.setResponsePage(TestPage.class); } }; dropDown.setRequired(true); return dropDown; } == Full Source: /** * File: TestPage.java */ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.RadioChoice; import org.apache.wicket.markup.html.form.SubmitLink; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.PropertyModel; import TestBean.Select; public class TestPage extends WebPage { public static final String [] YES_NO = { Yes, No }; @SuppressWarnings(unchecked) public TestPage(final PageParameters parameters) { super(parameters); TestBean bean = new TestBean(); if (WicketSession.get().getTestBean() == null) { bean = new TestBean(); WicketSession.get().setTestBean(bean); } else { bean = WicketSession.get().getTestBean(); } final FormTestBean form = new FormTestBean(form, new CompoundPropertyModel(bean)); this.add(form); form.add(new TextField(firstName)); form.add(new TextField(lastName)); form.add(createDropDown(selectBox1)); form.add(createDropDown(selectBox2)); final RadioChoice radioGroupYesNo = new RadioChoice(radioGroup1, new PropertyModel(bean, yesNo1), Arrays.asList(YES_NO)) { @Override public boolean wantOnSelectionChangedNotifications() { return true; } @Override public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } @Override public boolean isVisible() { return true; } }; // End of add radio group // radioGroupYesNo.setPrefix(); radioGroupYesNo.setSuffix(); form.add(radioGroupYesNo); final RadioChoice radioGroupYesNo2 = new RadioChoice(radioGroup2, new PropertyModel(bean, yesNo2), Arrays.asList(YES_NO)) { @Override public boolean wantOnSelectionChangedNotifications() { return true; } @Override public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } @Override public boolean isVisible() { return true; } }; // End of add radio group // radioGroupYesNo2.setPrefix(); radioGroupYesNo2.setSuffix();
Re: Issues with form submit, not retaining values from session without ajax
Hi, public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } you're telling Wicket to switch to a new instance of TestPage on each selection change. Just leave this method empty and Wicket will re-render the current page, retaining the current values. Sven Am 09.07.2010 22:52, schrieb Brown, Berlin [GCG-PFS]: I have a page that has a html components like a select list and radio buttons. And those components will invoke the onchange event to submit the form or move to the next page. It doesn't look like I am moving to the next page. My model values dont' seem to be retained, at least they aren't retained in for the radio buttons, text boxes. For example, I was thinking like Struts or Spring, I would call onchange on a radio button, the page would reload and all of my values would be retained. The values are NOT retained. Here are two radio buttons. I want to select one, do an onchange and have retain the value of radiogroup2. That is not happening: Also, I am losing the values of my textfields. What would I need to to keep the values of the widgets regardless if I submit the page or do an onchange. Source in a paste bin: http://paste.lisp.org/display/112321 = Snippet, two radio buttons. Radio two loses its values. final RadioChoice radioGroupYesNo2 = new RadioChoice(radioGroup2, new PropertyModel(bean, yesNo2), Arrays.asList(YES_NO)) { @Override public boolean wantOnSelectionChangedNotifications() { return true; } @Override public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } @Override public boolean isVisible() { return true; } }; // End of add radio group // radioGroupYesNo2.setPrefix(); radioGroupYesNo2.setSuffix(); form.add(radioGroupYesNo2); // Add Link // this.add(new SubmitLink(linkSubmit, form) { @Override public void onSubmit() { // Here what is the difference between the Class and the Object this.setResponsePage(TestPage.class); } }); } public final DropDownChoice createDropDown(final String str) { // Add list select elements. final ChoiceRenderer choiceRenderer = new ChoiceRenderer(name, value); final ListSelect list1 = new ArrayListSelect(); list1.add(new Select(select1, select1)); list1.add(new Select(select2, select2)); final DropDownChoice dropDown = new DropDownChoice(str, list1, choiceRenderer) { private static final long serialVersionUID = 3169945459254179351L; @Override protected boolean wantOnSelectionChangedNotifications() { return false; } @Override protected void onSelectionChanged(Object newSelection) { this.setResponsePage(TestPage.class); } }; dropDown.setRequired(true); return dropDown; } == Full Source: /** * File: TestPage.java */ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import org.apache.wicket.PageParameters; import org.apache.wicket.markup.html.WebPage; import org.apache.wicket.markup.html.form.ChoiceRenderer; import org.apache.wicket.markup.html.form.DropDownChoice; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.RadioChoice; import org.apache.wicket.markup.html.form.SubmitLink; import org.apache.wicket.markup.html.form.TextField; import org.apache.wicket.model.CompoundPropertyModel; import org.apache.wicket.model.PropertyModel; import TestBean.Select; public class TestPage extends WebPage { public static final String [] YES_NO = { Yes, No }; @SuppressWarnings(unchecked) public TestPage(final PageParameters parameters) { super(parameters); TestBean bean = new TestBean(); if (WicketSession.get().getTestBean() == null) { bean = new TestBean(); WicketSession.get().setTestBean(bean); } else { bean = WicketSession.get().getTestBean(); } final FormTestBean form = new FormTestBean(form, new CompoundPropertyModel(bean)); this.add(form); form.add(new TextField(firstName)); form.add(new TextField(lastName)); form.add(createDropDown(selectBox1)); form.add(createDropDown(selectBox2)); final RadioChoice radioGroupYesNo = new RadioChoice(radioGroup1, new PropertyModel(bean, yesNo1), Arrays.asList(YES_NO)) { @Override public boolean wantOnSelectionChangedNotifications() { return true; } @Override public void onSelectionChanged(Object newSel) { this.setResponsePage(TestPage.class); } @Override public boolean isVisible() { return true; } }; // End of add radio group // radioGroupYesNo.setPrefix(); radioGroupYesNo.setSuffix(); form.add(radioGroupYesNo); final RadioChoice radioGroupYesNo2 = new RadioChoice(radioGroup2, new PropertyModel(bean, yesNo2), Arrays.asList(YES_NO)) { @Override public boolean