Problem sending email using SSL after upgrading to Wicket 1.5
Greetings to all of you. We recently upgraded our application to Wicket 1.5. However, after upgrading we had problems sending email using SSL from our application. This may not be related to wicket at all but I promise we didn't change any dependencies other than wicket's. What amuses me is that it works as expected in our older versions which still use Wicket 1.4.x. Both the older version and the current version were run using the same JRE. Here's the code that sends email: pre public class MailSenderTask implements Runnable { private Properties smtpProperties; private EmailMessage message; private static final Logger logger = LoggerFactory.getLogger(MailSenderTask.class); public MailSenderTask(Properties smtpProperties, EmailMessage message) { this.smtpProperties = smtpProperties; this.message = message; } public synchronized void sendMail() throws Exception { try { if (addSSlProvider()) { logger.info(Adding ssl provider); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); } else { logger.info(Using plain text connection as ssl/tls is not enabled); } Session session = createSession(); MimeMessage mimeMessage = new MimeMessage(session); mimeMessage.setSender(new InternetAddress(message.getSender())); mimeMessage.setSubject(message.getSubject()); if (message.getRecipients().indexOf(',') 0) { mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(message.getRecipients())); } else { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(message.getRecipients())); } MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message.getBody(), text/html); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(bodyPart); if (message.getAttachments() != null message.getAttachments().length 0) { for (File file : message.getAttachments()) { logger.debug(Adding {} as an attachment, file); MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(file); multipart.addBodyPart(attachmentPart); } } mimeMessage.setContent(multipart); logger.info(Sending mail...); Transport.send(mimeMessage); logger.info(Mail sent to {}, message.getRecipients()); } catch (Exception ex) { throw new EmailException(Error occurred while sending mail, ex); } } private boolean addSSlProvider() { String sslEnabledProperty = smtpProperties.getProperty(mail.smtp.starttls.enable); if (StringUtils.isNotEmpty(sslEnabledProperty)) { return Boolean.parseBoolean(sslEnabledProperty); } return false; } private Session createSession() { Session session = null; if (Boolean.parseBoolean(smtpProperties.getProperty(mail.smtp.auth))) { logger.info(Creating session with authentication); session = createSessionWithAuthentication(smtpProperties); } else { logger.info(Creating default session); session = createDefaultSession(smtpProperties); } return session; } private Session createDefaultSession(final Properties smtpProperties) { return Session.getInstance(smtpProperties); } private Session createSessionWithAuthentication(final Properties smtpProperties) { return Session.getInstance(smtpProperties, new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(smtpProperties.getProperty(smtp.username), smtpProperties.getProperty(smtp.password)); } }); } public void run() { if (smtpProperties != null message != null) { try { sendMail(); } catch (Exception ex) { throw new EmailException(Error, ex); } } } } /pre These are the SMTP properties that were set: pre mail.smtp.socketFactory.fallback:false mail.smtp.socketFactory.class:javax.net.ssl.SSLSocketFactory mail.transport.protocol:smtp mail.smtp.connectiontimeout:1 mail.smtp.host:smtp.gmail.com mail.smtp.timeout:1 mail.smtp.starttls.enable:true mail.smtp.port:465 mail.smtp.auth:true mail.smtp.socketFactory.port:465 mail.smtp.quitwait:false smtp.username:f...@gmail.com smtp.password: bar /pre This is the exception thrown: pre Caused by: javax.mail.MessagingException: Could not connect to
Re: Is there a way to search component by its wicket ID ?
You can definitely search by wicket id but you may have to specify the hierarchy as well. Something like this, TextField usernameField = (TextField) get(userForm:username); to get the text field component with the wicket id username inside the form whose wicket id is userForm. Hope this helps you. DISCLAIMER: I'm no wicket expert but these are my humble opinions and this is what I do to locate components when they are loosely coupled. On Mon, Aug 13, 2012 at 9:41 PM, arkadyz111 azelek...@gmail.com wrote: Hello, team. I am looking for a way to locate component by its wicket id in markup container. But I see only option to search by path is supported. Do I miss something ? Thank you. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-component-by-its-wicket-ID-tp4651175.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 -- Thanks regards James Selvakumar mcruncher.com
Re: Problem sending email using SSL after upgrading to Wicket 1.5
Martin, Yes I use smtp props that are similar to what you have shared. Kindly see my initial post for the smtp properties used by me. I may sound stupid but the same piece of code runs fine when using wicket-1.4.x. And I use the following wicket related dependencies: - wicket - wicket-extensions - wicket-ioc - wicket-spring - wicket-datetime - wicketstuff-annotation - wicketstuff-objectautocomplete - wiquery-jquery-ui All of them use the version 1.5.7. (Yes some of them don't belong to the wicket project at all but they depend on wicket-1.5.x) Is there a possibility of a dependency conflict? NOTE: I found that wicket-ioc depends on cglib. But even when I excluded it the problem persists. On Tue, Aug 14, 2012 at 2:27 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, I don't think this is anyhow related to Wicket. Here are the GMail SMTP related props I use successfully: mail.server.host=smtp.gmail.com mail.server.port=587 mail.server.username=my.em...@gmail.com mail.server.password=my-passwd mail.server.starttls.enable=true You may also check the docs of SMTPAppender in Logback. There are examples for configuring it with GMail. I believe the problem is in these settings. On Tue, Aug 14, 2012 at 5:34 AM, James Eliyezar ja...@mcruncher.com wrote: Greetings to all of you. We recently upgraded our application to Wicket 1.5. However, after upgrading we had problems sending email using SSL from our application. This may not be related to wicket at all but I promise we didn't change any dependencies other than wicket's. What amuses me is that it works as expected in our older versions which still use Wicket 1.4.x. Both the older version and the current version were run using the same JRE. Here's the code that sends email: pre public class MailSenderTask implements Runnable { private Properties smtpProperties; private EmailMessage message; private static final Logger logger = LoggerFactory.getLogger(MailSenderTask.class); public MailSenderTask(Properties smtpProperties, EmailMessage message) { this.smtpProperties = smtpProperties; this.message = message; } public synchronized void sendMail() throws Exception { try { if (addSSlProvider()) { logger.info(Adding ssl provider); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); } else { logger.info(Using plain text connection as ssl/tls is not enabled); } Session session = createSession(); MimeMessage mimeMessage = new MimeMessage(session); mimeMessage.setSender(new InternetAddress(message.getSender())); mimeMessage.setSubject(message.getSubject()); if (message.getRecipients().indexOf(',') 0) { mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(message.getRecipients())); } else { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(message.getRecipients())); } MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message.getBody(), text/html); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(bodyPart); if (message.getAttachments() != null message.getAttachments().length 0) { for (File file : message.getAttachments()) { logger.debug(Adding {} as an attachment, file); MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(file); multipart.addBodyPart(attachmentPart); } } mimeMessage.setContent(multipart); logger.info(Sending mail...); Transport.send(mimeMessage); logger.info(Mail sent to {}, message.getRecipients()); } catch (Exception ex) { throw new EmailException(Error occurred while sending mail, ex); } } private boolean addSSlProvider() { String sslEnabledProperty = smtpProperties.getProperty(mail.smtp.starttls.enable); if (StringUtils.isNotEmpty(sslEnabledProperty)) { return Boolean.parseBoolean(sslEnabledProperty); } return false; } private Session createSession() { Session session = null; if (Boolean.parseBoolean(smtpProperties.getProperty(mail.smtp.auth))) { logger.info(Creating session with authentication); session = createSessionWithAuthentication(smtpProperties); } else { logger.info(Creating default session); session = createDefaultSession(smtpProperties
Re: Is there a way to search component by its wicket ID ?
Because the id is unique only within the markup container of a component. It need not be unique in a page. This is by design. For more details refer: https://cwiki.apache.org/WICKET/component-hierarchy.html On Tue, Aug 14, 2012 at 3:42 PM, arkadyz111 azelek...@gmail.com wrote: But why we have to write userForm ? What is an idea behind of this ? Why get(username) is not enough ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-component-by-its-wicket-ID-tp4651175p4651217.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 -- Thanks regards James Selvakumar mcruncher.com
Re: Problem sending email using SSL after upgrading to Wicket 1.5
It turns out that the problem was because of the custom trust store we were using in our application. It has nothing to do with wicket. Sorry for bothering you all. On Tue, Aug 14, 2012 at 3:55 PM, James Eliyezar ja...@mcruncher.com wrote: Martin, Yes I use smtp props that are similar to what you have shared. Kindly see my initial post for the smtp properties used by me. I may sound stupid but the same piece of code runs fine when using wicket-1.4.x. And I use the following wicket related dependencies: - wicket - wicket-extensions - wicket-ioc - wicket-spring - wicket-datetime - wicketstuff-annotation - wicketstuff-objectautocomplete - wiquery-jquery-ui All of them use the version 1.5.7. (Yes some of them don't belong to the wicket project at all but they depend on wicket-1.5.x) Is there a possibility of a dependency conflict? NOTE: I found that wicket-ioc depends on cglib. But even when I excluded it the problem persists. On Tue, Aug 14, 2012 at 2:27 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, I don't think this is anyhow related to Wicket. Here are the GMail SMTP related props I use successfully: mail.server.host=smtp.gmail.com mail.server.port=587 mail.server.username=my.em...@gmail.com mail.server.password=my-passwd mail.server.starttls.enable=true You may also check the docs of SMTPAppender in Logback. There are examples for configuring it with GMail. I believe the problem is in these settings. On Tue, Aug 14, 2012 at 5:34 AM, James Eliyezar ja...@mcruncher.com wrote: Greetings to all of you. We recently upgraded our application to Wicket 1.5. However, after upgrading we had problems sending email using SSL from our application. This may not be related to wicket at all but I promise we didn't change any dependencies other than wicket's. What amuses me is that it works as expected in our older versions which still use Wicket 1.4.x. Both the older version and the current version were run using the same JRE. Here's the code that sends email: pre public class MailSenderTask implements Runnable { private Properties smtpProperties; private EmailMessage message; private static final Logger logger = LoggerFactory.getLogger(MailSenderTask.class); public MailSenderTask(Properties smtpProperties, EmailMessage message) { this.smtpProperties = smtpProperties; this.message = message; } public synchronized void sendMail() throws Exception { try { if (addSSlProvider()) { logger.info(Adding ssl provider); Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider()); } else { logger.info(Using plain text connection as ssl/tls is not enabled); } Session session = createSession(); MimeMessage mimeMessage = new MimeMessage(session); mimeMessage.setSender(new InternetAddress(message.getSender())); mimeMessage.setSubject(message.getSubject()); if (message.getRecipients().indexOf(',') 0) { mimeMessage.setRecipients(Message.RecipientType.TO, InternetAddress.parse(message.getRecipients())); } else { mimeMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(message.getRecipients())); } MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setContent(message.getBody(), text/html); Multipart multipart = new MimeMultipart(); multipart.addBodyPart(bodyPart); if (message.getAttachments() != null message.getAttachments().length 0) { for (File file : message.getAttachments()) { logger.debug(Adding {} as an attachment, file); MimeBodyPart attachmentPart = new MimeBodyPart(); attachmentPart.attachFile(file); multipart.addBodyPart(attachmentPart); } } mimeMessage.setContent(multipart); logger.info(Sending mail...); Transport.send(mimeMessage); logger.info(Mail sent to {}, message.getRecipients()); } catch (Exception ex) { throw new EmailException(Error occurred while sending mail, ex); } } private boolean addSSlProvider() { String sslEnabledProperty = smtpProperties.getProperty(mail.smtp.starttls.enable); if (StringUtils.isNotEmpty(sslEnabledProperty)) { return Boolean.parseBoolean(sslEnabledProperty); } return false; } private Session createSession() { Session session = null; if (Boolean.parseBoolean(smtpProperties.getProperty(mail.smtp.auth
Re: Is there a way to search component by its wicket ID ?
Thanks Paul for this nice tip. On Tue, Aug 14, 2012 at 11:04 PM, Paul Bors p...@bors.ws wrote: If you use wicket-component-expressions from com.googlecode.londonwicket you can get to the list of all the components on the page that have that username id via a regexp of **:username, but as James mentioned earlier, the ID is not unique and your wicket component tree might have such multiple nodes (hence why wicket-component-expressions gives you a list of them). I normally know that my panel has only one such component by the ID since I developed it, so if I attach it to my page inside a panel with an ID like myPanel then I use **:myPanel:**:username and I also filter by the component type such as TextField.class to narrow down the search. That's not production code, is unit test and I'm assuming that's the context of your question. By using such regexp, I found myself refactoring the unit test code less when shuffling panels on a page. ~ Thank you, Paul Bors -Original Message- From: James Eliyezar [mailto:ja...@mcruncher.com] Sent: Tuesday, August 14, 2012 4:12 AM To: users@wicket.apache.org Subject: Re: Is there a way to search component by its wicket ID ? Because the id is unique only within the markup container of a component. It need not be unique in a page. This is by design. For more details refer: https://cwiki.apache.org/WICKET/component-hierarchy.html On Tue, Aug 14, 2012 at 3:42 PM, arkadyz111 azelek...@gmail.com wrote: But why we have to write userForm ? What is an idea behind of this ? Why get(username) is not enough ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Is-there-a-way-to-search-componen t-by-its-wicket-ID-tp4651175p4651217.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 -- Thanks regards James Selvakumar mcruncher.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar mcruncher.com
WicketTester best practices
Friends, Just curious to find out what best practices do you all follow when using WicketTester. FYI, to improve the performance of unit tests, we decided to use a shared instance of WicketTester across our unit tests. The tests worked fine in Wicket 1.4.x but fail after upgrading to 1.5.x when run using Maven. However, Wicket 1.5 based tests pass when the tests are run using maven fork mode always. Is it advisable to use a shared instance of WicketTester across multiple unit test classes? Or should WicketTester should be instantiated and destroyed in the setUp and tearDown methods in every unit test class? -- Thanks regards James Selvakumar mcruncher.com
Re: WicketTester best practices
Any suggestions regarding this? Thank you. On Thu, Aug 16, 2012 at 10:04 AM, James Eliyezar ja...@mcruncher.comwrote: Friends, Just curious to find out what best practices do you all follow when using WicketTester. FYI, to improve the performance of unit tests, we decided to use a shared instance of WicketTester across our unit tests. The tests worked fine in Wicket 1.4.x but fail after upgrading to 1.5.x when run using Maven. However, Wicket 1.5 based tests pass when the tests are run using maven fork mode always. Is it advisable to use a shared instance of WicketTester across multiple unit test classes? Or should WicketTester should be instantiated and destroyed in the setUp and tearDown methods in every unit test class? -- Thanks regards James Selvakumar mcruncher.com -- Thanks regards James Selvakumar mcruncher.com
Re: WicketTester best practices
Thanks Tom for the suggestions. I didn't know these things. On Fri, Aug 17, 2012 at 12:14 PM, Tom Norton tomwnorton.mailing.li...@gmail.com wrote: My unit tests construct the WicketTester in the setUp method. I also extend WicketTester so that I can mock our database-driven content system and Spring Application Context (wicket provides a mock for this: http://wicket.apache.org/**apidocs/1.5/org/apache/wicket/**spring/test/** ApplicationContextMock.htmlhttp://wicket.apache.org/apidocs/1.5/org/apache/wicket/spring/test/ApplicationContextMock.html). This page talks about extending WicketTester: https://cwiki.apache.org/** WICKET/testing-pages.htmlhttps://cwiki.apache.org/WICKET/testing-pages.html Tom On Thu 16 Aug 2012 09:14:22 PM EDT, James Eliyezar wrote: Any suggestions regarding this? Thank you. On Thu, Aug 16, 2012 at 10:04 AM, James Eliyezar ja...@mcruncher.com wrote: Friends, Just curious to find out what best practices do you all follow when using WicketTester. FYI, to improve the performance of unit tests, we decided to use a shared instance of WicketTester across our unit tests. The tests worked fine in Wicket 1.4.x but fail after upgrading to 1.5.x when run using Maven. However, Wicket 1.5 based tests pass when the tests are run using maven fork mode always. Is it advisable to use a shared instance of WicketTester across multiple unit test classes? Or should WicketTester should be instantiated and destroyed in the setUp and tearDown methods in every unit test class? -- Thanks regards James Selvakumar mcruncher.com --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar mcruncher.com
Unable to get response page from PageRequestHandlerTracker
Hi, We recently migrated our application to wicket-1.5.8. We have an audit aspect based on Spring AOP that shall log the actions performed in the current page. In wicket 1.4 we use to get that like RequestCycle.get().getResponsePage(). This has changed and I know that wicket 1.5 doesn't support this anymore. The suggested method as per the wiki is to use a custom RequestCycleListenerhttps://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . Fortunately, as highlighted in the mailing list, there is a new class in wicket 1.5.8 named PageRequestHandlerTrackerhttp://apache-wicket.1842946.n4.nabble.com/Interpolate-response-with-IResponseFilter-td4651476.htmlto meet this common requirement. However, when we use PageRequestHandlerTracker.getLastHandler(RequestCycle.get()), and then attempt to call #getPage(), a null pointer exception is thrown. Am I doing something wrong here? Please give your suggestions. -- Thanks regards James Selvakumar mcruncher.com
Re: Unable to get response page from PageRequestHandlerTracker
Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) at org.eclipse.jetty.server.handler.ContextHandler.__doHandle(ContextHandler.java:940) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) at org.eclipse.jetty.server.Server.handle(Server.java:349) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:904) at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:565) at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:46) at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:545) at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:43) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598
Re: Unable to get response page from PageRequestHandlerTracker
Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.comwrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) at org.eclipse.jetty.server.handler.ContextHandler.__doHandle(ContextHandler.java:940) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:874) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) at org.eclipse.jetty.server.Server.handle(Server.java:349) at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete
Re: Unable to get response page from PageRequestHandlerTracker
Thanks Martin for the info. A note in PageRequestHandlerTracker's javadoc can be very useful. And it will be great if this is reflected in the wiki page Request Cycle in wicket 1.5https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . On Wed, Aug 29, 2012 at 3:03 PM, Martin Grigorov mgrigo...@apache.orgwrote: Hi, Yes, you have to register it. It is not registered by default because not everyone needs it. On Wed, Aug 29, 2012 at 9:01 AM, James Eliyezar ja...@mcruncher.com wrote: Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) at org.eclipse.jetty.server.handler.ContextHandler.__doHandle(ContextHandler.java:940) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186
Re: Unable to get response page from PageRequestHandlerTracker
I like that deal.. :-) On Wed, Aug 29, 2012 at 3:09 PM, Martin Grigorov mgrigo...@apache.orgwrote: I'll improve the javadoc. You improve the wiki page ;-) On Wed, Aug 29, 2012 at 9:07 AM, James Eliyezar ja...@mcruncher.com wrote: Thanks Martin for the info. A note in PageRequestHandlerTracker's javadoc can be very useful. And it will be great if this is reflected in the wiki page Request Cycle in wicket 1.5 https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . On Wed, Aug 29, 2012 at 3:03 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Yes, you have to register it. It is not registered by default because not everyone needs it. On Wed, Aug 29, 2012 at 9:01 AM, James Eliyezar ja...@mcruncher.com wrote: Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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:188) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:244) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1326) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:479) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:520) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227
Re: Unable to get response page from PageRequestHandlerTracker
That was fast Martin. I'm working on the wiki now. On Wed, Aug 29, 2012 at 3:27 PM, Martin Grigorov mgrigo...@apache.orgwrote: https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a5a1fe98e3b76110c6827b5744bf83f45ab0aac4 On Wed, Aug 29, 2012 at 9:19 AM, James Eliyezar ja...@mcruncher.com wrote: I like that deal.. :-) On Wed, Aug 29, 2012 at 3:09 PM, Martin Grigorov mgrigo...@apache.org wrote: I'll improve the javadoc. You improve the wiki page ;-) On Wed, Aug 29, 2012 at 9:07 AM, James Eliyezar ja...@mcruncher.com wrote: Thanks Martin for the info. A note in PageRequestHandlerTracker's javadoc can be very useful. And it will be great if this is reflected in the wiki page Request Cycle in wicket 1.5 https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . On Wed, Aug 29, 2012 at 3:03 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Yes, you have to register it. It is not registered by default because not everyone needs it. On Wed, Aug 29, 2012 at 9:01 AM, James Eliyezar ja...@mcruncher.com wrote: Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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:188
Re: Unable to get response page from PageRequestHandlerTracker
Updated the wiki Request Cycle in Wicket 1.5https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 On Wed, Aug 29, 2012 at 3:31 PM, James Eliyezar ja...@mcruncher.com wrote: That was fast Martin. I'm working on the wiki now. On Wed, Aug 29, 2012 at 3:27 PM, Martin Grigorov mgrigo...@apache.orgwrote: https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a5a1fe98e3b76110c6827b5744bf83f45ab0aac4 On Wed, Aug 29, 2012 at 9:19 AM, James Eliyezar ja...@mcruncher.com wrote: I like that deal.. :-) On Wed, Aug 29, 2012 at 3:09 PM, Martin Grigorov mgrigo...@apache.org wrote: I'll improve the javadoc. You improve the wiki page ;-) On Wed, Aug 29, 2012 at 9:07 AM, James Eliyezar ja...@mcruncher.com wrote: Thanks Martin for the info. A note in PageRequestHandlerTracker's javadoc can be very useful. And it will be great if this is reflected in the wiki page Request Cycle in wicket 1.5 https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . On Wed, Aug 29, 2012 at 3:03 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Yes, you have to register it. It is not registered by default because not everyone needs it. On Wed, Aug 29, 2012 at 9:01 AM, James Eliyezar ja...@mcruncher.com wrote: Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93) at org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:237) at org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:167) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:784) 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
Re: Unable to get response page from PageRequestHandlerTracker
I second that Vineet. On Wed, Aug 29, 2012 at 4:12 PM, vineet semwal vineetsemwa...@gmail.comwrote: passing Requestcycle is kind of useless.., PageRequestHandlerTracker can itself get the current requestcycle,i think separate methods like getLastHandler() and getFirstHandler() can be added , they can just delegate to the respectve getMethod(RequestCycle) On Wed, Aug 29, 2012 at 1:32 PM, Martin Grigorov mgrigo...@apache.org wrote: Thanks ! On Wed, Aug 29, 2012 at 10:00 AM, James Eliyezar ja...@mcruncher.com wrote: Updated the wiki Request Cycle in Wicket 1.5 https://cwiki.apache.org/confluence/display/WICKET/RequestCycle+in+Wicket+1.5 On Wed, Aug 29, 2012 at 3:31 PM, James Eliyezar ja...@mcruncher.com wrote: That was fast Martin. I'm working on the wiki now. On Wed, Aug 29, 2012 at 3:27 PM, Martin Grigorov mgrigo...@apache.org wrote: https://git-wip-us.apache.org/repos/asf/wicket/repo?p=wicket.git;a=commitdiff;h=a5a1fe98e3b76110c6827b5744bf83f45ab0aac4 On Wed, Aug 29, 2012 at 9:19 AM, James Eliyezar ja...@mcruncher.com wrote: I like that deal.. :-) On Wed, Aug 29, 2012 at 3:09 PM, Martin Grigorov mgrigo...@apache.org wrote: I'll improve the javadoc. You improve the wiki page ;-) On Wed, Aug 29, 2012 at 9:07 AM, James Eliyezar ja...@mcruncher.com wrote: Thanks Martin for the info. A note in PageRequestHandlerTracker's javadoc can be very useful. And it will be great if this is reflected in the wiki page Request Cycle in wicket 1.5 https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html . On Wed, Aug 29, 2012 at 3:03 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, Yes, you have to register it. It is not registered by default because not everyone needs it. On Wed, Aug 29, 2012 at 9:01 AM, James Eliyezar ja...@mcruncher.com wrote: Guys, From the javadoc of IRequestCycleListener, I found that we have to explicitly register the implementations. I thought PageRequestHandlerTracker would have been registered by default as that's from wicket. So, when I registered it manually, it worked as expected. This is how I registered it in the wicket application's init method. @Override public void init() { super.init(); getRequestCycleListeners().add(new PageRequestHandlerTracker()); } On Wed, Aug 29, 2012 at 2:41 PM, James Eliyezar ja...@mcruncher.com wrote: Should I register PageRequestHandlerTracker anywhere? On Wed, Aug 29, 2012 at 2:40 PM, James Eliyezar ja...@mcruncher.com wrote: Alright Paul. This is my code: public class HomePage extends WebPage { private static Logger logger = LoggerFactory.getLogger(HomePage.class); private static final long serialVersionUID = 1L; public HomePage(final PageParameters parameters) { add(new Label(version, getApplication().getFrameworkSettings().getVersion())); try { IPageRequestHandler lastHandler = PageRequestHandlerTracker.getLastHandler(RequestCycle.get()); logger.debug(Last handler: {}, lastHandler); logger.debug(Requested page, lastHandler.getPage()); } catch (Exception ex) { logger.error(Error, ex); } } } This is the log with exception stack trace: [INFO] Started Jetty Server DEBUG - HomePage - Last handler: null ERROR - DefaultExceptionMapper - Unexpected error occurred org.apache.wicket.WicketRuntimeException: Can't instantiate page using constructor 'public org.apache.wicket.quickstart.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)' and argument ''. Might be it doesn't exist, may be it is not visible (public). at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:193) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:76) at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:46) at org.apache.wicket.DefaultMapperContext.newPageInstance(DefaultMapperContext.java:103) at org.apache.wicket.request.handler.PageProvider.resolvePageInstance(PageProvider.java:274) at org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:165) at org.apache.wicket.request.handler.render.PageRenderer.getPage(PageRenderer.java:78) at org.apache.wicket.request.handler.render.WebPageRenderer.renderPage(WebPageRenderer.java:93
Re: ObjectAutoCompleteBuilder in wicket 1.5.7 get is not a valid Serializable error.
Any updates regarding this? The issue https://github.com/wicketstuff/core/issues/148 filed in the wicketstuff issue tracker remains unanswered. On Thu, Aug 30, 2012 at 3:38 PM, Vignesh Palanisamy vign...@mcruncher.comwrote: This is the Class tom, private class SearchOptions implements Serializable { private String statusKey; public String getStatusKey() { return statusKey; } public void setStatusKey(String statusKey) { this.statusKey = statusKey; } } and another class is status private class Status implements Serializable { private String key; private String value; public Status(String key, String value) { this.key = key; this.value = value; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } @Override public String toString() { return getValue(); } } -Vignesh Palanisamy On Thu, Aug 30, 2012 at 3:26 PM, Thomas Götz t...@decoded.de wrote: Are all properties (fields) of HomePage$SearchOptions also Serializable? -Tom On 30.08.2012, at 03:17, Vignesh Palanisamy vign...@mcruncher.com wrote: while implementing Serializable also the same error came martin! On Wed, Aug 29, 2012 at 6:17 PM, Martin Grigorov mgrigo...@apache.org wrote: This line says it all: private java.lang.Object org.apache.wicket.model.CompoundPropertyModel.target [class=org.apache.wicket.quickstart.HomePage$SearchOptions] - field that is not serializable HomePage$SearchOptions is not Serializable - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar
Is anyone using ObjectAutoCompleteField from wicketstuff?
Hi all, What do you all do display objects in an autocomplete field? I used to use ObjectAutoCompleteField from wicketstuff but seems that it is having some problem with wicket-1.5.xhttps://github.com/wicketstuff/core/issues/148 Do you all use this component or stick to the traditional AutoCompleteTextField? Would love to hear your voice on this. -- Thanks regards James Selvakumar
Re: Is anyone using ObjectAutoCompleteField from wicketstuff?
Select2 is an awesome component. Will try that out. Anybody else out there? On Wed, Sep 12, 2012 at 9:21 AM, Igor Vaynberg igor.vaynb...@gmail.comwrote: http://ivaynberg.github.com/select2/ https://github.com/ivaynberg/wicket-select2 -igor On Tue, Sep 11, 2012 at 5:50 PM, James Eliyezar ja...@mcruncher.com wrote: Hi all, What do you all do display objects in an autocomplete field? I used to use ObjectAutoCompleteField from wicketstuff but seems that it is having some problem with wicket-1.5.xhttps://github.com/wicketstuff/core/issues/148 Do you all use this component or stick to the traditional AutoCompleteTextField? Would love to hear your voice on this. -- Thanks regards James Selvakumar - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar
Re: [Announce] wicket-jquery-ui 6.0.0 released
Hi Sebastien, Checked out the demos and wicket-jquery-ui looks amazing. The examples are very clear, the code looks much simpler. Looks I'll be moving over to wicket-jquery-ui soon. Thank you for all your efforts and hardwork. On Thu, Sep 13, 2012 at 7:19 AM, Sebastien seb...@gmail.com wrote: I am glad to follow, in this announcement period... wicket-jquery-ui 6.0.0 is an integration of jQuery UI (widgets, interactions effects) over Wicket 6.0.0. Some other extensions are also available (Kendo UI widgets, Calendar). Links, infos demos: http://www.7thweb.net/wicket-jquery-ui Best regards, Sebastien. -- Thanks regards James Selvakumar
How to create a dashboard with draggable widgets?
Wicketers, Wondering how to create a google analytics style dashboard with draggable widgets that remembers it's position across sessions. Please share your thoughts. -- Thanks regards James Selvakumar
Re: Datepicker with range selection support
This is really amazing Sebastien. wicket-jquery-ui is really feature rich. Is the demo site a wicket app? On Mon, Sep 24, 2012 at 1:38 AM, Sébastien Gautrin sebastien.gaut...@gmail.com wrote: Wow, This is simply terrific. I will sift through all this in the next weeks. All I can say is a big thanks for everything! Sébastien On 22/09/12 19:00, Sebastien wrote: Hi Sebastien. wicket-jquery-ui has the goal to integrate jQuery UI widgets as Wicket components; but it's also designed to integrate (easily, I guess) any jQuery plugins (that's what I tend to evince in the tutorial series...). So, I played around with the fox-run-software (range-)date-picker... I noticed that the (kind-of) drop-down box which displays the date-picker is not shipped in the library and should therefore be achieved out of the box, as stated here: http://www.foxrunsoftware.net/**articles/javascript/date-** range-picker-similar-to-**google-analytics/http://www.foxrunsoftware.net/articles/javascript/date-range-picker-similar-to-google-analytics/ Given this, I did integrate two components (for both Wicket 1.5.8 Wicket 6.0.0): The first one is a RangeDatePicker, which is designed - when used alone - to be an 'inline' widget, with an ajax behavior triggered on 'change' event. This component can serves as base for more complex component, like a google-analytics-date-picker..**.. (you will notice that the change event is triggered on every date click... A merge request - that provide an 'onRangeChanged' event - is in stand-by since a month and has therefore not been merged yet). The second component relies on this first one and on a TextField to make the RangeDatePickerTextField (which indeed is a FormComponent). It should be closed to the component you are looking for... http://www.7thweb.net/wicket-**jquery-ui/plugins/datepicker/** RangeDatePickerTextFieldPagehttp://www.7thweb.net/wicket-jquery-ui/plugins/datepicker/RangeDatePickerTextFieldPage If it fits your needs, you can either use it (released as com.googlecode.wicket-jquery-**ui:jquery-ui-plugin:1.2.3-**SNAPSHOT) or have a look at github project to see how it works. Sure, do not hesitate to have a look at the other integrations as well (wicket-select2 is a prime example, and the other jQuery integrations too). If you have any questions, do not hesitate to use the forum (you may find the link on the demo site's homepage) Best regards, Sebastien. On Fri, Sep 21, 2012 at 4:37 PM, Sébastien Gautrin sebastien.gaut...@gmail.com wrote: Well, If you make a tutorial about creating a plugin using wicket-jquery-ui, even though it'll be for wicket 6, it should be relatively simply adaptable to do the same for wicket 1.5 (unless there's a huge lot of changes between the two for wicket-jquery-ui which is quite possible considering wicket 6 comes with jquery support unlike 1.5). I'll take a look at your current how tos for wicket-jquery-ui (we don't use wicket-jquery-ui for the moment - we have a few components using wiquery and a couple very old components using jquery-ui in a crappy way), but that's always interesting to see what's out there and how it works. I'll take a closer look on wicket-select2 as well, as I suppose it could be a good inspiration to integrate the fox run software datepicker library (which is not using jquery-ui). Regards, Sébastien Sebastien wrote: Hi again, Well... I was looking for a jQuery plugin for the 3rd part of my HowTo's, about creating a plugin using wicket-jquery-ui. Maybe will I play with that one in the coming days... (just note that it will be over Wicket 6) Regards, Sebastien. --**--**- To unsubscribe, e-mail: users-unsubscribe@wicket.**apache.orgusers-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Thanks regards James Selvakumar
Re: How to create a dashboard with draggable widgets?
It's exciting to be part of wicket community. Thanks a lot friends for your enthusiastic responses. I will go through the resources you have shared. On Fri, Sep 21, 2012 at 6:13 PM, Decebal Suiu decebal.s...@asf.ro wrote: Hi I will release today or Monday a wicket-dashboard project on github. This project it's an open source project (Apache license) based on the dashboard implementations from nextserver (for a live demo see http://http://demo.next-reports.com/ user:demo, password:demo). I used jquery sortable from wiquery (in another project I uesd jqwicket) for dragdrop. When user stop on dragdrop a widget, a js function calls a wicket behavior with a json (as parameter) that contains the position (column and row) for each widget. I have a implementation for widgets like charts (openflashchart), text, pivot (see https://github.com/decebals/wicket-pivot) Best regards, Decebal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-to-create-a-dashboard-with-draggable-widgets-tp4652210p4652218.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 -- Thanks regards James Selvakumar
Re: [Announce] wicket-dashboard
This is a very good news. Will be using this right away! I have a small problem guys, definitely something is wrong with my setup (I'm using nexus). I get this exception when I try to build the project. No versions available for org.codehaus.jackson:jackson-mapper-asl:jar:[1.8,1.8.6],[1.9,1.9.7] within specified range But there indeed is a jackson-mapper-asl jar in my nexus. What's wrong here? On Sun, Sep 30, 2012 at 2:55 AM, Paul Szulc paul.sz...@gmail.com wrote: ok, I was using my own internal repo, that is why it did not work now all is fine, dashboard look pretty damn cool, I will love to use it in one of my applications. did you used it on any production code yet? best regards pawel szulc On Tue, Sep 25, 2012 at 8:35 PM, Gabriel Landon glan...@piti.pf wrote: If you look in the pom.xml, you will find the repo : repository idjofc2.maven.repo/id nameJOFC2 GoogleCode.com Snapshot Repository/name url http://jofc2.googlecode.com/svn/repository/snapshots/ /url /repository -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Announce-wicket-dashboard-tp4652308p4652343.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 -- Thanks regards James Selvakumar
Re: [Announce] wicket-dashboard
Managed to get the demo working. It's really elegant. Echoing the same feelings as Paul. It would be nice to split this up into relevant modules. While I was playing around with the code, I thought of creating a custom widget with just a data table. So I created the following classes: - TableWidget - TableWidgetView - TableWidgetDescriptor Now what should be in TableWidget and what should be in TableWidgetView? Should I expose the data provider and columns separately from TableWidget? On Mon, Oct 1, 2012 at 10:35 PM, Paul Szulc paul.sz...@gmail.com wrote: Hi, I will be adding your dashboard to one of my projects - this is a matter of weeks (customer is really, really excited ;)). I have some suggestions, I would divide the project into seperate modules: - wicket-dashboard-core: module with dashboard itself, simply juest the component and needed interfaces (jar as an output) - wicket-dashboard-widgets: module were some standard widgets would be implemented (jar as an output) - wicket-dashboard-demo: module with demo useage (war as an output) This way to use dashboard one must simply add wicket-dashboard-core as dependency. He can now develop his own widgets or use standard widgets. To use standard widgets, he must also add wicket-dashboard-widgets as dependency to his project. What do you think about it? Paul Szulc On Mon, Oct 1, 2012 at 10:29 AM, Decebal Suiu decebal.s...@asf.ro wrote: Hi Thanks Paul for the nice words. wicket-dashboard code is used in production in NextReports server (see http://apache-wicket.1842946.n4.nabble.com/How-to-create-a-dashboard-with-draggable-widgets-tp4652210p4652218.html ) but with some additional features (multiple dashboards, detached widgets, ...). If you have any questions, ideas or suggestions, please do not hesitate to contact me. Best regards, Decebal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Announce-wicket-dashboard-tp4652308p4652565.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 -- Thanks regards James Selvakumar