Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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)
 at
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread Martin Grigorov
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.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 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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)
  at
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread Martin Grigorov
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.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
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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

2012-08-29 Thread Martin Grigorov
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.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
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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)
at
   
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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)
at
   
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread Martin Grigorov
Thanks !

On Wed, Aug 29, 2012 at 10:00 AM, James Eliyezar ja...@mcruncher.com wrote:
 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
   
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread vineet semwal
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.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
   
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-29 Thread James Eliyezar
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

   
  
 
 

Re: Unable to get response page from PageRequestHandlerTracker

2012-08-28 Thread Paul BorČ™
Might help if you provide a stack trace for the NPE :)

Have a great day,
Paul BorČ™

On Aug 29, 2012, at 0:37, James Eliyezar ja...@mcruncher.com wrote:

 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

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org