Re: AbstractTransformerBehavior prevents further rendering.

2020-08-18 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Dienstag, 18. August 2020 um 08:50 schrieben Sie:

> sorry I missed that: on first sight it seems to work with a single
> transformer only.

Is that a special restriction for transformers only? Because
behaviours in general seem to be looped through when rendering
components.

Doesn't it make more sense to support multiple transformers as well?
Need to decide if I try to fix the underlying root cause or implement
a workaround. Combing my transformers isn't that easy, they are
totally unrelated in theory and are used individually already.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: AbstractTransformerBehavior prevents further rendering.

2020-08-18 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Montag, 17. August 2020 um 20:34 schrieben Sie:

> please create a quickstart, without debugging I cannot pinpoint the problem.

Will try to have a look at this later. In general, should multiple of
my behaviours on the same component work? Do you know of any tests in
place already making sure this works?

Because in my setup the problem happens when executed using
WicketTester, which might make a difference to normal rendering as
well.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



AbstractTransformerBehavior prevents further rendering.

2020-08-17 Thread Thorsten Schöning
Hi all,

I'm using Wicket as a renderer for HTML-reports WITHOUT browser, web
server or requests, only by using ComponentRenderer. There are two
implementations of AbstractTransformerBehavior to update "colspan"
attributes of table cells and IDs of arbitrary HTML nodes. Both are
used on the same component:

> resultsCont.add(new DvResultsCont.ColSpanUpdater());
> resultsCont.add(new MkIdReplacer
> (
>   "th", "id", "td", "headers",
>   String.format("%d.%s", itemIdx, kindOfDetail)
> ));

When only ONE of both behaviours is used, the page renders
successfully and it doesn't make any difference which one is used. If
both of those are used OTOH, the page stops rendering after the markup
of the component "resultsCont". That component renders to a table, so
the last markup I have is the following:

> 
> [...]
> 

In theory, after that table there should be additional content like
foots, closing elements for HTML itself etc. So the current rendering
is invalid. It's important to note, though, that I don't get any
exception, things seems to simply stop. When enabling DEBUG logging
during rendering, the logs make pretty much clear that Wicket really
tries to continue rendering, but the output is simply missing.

It might be of interest that the resulting HTML is somewhat large,
around 1,7 MiB. Though I didn't find any hard-coded limits in the
behaviours yet in that direction.

As no exceptions are thrown and output seems to simply be ignored at
some point, I have the feeling the problem is in handling the response
objects in "AbstractTransformerBehavior.afterRender". But I couldn't
find anything problematic during debugging yet and things seem to work
with only one behaviour applied.

Do you have any idea what might go wrong? Is there any size limit with
behaviours or when rendering at all? Is it generally OK to place
multiple behaviours onto one and the same component?

Thanks for your ideas!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Does addressing components by path support wildcards or alike?

2020-08-14 Thread Thorsten Schöning
Hi all,

I have some data view providing multiple result rows and each of those
rows is again some data view providing multiple rows. The
corresponding HTML is simply multiple "article"-elements containing
some headline and a table with multiple rows.

I have tests in place checking if the outer data view is available,
but would like to test the inner one, the tables, as well. Using path
syntax I have something like the following:

> tester.assertVisible("[...]:resultsRow:2:[...]:resultsContainer");

The problem is that because of something I didn't find yet[1], the
index "2" changes from time to time, making the tests unreliable. In
theory I don't care too much about a concret index, anyone would be
enough for me already.

So is there something like "*" or alike to tell Wicket to use any
component available at that level? Tested already, but didn't succeed.

> tester.assertVisible("[...]:resultsRow:*:[...]:resultsContainer");

Thanks!

[1]: 
http://mail-archives.apache.org/mod_mbox/wicket-users/202003.mbox/%3C919488035.20200318092902%40am-soft.de%3E

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: "wicket:message" in markup combined with Property Expression Language

2020-08-14 Thread Thorsten Schöning
Guten Tag Bas Gooren,
am Freitag, 14. August 2020 um 14:59 schrieben Sie:

> In both classes I see that wicket uses the provided message key verbatim,
> without doing any property replacement prior to using it to find a
> localized message.
> This means you’ll have to wire things up in java code to make your use-case
> work.

Thanks for looking into this. As I only needed two cases currently, I
decided to rollback to my former implementation of subclassing my
panel into two and create instances of those subclasses. This allows
to have individual language files per subclass again and seems easier
than to work with components not used otherwise.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



"wicket:message" in markup combined with Property Expression Language

2020-08-14 Thread Thorsten Schöning
Hi all,

I know how to use StringResourceModel with Property Expression
Language to read keys and values from language files using some
dynamic parts. The point is that StringResourceModel needs to be
provided to some component, like a label, or that model needs to be
used manually to read some values.

But is the same available when Wicket does things automatically, like
handling localized messages?

>  title="Show details of all [...] meters."
> wicket:message="title:caption.${kindOfDetail}.show.title">
> 
> Details of all [...] meters.
> 

That link is part of some markup of some component, but is not used by
the component itself, only by some client-side JavaScript. Though, I
would like to make the "caption"-text be resolved by some dynamic key
provided by the component.

Is that posisble and if so, how do I need to provide that key? Do I
need to set a StringResourceModel with that key as default model of
that component?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket can't distinguish multiple submit button in case of one form.

2020-06-26 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Freitag, 26. Juni 2020 um 10:44 schrieben Sie:

> I don't understand what I'm doing wrong, the plain HTML submit-input
> is pretty much exactly what is documnted elsewhere:

Found the problem: JS-handlers disabled the inputs BEFORE actually
sending the form to not let users accidently click too many times and
stuff like that. Disabled inputs are not part of POSTed data.

Need to solve that differently and afterwards Wicket's parts most
likely work as expected as well.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket can't distinguish multiple submit button in case of one form.

2020-06-26 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Freitag, 26. Juni 2020 um 10:34 schrieben Sie:

>> >   name="foobar"
>>   value="foobar"
>>   title="foobar"
>> />

Using a button instead works as one would expect: When that button is
clicked, the form gets submitted and the name and value of the button
are send as part of the POST-data. If any other "submit" gets clicked,
no names and values are part of the POST-data, not even the name and
value of the button. Which makes sense, because it wasn't clicked.

>name="foobar button"
>   value="foobar button"
>   title="foobar button">
>   foobar button
> 

I don't understand what I'm doing wrong, the plain HTML submit-input
is pretty much exactly what is documnted elsewhere:

> 
> 

https://stackoverflow.com/questions/22579616/send-value-of-submit-button-when-form-gets-posted

> Jeder Submit-Button hat ein individuelles name-Attribut, mit dem die
> Anwendung auf dem Server den Datensatz identifiziert.

https://www.mediaevent.de/html/submit.html

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket can't distinguish multiple submit button in case of one form.

2020-06-26 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Freitag, 26. Juni 2020 um 10:24 schrieben Sie:

> My HTML is pretty much the same, only more bloated because of my use
> case:

I just recognized that Wicket seems to set "name" attributes on inputs
differently on runtime than in my HTML, so I added a non-Wicket
maintained "submit" again.

>name="foobar"
>   value="foobar"
>   title="foobar"
> />

That button is shown in the UI, can be clicked and submits the form
like all the other submit-buttons do. But there's no hint to that name
in the URL or POST-data.

What should happen in theory? Should "foobar" be part of the POST
data? With or without any value?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket can't distinguish multiple submit button in case of one form.

2020-06-26 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Donnerstag, 25. Juni 2020 um 23:41 schrieben Sie:

> for a normal form submit the browser should send "bcdHistory.upload" as
> post parameter.

That's what one can read at some places, but my inputs of type
"submit" are not POSTed in different browsers. Neither with nor
without a "name" attribute. Even the official docs don't use any 
"name" at all:

> 
> 
> 
> 

My HTML is pretty much the same, only more bloated because of my use
case:

>method="post"
>   accept-charset="UTF-8"
>   wicket:id="realEstates.fmInstallTest">
>   [...]
>   
>  name="barfoo"
>   value="Start installation test"
>   title="Start installation test"
>   
> wicket:message="value:submit.value,title:submit.title"
>   />
>  value="Clear inputs"
>   title="Clear inputs"
>   
> wicket:message="value:reset.value,title:reset.title"
>   />
> 
>   
>  name="hidden_foobar"
>   value="Upload basic claims data"
>   />
>  name="foobar"
>   value="Upload basic claims data"
>   title="Upload basic claims data"
>   wicket:id="bcdHistory.upload"
>   
> wicket:message="value:bcdHistory.upload.value,title:bcdHistory.upload.title"
>   />
>   [...]
>   
>   
> 

"reset" is not send as expected, but neither of the "submit"s are as
well. No matter if they contain an explicit "name" or not. I guess
because of the URL Wicket forwards to the main form "onSubmit" always,
so I didn't recognize any problems in the past.

The hidden input OTOH gets instantly POSTed as expected after adding
it. I can change names across requests and that is reflected in the
POSTed form data instantly as well. I even deleted any web server
caches and restarted that regularly already. It additionally doesn't
make any difference of both "submit" are Wicket-components are the
default one is plain HTML.

How should HTML look like that "submit" gets send in the POST-body?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Wicket can't distinguish multiple submit button in case of one form.

2020-06-25 Thread Thorsten Schöning
Hi all,

I have one form in which I need two submit buttons with different
behaviour. The first is to submit the form with default
implementation, to do whatever the form needs to do. The second is to
submit the form WITHOUT doing what the form normally does, but
something completely different and redirect differently afterwards.

I've implemented this simply following the official docs:

https://cwiki.apache.org/confluence/display/WICKET/Multiple+submit+buttons

The problem is that Wicket can't properly find the submitting button
of the second request and therefore routes ALL requests to "onSubmit"
of the form only. "onSubmit" of the additionally added button never
fires. During debugging, one can easily see that when iterating
possible components in "Form.findSubmittingButton", Wicket doesn't
find the necessary component name of the second buttin in the request
parameters. 

My request looks like the following, with the first being the
requested URL:

> wicket/bookmarkable/de.am_soft.sm_mtg.frontend.pages.real_estates.PgInstallTest?22-9.-html-body-realEstates.fmInstallTest

Posted form data:

> realEstates.fcPnTargetSearch:realEstate: F6 F9
> text.seconds: Sekunden
> text.minutes: Minuten
> text.hours: Stunden
> text.days: Tage
> realEstates.fcPnBcdUpload:basicClaimsData.upload: (binary)
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.negativeVariation.quantity:
>  15
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.negativeVariation.unit: 
> MINUTE
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.timestamp.date: 2020-06-25
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.timestamp.time: 18:16
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.positiveVariation.quantity:
>  15
> readings.fcPnTimeWindowDetailed:timeWindow.detailed.positiveVariation.unit: 
> MINUTE
> readings.fcPnOptClientTz:options.clientTimeZone: Europe/Berlin
> realEstates.fcPnBcdUploadCharset:basicClaimsData.charset: Windows-1252
> readings.fcPnOptCsvCharset:options.csvCharset: Windows-1252
> realEstates.fcPnBcdUploadCache:basicClaimsData.cache: on
> readings.fcPnOptRecords:options.mostCurrentRecords: on

The name of the second submit button within the same form:

> bcdHistory.upload

While the button is properly reflected in the HTML, there's no hint to
it in the posted data or in the requested URL.

So how should adressing different "onSubmit"s work in generally? Does
the parent form encode hints in the requested URL? If so, what could
be the reason that it doesn't in my case?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



How to parse URL-strings based on some template for contained parameters?

2020-05-27 Thread Thorsten Schöning
Hi all,

I'm using Wicket as some template engine to generate reports about
tabular data as HTML-documents in a backend published using SOAP. The
called SOAP-interfaces expect what to generate pretty much as some
path/URL-like resource description:

> alert/topic1/foo/bar
> report/topic1/foo/bar
> report/topic2/bar/foo

I would like to have some parser for those kinds of paths/URLs, so
that I'm able to provide some template-paths and get some results by
name.

> ${type}/${topic}/foo/${fooVal}

Is something like that available in Wicket already?

Looking at "PageParameters", Wicket does only support query strings
and indexed parameters, so no support for templates like the above.
Indexed parameters don't seem too different, though. Additionally,
"PagerParameters" doesn't seem to support parsing itself.

So how can I parse a string only and get "PageParameters"?

I've found "UrlRequestParametersAdapter" and
"UrlPathPageParametersEncoder", the latter supports decoding paths
like "/key1/value/key2/value" etc. And both don't seem to be bound to
an application or HTTP, which would exactly be what I need.

Anything else to look at? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: ERROR org.apache.wicket.protocol.http.WebApplication.storeBufferedResponse

2020-04-03 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Mittwoch, 1. April 2020 um 21:09 schrieben Sie:

> Seems WebPageRenderer thinks it has to store the rendering result and
> redirect to it.
> That's definitely nothing something you want to have when using
> ComponentRenderer.

Agreed, but I couldn't find yet why it thinks so. Additionally, as I
get the correct render result, the redirect target seems to be the
expected outpout anyway? So is trying to buffering the "problem" here
or the redirect already or both?

> There's probably something in your setup that triggers this redirect 
> (e.g. page url changes after render).

I can't think of dealing with URLs beyond "setAutomaticLinking", but
will have a look at this later: Im rendering HTML and some plain-text
format using Wicket, in the latter case transforming HTML-links using
TransformerBehavior to something like the following:

> Linktext:HREF

And the error really gets only logged when rendering HTML, NOT when
rendering plain text. The app used to render both formats and their
base page is the same, though. Difference is markup and things like
TransformerBehaviour.

> Maybe we could improve ComponentRender so it never redirects.

And throw an exception to find that unexpected redirect or simply
ignore it at all? If that redirect-by-accident leads to wrong results,
an exception w9ould be good. Otherwise in my case I might not care too
much, as results are simply as expected.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: ERROR org.apache.wicket.protocol.http.WebApplication.storeBufferedResponse

2020-04-01 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Mittwoch, 1. April 2020 um 17:31 schrieben Sie:

