Discussion:
Rendering a page for storage
René Stolle
2018-09-16 19:48:49 UTC
Permalink
Hello,

most of my projects have a AppStatus Page containing some statistics.

No I need to store this information on web server shut down and I was
wondering, if I could just persist a freshly rendered page and have
everything I need nicley formatted in a html file. The javadoc looked
promising but the following code in my app class

@Override
protected void onDestroy() {
    ComponentRenderer cr = new ComponentRenderer(this);
    logStatus (cr.renderPage(AppStatus::new));
}

gave me only a java.lang.IllegalArgumentException: Request must be
ServletWebRequest

What did I miss? Am I on the right path?

René

---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Bas Gooren
2018-09-17 04:23:34 UTC
Permalink
Hi René,

If I recall correctly, the component renderer uses a mock request and
response to render components. Does your page (or any injected
services) require the request to be a servlet request?

// Bas

Verstuurd vanaf mijn iPhone
Post by René Stolle
Hello,
most of my projects have a AppStatus Page containing some statistics.
No I need to store this information on web server shut down and I was
wondering, if I could just persist a freshly rendered page and have
everything I need nicley formatted in a html file. The javadoc looked
promising but the following code in my app class
@Override
protected void onDestroy() {
ComponentRenderer cr = new ComponentRenderer(this);
logStatus (cr.renderPage(AppStatus::new));
}
gave me only a java.lang.IllegalArgumentException: Request must be
ServletWebRequest
What did I miss? Am I on the right path?
René
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Sven Meier
2018-09-17 20:24:59 UTC
Permalink
Hi,

that exception seems to originate from HttpSessionStore, which indicates
some code tries to store something in the HTTP session.

Please show us the stacktrace.

Have fun
Sven
Post by Bas Gooren
Hi René,
If I recall correctly, the component renderer uses a mock request and
response to render components. Does your page (or any injected
services) require the request to be a servlet request?
// Bas
Verstuurd vanaf mijn iPhone
Post by René Stolle
Hello,
most of my projects have a AppStatus Page containing some statistics.
No I need to store this information on web server shut down and I was
wondering, if I could just persist a freshly rendered page and have
everything I need nicley formatted in a html file. The javadoc looked
promising but the following code in my app class
@Override
protected void onDestroy() {
ComponentRenderer cr = new ComponentRenderer(this);
logStatus (cr.renderPage(AppStatus::new));
}
gave me only a java.lang.IllegalArgumentException: Request must be
ServletWebRequest
What did I miss? Am I on the right path?
René
---------------------------------------------------------------------
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...