Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-08 Thread Thomas R. Corbin
On Thursday 03 May 2007 6:30 pm, Igor Vaynberg escreveu:
 hrm. i would consider that a bug i think. i dont see why it would get
 called before constructor. can you set a breakpoint in there and paste the
 stacktrace please.

I'm still using the pre-wicket name change stuff.  I can upgrade, 
though it 
might take an evening's work to do so.   I threw an exception in my method 
where the markup gets generated, so that's what the GUNK! bit is.


Can't instantiate page using constructor public 
com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument 
queryName = viewMeterRoute
wicket.WicketRuntimeException: Can't instantiate page using constructor public 
com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument 
queryName = viewMeterRoute
at 
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
at 
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:95)
at 
wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:260)
at 
wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:275)
at 
wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:204)
at 
wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:89)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:961)
at wicket.RequestCycle.step(RequestCycle.java:1034)
at wicket.RequestCycle.steps(RequestCycle.java:1113)
at wicket.RequestCycle.request(RequestCycle.java:474)
at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248)
at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:122)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at 
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:153)
... 25 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at wicket.proxy.$Proxy11.getMarkupResourceStream(Unknown Source)
at 
com.samsix.reports.QueryDialogPage.getMarkupResourceStream(QueryDialogPage.java:95)
at wicket.markup.MarkupCache.getMarkup(MarkupCache.java:286)
at wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:110)
at 
wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:327)
at wicket.markup.html.WebPage.commonInit(WebPage.java:210)
at wicket.markup.html.WebPage.init(WebPage.java:98)
at com.samsix.wicket.NrgPage.init(NrgPage.java:33)
at com.samsix.wicket.VariationPage.init(VariationPage.java:39)
at com.samsix.reports.QueryDialogPage.init(QueryDialogPage.java:58)
... 30 more
Caused by: java.lang.Exception: GUNK!
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at 

Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-08 Thread Igor Vaynberg

ah, you are just using an old version.

this is the _exact_ problem that chris encountered, and has been fixed a
long time ago.

-igor


On 5/8/07, Thomas R. Corbin [EMAIL PROTECTED] wrote:


On Thursday 03 May 2007 6:30 pm, Igor Vaynberg escreveu:
 hrm. i would consider that a bug i think. i dont see why it would get
 called before constructor. can you set a breakpoint in there and paste
the
 stacktrace please.

I'm still using the pre-wicket name change stuff.  I can upgrade,
though it
might take an evening's work to do so.   I threw an exception in my method
where the markup gets generated, so that's what the GUNK! bit is.


Can't instantiate page using constructor public
com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument
queryName = viewMeterRoute
wicket.WicketRuntimeException: Can't instantiate page using constructor
public
com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument
queryName = viewMeterRoute
at
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
at
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:95)
at
wicket.request.target.component.BookmarkablePageRequestTarget.newPage(
BookmarkablePageRequestTarget.java:260)
at
wicket.request.target.component.BookmarkablePageRequestTarget.getPage(
BookmarkablePageRequestTarget.java:275)
at

wicket.request.target.component.BookmarkablePageRequestTarget.processEvents
(BookmarkablePageRequestTarget.java:204)
at
wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:89)
at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
:961)
at wicket.RequestCycle.step(RequestCycle.java:1034)
at wicket.RequestCycle.steps(RequestCycle.java:1113)
at wicket.RequestCycle.request(RequestCycle.java:474)
at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248)
at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
:122)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at