> Without a quickstart it's hard to guess whether this is an error
> actually or you did something wrong.

Things are easy in my opinion: There's no session-ID in my use case at
all, the code itself is tolerant and many other places are as well,
like BufferedResponseMapper:

> protected String getSessionId()
> {
> String sessionId = null;
>
> if (Application.exists() && RequestCycle.get() != null)
> {
> [...]
> Session session = 
> sessionStore.lookup(requestCycle.getRequest());
> if (session != null)
> {
> sessionId = session.getId();
> }
> }
>
> return sessionId;
> }

> protected boolean hasBufferedResponse(Url url)
> {
> String sessionId = getSessionId();
> boolean hasResponse = false;
> if (Strings.isEmpty(sessionId) == false)
> {
> hasResponse = 
> WebApplication.get().hasBufferedResponse(sessionId, url);
> }
>  return hasResponse;
> }

I tried to reproduce this using a quickstart but failed, it's too much
work to get all my components/customizations into place to see which
triggers the code path. The original quickstart doesn't seem to
trigger it.

So my approach is different, I'm simply overriding the method in
question and make it more tolerant myself. This allows me to get a
stacktrace of the code path triggered as well:

> java.lang.UnsupportedOperationException: foobar
> at 
> de.am_soft.sm_mtg.view.report.VwrRenderApp.storeBufferedResponse(VwrRenderApp.java:112)
> at 
> org.apache.wicket.request.handler.render.WebPageRenderer.storeBufferedResponse(WebPageRenderer.java:87)
> at 
> org.apache.wicket.request.handler.render.WebPageRenderer.respond(WebPageRenderer.java:278)
> at 
> org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider$1.respond(BaseWicketTester.java:2824)
> at 
> org.apache.wicket.core.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:202)
> at 
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:914)
> at 
> org.apache.wicket.request.RequestHandlerExecutor.execute(RequestHandlerExecutor.java:65)
> at 
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:282)
> at 
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:253)
> at 
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:221)
> at 
> org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:713)
> at 
> org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:652)
> at 
> org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:879)
> at 
> org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:896)
> at 
> de.am_soft.sm_mtg.view.report.html.pages.meter_cnt.some_month.VwrPgMcsmSummaryTest.wicket(VwrPgMcsmSummaryTest.java:63)

> try (VwrCtxThreadScoped scopedCtx = new 
> VwrCtxThreadScoped(ctx0))
> {
> Supplier   page= () -> new 
> VwrPgMcsmSummary();
> VwrRenderAppapp = new 
> VwrRenderApp(page);
>     WicketTestertester  = new 
> WicketTester(app);
>
> tester.startPage(page.get());
> }

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



ERROR org.apache.wicket.protocol.http.WebApplication.storeBufferedResponse

2020-04-01 Thread Thorsten Schöning
Hi all

I have a project in which I use Wicket as some rendering engine only,
without actual HTTP-requests of any kind. As has been advised here in
the past, this is done using ComponentRenderer and some custom mocks
for the serializer and session store. The latter are pretty much what
is used within ComponentRenderer as well already.

Additionally I started using WicketTester in that project to test
things and during running tests I get the following errors logged:

> 16:31:21 ERROR
> org.apache.wicket.protocol.http.WebApplication.storeBufferedResponse:
> storeBufferedResponse needs a valid session id to store the
> response, but a null one was found. Please report the problem to dev
> team and try to reproduce it in a quickstart project.

Nevertheless, things succeed, because the logging code simply returns
and in that case it doesn't seem to make any difference:

> public void storeBufferedResponse(String sessionId, Url url, 
> BufferedWebResponse response)
> {
> if (Strings.isEmpty(sessionId))
> {
> log.error("storeBufferedResponse needs a valid 
> session id to store the response, but a null one was found. "
> + "Please report the problem to dev 
> team and try to reproduce it in a quickstart project.");
> return;
> }
>
> String key = sessionId + url.toString();
> storedResponses.put(key, response);
> }

Shouldn't this be changed to at least a warning, if not removed
entirely?

Both of my cases seem to be valid use cases in the end. So logging an
error when things can't ever work this way in those use cases seems
overkill and unnecessary alarming to me.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Where does Wickets debug-output when running tests in Gradle come from?

2020-04-01 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 1. April 2020 um 11:46 schrieben Sie:

>> 11:34:01.536 [Test worker] INFO  org.apache.wicket.Application - 
>> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: 
>> org.wicketstuff.event.annotation.Initializer@3456cd50
>> 11:34:01.546 [Test worker] INFO  org.apache.wicket.Application - 
>> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: Wicket 
>> core library initializer
>> 11:34:01.569 [Test worker] DEBUG o.a.w.p.h.servlet.ServletWebRequest - 
>> Calculating context relative path from: context path '/context', 
>> filterPrefix 'servlet/', uri '/context/servlet/'

> Any idea why that output is triggered?

Things were easier than expected: Logback was simply available on the
classpath for some reason, loaded, didn't find a configuration and
therefore configured itself to its defaults: Using the console.

Making a logback-test.xml available in "src/test/resources" with
higher log levels easily resolved those debugging messages and the
generated reports of Gradle or small again. Though already available,
it might make sense to require logback to be available during running
tests always:

> testRuntimeOnly 'ch.qos.logback:logback-classic:1.1.3',
> 'ch.qos.logback:logback-core:1.1.3',
> 'org.junit.jupiter:junit-jupiter-engine:5.1.0'

I tried a different approach before: Expactation was that in case
tests fail, at least the last X log statements might be of use to
debug the problem, but really only then. While Gradle doesn't provide
anything like that on its own, there are examples to do so on SO and
other places:

https://stackoverflow.com/a/51786839/2055163

The basic approach is using some listener to log into some cache in
the background and only print those contents when the tests have
failed. Logging in the background needs to be implemented, but
additonally its important to tell Gradle that really only some
statements should be logged at all:

> tasks.withType(Test) {
> testLogging {
> events 'failed' // TestLogEvent.FAILED
> }
> }

While that should work in theory, I ran into two problems: Whatever I
did I wasn't able to reduce what Gradle logs on STDOUT. It's important
to note that the implemented logging cache int he background DOES NOT
prevent logging, it's only for additional maintenance. The events-part
is what prevents logging of some sort in theory. That is even for
multiple different log level, but things didn't change even for
setting all of those to "failed" for some reason.

Even if things have succeeded, I might only not have recognized,
becuase at some point I disabled Gradle's logging again, so wouldn't
see a difference anway. Nevetheless, the generated test-reports were
always still huge and always contained the whole output of STDOUT.
Might be that Gradle simply works that way and doesn't support
anything else at all:

https://discuss.gradle.org/t/disabling-stdout-stderr-generated-by-unit-tests-and-captured-in-the-test-results-xml-files/6546

So things simply didn't work in the end and falling back to
logback-test.xml was the best I coud do. In case anyone is interested,
I added my PoC.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

logback-test.xml
Description: XML document

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

Re: Where does Wickets debug-output when running tests in Gradle come from?

2020-04-01 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 1. April 2020 um 11:46 schrieben Sie:

>> 11:34:01.536 [Test worker] INFO  org.apache.wicket.Application - 
>> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: 
>> org.wicketstuff.event.annotation.Initializer@3456cd50
>> 11:34:01.546 [Test worker] INFO  org.apache.wicket.Application - 
>> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: Wicket 
>> core library initializer
>> 11:34:01.569 [Test worker] DEBUG o.a.w.p.h.servlet.ServletWebRequest - 
>> Calculating context relative path from: context path '/context', 
>> filterPrefix 'servlet/', uri '/context/servlet/'

> Any idea why that output is triggered?

Things were easier than expected: Logback was simply available on the
classpath for some reason, loaded, didn't find a configuration and
therefore configured itself to its defaults: Using the console.

Making a logback-test.xml available in "src/test/resources" with
higher log levels easily resolved those debugging messages and the
generated reports of Gradle or small again.

I tried a different approach before: Expactation was that in case
tests fail, at least the last X log statements might be of use to
debug the problem, but really only then. While Gradle doesn't provide
anything like that on its own, there are examples to do so on SO and
other places:

https://stackoverflow.com/a/51786839/2055163

The basic approach is using some listener to log into some cache in
the background and only print those contents when the tests have
failed. Logging in the background needs to be implemented, but
additonally its important to tell Gradle that really only some
statements should be logged at all:

> tasks.withType(Test) {
> testLogging {
> events 'failed' // TestLogEvent.FAILED
> }
> }

While that should work in theory, I ran into two problems: Whatever I
did I wasn't able to reduce what Gradle logs on STDOUT. It's important
to note that the implemented logging cache int he background DOES NOT
prevent logging, it's only for additional maintenance. The events-part
is what prevents logging of some sort in theory. That is even for
multiple different log level, but things didn't change even for
setting all of those to "failed" for some reason.

Even if things have succeeded, I might only not have recognized,
becuase at some point I disabled Gradle's logging again, so wouldn't
see a difference anway. Nevetheless, the generated test-reports were
always still huge and always contained the whole output of STDOUT.

So things simply didn't work in the end and falling back to
logback-test.xml was the best I coud do. In case anyone is interested,
I added my PoC.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

logback-test.xml
Description: XML document

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

Where does Wickets debug-output when running tests in Gradle come from?

2020-04-01 Thread Thorsten Schöning
Hi all,

I'm using Gradle and recently started to run tests using Wicket
rendering some contents. Things work pretty well, but Wicket provides
a lot of DEBUG-output on STDOUT or STDERR, which Gradle puts into its
own HTML-reports for results of tests.

This makes those reports pretty large in my case, e.g. ~24 MiB, and
therefore takes a pretty long time to view in the browser. As well,
when running those tests using the integration into Eclipse, that
blocks for around half a minute as well, because each individual line
of Wicket DEBUG-output is added to some GUI-tree view.

Output looks e.g. like the following, only 10 thousands of lines more:

> 11:34:01.536 [Test worker] INFO  org.apache.wicket.Application - 
> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: 
> org.wicketstuff.event.annotation.Initializer@3456cd50
> 11:34:01.546 [Test worker] INFO  org.apache.wicket.Application - 
> [WicketTesterApplication-7fefbf5f-492f-4c7d-b276-522938b3242c] init: Wicket 
> core library initializer
> 11:34:01.569 [Test worker] DEBUG o.a.w.p.h.servlet.ServletWebRequest - 
> Calculating context relative path from: context path '/context', filterPrefix 
> 'servlet/', uri '/context/servlet/'

Any idea why that output is triggered?

I thought it might be bound to Gradle's own log levels somehow, but
switching between "--quiet" and "--debug" really only changes how much
Gradle logs on STDOUT, not what Wicket does. Additionally, I don't see
any other debugging output, besides some of my own classes using SLF4J
as well.

This leaves some logging-backend with some explicit configuration
only, doesn't it? Something like log4j2, Logback or else with some
config, but couldn't find some yet.

Is there something embedded in Wicket used automatically when the
teser is used?

Thanks for your ideas!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Is it safe to use ComponentRenderer with different apps in the same thread one after another?

2020-03-29 Thread Thorsten Schöning
Hi all,

I'm using Wicket as some render engine to render mails for reports
consisting of different individual render approaches: plain text only,
HTML only, a combination of both. In the latter case I of course would
like to simply reuse the former approaches, but am not sure if the
used ComponentRenderer does support that.

My individual rendering looks like the following:

> private static  String
> forSome(VwrCtxctx,
> Supplier page)
> {
> try (VwrCtxThreadScoped scopedCtx = new VwrCtxThreadScoped(ctx))
> {
> VwrHtmlApp  app = new VwrHtmlApp();
> ComponentRenderer   renderer= new ComponentRenderer(app);
> CharSequenceretVal  = renderer.renderPage(page);
> 
> return retVal.toString();
> }
> }

"renderer.renderPage" is where I would call the above additionally to
provide text- and HTML-only. From my understanding that should be
safe, because ComponentRenderer supports multiple different contexts
for app etc.:

> private  T inThreadContext(Supplier supplier)
> {
> ThreadContext oldContext = ThreadContext.detach();
> 
> try
> {
> ThreadContext.setApplication(application);
> 
> return supplier.get();
> }
> finally
> {
> 
> ThreadContext.restore(oldContext);
> }
> }

As well I really only need to render within one and the same thread
one after another, I'm not resuing apps or contexts between different
threads in parallel. If that would be needed at some point, it would
be dealt with at a higher level rendering using some threadpool.

So, is it safe to render recursively using ComponentRenderer within
one and the same thread? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: How to change the target of some form-action to some configured value?

2020-03-18 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Mittwoch, 18. März 2020 um 10:41 schrieben Sie:

> have you tried overriding #getActionUrl()?

No, that was exactly what I was looking for and must have missed.
Thanks, it works as expected.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Unexpected component-ID "2" for 1 child of repeating view.

2020-03-18 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Mittwoch, 18. März 2020 um 10:04 schrieben Sie:

> what IItemReuseStrategy are you using?

> DefaultItemReuseStrategy creates new items on each render, which leads
> to new ids.

I didn't care yet and can't find anything regarding that strategy, so
I guess it's the default one. While I indeed render the same page
multiple times within the same test, things look like the following:

> try (VwrCtxThreadScoped scopedCtx = new VwrCtxThreadScoped(ctx0))
> {
>   VwrHtmlApp  app = new VwrHtmlApp();
>   WicketTestertester  = new WicketTester(app);
>   VwrHtmlPage page= new VwrPgMcsmSummary();
> 
>   tester.startPage(page);
>   this.wicketAssertBase(tester, page);
>   
> tester.assertVisible("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:noResults");
>   tester.destroy();
> }

So each invocation works with new instances of everything in theory.
Even the results to render themself change, as those are contained in
"ctx0", "ctx1" and "ctx3". 

So, shouldn't each of those blocks start freshly in theory?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



How to change the target of some form-action to some configured value?

2020-03-18 Thread Thorsten Schöning
Hi all,

I'm rendering a web page for offline use, but am playing around with
integration into the parent web site where that offline page comes
from. The current approach is to simply show the same auth-form used
by the online variant itself already and to simply POST credentials
there.

The problem is that Wicket generates a local action-target for the
form and I don't see any way to override that behaviour. Look at the
following examples:

>   method="post"[...]

What I'm currently doing is implementing a custom
"AbstractTransformerBehavior" simply changing the action-attribute in
the generated markup using some configured value.

Is that the easiest/preferred approach?

Searchign for that topic I only found Ajax-related things, which is
not what I'm interested in. But I couldn't find somethign to simply
set the target or override the strategy how that is calculated or
such.

Thanks for your hints!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Unexpected component-ID "2" for 1 child of repeating view.

2020-03-18 Thread Thorsten Schöning
Hi all,

I have some test in Wicket which renders a HTML-table using some
"DataView" and in that test I'm distinguishing the cases 0, 1 and 3
result rows. The following is an example for 1 and 3 rows:

> assertNotNull(tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:1",
>  true,  false), "No first result item available.");
> assertNull(   
> tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:2",
>  false, false), "A second result item available.");

