Re: NullPointerException at Session line 492 - current RequestCycle is null
Thanks, I wonder if I use invalidate() it would throw an error. I'll give it a try. Best regards, Martin On Thu, Mar 8, 2012 at 2:39 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, You can invalidate the http session. Since Wicket Session is an attribute in the http session it will be removed as well. On Wed, Mar 7, 2012 at 6:35 PM, Martin A wml...@gmail.com wrote: Hello, I've got a REST service which is behind a Wicket Session Filter (due to the need to obtain the wicket current session at the service), and this REST service is being periodically hit by a Flash client (embedded in wicket page) At this REST service I've got a method that retrieves the wicket session, and it holds this snippet of code: if (session.hasExpired()) { session.invalidateNow(); throw new SessionExpiredException(); } The reason I do this and rely not on wicket's session timeout is because Wicket will create a new session if previous one is expired, so it'll lack all data I've stored in the session. The problem is that, this piece of code being called by the client via the REST service throws NullPointerException at Session line 492, which means that current RequestCycle is null. This happens due to calling invalidateNow(). I'm using wicket 1.5.0. Would you please tell me how to invalidate the session immediately in this case? Best regards, Martin -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
RE: Tree onClick() question...
My question is why is target always null in the onClick handler? Typically that happens for AjaxFallback* components when the click is not an Ajax request, e.g. the user has disabled Javascript. In those cases target is null and the whole page will be rendered in the (normal) response. - Tor Iver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tree onClick() question...
Check the tree's link type, if it is REGULAR the target will always be null. Sven On 03/09/2012 12:14 AM, mlabs wrote: I'm using a Tree and I have declared an onClick() handler in the usual way : new Tree(treeID, treeModel){ @Override protected MarkupContainer newNodeLink(MarkupContainer parent, String id, final TreeNode){ return newLink(parent, id, new ILinkCallback(){ public void onClick(AjaxRequestLink target){ // why is target always null in here? } }); } My question is why is target always null in the onClick handler? My problem is that I want to alter the model of another component when the user clicks a tree node, and then refresh that component in the page... so I'm thinking I need to make a target.addComponent(..) call at the end of this... but, well, I don't appear to have a target? What am I missing? TIA -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Tree-onClick-question-tp4457980p4457980.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard step with three textfields and one is required
Hi Andre, use WizardStep#add(IFormValidator). Sven On 03/08/2012 09:13 PM, Andre Schütz wrote: Hello, I want to create a WizardStep with three textfields. On of the three fields must be filled. If none of the fields is filled, the user should get a feedback. I don't think that it is possible to use RequiredTextField's? How can I make it possible that the system knows it just has to check for at least one of them? Thank you, Andre - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wizard step with three textfields and one is required
You can add a Form to your Step, then add TextFields and then make Form#onValidate() -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wizard-step-with-three-textfields-and-one-is-required-tp4457538p4459250.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
How to include a link to a css file not in classpath (not in WEB-INF)
Still not clear what I did wrong. With wicket 1.4 my code was: public final class PageHeaderComponent extends WebComponent { public PageHeaderComponent(final String id, final String changeDestination) { super(id); add(CSSPackageResource.getHeaderContribution(/css/header.css)); } (...) } and it created what I needed link rel=stylesheet type=text/css href=/css/header.css / Now with wicket 1.5, my code is: public final class PageHeaderComponent extends WebComponent { public PageHeaderComponent(final String id, final String changeDestination) { super(id); add(new Behavior() { private final ResourceReference headerCss = new PackageResourceReference(/css/header.css); @Override public void renderHead(Component component, IHeaderResponse response) { response.renderCSSReference(headerCss); } }); } (...) } and it creates: link rel=stylesheet type=text/css href=wicket/resource/org.apache.wicket.Application/css/header.css / The warning being logged is: WARNING: Asked to auto-create a ResourceReference, but ResourceReferenceRegistry .createDefaultResourceReference() return null. [scope: org.apache.wicket.Application; name: css/header.css; locale: null; style: null; variation: null] -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-include-a-link-to-a-css-file-not-in-classpath-not-in-WEB-INF-tp4459528p4459528.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: A Panel inside another Panel
On Thu, Mar 8, 2012 at 7:44 PM, Andrea Del Bene an.delb...@gmail.comwrote: Your code seems good, I can't find any reason why it should not work. I've seen you have deployed your code on Google Appengine, maybe your problem is related with this running environment. Can you run you project locally and reproduce the problem? I'm running on local AppEngine dev server. If I may ask, have you ever included a Panel inside another Panel before? Did it work? All examples I have seen shows including a Panel in a Page. I have never seen an example of a Panel included within a Panel. If you have, please show me an example. Here it is: Root cause: org.apache.wicket.**WicketRuntimeException: The component(s) below failed to render. A common problem is that you have added a component in code but forgot to reference it in the markup (thus the component will never be rendered). 1. [SearchForm [Component id = searchForm]] 2. [TextField [Component id = searchtextfield]] at org.apache.wicket.Page.**checkRendering(Page.java:693) at org.apache.wicket.Page.**onAfterRender(Page.java:849) at org.apache.wicket.markup.html.**WebPage.onAfterRender(WebPage.**java:213) at org.apache.wicket.Component.**afterRender(Component.java:**950) at org.apache.wicket.Component.**render(Component.java:2298) at org.apache.wicket.Page.**renderPage(Page.java:1041) at org.apache.wicket.request.**handler.render.**WebPageRenderer.renderPage(* *WebPageRenderer.java:105) at org.apache.wicket.request.**handler.render.**WebPageRenderer.respond(** WebPageRenderer.java:224) at org.apache.wicket.request.**handler.**RenderPageRequestHandler.**respond( **RenderPageRequestHandler.java:**167) at org.apache.wicket.request.**cycle.RequestCycle$**HandlerExecutor.respond( **RequestCycle.java:781) at org.apache.wicket.request.**RequestHandlerStack.execute(** RequestHandlerStack.java:64) at org.apache.wicket.request.**cycle.RequestCycle.execute(** RequestCycle.java:255) at org.apache.wicket.request.**cycle.RequestCycle.** processRequest(RequestCycle.**java:212) at org.apache.wicket.request.**cycle.RequestCycle.**processRequestAndDetach( **RequestCycle.java:283) at org.apache.wicket.protocol.**http.WicketFilter.** processRequest(WicketFilter.**java:162) at org.apache.wicket.protocol.**http.WicketFilter.doFilter(** WicketFilter.java:218) at org.mortbay.jetty.servlet.**ServletHandler$CachedChain.** doFilter(ServletHandler.java:**1157) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:312) at org.springframework.security.**web.access.intercept.** FilterSecurityInterceptor.**invoke(**FilterSecurityInterceptor.** java:116) at org.springframework.security.**web.access.intercept.** FilterSecurityInterceptor.**doFilter(**FilterSecurityInterceptor.** java:83) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.access.**ExceptionTranslationFilter.** doFilter(**ExceptionTranslationFilter.**java:95) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.session.**SessionManagementFilter.** doFilter(**SessionManagementFilter.java:**100) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.authentication.** AnonymousAuthenticationFilter.**doFilter(**AnonymousAuthenticationFilter. **java:79) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.servletapi.** SecurityContextHolderAwareRequ**estFilter.doFilter(** SecurityContextHolderAwareRequ**estFilter.java:54) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.savedrequest.** RequestCacheAwareFilter.**doFilter(**RequestCacheAwareFilter.java:**35) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.authentication.www.** BasicAuthenticationFilter.**doFilter(**BasicAuthenticationFilter.** java:119) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at org.springframework.security.**web.authentication.** AbstractAuthenticationProcessi**ngFilter.doFilter(** AbstractAuthenticationProcessi**ngFilter.java:187) at org.springframework.security.**web.FilterChainProxy$** VirtualFilterChain.doFilter(**FilterChainProxy.java:324) at
AutoLabelResolver requires ILabelProvider
Hi, I am trying to use label with wicket:for attribute to create label for MultiFileUploadField. However, this doesn't work because AutoLabelResolver checks whether component implements ILabelProvider. But ILabelProvider is not used in AutoLabelResolver and it is not even needed in order to render wicket:for attribute, I think this check is unnecessary and should be removed. Or am I missing something? Tibor Blenessy - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: A Panel inside another Panel
Yes I did, it's a quite common solution with Wicket. I can show you my code but it doesn't differ so much from your. I've wrote a container panel with two sub panels: the upper one shows some information about a generic iter of certification, the lower one is the custom content of the page. Here's the markup code: html xmlns:wicket wicket:panel div wicket:id=iterInfo/div br/ div wicket:id=contentPanel/div /wicket:panel /html and here's the java code: public class IterAwarePanel extends Panel { public static String CONTENT_ID = panelContent; private IterNavigationPanel navigationPanel; public IterAwarePanel(String id, Iter iter) { super(id); navigationPanel = new IterNavigationPanel(iterInfo, iter); add(navigationPanel); } public Iter getIter() { return navigationPanel.getIter(); } } If I were you I would try to use SearchPanel in another test page to see if it gives the same error. Probably you a have just a typo somewhere in your code on in your markup. On Thu, Mar 8, 2012 at 7:44 PM, Andrea Del Benean.delb...@gmail.comwrote: Your code seems good, I can't find any reason why it should not work. I've seen you have deployed your code on Google Appengine, maybe your problem is related with this running environment. Can you run you project locally and reproduce the problem? I'm running on local AppEngine dev server. If I may ask, have you ever included a Panel inside another Panel before? Did it work? All examples I have seen shows including a Panel in a Page. I have never seen an example of a Panel included within a Panel. If you have, please show me an example. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Upgrade from 1.4 to 1.5: timeframe?
Hi all, I'm finally coming up on upgrading from 1.4.19 to 1.5. To manage my projects better, could anybody comment on how long it took them to upgrade? I know it depends on how complicated your application is, but as a general guideline, does it take minutes, days, months? Thanks, Natalie -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Upgrade-from-1-4-to-1-5-timeframe-tp4460050p4460050.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Upgrade from 1.4 to 1.5: timeframe?
In my experience an upgrade should be possible in 4 hours to 4 days depending on the complexity of your application. Sven On 03/09/2012 06:09 PM, N. Metzger wrote: Hi all, I'm finally coming up on upgrading from 1.4.19 to 1.5. To manage my projects better, could anybody comment on how long it took them to upgrade? I know it depends on how complicated your application is, but as a general guideline, does it take minutes, days, months? Thanks, Natalie -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Upgrade-from-1-4-to-1-5-timeframe-tp4460050p4460050.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Upgrade from 1.4 to 1.5: timeframe?
Hi, I haven't done any migration myself (started on 1.5), but while reading this list, I noticed a number of users having issues with page mountings and page versioning. Try the following query for more hints: http://wicket-users.markmail.org/search/?q=migrate+1.5+-subject%3A%3A[announce] On 09/03/2012 1:40 PM, Sven Meier wrote: In my experience an upgrade should be possible in 4 hours to 4 days depending on the complexity of your application. Sven On 03/09/2012 06:09 PM, N. Metzger wrote: Hi all, I'm finally coming up on upgrading from 1.4.19 to 1.5. To manage my projects better, could anybody comment on how long it took them to upgrade? I know it depends on how complicated your application is, but as a general guideline, does it take minutes, days, months? Thanks, Natalie -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Upgrade-from-1-4-to-1-5-timeframe-tp4460050p4460050.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Preferred way to unit testing a WizardStep?
Hi again, Sorry for the repost but I haven't been able to find a way through WicketTester API to accomplish this, so I'm bumping this thread. Has anybody successfully written unit tests for the wizard? Thanks, Dan On Mon, Mar 5, 2012 at 2:34 PM, Dan Alvizu dalv...@pingidentity.com wrote: Hi, I've got a wizard with 5 steps. If I want to test just step four, but do not want to go through steps 1 through 3 first, how would I do that? I found this message for wicket 1.4: http://osdir.com/ml/users-wicket.apache.org/2011-06/msg00498.html However, startPanel() is deprecated and replaced with startComponentInPage(). If I use this method, I will get an NPE in WizardSteps.onInitialize() method: java.lang.NullPointerException: null at org.apache.wicket.extensions.wizard.WizardStep.onInitialize(WizardStep.java:445) ~[wicket-extensions-1.5.4.jar:1.5.4] at org.apache.wicket.Component.fireInitialize(Component.java:920) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.MarkupContainer$4.component(MarkupContainer.java:1007) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.MarkupContainer$4.component(MarkupContainer.java:1005) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:143) ~[wicket-util-1.5.4.jar:1.5.4] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:122) ~[wicket-util-1.5.4.jar:1.5.4] at org.apache.wicket.util.visit.Visits.visitChildren(Visits.java:191) ~[wicket-util-1.5.4.jar:1.5.4] at org.apache.wicket.MarkupContainer.visitChildren(MarkupContainer.java:923) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.MarkupContainer.internalInitialize(MarkupContainer.java:1003) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.Page.internalPrepareForRender(Page.java:278) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.Component.render(Component.java:2282) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.Page.renderPage(Page.java:1041) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:105) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:224) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:781) ~[wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64) ~[wicket-request-1.5.4.jar:1.5.4] at org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:255) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:283) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:650) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:570) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:780) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:796) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1400) [wicket-core-1.5.4.jar:1.5.4] at org.apache.wicket.util.tester.BaseWicketTester.startComponentInPage(BaseWicketTester.java:1336) [wicket-core-1.5.4.jar:1.5.4] [...] Sure enough, in org.apache.wicket.extensions.wizard.WizardStep.java, there's an attempt to find the Form parent which will not exist: @Override protected void onInitialize() { super.onInitialize(); Form? form = findParent(Form.class); form.add(formValidatorWrapper); // NPE here, form will be null } Is there a preferred way to do this without patching BaseWicketTester? Thanks, Dan