org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:153)
... 25 more
Caused by: java.lang.reflect.UndeclaredThrowableException
at wicket.proxy.$Proxy11.getMarkupResourceStream(Unknown Source)
at
com.samsix.reports.QueryDialogPage.getMarkupResourceStream(
QueryDialogPage.java:95)
at wicket.markup.MarkupCache.getMarkup(MarkupCache.java:286)
at wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:110)
at
wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:327)
at wicket.markup.html.WebPage.commonInit(WebPage.java:210)
at wicket.markup.html.WebPage.init(WebPage.java:98)
at com.samsix.wicket.NrgPage.init(NrgPage.java:33)
at com.samsix.wicket.VariationPage.init(VariationPage.java:39)
at com.samsix.reports.QueryDialogPage.init(QueryDialogPage.java
:58)
... 30 more
Caused by: java.lang.Exception: GUNK!
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(
NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-08 Thread Thomas R. Corbin
On Tuesday 08 May 2007 1:06 pm, Igor Vaynberg escreveu:
 ah, you are just using an old version.

 this is the _exact_ problem that chris encountered, and has been fixed a
 long time ago.

Cool, thanks.  I'll upgrade.


 -igor

 On 5/8/07, Thomas R. Corbin [EMAIL PROTECTED] wrote:
  On Thursday 03 May 2007 6:30 pm, Igor Vaynberg escreveu:
   hrm. i would consider that a bug i think. i dont see why it would get
   called before constructor. can you set a breakpoint in there and paste
 
  the
 
   stacktrace please.
 
  I'm still using the pre-wicket name change stuff.  I can upgrade,
  though it
  might take an evening's work to do so.   I threw an exception in my
  method where the markup gets generated, so that's what the GUNK! bit is.
 
 
  Can't instantiate page using constructor public
  com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument
  queryName = viewMeterRoute
  wicket.WicketRuntimeException: Can't instantiate page using constructor
  public
  com.samsix.reports.QueryDialogPage(wicket.PageParameters) and argument
  queryName = viewMeterRoute
  at
  wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:174)
  at
  wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:95)
  at
  wicket.request.target.component.BookmarkablePageRequestTarget.newPage(
  BookmarkablePageRequestTarget.java:260)
  at
  wicket.request.target.component.BookmarkablePageRequestTarget.getPage(
  BookmarkablePageRequestTarget.java:275)
  at
 
  wicket.request.target.component.BookmarkablePageRequestTarget.processEven
 ts (BookmarkablePageRequestTarget.java:204)
  at
  wicket.request.AbstractRequestCycleProcessor.processEvents(
  AbstractRequestCycleProcessor.java:89)
  at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java
 
  :961)
 
  at wicket.RequestCycle.step(RequestCycle.java:1034)
  at wicket.RequestCycle.steps(RequestCycle.java:1113)
  at wicket.RequestCycle.request(RequestCycle.java:474)
  at wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:248)
  at wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java
 
  :122)
 
  at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
  ApplicationFilterChain.java:202)
  at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(
  ApplicationFilterChain.java:173)
  at
  org.apache.catalina.core.StandardWrapperValve.invoke(
  StandardWrapperValve.java:213)
  at
  org.apache.catalina.core.StandardContextValve.invoke(
  StandardContextValve.java:178)
  at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
 
  :126)
 
  at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
 
  :105)
 
  at
  org.apache.catalina.core.StandardEngineValve.invoke(
  StandardEngineValve.java:107)
  at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
 
  :148)
 
  at
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869
 ) at
 
  org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proce
 ssConnection (Http11BaseProtocol.java:664)
  at
  org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
  PoolTcpEndpoint.java:527)
  at
  org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
  LeaderFollowerWorkerThread.java:80)
  at
  org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
  ThreadPool.java:684)
  at java.lang.Thread.run(Thread.java:619)
  Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
  Method)
  at
  sun.reflect.NativeConstructorAccessorImpl.newInstance(
  NativeConstructorAccessorImpl.java:39)
  at
  sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
  DelegatingConstructorAccessorImpl.java:27)
  at
  java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
  wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:153)
  ... 25 more
  Caused by: java.lang.reflect.UndeclaredThrowableException
  at wicket.proxy.$Proxy11.getMarkupResourceStream(Unknown Source)
  at
  com.samsix.reports.QueryDialogPage.getMarkupResourceStream(
  QueryDialogPage.java:95)
  at wicket.markup.MarkupCache.getMarkup(MarkupCache.java:286)
  at
  wicket.markup.MarkupCache.getMarkupStream(MarkupCache.java:110) at
  wicket.MarkupContainer.getAssociatedMarkupStream(MarkupContainer.java:327
 ) at wicket.markup.html.WebPage.commonInit(WebPage.java:210) at
  wicket.markup.html.WebPage.init(WebPage.java:98)
  at com.samsix.wicket.NrgPage.init(NrgPage.java:33)
  at com.samsix.wicket.VariationPage.init(VariationPage.java:39)
  at com.samsix.reports.QueryDialogPage.init(QueryDialogPage.java
 
  :58)
 
  ... 30 

[Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-03 Thread Thomas R. Corbin

I've got some groovy code which processes an xml file and generates some html.  
Right now I do it at build time, but would really prefer to do it at run 
time.   I've got some code hooked up which does so, but all I get is an empty 
page.

I'm using wicket 1.3.0-snapshot (prior to the name change)

when building the page, I run the following groovy code, where the buffer 
contains the html I generate.

MarkupParser  parser  = new MarkupParser( new XmlPullParser() )
Markupmarkup  = parser.parse( buffer )

def markupStream= new MarkupStream( markup )

page.setMarkupStream( markupStream )


I've tried overriding onRender in the page java code and calling 
renderComponent with my markup stream, but I still don't get anything 
showing.   It works with the same html generated at build time.

Am I way off base and this just won't work, or do I have some details mucked 
up?

Thanks,
Tom

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-03 Thread Igor Vaynberg

see IMarkupResourceStreamProvider, there is also an example in
wicket-examples that shows custom markup loading.

-igor


On 5/3/07, Thomas R. Corbin [EMAIL PROTECTED] wrote:



I've got some groovy code which processes an xml file and generates some
html.
Right now I do it at build time, but would really prefer to do it at run
time.   I've got some code hooked up which does so, but all I get is an
empty
page.

I'm using wicket 1.3.0-snapshot (prior to the name change)

when building the page, I run the following groovy code, where the buffer
contains the html I generate.

MarkupParser  parser  = new MarkupParser( new XmlPullParser() )
Markupmarkup  = parser.parse( buffer )

def markupStream= new MarkupStream( markup )

page.setMarkupStream( markupStream )


I've tried overriding onRender in the page java code and calling
renderComponent with my markup stream, but I still don't get anything
showing.   It works with the same html generated at build time.

Am I way off base and this just won't work, or do I have some details
mucked
up?

Thanks,
Tom

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-03 Thread Thomas R. Corbin
On Thursday 03 May 2007 5:05 pm, Igor Vaynberg escreveu:
 see IMarkupResourceStreamProvider, there is also an example in
 wicket-examples that shows custom markup loading.

Thanks.  I think I'll have to go with the build time option because the 
getMarkupResourceStream( container, containerClass ) method gets called 
before any code in my constructor has a chance to look at the PageParameters 
to find out where the xml file is to be able to build the html.

I don't see any way to delay the markup processing/loading until after 
I can 
examine the PageParameters.


 -igor

 On 5/3/07, Thomas R. Corbin [EMAIL PROTECTED] wrote:
  I've got some groovy code which processes an xml file and generates some
  html.
  Right now I do it at build time, but would really prefer to do it at run
  time.   I've got some code hooked up which does so, but all I get is an
  empty
  page.
 
  I'm using wicket 1.3.0-snapshot (prior to the name change)
 
  when building the page, I run the following groovy code, where the buffer
  contains the html I generate.
 
  MarkupParser  parser  = new MarkupParser( new XmlPullParser() )
  Markupmarkup  = parser.parse( buffer )
 
  def markupStream= new MarkupStream( markup )
 
  page.setMarkupStream( markupStream )
 
 
  I've tried overriding onRender in the page java code and calling
  renderComponent with my markup stream, but I still don't get anything
  showing.   It works with the same html generated at build time.
 
  Am I way off base and this just won't work, or do I have some details
  mucked
  up?
 
  Thanks,
  Tom
 
  -
  This SF.net email is sponsored by DB2 Express
  Download DB2 Express C - the FREE version of DB2 express and take
  control of your XML. No limits. Just data. Click to get it now.
  http://sourceforge.net/powerbar/db2/
  ___
  Wicket-user mailing list
  Wicket-user@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/wicket-user

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user


Re: [Wicket-user] Is it possible to use setMarkupStream to assign html to a web page?

2007-05-03 Thread Chris Colman
Sounds like a similar bug I had with overriding getVariation on WebPage.
This is now fixed in 1.2.6. The wicket authors had to rearrange the
ordering of initialization to ensure that my constructor got called
before the call to my overridden getVariation method. It could be that
they may have to do a similar thing for your case.

At the time I proposed a two phase initialization solution like most OO
frameworks have adopted: 

Phase 1: Constructors are called and allowed to return resulting in
fully constructed objects.

Phase 2: The framework calls 'init' on the fully constructed object - at
this point init will be working on fully constructed objects and so
avoid the issue I had and the issue you are having with parameters not
yet being processed and member data and relationships possibly not being
in the correct state.

The wicket authors prefer the current, single phase construction
approach, over a two phase initialization approach because it avoids the
task of writing 'init' methods but given that just about every other OO
framework I've ever used uses two phase initialization of objects I
think that wicket will continue to suffer bugs like yours and mine.

As wicket's popularity snowballs they're going to get more and more
propeller head users like you and me that have a great idea and then try
and implement it in wicket - often going where no man or woman has gone
before and pushing things to the edge of breaking. To date they've been
able to rearrange things under the bonnet to work around my issue and I
hope they can do that with your issue too but I fear that one day
someone is going to come up with a great idea that won't elegantly work
with a single phase construction/initialization mechanism. I don't know
how what the outcome of that would be.

 hrm. i would consider that a bug i think. i dont see why it would get
 called
 before constructor. can you set a breakpoint in there and paste the
 stacktrace please.
 
 -igor
 
 
 On 5/3/07, Thomas R. Corbin [EMAIL PROTECTED] wrote:
 
  I don't see any way to delay the markup processing/loading until
  after I can examine the PageParameters.

Exactly what my problem was.

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user