> assertNotNull(tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:3",
>  true,  false), "No third result item available.");
> assertNull(   
> tester.getComponentFromLastRenderedPage("html:body:meterCnt.someMonth.pnMcsmSummary:resultsContainer:resultsRow:4",
>  false, false), "A fourth result item available.");

The above worked for some days, but yesterday I changed the overall
HTML-template to add additional panels and the tests above stopped to
work. It's important to note that the added panel has nothing to do
with that table, it is completely unrelated in the header-part of the
body of the template and therefore shouldn't have any influence on the
table.

Nevertheless, the tests fail now, because the IDs of the generated
result rows seem to be off by one. In the debugger I can see that the
number of result rows is still as expected, but the former ID "1" has
changed to "2" now for some reason. So after reimplementing the test
to check "rows.getItemCount()" instead of concrete component-IDs, they
succeed again. But checking availability of expected components felt
more correct to me.

Any idea what the cause for the changed child-component-ID might be?

Looking at "RepeatingView", it seems the generated ID is neither
static nor am I aware of reusing components during tests. And I don't
think that the newly added panel has any influence, I guess it's more
on execution order of tests or something. But all my tests are
executed in order 0, 1 and 3 results and that didn't change since the
days before as well.

As I have changed the tests this is not a big deal currently, but I'm
wondering what I'm missing here. Thanks for your thoughts!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: How to make Wicket prefer a custom resource finder always?

2020-03-04 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Mittwoch, 4. März 2020 um 10:19 schrieben Sie:

> Maybe the default classpath finder is kicking in and loads a
> template for a class that would otherwise inherit its markup from its 
> superclass?

Thanks for the hint, that was exactly what was happening. Putting my
finders at the front of the list otherwise worked as expected. After
clearing all default finders things work again, but there's a
downside: 

For some templates and languages I still relied on what gets bundled
with Wicket, e.g. FeedbackPanel, and those need custom files now as
well. There's no classpath-finder which could find them in the
Wicket-JARs anymore. Not yet sure if I like this or not: Should only
be very few templates currently and my directories easy fit to the
default package-based naming scheme, so adding new files is easy.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



How to make Wicket prefer a custom resource finder always?

2020-03-03 Thread Thorsten Schöning
Hi all,

I'm maintaining a Wicket webapp with slightly modified directories to
get templates and language files from and created implementations of
IResourceFinder for both. Things worked like epxected for some years
now, but recently I changed deployment a bit to provide Javadoc by
default for all my artifacts.

Javadoc is simply deployed as JARs and because it's stored in
"WEB-INF/lib", available in the classpath by default. That leads to
the problem that Wicket now finds HTML files generated by Javadoc as
templates to use. That doesn't work of course and results in errors
like the following:

> Expected to find  in associated markup file. Markup:
> jar:file:/C:/Program%20Files/Apache/Tomcat%209.0/webapps/de.am_soft.sm_mtg.frontend.bug_2590_gradle/WEB-INF/lib/de.am_soft.sm_mtg.frontend-javadoc.jar!/de/am_soft/sm_mtg/frontend/panels/collectors/PnReadWithRealEstates.html

So the first approach was to simply change the place where I provide
my own resource finders to Wicket to make them the first items in the
list. The current code is the following:

> ResourceSettings  settings = this.getResourceSettings();
> List finders  = settings.getResourceFinders();
>
> finders.add(0, new CustDefTmplResFinder(this.getServletContext()));
> finders.add(1, new LangResFinder(this.getServletContext()));

But that works for some pages only, sadly not for all. E.g. the
login-page works well that way, but after logging in, the former error
occurs again.

So how do I tell Wicket to really always use my resource finders
first? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Experiences with Wicket in some IoT-project?

2019-10-17 Thread Thorsten Schöning
Hi all,

TL;DR:

Is someone hosting web interfaces in IoT-related projects using
Wicket? If so, under which hardware requirements, especially CPU and
RAM, and using which web server like Tomcat etc.? Did you do so in the
past and might have failed terribly, for what reasons?

The background:

I'm working on some IoT-project creating some device(s) with currently
only very few and vague requirements. Some of those requirements are
providing a web interface and web services, but another one is that
some variant of the device should be used in some battery-powered
context as well. If that should provide a web interface/web services
as well and how complex etc. still needs to be discussed.

Additionally, there's some cloud-based software with its own frontend
interacting with the predecessor of the newly created device. That
whole stack is implemented using Apache Tomcat, Wicket and Axis 2 and
because we are a pretty small company and stuff I would like to reuse
as much of that stack as possible and somewhat reasonable.

What we currently test is some Avenger96-Board with 1 GiB of RAM
running some Yocto-Linux, but it already seems that this doesn't fit
to a battery-powered mode. So some far less powerful hardware with
e.g. only 128 MiB of RAM gets considered as well.

https://www.96boards.org/product/avenger96/

The AV96 with 1 GiB of RAM runs my tested server-software pretty fine,
but fails with 128 MiB. With some easy steps the image could be
changed to make ~60 MiB of RAM free for my usage, but that simply
wasn't enough to start my web-app at all. Tomcat itself ran fine even
with only 15 MiB of RAM free, though, unless used with my app. :-)

What I would like to get a feeling for is if that approach is even
worth following or not. So thanks for everything you share!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Build problems for Wicket 7.15.0 and Java 8 regarding Javadoc.

2019-09-16 Thread Thorsten Schöning
Hi all,

I'm trying to build Wicket 7.15.0 from source using Java 8:

> openjdk version "1.8.0_222"
> OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_222-b10)
> OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.222-b10, mixed mode)

This fails in Wicket Util already with lots of Javadoc-related errors.
I know that the reason this happens is because of enabled linting for
Javadoc in Java 8 by default, but earlier versions of Wicket 7
implemented a workaround. That workaround has been removed without any
further notice on why and what the alternative is:

https://github.com/apache/wicket/commit/ee1b8b37dbe5b34c63a33d65f84b26cbd38080d4
https://github.com/apache/wicket/commit/d7416a325338a7d229c9e25f4d6852f0c83775eb

So, how am I supposed to build Wicket 7 using Java 8 these days?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Using Wicket to generate E-Mails.

2019-03-12 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 12. März 2019 um 17:12 schrieben Sie:

> To render more complex markup you need to use ComponentRenderer.
> You can render whole Pages or just Components (like Panels).

Great, I'll have a look at that.

> I do not understand what you mean with `adding newlines, manual
> indentation, etc.` - Wicket just renders whatever your page/panel says.

My HTML-templates would contain elements like "h1", "p", "table",
"pre", "blockquote" etc., which are not useful as is in plain text
mails. Consider the following pseudo-HTML:

Hi customer!
Good news for you...
NEW PRICE: 10 bucks
You said...

That should be rendered to something like the following:

Hi customer!

Good news for you...

 NEW PRICE: 10 bucks

> You said...

But that should be achievable using Component.setRenderBodyOnly and
pre-/post-processing the results of ComponentRenderer. Two slightly
different render approaches using the same templates in best cases.

> ComponentRenderer just sets up a dummy RequestCycle so that you can render
> in non-HTTP threads, i.e. background threads.

Which is exactly what I need. Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Using Wicket to generate E-Mails.

2019-03-12 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 12. März 2019 um 15:18 schrieben Sie:

> There is an example how to do this in wicket-examples:
> - http://examples8x.wicket.apache.org/mailtemplate/
> - 
> https://github.com/apache/wicket/tree/master/wicket-examples/src/main/java/org/apache/wicket/examples/asemail

Thanks, looking at PackageTextTemplate, it doesn't provide any support
for tables, lists etc.? Only replacement of key-value-pairs?

If I want to use HTML-templates only at best, do I need to
additionally look at ComponentRenderer? "Component.setRenderBodyOnly"
in combination with adding newlines, manual indentation etc. on the
result of the rendering?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Using Wicket to generate E-Mails.

2019-03-12 Thread Thorsten Schöning
Hi all,

I'm using Wicket for some frontend of some web app and pretty much
like it because it allows me to clearly separate skins, language
files, templates and to not mix too much view and business logic. My
current requirements are to send mails in some web service backend and
I want to use some template engine to generate those, because I need
to support multiple languages, might need to create somewhat complex
content like tables, headlines and stuff. Not only using HTML, but
using plain text as well.

I've already searched around that topic focussing on Wicket and found
some explanations that this in fact is doable, but those references
are pretty old already. The following are some examples:

http://wicket-praxis.de/blog/2009/12/01/sending-html-email-from-wicket-app/
https://cwiki.apache.org/confluence/display/WICKET/Use+wicket+as+template+engine

Are there any newer docs available covering that topic I have missed?

What I'm especially interested in is how to avoid the HTTP-stuff, what
the entry points are if I want to render to some string only and what
the best approach is to provide necessary data like different language
settings, as the corresponding HTTP-headers are missing.

Another focus is on generating plain text. I know Wicket is based on
HTML/XML-templates, but components can be rendered "body only" already
as well. I had something in mind like reusing the templates for
HTML-mails by not rendering them entirely including nodes, but only
node content itself specially.

Something like "..." would simply be rendered as some line of
text with an empty line afterwards. Same for e.g. "p", while "pre"
might simply be indented, "cite" might get a leadin ">" per line etc.
So in the best case, I would maintain one set of templates mostly and
two different rendering approaches to switch between.

Any hints on how I need to implement those different rendering
approaches for the same components? So that I don't need to deal with
that for each and every component, but some visitor-rendering-pattern
or such.

Does anyone already have experience with such an approach and
additonal advises? Is it a totally bad idea for some reason?

Thanks for your input!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Tool for finding missing translations in properties.xml

2016-07-10 Thread Thorsten Schöning
Guten Tag Per Newgro,
am Freitag, 8. Juli 2016 um 16:37 schrieben Sie:

> I wrote my own tool as my search wasn't successful. But it is simply a
> main method loading the files and compares keys.

Thanks, I had the same approach in my mind.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Tool for finding missing translations in properties.xml

2016-07-07 Thread Thorsten Schöning
Hi all,

in my Wicket app I'm using properties.xml files for my i18n texts,
like described in the wiki[1]. The problem I have is that the files
are differently up to date, depending on the language and how
important it was for somebody to translate one exact key for one
special language etc. the only thing I really know is that English is
up to date...

So, does anyone knows a tool which expects translation files in a dir
structure and compares all found to their English base file? In the
end it should simply print which file in which dir is missing which
key compared to the English base.

Such a problem sounds common to me, but I couldn't find any good
software dealing with it yet.

Thanks!

[1]: https://ci.apache.org/projects/wicket/guide/6.x/guide/i18n.html#i18n_2

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Markupstream.hasMore vs. MarkupStream.next

2016-05-15 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Freitag, 13. Mai 2016 um 20:14 schrieben Sie:

> Is this a bug or is using hasMore the wrong idiom in this case?

https://issues.apache.org/jira/browse/WICKET-6165

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Generating table header ids for multiple tables pe rpage

2016-05-15 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Sonntag, 15. Mai 2016 um 11:14 schrieben Sie:

> So next I will have a look at extending
> AbstractTransformerBehavior with its "tranform" method.

Hi,

this was far easier to use, beautiful Wicket... Sadly I saw it too
late and wasted quite some hours on the former approach. :-)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Generating table header ids for multiple tables pe rpage

2016-05-15 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Samstag, 14. Mai 2016 um 19:26 schrieben Sie:

> [...]instead I would like to have one
> place, e.g. "resultsContainer" itself, to process the markup in such a
> way that this parent container of all markup generates unique ids,
> changes the "headers" references to those ids and afterwards Wicket
> proceeds with markup processing fully transparent.

Hi,

I seem to have a working PoC overriding Component.getMarkup, by
converting the given markup of the super class to a string, replacing
some parts of it and creating a new IMarkupFragment instance. The most
tricky part of this is that one really needs to create a
MarkupFragment instance, not Markup, even though both implement the
same interface:

> Markup  newMarkup   = Markup.of(stringifiedNew);
> IMarkupFragment retVal  = new MarkupFragment(newMarkup, 0);

While this seems to work, it's not as elegant as I hoped because one
needs to override getMarkup. So next I will have a look at extending
AbstractTransformerBehavior with its "tranform" method. It reads as
well like what I would like to have, only after all processing by
Wicket has happends. Shouldn't make any difference for me, though.

https://ci.apache.org/projects/wicket/apidocs/7.x/org/apache/wicket/markup/transformer/AbstractTransformerBehavior.html#transform(org.apache.wicket.Component,%20java.lang.CharSequence)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Generating table header ids for multiple tables pe rpage

2016-05-14 Thread Thorsten Schöning
100




1










No results 
found!






Real estate 1


MEH


12345678


Heat


        
    


Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Generating table header ids for multiple tables pe rpage

2016-05-14 Thread Thorsten Schöning
Hi all,

I have a page where one and the same table (in terms of markup) is
rendered multiple times with different data at the same time, simply
underneath each other. The markup uses "id" and "headers" attributes,
but with static values in the markup and with multiple instances of
the table this is wrong of course, because ids need to be unique
across a whole page, not only across a single table.

In terms of Wicket the tables itself are rendered using IDataView with
the table markup coming from a panel. The rows of the table are
rendered using IDataView as well and each cell is e.g. a simple Label
component.

With each cell being a Label, I could add an AttributeReplacer or sich
replacing the static "headers" from the markup with some generic
value. But I would like to avoid the need to think of this for every
table and a more generic approach. Additionally, the "thead" of the
table with the column headers and ids is no wicket component
currently, but I would need to make each column header one to be able
to change the "id" using an AttributeReplacer as well.

So is there some easy, somewhat clean way to change the markup of a
component instance before it is used for rendering and produce some
page unique ids in it?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Markupstream.hasMore vs. MarkupStream.next

2016-05-13 Thread Thorsten Schöning
Hi all,

hasMore: return currentIndex < markup.size();
next:if (++currentIndex < markup.size()) {...}
me:  while (markupStream.hasMore()) {...}

I get a null element within the while loop which I wouldn't expect to
get. markup.size() is 73, currentIndex 72, so hasMore returns true,
while next returns null, because it already advanced the index on its
check.

Is this a bug or is using hasMore the wrong idiom in this case?

I just followed code in the core codebase, like in Enclosure, the only
difference there is that the result of next is ignored. Of course I
can check for null and such, I just didn't expect such a behavior.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Which model to use for forwarding form processing results?

2016-05-11 Thread Thorsten Schöning
Guten Tag Bas Gooren,
am Dienstag, 10. Mai 2016 um 20:48 schrieben Sie:

> Yes, that is normal behavior I think - for invisible components we
> either wrap it in a container which receives the event, or let the page be 
> the coordinator.

I found overriding Component.canCallListenerInterface easier to
maintain and suggested an improvement to the dispatcher:

https://github.com/wicketstuff/core/issues/493

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Which model to use for forwarding form processing results?

2016-05-10 Thread Thorsten Schöning
Guten Tag Bas Gooren,
am Dienstag, 10. Mai 2016 um 13:43 schrieben Sie:

> This sounds like a good use-case for an event.

Thanks for this hint, I totally forgot about it and decided to give it
a try. There was a pitfall in my case, though: 
Component.canCallListenerInterface
is asked before an event is dispatched and I'm starting with an
invisible panel, so the method returns false, waiting for data to
become visible, which is never dispatched... Doesn't seem to be
mentioned in the docs or I must have missed it.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Which model to use for forwarding form processing results?

2016-05-10 Thread Thorsten Schöning
Hi all,

I have one and the same form on different pages used to provide some
input data which is afterwards used by the form's onSubmit handler to
request some complex data structure from a 3rd party service. This
result needs to be forwarded to the caller/owner of the form, mainly
pages, so those can provide the data to different views focussing on
different aspects of the data. Most of those views are panels using
different DataViews to provide data in HTML tables in the end.

The important thing is that the form shouldn't render the results
itself, only return some raw data structure, and the panels shouldn't
need to know about the form as well.

What is the best way to send those resulting data around?

From my understanding it's not the default model of the form with all
the convert input stuff, those input comes from the user, but it may
be that of the page containing form and panels, so both could access
the page and its default model. Else I could simply create a model
instance and forward it using the CTORs of the form and panels,
without (misusing?) the page's default model.

Does it even matter at all?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: [ANNOUNCE] Apache Wicket 7.3.0 Released

2016-05-07 Thread Thorsten Schöning
Guten Tag Martijn Dashorst,
am Samstag, 7. Mai 2016 um 15:00 schrieben Sie:

> The Apache Wicket PMC is proud to announce Apache Wicket 7.3.0!

Great work. Any idea on how long it takes until the tag will be
available on GitHub?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: weird "Unable to find component with id"

2016-05-04 Thread Thorsten Schöning
Guten Tag Ernesto Reinaldo Barreiro,
am Mittwoch, 4. Mai 2016 um 12:27 schrieben Sie:

> I have tried to reproduce this locally in "development" and "production"
> modes with no success. Are there any known issues that can cause this? Any
> leads would be appreciated.

I often have problems with an error message like yours, not with the
strange ids though, during development, if I e.g. change markup and
just reload a formerly working page in the browser instead of
requesting a new and/or restarting Tomcat.

So if your customer is not changing markup, he maybe has customers
accessing old versions of pages referencing things in markup which
don't exist anymore because of upgrades and such.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Improve compatibility with non-Wicket Ajax in ServletWebRequest

2016-05-03 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Dienstag, 3. Mai 2016 um 15:49 schrieben Sie:

> So I would suggest enhancing WebRequest to provide isAjax and some
> kind of isWicketAjax to distinguish both situations from each other.
> getClientUrl could than simply take isWicketAjax into account for its
> special behavior and use the "non-Ajax" approach like it did before
> else.

https://issues.apache.org/jira/browse/WICKET-6159

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Provide error message for Ajax requests in DefaultExceptionMapper?

2016-05-03 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 3. Mai 2016 um 15:35 schrieben Sie:

> Configuring your own IExceptionMapper[...]

I already use a custom exception mapper extending
DefaultExceptionMapper because I wanted to follow an approach
comparable to the one discussed before:

http://apache-wicket.1842946.n4.nabble.com/Pass-exception-to-internal-error-page-td4664951.html

But DefaultExceptionMapper.internalMap is private and there's no other
callback to easily change the specific behavior I need.

> She doesn't know what is "null" and she doesn't want to know!

And that's perfectly OK, but in my opinion that shouldn't be a
decision made depending on Ajax vs. non-Ajax, and is in general highly
depending on the audience as well, which I know better than "Wicket".

So in the end, the only question is: Is it worth to make this specific
behavior of DefaultExceptionMapper a bit more flexible for users like
me or not? Given the two possible relative easy approaches, I think it
is worth it and hope that others will see it the same way.

https://issues.apache.org/jira/browse/WICKET-6158

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Improve compatibility with non-Wicket Ajax in ServletWebRequest

2016-05-03 Thread Thorsten Schöning
Hi,

I have a legacy web app which uses some pieces of Wicket and plain
jQuery to do some Ajax, but without any Wicket specific JS. The
glue between both is simply using AjaxBehavior to register some
callbacks and that works fine.

The problem I have currently is that Wicket thinks in some places that
Ajax always means using Wicket JS as well and checks for special
headers. One such place is WebRequest.isAjax, which is used e.g. to
determine if a special error handler should be invoked, which it
should in my case so I reimplemented isAjax.

The problem is that ServletWebRequest.getClientUrl makes the same
assumptions and throws exceptions if needed headers are missing. But
throwing those exceptions is unnecessary in my case, because the
non-Ajax behavior of that method simply works.

So I would suggest enhancing WebRequest to provide isAjax and some
kind of isWicketAjax to distinguish both situations from each other.
getClientUrl could than simply take isWicketAjax into account for its
special behavior and use the "non-Ajax" approach like it did before
else.

Currently I can achieve this only with a messy hack in my
implementation of WebRequest.isAjax, which returns false if called
from getClientUrl. Instead, the mentioned distinction should be of
general use for all applications dealing with Wicket and non-Wicket
parts.

Any thoughts on this?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Provide error message for Ajax requests in DefaultExceptionMapper?

2016-05-03 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 3. Mai 2016 um 14:31 schrieben Sie:

> Because the DefaultExceptionMapper is the final/catch-all place to catch
> exceptions and it should be generic.

Subclasses can't easily override this specific behavior as well and a
more useful default behavior is generic.

> Most of the time end users should not see what exactly broke in the
> application. A generic "An error occurred" should be enough.

Yeah, that's why the web is full of jokes and anger about no helpful
error messages like that one. ;-)

Your argument doesn't even hold for your own codebase, like can be
seen in ServletWebRequest. In fact, it's the other way around: It is
easy to not provide detailed information to my users if I/they don't
want to, but it's unnecessary hard currently to do so if I/they want
to know more.

That's especially true for Ajax like in this case: Those errors are
already either handled specially by the client software or simply
ignored by the browser. So there's exactly no user out there getting
to much unwanted information.

> You could use custom IRequestCycleListener#onException() if you want
> special behavior.

I would prefer providing a patch making default Wicket implementations
more useful for most devs and code base more consistent. ;-) You
already have everything needed where it's needed and things could even
be made configurable using some kind of INVOKE_FAILURE_HANDLER_WITH_MSG
or a protected callback which creates the object to return with the
current behavior as default implementation. I already have a subclass
of DefaultExceptionMapper, it's only that I don't want to double so
many code...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Provide error message for Ajax requests in DefaultExceptionMapper?

2016-05-03 Thread Thorsten Schöning
Hi all,

> private IRequestHandler internalMap(Exception e)
[...]
>switch (application.getExceptionSettings().getAjaxErrorHandlingStrategy())
>{
>case INVOKE_FAILURE_HANDLER :
>return new ErrorCodeRequestHandler(500);
>}

Is there any reason why the request handler doesn't get any message
retrieved from the available exception? The exception message may span
multiple lines and such of course, but such things could be filtered.
Currently only getting 500 without any hint to what's actually wrong
looks a bit wasteful.

Especially if I see lines like the following in ServletWebRequest:

> throw new AbortWithHttpErrorCodeException(HttpServletResponse.SC_BAD_REQUEST,
> "Current ajax request is missing the base url header or parameter");

So you already have places where you end with custom messages.

Is this something worth filing as an enhancement in JIRA?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Evicting the page store to force Wicket to create a new instance of a page after using the back-button

2016-04-14 Thread Thorsten Schöning
Guten Tag Joachim Rohde,
am Donnerstag, 14. April 2016 um 15:35 schrieben Sie:

> 1) Checking in every isVisible() if the user is null. This *does*
> work but I have quite a lot of links and I would like
> to go with this solution only if I cannot find any other.
[...]
> Long story short: is there a more elegant solution to my problem
> than the first solution that I've tried?

I'm implementing a similar approach like you and am simply using a
custom base class for my links which need to be visible by some
criteria only. In this base class you can take a missing user object
because of no session into account at exactly one place. Your role
as the only deciding criteria for visibility or not could easily be
propagated using a CTOR or such.

Additionally, you should not override isVisible, but onConfigure
instead and call setVisible as needed.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Automatically generate breadcrumb like page headlines from navigation

2016-04-09 Thread Thorsten Schöning
Hi all,

I have a navigation like the following:

> Parent 1
> - Child 1
> - Child 2
> Parent 2
> - Child 1
> - Child 2
> Parent 3
> - Child 1
> - Child 2

The important thing is that all the "Parent X" levels are no links,
just wicket:message, simply because there's no valuable content to
provide, but all the "Child X" are links.

What I would like to achieve is automatically adding a headline on
each requested page like the following:

> Parent 1: Child 1

If Parent 1/Child 1 was requested.

> Parent 1: Child 2

If Parent 1/Child 2 was requested and so on. Currently I do this
manually for each page using "wicket:message" and I'm looking for a
solution to automate this, because the navigation levels are already
translated and all the words should be the same anway.

I already had a look at BreadCrumbBar and IBreadCrumbParticipant, but
am not sure how to approach from there. The links are Wicket
components and I can do things with them, e.g. get their translated
texts and such, all that Wicket currently does as well. So those
should be usable as "IBreadCrumbParticipant" somehow.

But how would I access their parents, which are only wicket:message?
Whatever my "IBreadCrumbParticipant" looks like, it would need the
translation of "Parent X" as well, but there's no available component
to work with right now.

Do you have any ideas for me? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: svn: Unexpected HTTP status 504 'Gateway Timeout' on '/apache/wicket/branches/wicket-7.x'

2016-04-05 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 5. April 2016 um 12:25 schrieben Sie:

> 1) if you insist on using Subversion then contact infrastruct...@apache.org
> and explain the problems.
> In this case better use only Apache servers, because Apache Infra cannot
> help with GitHub related issues

But does Wicket still use the Apache SVN repos in any way? I had a
look at the repos and only found older Wicket source base, nothing
current. I had the feeling you are using GitHub only.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



svn: Unexpected HTTP status 504 'Gateway Timeout' on '/apache/wicket/branches/wicket-7.x'

2016-04-05 Thread Thorsten Schöning
Hi all,

I'm using Subversion for my projects and recently integrated a Wicket
branch using GitHub's svn bridge and svn:externals. The problem is
that this doesn't work reliable, I very often get the following error
message during updates of my project and such:

> svn: Unexpected HTTP status 504 'Gateway Timeout' on 
> '/apache/wicket/branches/wicket-7.x'

This happens around 1/3 or sometimes even 1/2 of the times, but not
always and I have the feeling that if it succeeded once, it succeeds
for some time afterwards as well. I have one other project integrated
with one of my projects this way and in that case such an error didn't
ever occur. But this project is a lot smaller and such.

The error looks like some kind of proxy problem, but I'm not using
any, but it would fit to what I would expect how GitHub implements its
svn bridge.

So, is there any other experience out there with such a setup?

Might this be a problem of the Apache guys and how they provide their
repos to GitHub? They have a GitHub mirror on their own, but I'm not
sure if Wicket uses this or is GitHub only these days. Looking at the
svn repos I guess the latter.

Thanks for any ideas.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-31 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 15:54 schrieben Sie:

> Please create a patch / Pull Request and a ticket.

https://issues.apache.org/jira/browse/WICKET-6133

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 15:45 schrieben Sie:

> If I try to build Wicket 7.x with de_DE locale the build fails at
> wicket-core:

Not on Windows BTW, I'm building on Ubuntu and Windows and the
wicket-spring problem is currently only on Windows, while the
wicket-core one is only in my Ubuntu. :-)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Failing locale dependent tests in wicket-core

2016-03-30 Thread Thorsten Schöning
Hi,

I'm building wicket 7.3.0.0 SNAPSHOT in Ubuntu 12.04 LTS and have the
following failed tests:

> Failed tests:
>  
> MinifiedAwareResourceReferenceTest.minifiedResourceAvailable:61->Assert.assertEquals:144->Assert.assertEquals:115
>  expected: but was:
>  
> ResouceBundleTest.concatBundle:48->Assert.assertEquals:144->Assert.assertEquals:115
>  expected: but was:
>  
> ResourceReferenceLocatingTest.locateMinifiedJavaScriptResourceReference:214->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
>  TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
> but: was "// b_de.js"
>  
> ResourceReferenceLocatingTest.locateMinifiedPackageResourceReference:223->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
>  TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.min.js"
> but: was "// b_de.js"
>  
> ResourceReferenceLocatingTest.locateNonMinifiedJavaScriptResourceReference:196->checkNonStrictUsingJavaScriptResourceReference:236->Assert.assertThat:956
>  TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
> but: was "// b_de.js"
>  
> ResourceReferenceLocatingTest.locateNonMinifiedPackageResourceReference:205->checkNonStrictUsingPackageResourceReference:250->Assert.assertThat:956
>  TestCase [locale=null, style=null, variation=null, extension=null]
> Expected: is "// b.js"
> but: was "// b_de.js"
 
> Tests run: 1947, Failures: 6, Errors: 0, Skipped: 1

This fails for different versions of maven all starting with an empty
.m2 folder:

> Apache Maven 3.0.4
> Maven home: /usr/share/maven
> Java version: 1.7.0_95, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
> Default locale: de_DE, platform encoding: UTF-8
> OS name: "linux", version: "3.13.0-83-generic", arch: "amd64", family: "unix"

> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
> 2015-11-10T17:41:47+01:00)
> Maven home: /home/tschoening/apache-maven-3.3.9
> [like before]

In one of the tests I find the following comment:

> // this will try 3 lookups for minified resources: en_US.min, en.min and .min

My locale is de_DE, so is this simply not supported or is this a bug
in the tests?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 30. März 2016 um 14:52 schrieben Sie:

> No change even with a more current version of Maven:

I have the feeling that the error is non deterministic somehow,
because yesterday after upgrading 7.3.0.0 I was so damn sure that the
error didn't occur anymore, that I removed skipping of the tests from
my shell script invoking the build. Today the test is failing the
whole morning.

Now after upgrading Maven I additionally tried without a .m2 folder
and the tests pass. Another execution directly afterwards with the
same commands and such, only a present .m2 folder now, the test fails
for every invocation. So I deleted the .m2 folder again and the tests
pass now. Executed again with the available .m2 folder and the tests
fail, pass(!), fail, fail...

This test is buggy, at least "ConfigContextWithGenerics.getStrings"
doesn't make sense compared to the other method and field names.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Mittwoch, 30. März 2016 um 14:16 schrieben Sie:

> "mvn --version" should provide all requested info:

No change even with a more current version of Maven:

> Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 
> 2015-11-10T17:41:47+01:00)
> Maven home: C:\Program Files\Apache Software Foundation\Maven\bin\..
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

The test doesn't even seem to be very platform or locale dependent to
me. I don't use a more current JDK 8 because that already fails during
compiling or tests in wicket-util. Not sure how to read the output...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 30. März 2016 um 12:42 schrieben Sie:

> The tests pass successfully here and at the CI server.
> Which version of JDK and Maven do you use? What is the system locale ?

"mvn --version" should provide all requested info:

> Apache Maven 3.1.1 (0728685237757ffbf44136acec0402957f723d9a; 2013-09-17 
> 17:22:22+0200)
> Maven home: C:\Program Files (x86)\Apache Maven\bin\..
> Java version: 1.7.0_80, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_80\jre
> Default locale: de_DE, platform encoding: Cp1252
> OS name: "windows 8.1", version: "6.3", arch: "amd64", family: "windows"

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Failing test SpringBeanWithGenericsTest in 7.3.0.0 SNAPSHOT

2016-03-30 Thread Thorsten Schöning
Hi all,

I try to build 7.3.0.0-SNAPSHOT from source, but there's at least the
following failing test. Skipping the tests builds OK and the results
seem to work, but that shouldn't be necessary, right?

[...]
> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.398 sec - 
> in org.apache.wicket.spring.injection.annot.SpringBeanTest
> Running org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest
> Tests run: 7, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.557 sec <<< 
> FAILURE! - in 
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTestlistField(org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest)
> Time elapsed: 0.072 sec  <<< FAILURE!
> java.lang.AssertionError: expected:<3> but was:<1>
> at org.junit.Assert.fail(Assert.java:88)
> at org.junit.Assert.failNotEquals(Assert.java:834)
> at org.junit.Assert.assertEquals(Assert.java:645)
> at org.junit.Assert.assertEquals(Assert.java:631)
> at 
> org.apache.wicket.spring.injection.annot.SpringBeanWithGenericsTest.listField(SpringBeanWithGenericsTest.java:143)
[...]

The mentioned line is the last one of the following quote:

> @Test
> public void listField() throws Exception
> {
> AnnotatedListField page =
> tester.startPage(new AnnotatedListField());
>
> assertNotNull(page.getStringsList());
> assertEquals(3, page.getStringsList().size());

I've found the following commit, which introduced "getStringsList":

https://github.com/apache/wicket/commit/f0340a3ef62a18df14badb26acee01bf102b9a2c

The interesting part for me about that commit is that
"ConfigContextWithGenerics.getStrings" in the same file was NOT
changed as well. So I renamed to .stringsList and that did have an
effect, now another test is failing instead:

> Failed tests:
>   
> SpringBeanWithGenericsTest.listField:147->Assert.assertThat:923->Assert.assert
> That:956
> Expected: is <3>
>  but: was <1>

The only 1 element list in the class is "myList", so I guess that
"arrayListStrings" can't be found properly as well, only this time not
because of a wrong name, but maybe signature problems.

In the end, this test seems broken to me... Any further ideas, should
I file a bug? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Enclosure can't find its markup anymore after restart of Tomcat

2016-03-11 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Freitag, 11. März 2016 um 19:45 schrieben Sie:

> I tried to track this down and recognized one important difference:

The following are parts of the stacktrace after a clean startup with
a breakpoint in EnclosureHandler, where the tag has the following id
and content:

> wicket_enclosure34: 

> Daemon Thread [http-bio-127.0.0.1-8081-exec-5] (Suspended (breakpoint at line 
> 131 in EnclosureHandler))
> owns: SocketWrapper  (id=89)
> EnclosureHandler.onComponentTag(ComponentTag) line: 131
> EnclosureHandler(AbstractMarkupFilter).nextElement() line: 100
> InlineEnclosureHandler(AbstractMarkupFilter).nextElement() line: 95
> ConditionalCommentFilter(AbstractMarkupFilter).nextElement() line: 95
> WicketContainerTagHandler(AbstractMarkupFilter).nextElement() line: 95
> RelativePathPrefixHandler(AbstractMarkupFilter).nextElement() line: 95
> StyleAndScriptIdentifier(AbstractMarkupFilter).nextElement() line: 95
> MarkupFactory$1(AbstractMarkupParser).getNextTag() line: 217
> MarkupFactory$1(AbstractMarkupParser).parseMarkup() line: 232
> MarkupFactory$1(AbstractMarkupParser).parse() line: 185
> SimpleMarkupLoader.loadMarkup(MarkupContainer, MarkupResourceStream, 
> IMarkupLoader, boolean) line: 51
> InheritedMarkupMarkupLoader.loadMarkup(MarkupContainer, 
> MarkupResourceStream, IMarkupLoader, boolean) line: 57
> DefaultMarkupLoader.loadMarkup(MarkupContainer, MarkupResourceStream, 
> IMarkupLoader, boolean) line: 52
> MarkupFactory.loadMarkup(MarkupContainer, MarkupResourceStream, 
> boolean) line: 412
> MarkupCache.loadMarkup(MarkupContainer, MarkupResourceStream, 
> boolean) line: 447
> MarkupCache.loadMarkupAndWatchForChanges(MarkupContainer, 
> MarkupResourceStream, boolean) line: 543
> MarkupCache.getMarkup(MarkupContainer, Class, boolean) line: 304
> MarkupFactory.getMarkup(MarkupContainer, Class, boolean) line: 236
> MarkupFactory.getMarkup(MarkupContainer, boolean) line: 194
> PnNav(MarkupContainer).getAssociatedMarkup() line: 456
> PnNav(MarkupContainer).getRegionMarkup() line: 2224
> PnNav(Panel).getRegionMarkup() line: 96
> PnNav(MarkupContainer).newDequeueContext() line: 2211
> PnNav(MarkupContainer).dequeue() line: 2029
> WebMarkupContainer(MarkupContainer).addedComponent(Component) line: 
> 1049
> WebMarkupContainer(MarkupContainer).add(Component...) line: 239
> HomePage.(PageParameters) line: 25
> NativeConstructorAccessorImpl.newInstance0(Constructor, Object[]) 
> line: not available [native method]
> NativeConstructorAccessorImpl.newInstance(Object[]) line: 57
> DelegatingConstructorAccessorImpl.newInstance(Object[]) line: 45
> Constructor.newInstance(Object...) line: 526
> DefaultPageFactory.newPage(Constructor, PageParameters) line: 171
> DefaultPageFactory.newPage(Class) line: 76
> DefaultMapperContext.newPageInstance(Class, 
> PageParameters) line: 102
> PageProvider.resolvePageInstance(Integer, Class, 
> PageParameters, Integer) line: 271
> PageProvider.getPageInstance() line: 169
> WebPageRenderer(PageRenderer).getPage() line: 78
> WebPageRenderer.isPageStateless() line: 287
> WebPageRenderer.shouldRenderPageAndWriteResponse(RequestCycle, Url, 
> Url) line: 329
> WebPageRenderer.respond(RequestCycle) line: 193
> RenderPageRequestHandler.respond(IRequestCycle) line: 175

The following is the same stacktrace after a restart of Tomcat and as
you can see, the id of the tag in EnclosureHandler is different now
and markup is only parsed because the Enclosure instance from the page
cache with the old id needs its child component and tries to find it
in the markup:

> wicket_enclosure12: 

> Daemon Thread [http-bio-127.0.0.1-8081-exec-3] (Suspended (breakpoint at line 
> 131 in EnclosureHandler))
> owns: SocketWrapper  (id=84)
> EnclosureHandler.onComponentTag(ComponentTag) line: 131
> EnclosureHandler(AbstractMarkupFilter).nextElement() line: 100
> InlineEnclosureHandler(AbstractMarkupFilter).nextElement() line: 95
> ConditionalCommentFilter(AbstractMarkupFilter).nextElement() line: 95
> WicketContainerTagHandler(AbstractMarkupFilter).nextElement() line: 95
> RelativePathPrefixHandler(AbstractMarkupFilter).nextElement() line: 95
> StyleAndScriptIdentifier(AbstractMarkupFilter).nextElement() line: 95
> MarkupFactory$1(AbstractMarkupParser).getNextTag() line: 217
> MarkupFactory$1(AbstractMarkupParser).parseMarkup() line: 232
> Markup

Enclosure can't find its markup anymore after restart of Tomcat

2016-03-11 Thread Thorsten Schöning
Hi all,

I'm using some wicket:enclosures in the navigation of my web app to
hide some content surrounding links, if the links are invisible for
some reason. This worked well with Wicket 6.0.x, but now I get the
following problem:

Consider a fresh, clean, empty Tomcat server, no wicket persistent
data whatsoever, no session, no DiskDataStore, nothing. If I now
start my app I can use it without any problems, click links, reload
pages, some enclosures are hidden, some are visible, all depending on
the visibility of the containing links, everything like I need it.

The only thing I'm doing now is restarting the Tomcat server and on
refreshing the current page in the browser I get a stackoverflow in
Enclosure while trying to determine its visibility. It tries to find
its markup, can't, which somehow leads back to where the caller came
from in AbstractMarkupSourcingStrategy#searchMarkupInTransparentResolvers
and which once again tries to find the markup with the same Enclosure
already tried before... The stackoverflow happens in my web app with
more complex HTML, but in a reduced version based on a quickstart I
don't get one, but instead the following exception is thrown:

> java.lang.IllegalArgumentException: Argument 'markup' may not be null.

So I guess the root cause is the same in both cases, Enclosure can't
find it's markup anymore.

Sadly I couldn't reproduce this with Jetty and an original quickstart,
because I don't know how to restart Jetty the same way I do with
Tomcat. If it gets stopped and started again, it generates a new
random temp working dir and starts without persistent data as well, so
the problem doesn't occur. Tomcat instead keeps some session data and
such during restarts and I guess that's part of the problem. Whenever
I clean the working dir of Tomcat, the problem is gone again until I a
restart is issued without cleaning the working dir.

I tried to track this down and recognized one important difference:

On the first empty start of Tomcat without any persistent data, the
ids recognized in EnclosureHandler for the tags are different than
after a restart of Tomcat. The numeric part of the tag ids is
incremented whenever a new tag is recognized and on the first clean
start this numeric part is simply higher, e.g. 20, than after a
restart, in which case it might be 15. This indicates that after the
restart less tags are parsed from the underlying markup compared to
the first start of the web app. Because of the wicket page cache and
such, the Enclosures with the OLD ids are still assigned to pages
after a restart, so if a subsequent process of the markup produces
different ids now, Wicket seems unable to find the OLD enclosure
ids in the markup, because the MarkupStream now contains Enclosures
with NEW ids. I could verify that in the debugger: Wicket tries to
determine visibility for Enclosure with id 20, because that was stores
in the page cache, and after a restart the logical same markup
component now has the id e.g. 15 and therefore can't be found anymore.

I think this has to do something with my HTML structure:

I have a main div as a WebMarkupContainer, which contains two Panels
on the same level, which both contains links. Only second Panel
contains the links embedded into enclosures. My feeling is that after
a restart the links of the first Panel are not parsed anymore from
their markup, because the objects where in the store already, so when
the markup for the enclosures in the second panel are parsed, the
request unique id is simply less than it was after the first clean
start without any persistent data.

I have two questions now:

1. Workaround?

I think if I'm able to get Wicket to not store any pages anymore
persistently, I could workaround the problem. I don't care if people
need to login or whatever in the worst case, but the app needs to be
functional after a restart of Tomcat without manually cleaning working
directories and such.

I already tried with a custom DefaultPageManagerProvider and
IDataStore implementation which simply doesn't store and retrieve any
data. But this is not enough, the problem still occurs.

2. Root cause?

In the end of course I need to find the root cause and would like to
fix that. How should Wicket behave in parsing markup when pages come
from the cache? Does it only parse some missing pieces of markup like
for Enclosure, because t doesn't cache it's associated markup/child
component or always everything like from a clean start? I guess the
first, but that would mean that ids always change and relying on them
during subsequent requests is not save.

Thanks for any hints!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsfüh

Re: Empty redirect on redirect to home page if home page already shown

2016-03-07 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Montag, 7. März 2016 um 11:55 schrieben Sie:

> Please file a ticket with this information and the quickstart.

https://issues.apache.org/jira/browse/WICKET-6111

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty redirect on redirect to home page if home page already shown

2016-03-07 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Montag, 7. März 2016 um 10:06 schrieben Sie:

> Try with latest Tomcat release. There were some changes in this area
> recently.

I'm already using 7.0.67, the most current is only 7.0.68, but our
production server is an even older version maintained by apt, so I
would need a workaround in my app anyways.

> org.apache.wicket.protocol.http.servlet.ServletWebResponse#encodeRedirectURL

That's what I needed to find, thanks! This function behaves (nearly)
the same for my URLs, the only difference is the following line:

> Url originalUrl = Url.parse(url);

In my Tomcat I get a completely empty object, NOT null though, in the
quickstart with Jetty I get an object containing ".". But in the end
that doesn't seem to make any difference, both requests go through the
following:

> if (fullUrl.equals(encodedFullUrl))
> {
> // no encoding happened so just reuse the original url
> encodedUrl = url.toString();
> }

encodedUrl is "./" using Tomcat and Jetty as well, while "fullUrl"
contains an absolute URL in both cases:

> http://localhost:8080/org.example.frontend/

"./" is returned to ServletWebResponse.sendRedirect and runs into the
following:

> if (url.startsWith("./"))
> {
> /*
>  * WICKET-4260 Tomcat does not canonalize urls, which leads to 
> problems with IE
>  * when url is relative and starts with a dot
>  */
> url = url.substring(2);
> }

And that empties my URL and forwards it to the servlet container,
where Jetty instead of Tomcat seems to provide some magic to respond
with an absolute URL in the end. But my debugger says that in both
cases

> httpServletResponse.sendRedirect(url);

gets called with an empty string!

> But we'll let ServletWebResponse remove a leading "./" before passing the url 
> to HttpServletRequest#sendRedirect().
> This does no harm and as you stated is essential as a workaround for the 
> Tomcat/IE combination.

https://issues.apache.org/jira/browse/WICKET-4260?focusedCommentId=13247750=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13247750

It does harm in my case... ;-)

So, any ideas on how I can work around this and what should be the
correct behavior? Is having "./" already a problem or only to remove
it when there's nothing left anymore?

I don't see any callback or listener or such where I could influence
that behavior...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty redirect on redirect to home page if home page already shown

2016-03-07 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Sonntag, 6. März 2016 um 22:08 schrieben Sie:

> I wouldn't expect Wicket to generate an empty location header. Can you
> reproduce this problem in a Wicket quickstart?

You are right, I forgot to mention it: During debugging I already
noticed that Wicket is in fact rendering "./" instead of an empty
string using UrlRenderer.renderRelativeUrl, but I thought this might
get changed later to an empty string for some reason.

I created a quickstart and "sadly" this worked as expected, the client
is getting the following header:

> Location:http://localhost:8081/org.example.frontend/

But in the debugger the processing looks identical to my problem, the
quickstart renders "./" as well. The only difference seems to be that
in my case the browser isn't getting a properly resolved URL anymore,
but and empty string or such, while that's not the case with the
quickstart.

My servlet container with the problem is Tomcat 7, while the
quickstart uses embedded Jetty? I guess I'll need to focus on that for
now and find a difference.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Empty redirect on redirect to home page if home page already shown

2016-03-06 Thread Thorsten Schöning
Hi all,

I have a web app with an empty fallback home page which is of no use
most of the times, only if the wrong people login to my app they get
this home page presented. Every other user is redirected to another
page with some meaningful content. If all users logout, they normally
get redirected to the home page, which needs authentication, so users
get redirected to the sign in page and afterwards to some other page
depending on which user logged in. In some rare cases this is the
homepage again.

The problem no is for those rare users sitting at the home page: If
those logout they should get redirected to the home page and
afterwards to the sign in page again like all other users. But Wicket
renders some empty redirect, I guess because the users are already at
the home page, and the browser does nothing, especially it doesn't
send another request. If I issue the request manually in the browser I
get redirected to the sign in page properly.

The following are the URLs involved:

> http://localhost:8081/org.example.frontend/?3
> http://localhost:8081/org.example.frontend/?3-1.ILinkListener-html-body-pnNav-home.signOut

The first one is after successful authentication and presents the
content of the home page, the second one is the sign out url and stays
in the browser with empty content, because of the empty "Location"
header in the generated 302 response.

> Request 
> URL:http://localhost:8081/org.example.frontend/?3-1.ILinkListener-html-body-pnNav-home.signOut
> Request Method:GET
> Status Code:302 Found
> Remote Address:127.0.0.1:8081
> Cache-Control:no-cache, no-store
> Content-Length:0
> Date:Sun, 06 Mar 2016 19:34:40 GMT
> Expires:Thu, 01 Jan 1970 00:00:00 GMT
> Location:
> Pragma:no-cache
> Server:Apache-Coyote/1.1
> Set-Cookie:JSESSIONID=[...]; Path=/org.example.frontend/; HttpOnly

My sign out logic ends with the following, after making some custom
things:

> RequestCycle.get().setResponsePage(Application.get().getHomePage(), params);

Any ideas of what I'm doing wrong and what needs to be done to get my
behavior? I want to redirect always to getHomePage(), even if it's
already shown and Wicket tries to do it, it just renders an incomplete
URL.

Thanks for your help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket with some servlet container on Android?

2015-06-22 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Sonntag, 21. Juni 2015 um 23:09 schrieben Sie:

 Netty doesn't support server side http sessions[...]
 When running in Android there will be just one client so it
 could be simplified.

Exactly, one might even argue that using a session as cache only for
performance related things may be unnecessary as well, because there's
no server with high load and local flash storage is getting faster as
well and such. But I guess that wouldn't simply things much because
Wicket simply relies on a session, right?

 @Thorsten: please tell me that i-jetty works fine and let me enjoy the
 summer :-)

I would love to, I hope I can give it a try in the next two weeks.

Thank you guys for the very interesting details!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Wicket with some servlet container on Android?

2015-06-21 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Samstag, 20. Juni 2015 um 20:18 schrieben Sie:

 there seem to be different solutions already, why do you think they are
 not promising?

  https://github.com/jetty-project/i-jetty

The commit history doesn't look very active to me and I've read that
Tomcat and newer versions of Jetty rely on JMX, which shall be a no go
on Android. On SO where some unanswered questions about Tomcat on
Android as well. But I'm just at the start of my research and didn't
try anything myself yet.

 Actually it would be interesting to just skip all servlet stuff and just
 use an HTTP server:

  https://github.com/NanoHttpd/nanohttpd

And why would that be interesting or preferable or whatever? Besides
the fact that it might be the only working solution at all, of course. ;-)
I guess it might be faster and such, but would mean that the frontend
needs adoption for both different environments, executing within a
servlet container or not. That's exactly what I would like to avoid as
much as possible.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Wicket with some servlet container on Android?

2015-06-20 Thread Thorsten Schöning
Hi all,

we have a web app based on Wicket, Tomcat 7 etc. and one of our
customers has a native Windows only app which is about to be replaced
now to 1. support Android as well, 2. add some missing features and 3.
provide some more modern GUI and such. The two most interesting things
for that replacement from my point of view are that the new app needs
to be able to work totally offline and that its current and some of
the new features contains things the customer already asked for the
Wicket-web app we've created as well.

Working offline is a hard requirement, so we can't just use the Wicket
web app as it is. But because features are clearly overlapping we
don't want to maintain a very comparable feature set with two
different technologies for years to come. Our customer totally agrees
with that and sees the functional overlapping as well.

So, is there already any experience or suggestions about or down
votes of an approach were one would embed some servlet container in
an Android app and provide the frontend using Wicket, HTML, JS and
CSS? This shouldn't be too much of a problem with Windows desktops,
but a completely different thing for Android.

I've found some posts about Jetty and Tomcat regarding this, which
don't look very promising.

But how about Wicket itself? Maybe someone already tried or knows it's
impossible because of the Android API or Dalvik or such.

Any thoughts welcome, thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Handle form with multiple dynamic lines of the same input

2015-04-01 Thread Thorsten Schöning
Hi all,

I have a form currently only consisting of one line of inputs, like
the following:

 label1 input1 label2 input2
 label3 input3 label4 input4
 label5 input5

All those three lines form one logical line of input from the form's
perspective. What I would like to add is the ability for the user to
add and remove lines on demand with simple JS just cloning a current
line. The result should be something like the following:

 label1 input1 label2 input2
 label3 input3 label4 input4
 label5 input5

 label1.2 input1.2 label2.2 input2.2
 label3.2 input3.2 label4.2 input4.2
 label5.2 input5.2

 label1.3 input1.3 label2.3 input2.3
 label3.3 input3.3 label4.3 input4.3
 label5.3 input5.3

The interesting part now is with Wicket, because the form submitted
may 1. have an unknown amount of lines and 2. the lines may change
during submits because during validation Wicket may find input errors,
shows the form again and a user decides to resolve such errors by just
removing some lines of input and such.

Do you have any hints an what would be the best approach implementing
this in Wicket?

I obviously need some buttons or such for the user to add and remove
lines, so I thought of adding some Ajax behavior to send the fact of
the added/removed line with some sort of ID or index to Wicket, which
will then create/remove corresponding models and components in a map
or list of the current form instance.

Is there any approach without such an Ajax call by just parsing the
request fields into some list or such? All my inputs follow a known
naming convention. Something like getInputAsArray on a global form
level instead of per component?

And last, how would I need to render the form in case of validation
errors? The form always starts with only one input line but may need
to be rendered with 3 or 10 or whatever in case of errors.

Thanks for your valuable input!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Improve Support for placeholder label option for DropDownChoice?

2015-04-01 Thread Thorsten Schöning
Hi all,

I got the following error during validation of one of my forms today:

 The first child option element of a select element with a required
 attribute, and without a multiple attribute, and without a size
 attribute whose value is greater than 1, must have either an empty
 value attribute, or must have no text content. Consider either
 adding a placeholder option label, or adding a size attribute with a
 value equal to the number of option elements.

The message is about the following spec:

http://dev.w3.org/html5/spec-preview/the-select-element.html#placeholder-label-option

The reason for the error seems simple: I use a DropDownChoice with a
default selected value and null disallowed, so I always need a value.
In that case AbstractSingleSelectChoice.getDefaultChoice doesn't
provide any content, because there's already one value selected and
this is not null. That results in the select gets only rendered with
the choices provided, missing a default option with value  and so
violating the HTML5 spec... The default option doesn't necessarily
needs to be selected, it just needs to exist if the select is
required.

To resolve this issue I extended DropDownChoice and implemented my own
getDefaultChoice, which simply always returns an option with value 
if the base implementation returns an empty string.

Is this worth creating an issue in JIRA, either as bug or enhancement?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: How to convert component model object to rendered HTML?

2015-03-05 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Donnerstag, 5. März 2015 um 08:47 schrieben Sie:

 You can call formComponent#clearInput() in #onError() callback method.
 This way Wicket will use the last (valid) model value.

This way I would loose the current input of the user?

 You can also set custom model value in #onError() if you need.

My model needs to be a list of unique IDs, I can't change that to a
list of non unique company names.

Looks like I would need something simple like overriding
FormComponent.getValue, which is final... Who does call this method
during the render process? I couldn't find the place, maybe I can hook
the caller.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: How to convert component model object to rendered HTML?

2015-03-05 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Donnerstag, 5. März 2015 um 18:57 schrieben Sie:

 Looks like I would need something simple like overriding
 FormComponent.getValue, which is final...

I found a simple workaround for me: Override onInvalid and
getInputAsArray, in onInvalid I set an instance flag to note it was
called, call inputChanged and reset the flag. inputChanged calls
getInputAsArray (currently), which I overridden to respect my flag, in
which case I provide my company names instead of the ids. The current
model with ids is available using getConvertedInput and because auf
the validation errors the changed raw input doesn't move forward into
other wicket internals, but only gets rendered in the output.

I know it's hacky, but that's exactly what I need. :-/

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



How to convert component model object to rendered HTML?

2015-03-04 Thread Thorsten Schöning
Hi all,

I have my own subclass of RequiredTextField for very specific reasons
and need to convert input after form submit to a Wicket model and vice
versa from a Wicket model to a form input value in case of errors and
such, when Wicket renders the form with the current values. I have
overridden Component.getConverter and can see that convertToObject of
my implementation is called, but not convertToString. Instead Wicket
renders exactly that data which it got submitted by the form, but is
not what I need to show to the user.

Any idea on where I have a problem? Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Using wicket:... tags messes up css

2015-03-04 Thread Thorsten Schöning
Guten Tag Andreas Lundblad,
am Mittwoch, 4. März 2015 um 22:14 schrieben Sie:

 That's a very crude solution. Almost as crude as switching deployment mode.

From my point of view Wicket's tags are an implementation detail and
don't belong to the HTML output, stripping them is therefore the only
correct solution.

 The wicket tags are useful during debugging and I'd like them to be
 available (except possibly in this case) in development mode.

You obviously can't have both, either you see them as part of your end
user DOM, than you need to care in CSS of them, or not, then just
strip them. What exactly do they help you with during debugging? There
might be other solutions for what you are trying to achieve.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: How to convert component model object to rendered HTML?

2015-03-04 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Donnerstag, 5. März 2015 um 08:05 schrieben Sie:

 If the validation fails
 then the *raw* input is rendered to the user and there is no usage of
 #convertToString() because there is no need.

Thanks, I wasn't aware of this and that explains why it looked like it
would work in other places, because there I have generated the exact
same values in convertToString like came from the browser and didn't
notice that the method wasn't ever called.

But now I do need to render other values, in case of errors during
form validation Wicket needs to render other values than came form the
browser during the submit. Is there any way to do this?

Some background: I have an Ajax auto complete input which searches
based on company names, but sends company IDs to Wicket. If other
forms on the page fail validation, I need to render the former
searched company names instead of their IDs back into the form. Wicket
by default renders IDs, because that's what it gets, but I thought I
can simply change that on the server during the render process somehow
back to company names.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Make wicketpath HTML5 compatible

2015-02-18 Thread Thorsten Schöning
Hi all,

is there any easy way to influence the rendering of wicketpath in
Wicket if isOutputComponentPath is enabled on a page or application
level? I would like to change it to data-wicketpath or
wicket:wicketpath or something like that to be able to validate my
HTML if this attribute is rendered.

Is adding a response filter using IRequestCycleSettings a good way to
got? And if so, how about simply using a global regexp to replace all
occurrences of wicketpath and clear and set again the data of
AppendingStringBuffer? Would that be a major performance hit?

Or is there any way how can I do something like onComponentTag for
each component in a page and replace the tag directly there?

Thanks for your input!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



WicketMessageResolver, Message Container and variable substitution

2015-02-17 Thread Thorsten Schöning
Hi all,

I have a panel with some wicket:message keys with some text out of
property files and would like to input some variables in there with
values coming from a global configuration. What I do not want to do is
to create a label for each message just to provide my map for variable
substitution, I would like to have some more automatic approach.

I had a look at WicketMessageResolver and it's private
MessageContainer and the latter seems to be capable of doing variable
substitution from e.g. a default model of a component. The problem
seems to be that this only takes the direct parent of the
wicke:message-object into account which is some
TransparentMarkupContainer I don't seem to have access to. The parent
of that TransparentMarkupContainer is my panel, but I'm simply unable
to find any way to tell MessageContainer to use the default model of
my panel or something else I have provided.

I don't seem to understand how this is supposed to work as the
TransparentMarkupContainer is automatically created by Wicket and it
doesn't seem to me that it's parent component has any influence on the
created object to provide it with a default model or whatever.

Could you please enlighten me a bit again and tell me if it's possible
to achieve what I want at all and if so how?

Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: WicketMessageResolver, Message Container and variable substitution

2015-02-17 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Dienstag, 17. Februar 2015 um 17:58 schrieben Sie:

 I don't seem to understand how this is supposed to work as the
 TransparentMarkupContainer is automatically created by Wicket and it
 doesn't seem to me that it's parent component has any influence on the
 created object to provide it with a default model or whatever.

I've found the missing part myself: In case of no model for
TransparentMarkupContainer itself it calls through to it's parents
using Component.initModel to give those the chance to provide a model.
The nasty thing here is that a simple default model of a parent is not
enough, only models implementing the special interface
IComponentInheritedModel are accepted and this behavior doesn't seem
to be clearly enough documented to me. My default model was a simple
Map and obviously didn't implement it so it was not taken into
account.

And because the fun never stops, it seems that wicket:message as an
attribute is resolved using another class WicketMessageTagHandler
which implements a different behavior regarding variable substitution
which seems to result in a call to Component.getString without any
model at all:

 final String value;
 if (tag.getAttributes().containsKey(attr))
 {
 value = component.getString(key, null, 
 tag.getAttributes().getString(attr));
 }
 else
 {
 value = component.getString(key);
 }

From my point of view both calls should provide the same model as
MessageContainer does, because in both cases the component is a
TransparentWebMarkupContainer with my custom panel as parent, which is
able to provide a default model. I don't see why there should be a
different approach than in MessageContainer.

Additionally it seems there's a misplaced comment in Localizer.getString:

 // If a property value has been found, or a default value was given,
 // than replace the placeholder and we are done
 if (value != null)
 {
   return value;
 }

There's no replacement done and the one mentioned seems to happen in
getStringIgnoreSettings already.

So half the way done and still no solution...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Question regarding index handling with RefreshingView and OddEvenItem

2015-02-15 Thread Thorsten Schöning
Hi all,

I'm using DataView to publish some search results in a HTML table and
what the results to format zebra style. I've found OddEvenItem for
that purpose but ran into what I find is a problem: The first item is
always rendered with CSS class even, because the index used is 0
based. That may be correct from a technical point of view, but is not
what I want to present my users.

So I changed my creation of OddEvenItem to simply not provide index 0,
but found that my provided index is always ignored. Even if I change
my index to a constant like 1 it is ignored.

I found the problem in RefreshingView.addItems, where a loop is used
to iterate over items and an index is always set:

 protected void addItems(IteratorItemT items)
 {
   int index = 0;
   while (items.hasNext())
   {
   ItemT item = items.next();
   item.setIndex(index);
   add(item);
   ++index;
   }
 }

This doesn't make sense to me, because the OddEvenItem ctor is
designed to take an index, which is afterwards ignored.

Two questions here:

1. Is the call to setIndex by design and one should override setIndex in
custom created items to just ignore that call? In that case the
documentation for Item should make that more clear, unless I have
missed that.

2. How should I get my OddEvenItem to print CSS classes based on a 1
index at all? Should I override onComponentTag instead of changing the
index to 1 in my newItem-method?

Thanks für help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty form values after successful onSubmit?

2015-02-03 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Montag, 2. Februar 2015 um 21:03 schrieben Sie:

 You can navigate to a new page instance
 (#setResponsePage(this.getClass()) if you want to start over with empty
 input *and* an empty model.

Tried that and indeed the form values are empty in that case, but my
success message is not rendered anymore.

Guten Tag Martin Grigorov,
am Montag, 2. Februar 2015 um 21:59 schrieben Sie:

 Or set a fresh instance as a model object of the Form.

That rendered my success message without any old model values. Is
that a workaround or something one can do without risking problems? It
feels a bit strange to always create a new form instance which is only
used as the model, while the first created instance added by the page
is kept around for the page.

Would it be a better solution to just empty the only one created
instance of the form by the page, which I already have anyways and is
used as default model?

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty form values after successful onSubmit?

2015-02-03 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 3. Februar 2015 um 09:28 schrieben Sie:

 You can use getSession().success(...) instead if you know there is a
 session, or it is OK to bind one.

Thanks for that hint, I indeed always have a session in my context.

 I meant to set a new instance of YourEntity in the Form's model. Not to
 create a new instance of the Form itself.

I use a CompoundPropertyModel with the form itself as a model, so in
that scenario I shouldn't set a new model instance manually just to
empty values?

 It is really up to *your* use case and wanted user experience

That was my impression as well, I just wanted to be clear if I don't
miss any best practice or am doing something wrong.

Thanks a lot!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Empty form values after successful onSubmit?

2015-02-02 Thread Thorsten Schöning
Hi all,

I have some very straightforward forms, but am really new to the
whole stateful forms/pages thing in Wicket. My form has some elements
with validators and if things fail the form is rendered again with the
former input values and a feedback message with the error. If no error
occured my form changes some data and provides a simple success
feedback message by calling this.success(...).

I didn't expect the latter, but instead that the form data is cleared
automatically. Is that something Wicket don't want to do automatically
by purpose because it's only sometimes wanted, not always?

I'm a bit afraid I could forget clearing data on my own in that case
and thought about how to deal with this, especially as forms may grow
in future and fields get added. I'm using CompoundPropertyModel, like
suggested in the tutorials.

Any ideas or suggestions on this? Would be a simple call to
Form.clearInput the best solution?

Thank für your feedback!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty form values after successful onSubmit?

2015-02-02 Thread Thorsten Schöning
Guten Tag Sven Meier,
am Montag, 2. Februar 2015 um 17:38 schrieben Sie:

 a Form clears all FormComponents' input automatically on a successful
 submit.

 Why do you think that this is not the case?

Because that's what I see. ;-) Using the following code:

@Override
protected void onSubmit()
{
do something...

// TODO Instanzdaten leeren?
this.success(this.getString(success));
}

I do see the success message AND the values of the input which have
been sent.

So, you tell me that I'm doing something wrong? I only have a form and
use it as a compound one as the default model. Any ideas on where I
should look at to find the problem?

Thank!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Empty form values after successful onSubmit?

2015-02-02 Thread Thorsten Schöning
Guten Tag Thorsten Schöning,
am Montag, 2. Februar 2015 um 18:13 schrieben Sie:

 I do see the success message AND the values of the input which have
 been sent.

I debugged a bit and can verify that success calls though to some
logic which marks my page as dirty, generated a new version number,
stores the changed page in the session and such. I don't see anything
to interfere with that and the ctor of my page is not called again,
the same with onInitialization, which I override to build my form.

I didn't see any code which resets the default model or its properties
or such.

Is all that expected and intended behavior or am I doing something
really weird? :-)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



AttributeAppender seems to be ignored in AbstractAjaxBehavior.onComponentTag

2015-01-27 Thread Thorsten Schöning
Hi all,

I have a class extending AbstractAjaxBehavior and overriding
onComponentTag(ComponentTag tag), because I need a custom css class
added. I thought this would be an easy task by simply adding an
AttributeAppender like the following:

 tag.addBehavior(AttributeModifier.append(class, murks2));

But that doesn't work, the class attribute retains it's initial
value. If I add low level like the following the attribute's value
changes successfully:

 tag.append(class, murks,  );

I googled a bit and found one thread about AjaxLink and the same
problem, but no description on why using AttributeModifier doesn't
work and I don't even use AjaxLink at all.

Am I doing something wrong or is this intended behavior? In the latter
case, what should I do to let my AjaxBehavior change the class
attribute?

Thanks for your help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Best practice integrating Wicket and 3rd party Ajax-component

2015-01-22 Thread Thorsten Schöning
Hi all,

I have some AutoComplete Ajax component which I need to integrate with
Wicket. The component mainly gets configured an URL as target of it's
request and expects the server to provide some JSON structure.

One important thing to note is, that this component is part of a
larger JS app consisting of many more components, with it's own build
tools and integration into the site. So I can't extract that one
component and build a Wicket component or such around it. Instead I
want to keep all like it's is and just want to configure a Wicket
entry point for the component, which than handles the requests and
provides the response.

From my currently limited knowledge of Wicket I thought of simply
using a ResourceReference which gets mounted to a special URL,
implementing the search logic needed. Because I won't use any
templates or such and just need to provide some JSON.

Or is there any better approach I should have a look into for any
reason?

Thanks for your ideas!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Best practice integrating Wicket and 3rd party Ajax-component

2015-01-22 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Donnerstag, 22. Januar 2015 um 09:47 schrieben Sie:

 https://github.com/wicketstuff/core/tree/master/jdk-1.7-parent/autocomplete-tagit-parent

That looks interesting, I have a closer look. Thanks!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Use application.setName to set a custom name?

2015-01-21 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 21. Januar 2015 um 09:46 schrieben Sie:

 But how would you decide what name to use if you do this in the constructor?
 At that time you don't have access to many things, e.g. the servlet context.

I would have implemented a ServletContextListener to create my custom
name depending on it's dir name and save that statically. Such a
listener should always be called before the Wicket filter.

 I meant to add your own MBean somewhere in the root.
 This way it will be easy for you to check the instance real name in the
 JMX viewer

I see, but for that to work I would need more than one wicket specific
entry in the console and currently I have only one. It's always just
one org.apache.wicket.app.WicketFilter, where WicketFilter is the
name of the filter in web.xml, and not two of them. I guess I only see
the first recognized or whatever, if I change one name in web.xml, I
get two entries.

 Here is a quick and dirty workaround for the problem: use Reflection to set
 the Application#name field value to anything by-passing the setter and the
 check.

I will rather stick with documentation in web.xml if I can't guarantee
being the first and only one setting this. Thanks anyways!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Use application.setName to set a custom name?

2015-01-21 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Dienstag, 20. Januar 2015 um 19:21 schrieben Sie:

 This is by design (
 https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/Application.java#L944-L945
 ).
 The application name is used for internal caches, keys, etc. and it must be
 something stable and unique.
 If it was allowed to change it at any time then many things may break.

That's fine, but why am I not allowed to set it myself first?
WicketFilter could just test if it is already set and don't set it
than, it doesn't necessarily provide a better one. The problem
currently is only that it always wants to set it, even if I already
did using a custom constructor.

That's the only thing that doesn't make sense to me.

 I think the easiest thing to do is to export yet another JMX ObjectName
 with the custom name. See
 https://github.com/apache/wicket/blob/master/wicket-jmx/src/main/java/org/apache/wicket/jmx/Initializer.java#L109

I had a look at that as well, but didn't understand what I could do to
change the implementation, as there doesn't seem to be any hook or
callback or whatever to change how the variable domain is created.
It always uses the application name.

Would I need to implement an own Initializer by overriding the
mentioned init? How would I register my Initializer to be used by
wicket-jmx then? I would prefer some way like it's now, either the
wicket-jmx gets deployed or not, so everything is as loose coupled as
now.

Thanks for any more details.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Use application.setName to set a custom name?

2015-01-21 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Mittwoch, 21. Januar 2015 um 11:37 schrieben Sie:

 This is a problem that deserves a ticket, IMO.

https://issues.apache.org/jira/browse/WICKET-5816

Thanks for your help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Use application.setName to set a custom name?

2015-01-20 Thread Thorsten Schöning
Hi all,

I have an application which gets deployed into different web app
contexts of a Tomcat simply be naming the folder of the context
differently. So application is hosted as application1,
application2 etc. simply by copying the generic folder of
application into a new target and do some minor configuration
changes. The point is, that web.xml keeps the same for all
installations within one Tomcat.

Today I had a look at using JMX with Wicket and recognized, that the
name of the application by default is set to the name the Wicket
filter gets in web.xml. Because that's generic in my case I'm unable
to distinguish what the JMX console shows me, it's always called the
same and I can't see to which application it belongs.

Two options now: Either one has to change web.xml for each folder or
provide some logic to set the application name on runtime, e.g.
depending on the folder name.

I would prefer the latter and tested a bit around Application.setName,
but this doesn't seem to work, because setName can only be called
once and WicketFilter currently always calls it. So regardless if
someone wants to call it earlier or afterwards, it will always result
in an error.

Is that expected behavior, should no application be able to provide
another name at all? Or is there any other way to set the name on my
own without WicketFilter trying to do the same?

The relevant code in WicketFilter is the following:

 public void init(final boolean isServlet, final FilterConfig filterConfig)
[...]
// locate application instance unless it was already 
 specified during construction
if (application == null)
{
applicationFactory = getApplicationFactory();
application = 
 applicationFactory.createApplication(this);
}

application.setName(filterConfig.getFilterName());
application.setWicketFilter(this);

This looks to me as if setName is effectively useless for anyone
except WicketFilter, because it's always called there.

Thanks for your help!

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Proposal: EnclosureGroup to hide surrounding markup depending on enclosure children

2015-01-16 Thread Thorsten Schöning
Hi all,

I have a navigation, where each level consists of a headline to
summarize all sub nav links and a list of those sub nav links. Pretty
standard. I needed to implement two things: First the sub nav links
itself should be hidden or visible during some configuration and such
on runtime, e.g. if a user is logged in and has special permissions to
see the link etc. Second if all sub nav links are invisible, their
headline should be invisible, too, which results in the whole HTML of
that navigation block should be removed at all.

Hiding the links itself is pretty straightforward by using
wicket:enclosure, because the links are the only wicket objects within
and everything works automatically. The trickier part is to hide the
whole parent HTML with the headline, if all links are hidden already.

This sounded like a perfect approach for wicket:enclosure to me as
well, but from my understanding wouldn't work because enclosure always
needs a special child component to work on, only one of that and is
transparent in the component hierarchy and so on. The only
alternatives I found were using wicket:container[1], but from my
understanding that approach would require to manually create such an
container, something which I wanted to avoid, simply because I
wouldn't need it for any other useful reason.

So what I did was to have a closer look at the current
EnclosureHandler and Enclosure and implement my own EnclosureGroup
based on those. Such a group is only a simple component which combines
Enclosures as children to determine the visibility of the whole group
depending on the visibility of the children. Because I as well
implemented a filter for the MarkupParser, I'm able to determine
special combinations where wicket:enclosure tags can't be standard
tags anymore, but need to be my new EnclosureGroup and can be resolved
automatically like the standard wicket:enclosure. The only thing I
needed to change from Wickets default behavior was the usage of
EnclosureHandler as a component resolver and instead replace it with
my own EnclosureGroupHandler, simply because naked wicket:enclosure
without child attribute is not accepted by Wicket, but I use those as
my group indicator.

Here's one example:

 ol class=subNav
   wicket:enclosure
   li class=cmds
   h2
   wicket:message key=../wicket:message
   /h2
   ol class=subNav
   wicket:enclosure
   li class=...
   a  href=...
   title=...
   wicket:id=...
   wicket:message=...
   wicket:message 
 key=../wicket:message
   /a
   /li
   /wicket:enclosure
   /ol
   /li
   /wicket:enclosure
   wicket:enclosure
   [...]
   /wicket:enclosure
 /ol

My simple rule is that each wicket:enclosure without any child
attribute, but with wicket:enclosure as children is my new group. My
current implementation seems to work, but I still have some question:

Do you see any likely problems with such an approach, which I just
didn't run into yet?

Do you see any easier alternatives I've not recognized and which don't
force me to manually create components?

If my approach doesn't totally suck and you find it useful, is there
any interest to add it to the wicket core? From my opinion others
could benefit of it as well.

[1] 
http://stackoverflow.com/questions/11754719/wicket-container-that-is-hidden-when-all-its-child-components-are-hidden

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Proposal: EnclosureGroup to hide surrounding markup depending on enclosure children

2015-01-16 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Freitag, 16. Januar 2015 um 14:45 schrieben Sie:

 I'd suggest you to take a look at EnclosureContainer.

Hello,

I had and from my understanding that would require me to add more
boilerplate code to manually create such containers and I would still 
need to create something like EnclosureGroup as well, because
EnclosureContainer itself works only on one child component.

 There are many known problems with wicket:enclosure (consult with JIRA
 about them) so I guess you will face issues with your custom solution at
 some point too.

OK, in that case I can still fallback to EnclosureContainer I guess.
Thanks for the hint.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Why doesn't Wicket seem to call Session.replaceSession automatically?

2014-11-25 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Montag, 24. November 2014 um 20:44 schrieben Sie:

 https://issues.apache.org/jira/browse/WICKET-5775

Thanks a lot, I didn't have the time yet to create it on my own.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Why doesn't Wicket seem to call Session.replaceSession automatically?

2014-11-24 Thread Thorsten Schöning
Hi all,

during implementing the login a my current project I came across
WICKET-1767[1] which deals with session fixation problems, but to my
surprise it looks like the newly created method is not called
automatically by Wicket. If I search the code base for
replaceSession( I only get one result, the method itself.

Is there any reason why Wicket doesn't call the method automatically?
Looks to me like AuthenticatedWebSession.signIn would be a good place
to call it automatically. When should I call it instead, at the
beginning of AuthenticatedWebSession.authenticate? This would prevent
session fixation even if exception got throw during the authentication
itself for any reason.

[1]: https://issues.apache.org/jira/browse/WICKET-1767

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Auto-reloading markup during development

2014-11-23 Thread Thorsten Schöning
Guten Tag mscoon,
am Samstag, 22. November 2014 um 21:44 schrieben Sie:

 Is it possible to set wicket to reload markup and other resources during
 development so that one does not need to redeploy-restart the server in
 order to see their changes?

From my understanding this should work automatically, because
properties files are added to a watcher and if you have enabled
development mode templates are observed as well. What you need to make
sure is that Eclipse had the time to republish the changed files and
such. A short test with changes to a property and template file worked
for me, though I often restarted the server in the past for various
reasons as well.

http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/settings/IResourceSettings.html#setResourcePollFrequency(org.apache.wicket.util.time.Duration)
http://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/settings/IResourceSettings.html#setResourceWatcher(org.apache.wicket.util.watch.IModificationWatcher)

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Bes practice for deployment to avoid ClassNotFoundException

2014-11-23 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Sonntag, 23. November 2014 um 11:22 schrieben Sie:

 You are experiencing Tomcat Session Persistence -
 http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html#Persistence_Across_Restarts
 Just disable it for development to avoid such kind of problems.

But the exception clearly comes from wicket's page store, I already
found the code where the exception is captured and rethrown as
RuntimeException. I really doubt this is a problem of the Tomcat.

 122: return ois.readObject();
 at 
 org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:122)
 java.lang.RuntimeException: Could not deserialize object from byte[]
 throw new RuntimeException(Could not deserialize object from byte[], cnfx);

Additionally, deactivating this feature for development only in Tomcat
wouldn't change anything, if I update the production system after
refactoring I would get the same error there of course.

From looking at the code I think what I would need to do instead is
create my own delegating serializer, which encapsulates the default
Wicket one, catches the problematic exception and returns null instead
of throwing the exception. It looks like that all code mentioned in
the stacktrace is using null if things are not found or such and would
ultimately lead to PageProvider.isNewPageInstance believing that a new
instance is needed:

 public boolean isNewPageInstance()
 {
boolean isNew = pageInstance == null;
   if (isNew  pageId != null)
   {
   IRequestablePage storedPageInstance = 
 getStoredPage(pageId);
   if (storedPageInstance != null)
   {
   pageInstance = 
 storedPageInstance;
   isNew = false;
   }
   }
 
   return isNew;
 }

storedPageInstance would simply be null when using my own serializer.
From my opinion this should be a at least configurable default
behavior in Wicket anyways, I don't see how else it can handle things
like refactoring with using it's own page store of serialized Java
classes. It must ignore ClassNotFoundException in such cases somehow
because it's a perfectly valid situation.

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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



Re: Bes practice for deployment to avoid ClassNotFoundException

2014-11-23 Thread Thorsten Schöning
Guten Tag Martin Grigorov,
am Sonntag, 23. November 2014 um 12:20 schrieben Sie:

 4) you start Tomcat and it tries to load the persisted sessions
 4.1) Since Wicket stores its data
 as org.apache.wicket.pageStore.DefaultPageStore.SerializedPage (a triple of
 pageId (int) / sessionId (String) / pageData (byte[])) it is Wicket's job
 to deserialize the pageData byte[] to SomePage instance.

I'm pretty sure this is not what is happening and the provided
stacktrace makes clear that Wicket is doing everything. The only thing 
where Tomcat comes into play is the actual class loading itself, but
that's correct of course because Tomcat provides at least a parent
classloader to use. Wicket does serialize and deserialize the pages on
it's own just because of an incoming request.

 In both cases I think Tomcat will just log an error that an old session
 cannot be loaded and continue with the start of the application.
 Am I correct or Tomcat fails to start ?

Tomcat doesn't log anything and just succeeds to start, at least I
didn't find any log messages from Tomcat in Eclipse and requesting
other pages from Wicket after ClassNotFoundException succeeded as
well. Simply because there were newly created.

 Please paste the complete exception if I am not correct.

I attached the saved HTML file with everything Wicket told me, but
there's nothing more interesting than what I've already posted in my
fist mail.

 No.
 Wicket cleans up its data storages at session invalidation time (per
 sessionId) or at application stop (for all sessions).
 So there is nothing to load at start time and no knowledge about old stuff.

If that was true, Tomcat wouldn't be able to run into any problems with
a serialized session as well because there wouldn't be anything left
from Wicket to serialize. Or does Wicket only clear persistent storage
in files, but retains it's session data? That wouldn't make much sense
to me, because the problem would remain.

Besides that, I just tested with a request for some page: Wicket did
create a folder to save the serialized page during runtime of Tomcat.
So I stopped Tomcat to see if the folder gets deleted or such and it
didn't, instead Wicket created the additional file DiskDataStoreIndex
as serialized Java object, which clearly contains the path to the
serialized page. Afterwards I restarted Tomcat, issued another
request, DiskDataStoreIndex got read (monitored using ProcMon) and
afterwards deleted. The only thing I didn't see was reading the former
persisted page... But the former behavior corresponds to the code:
DiskDataStore.destroy doesn't just empty anything, data gets persisted
in a file and there's even a load method to load the data.

So the only interesting thing is if pages are used as well after the
restart or not: Application.internalDestroy does call a lot of destroy
methods, but DiskDataStore.destroy e.g. is implemented to persist
data, while other caches seem to really be just cleared, like that for
markup.

Which is the codepath where I can see that persisted pages get
forgotten on shutdown of Wicket? Following Application.internalDestroy
and it's call of internalGetPageManager().destroy(); lead me to
DiskDataStore which clearly doesn't destroy the data...

A simple explanation for my problem could as well be that I didn't
restart the Tomcat and that during it's restart it works like you say,
but in that case I want to make sure that really session and
persistent page store are abandoned and currently it doesn't look
so...

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

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

Bes practice for deployment to avoid ClassNotFoundException

2014-11-21 Thread Thorsten Schöning
Hi all,

I'm new to wicket and just recently started to use it for a new web
app for one of our projects. Today I came across a similar issue like
described in [1], a ClassNotFoundException during deserialization of a
page. The interesting part about this in my mind is, that the
mentioned missing class was missing for a good reason: I simply
refactored a bit and renamed the class, redeployed and restarted my
Tomcat. This looks like a normal use case to me, but is something I
didn't thought of when I've read through the docs because.

My deployment is very simple: I check out a SVN working copy with a
pre-configured tag containing the whole application once and
afterwards just need to merge/update and stop/start the web
server/app.

How is deployment supposed to work in Wicket after I have refactored
or otherwise changed my classes regarding cached and serialized pages?
Is there anything I need to tell wicket to clear its caches on each
deployment or ignore those or whatever? Am I forced to not delete once
deployed classes for a fair period of time? That would be a litte
nightmare... Or is there any other issue I ran into I should have
avoided?

Obviously others do deploy their Wicket apps as well, so I hope you
have some input on how to avoid the problem I've ran into. Thanks!

The important parts of the stacktrace:

java.lang.ClassNotFoundException: 
de.am_soft.util.frontend.wicket.markup.link.LogoutLink
 at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
 at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at 
org.apache.wicket.application.AbstractClassResolver.resolveClass(AbstractClassResolver.java:108)
 at 
org.apache.wicket.serialize.java.JavaSerializer$ClassResolverObjectInputStream.resolveClass(JavaSerializer.java:218)
 at java.io.ObjectInputStream.[...]
 [...]
 at 
org.apache.wicket.serialize.java.JavaSerializer.deserialize(JavaSerializer.java:122)
 at 
org.apache.wicket.pageStore.DefaultPageStore.deserializePage(DefaultPageStore.java:396)
 at 
org.apache.wicket.pageStore.DefaultPageStore.getPage(DefaultPageStore.java:135)
 at 
org.apache.wicket.page.PageStoreManager$SessionEntry.getPage(PageStoreManager.java:203)
 at 
org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.getPage(PageStoreManager.java:360)
 at 
org.apache.wicket.page.AbstractPageManager.getPage(AbstractPageManager.java:107)

[1]: https://issues.apache.org/jira/browse/WICKET-4785

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning   E-Mail: thorsten.schoen...@am-soft.de
AM-SoFT IT-Systeme  http://www.AM-SoFT.de/

Telefon...05151-  9468- 55
Fax...05151-  9468- 88
Mobil..0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


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