Re: AjaxFormValidatingBehavior with multiple FormComponents

2013-08-10 Thread Jochen Mader
Aargh, wasn't aware of that.
Thanks.


On Fri, Aug 9, 2013 at 9:33 AM, Martin Grigorov wrote:

> Hi,
>
> This is how the browsers work. If there is one form element then ENTER
> submits, otherwise - no.
>
> You can register a listener on the form for keyup events that checks the
> keyCode and on ENTER does: $('#buttonId').trigger('click')
>
>
> On Thu, Aug 8, 2013 at 6:13 PM, Jochen Mader  >wrote:
>
> > Wicket 6.9.1:
> > I ran into a weird issue:
> > I am trying to submit a form when pressing enter. Using
> > the AjaxFormValidatingBehavior (same for AjaxFormSubmitBehavior) I can
> > submit a form with a SINGLE FormComponent.
> > When adding a second one the form won't submit when pressing enter.
> >
> > Sourcecode below shows what I am doing. Removing the DateTextField makes
> > the whole thing work:
> >
> >
> > Form form = new Form("taskForm", new
> > CompoundPropertyModel(new Task())) {
> > @Override
> > protected void onSubmit() {
> > taskListModel.getObject().addTask(getModelObject());
> > setModelObject(new Task());
> > send(getPage(), Broadcast.EXACT, new TaskCreatedEvent());
> > }
> > };
> >
> >
> > add(new
> >
> >
> FeedbackPanel(FEEDBACK).setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true));
> > add(form
> > .add(new TextField("title").setRequired(true))
> > .add(new DateTextField("dueDate").add(new DatePicker()))
> > .add(new
> Button("submit").add(hideIf(javascriptEnabled(
> > );
> > add(new AjaxFormValidatingBehavior(form, "onsubmit"));
> >
> >
> > 
> > 
> > 
> > 
> >  > key="taskForm">
> >  > key="title">
> >  > key="dueDate">
> > 
> > 
> > 
> > 
> > 
> > 
> >
>


AjaxFormValidatingBehavior with multiple FormComponents

2013-08-08 Thread Jochen Mader
Wicket 6.9.1:
I ran into a weird issue:
I am trying to submit a form when pressing enter. Using
the AjaxFormValidatingBehavior (same for AjaxFormSubmitBehavior) I can
submit a form with a SINGLE FormComponent.
When adding a second one the form won't submit when pressing enter.

Sourcecode below shows what I am doing. Removing the DateTextField makes
the whole thing work:


Form form = new Form("taskForm", new
CompoundPropertyModel(new Task())) {
@Override
protected void onSubmit() {
taskListModel.getObject().addTask(getModelObject());
setModelObject(new Task());
send(getPage(), Broadcast.EXACT, new TaskCreatedEvent());
}
};


add(new
FeedbackPanel(FEEDBACK).setOutputMarkupPlaceholderTag(true).setOutputMarkupId(true));
add(form
.add(new TextField("title").setRequired(true))
.add(new DateTextField("dueDate").add(new DatePicker()))
.add(new Button("submit").add(hideIf(javascriptEnabled(
);
add(new AjaxFormValidatingBehavior(form, "onsubmit"));

















Re: using static fileds in a page

2013-03-06 Thread Jochen Mader
If you are already using Spring why do you need the field to be static?
Beans are by default singleton scoped and can be tailored to
session/request scoped.

On Wed, Mar 6, 2013 at 1:41 PM, Martin Grigorov  wrote:
> If you create an ExecutorService then you should shutdown it too.
> See org.apache.wicket.Application#getApplicationListeners &
> org.apache.wicket.IApplicationListener#onBeforeDestroyed
> or org.apache.wicket.Application#onDestroy
>
>
> On Wed, Mar 6, 2013 at 2:32 PM, fachhoch  wrote:
>
>> My proxy executes  my service  call in  a thread for which I ma uisng
>> google
>> Guava com.google.common.util.concurrent.SimpleTimeLimiter
>>
>> this uses   Executors.newCachedThreadPool() ,  if I want to restart my
>> server   do I have to worry about all these threadsnot stopping or any
>> issue with this ?
>>
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/using-static-fileds-in-a-page-tp4657021p4657024.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 

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



Re: Eclipse or IntelliJ

2013-02-20 Thread Jochen Mader
Well, weighting a few years of Eclipse usage vs one week of Idea is
not really a fair comparison.
It took me about 4 months to really get into Idea (short-cuts,
different compile behavior ...).
If you ever really consider switching an IDE don't base your
assumptions on a week of usage.
If there weren't any differences we wouldn't have several major IDEs.

But that's just my two cents ;)

P.S.: Netbeans is also an awesome IDE, it just gets horribly slow with
bigger projects (and that's based on the most recent Release of
Netbeans I tried a week ago).

On Wed, Feb 20, 2013 at 5:48 PM, Bertrand Guay-Paquet
 wrote:
> Hi William,
>
> This might be your lucky day :)
>
> Here's the fix for that horrible slowness in xml tabs:
> From: http://wiki.eclipse.org/Platform_UI/Juno_Performance_Investigation
>
> Ensure you are already running on a package from the Juno SR1 release
> (September 2012)
> Invoke Help > Install New Software
> Select this repository: http://download.eclipse.org/eclipse/updates/4.2
> Expand Juno SR1 Patches and install Eclipse UI Juno SR1 Optimizations
>
> Have a nice day,
> Bertrand
>
> p.s. I use Eclipse Juno. Tried Intellij 12 for a week but didn't like it...
> It was a constant battle to get my project working.
>
>
> On 20/02/2013 9:29 AM, William Speirs wrote:
>>
>> I've always used Eclipse and am currently using Juno. The Maven support
>> got
>> much better, but other stupid things seem to have "broke." For example,
>> switching tabs into the XML editor (or pom editor) seems to require
>> calculating Pi to 10 million digits each time. Actually, I think there is
>> a
>> memory leak somewhere and its just a GC going off, I should load it in
>> VisualVM and see. There are other annoying things about Eclipse with
>> respect to settings, but they can usually be "fixed" by editing some file
>> in the .settings directory.
>>
>> Tried IntelliJ once and it was terribly slow (and looked a bit ugly on
>> Linux)... maybe I should try 12?
>>
>> At the end of the day... anything's better than vim/emacs :-)
>>
>> Bill-
>>
>>
>> On Wed, Feb 20, 2013 at 8:03 AM, Martin Grigorov
>> wrote:
>>
>>> My main problem with Eclipse was that it mixes the classpaths for main
>>> and
>>> test.
>>> If you have separate config files in the test classpath some weird things
>>> may happen.
>>>
>>> There is a ticket about this since March 2008:
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224708 and it says "we need
>>> someone to help us to implement it".
>>> It strange because Eclipse is OSGi based, i.e. they should have a very
>>> good
>>> control over the classloaders.
>>>
>>> So I moved to IDEA and I find it much better for my needs.
>>>
>>>
>>> On Wed, Feb 20, 2013 at 2:52 PM, Richard W. Adams 
>>> wrote:
>>>
 If you do software development for a living (as opposed to a hobby), one
 thing to consider is what tools are used at prospective employers. I
 work
 at a large (40,000+) company where Eclipse is the standard tool. Partly
 because it's open source (read "free," no budget impact) & has such a
 large support community. Plus it meets all our needs.

 I've used Eclipse for years (both home & work), and have been satisfied
 with it.


 **

 This email and any attachments may contain information that is
 confidential and/or privileged for the sole use of the intended
>>>
>>> recipient.

   Any use, review, disclosure, copying, distribution or reliance by
>>>
>>> others,

 and any forwarding of this email or its contents, without the express
 permission of the sender is strictly prohibited by law.  If you are not
>>>
>>> the

 intended recipient, please contact the sender immediately, delete the
 e-mail and destroy all copies.
 **

>>>
>>>
>>> --
>>> Martin Grigorov
>>> jWeekend
>>> Training, Consulting, Development
>>> http://jWeekend.com 
>>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Eclipse or IntelliJ

2013-02-20 Thread Jochen Mader
I don't really like forcing people to use a specific IDE. We keep our
stuff IDE-agnostic as far as possible.
That said:
I have about 50 lines of code in my current multimodule project in Idea 12.
No slow down or any other problems ;)
But I have to say: Idea 10 was a horrible failure.

On Wed, Feb 20, 2013 at 2:03 PM, Martin Grigorov  wrote:
> My main problem with Eclipse was that it mixes the classpaths for main and
> test.
> If you have separate config files in the test classpath some weird things
> may happen.
>
> There is a ticket about this since March 2008:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=224708 and it says "we need
> someone to help us to implement it".
> It strange because Eclipse is OSGi based, i.e. they should have a very good
> control over the classloaders.
>
> So I moved to IDEA and I find it much better for my needs.
>
>
> On Wed, Feb 20, 2013 at 2:52 PM, Richard W. Adams  wrote:
>
>> If you do software development for a living (as opposed to a hobby), one
>> thing to consider is what tools are used at prospective employers. I work
>> at a large (40,000+) company where Eclipse is the standard tool. Partly
>> because it's open source (read "free," no budget impact) & has such a
>> large support community. Plus it meets all our needs.
>>
>> I've used Eclipse for years (both home & work), and have been satisfied
>> with it.
>>
>>
>> **
>>
>> This email and any attachments may contain information that is
>> confidential and/or privileged for the sole use of the intended recipient.
>>  Any use, review, disclosure, copying, distribution or reliance by others,
>> and any forwarding of this email or its contents, without the express
>> permission of the sender is strictly prohibited by law.  If you are not the
>> intended recipient, please contact the sender immediately, delete the
>> e-mail and destroy all copies.
>> **
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 

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



Unit-Testing JavaScript

2013-02-20 Thread Jochen Mader
>From time to time we have to do some JavaScript-heavylifting in
conjunction with the Wicket-JS-API.
To make it short:
What are you doing to Unit-Test JavaScript in Wicket? Especially
JavaScript interacting with Wicket-APIs?

Cheers,
Jochen

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



Re: Eclipse or IntelliJ

2013-02-20 Thread Jochen Mader
I abandoned Eclipse for IntelliJ after using it for almost 10 years
because of Maven. Since then I have become a big Idea-Fan :)
Working with Wicket using the community edition (the free one) is no
problem at all as you can use the Maven-Jetty-PlugIn. I did that for
quite a while.
I only switched to Ultimate because I have to work with several
app-servers (JBoss, TomcatEE, Glassfish,...).


On Wed, Feb 20, 2013 at 8:09 AM, Francois Meillet
 wrote:
>
> http://java.dzone.com/articles/why-idea-better-eclipse
>
>
> François Meillet
> Formation Wicket - Développement Wicket
>
>
>
>
>
> Le 20 févr. 2013 à 01:57, Igor Vaynberg  a écrit :
>
>> all the popular IDEs have more or less converged in regard to their
>> java feature set. now its just a matter of muscle memory :)
>>
>> -igor
>>
>> On Tue, Feb 19, 2013 at 4:39 PM, Timo Schmidt  wrote:
>>> On Tue 19.02.2013 15:17, Stephen Walsh wrote:
 Who uses what and why?

 I've only ever used Eclipse, but I discovered IntelliJ earlier this week
 and it's so different.  Just wondering pros and cons on each.
>>>
>>> I'm using NetBeans for serveral years now and havn't missed a
>>> feature yet. IMHO NetBeans is worth a try.
>>>
>>>  -Timo
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>

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



Re: ASK: Updating one wicket page's component from other wicket apps

2013-01-14 Thread Jochen Mader
I would say he already provided all workable options:
1. Use a dedicated messaging mechanism (JMS) through a container
(Spring, JEE6, ...)
2. Build your own messaging mechanism

Which one is best for you depends on your requirements.

On Mon, Jan 14, 2013 at 12:56 AM, Noven  wrote:
> Hi Sebastien,
>
> Thank you for your quick reply before :)
>
> Jboss, JMS, MDB are such a new thing for me. I heard them before but just 
> never use it in real apps.
> I'm considering AjaxSelfUpdatingTimerBehaviour like you've suggested while 
> waiting for others reply to this topic.
>
> Noven
>
>
>
> 
>  From: Sebastien 
> To: users@wicket.apache.org; Noven 
> Sent: Monday, January 14, 2013 6:24 AM
> Subject: Re: ASK: Updating one wicket page's component from other wicket apps
>
>
> Hi,
>
> Well, if you want your 2 webapps communicates "live", maybe
> you should consider an application server (JBoss?), JMS for sending the
> message, an MDB (message driven bean) to read the message (admin side)
> and wicket native socket (or wicket atmosphere) to send the message back
>  to the admin (and refresh the datatable?)
>
> To be honest, it is
> not so easy. So maybe you can refine your requirements. For instance,
> could the updated information not be stored in the database (as they
> already sharing the same DB) instead of sending a message? Then the
> admin page could read the DB next time the page refreshes (or using a
> AjaxSelfUpdatingTimerBehavior)
>
> Hope this helps (a bit)
> Sebastien.
>
>
> On Mon, Jan 14, 2013 at 12:20 AM, Noven  wrote:
>
> My idea is, first the member's apps have to able to call an admin's wicket 
> page, than post it using atmosphere to update the component from Admin's page.
>>
>>I just don't know what the best practice to achieve calling a wicket page 
>>from outside wicket apps.
>>
>>
>>Any help or suggestion appreciated. Thanks
>>
>>
>>
>>
>> From: Noven 
>>To: "users@wicket.apache.org" 
>>Sent: Monday, January 14, 2013 5:53 AM
>>Subject: ASK: Updating one wicket page's component from other wicket apps
>>
>>
>>Hi all,
>>
>>Currently, I am developing 2 separated wicket apps, they are an Admin's web 
>>and a Member's web. Both shared the same database but run in different tomcat 
>>container.
>>
>>My question is how to achieve below use case:
>>
>>On member's web: When a member submit a form, the form will send message to 
>>update a component (e.g. a datatable) on Admins' page. Or in the form's 
>>onSubmit method, it will call/ send parameter to the Admin's page. Later at 
>>the Admin's page it will update it's component base on the parameter.
>>
>>I read about web service but have not find a good example on how updating a 
>>wicket page.
>>
>>Thanks,
>>Noven

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



Re: update panels inside webmarkupcontainer

2013-01-14 Thread Jochen Mader
As long as you are not holding references on your own it will be
collected after a replaceWith.

On deleting pages: You could use DefaultPageStore.removePage but I am
not sure if that's a really good idea. Wicket is pretty good in
managing what's in the store and you should rely on its behavior as
much as possible.


On Sun, Jan 13, 2013 at 12:41 AM, fachhoch  wrote:
> Thanks for your reply, I am assuming if I  use component.replacewith will
> the old component is replaced with the new componenet and the old is no more
> in the component tree so will be gc colected , sure I am not holding any
> references  top it.
> second if I move out of this page  to some other page   can i delete all
> version of this page from pagemap ?
> if so please tell me how .
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/update-panels-inside-webmarkupcontainer-tp4655279p4655319.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Constructors take vararg of Component? (Enhancement RFC)

2013-01-07 Thread Jochen Mader
Why aren't you using fluent interfaces?
The API ist built around that and allows for a much cleaner structure
inside your constructors.
Just watch out for those Auto-Formaters ;)

new Form("frmRsvp", cpm)
.add(new StatusPanel("pnlRsvp"))
.add(new ConfirmPanel("pnlConfirm"))
.add(new RsvpRulesPanel("pnlRsvpRules"));


On Mon, Jan 7, 2013 at 9:17 AM, Martin Grigorov  wrote:
> Hi,
>
> The component constructor doesn't call #add() at the moment (and I think
> this wont change soon without a better reason).
> So even if adding the varargs this wont help.
>
> But you can create your own components which do this:
>
> public class MyForm extends Form {
>public MyForm(String id, IModel model, Component... children) {
>  super(id, model);
>
>  ad(children);
>}
> }
>
>
> On Sun, Jan 6, 2013 at 9:24 PM, Zac Bedell  wrote:
>
>> Greetings all,
>>
>> I was wondering what Wicket users & devs might thing of a possible API
>> change for a future version (maybe Wicket 7?) of including a varargs array
>> of Component as the final parameter of all of the various MarkupContainer
>> subclasses?  I find myself doing things like these a lot:
>>
>> pnlNoRsvp = new WebMarkupContainer("pnlNoRsvp");
>> pnlRsvp = new StatusPanel("pnlRsvp");
>> pnlConfirm = new ConfirmPanel("pnlConfirm");
>> pnlRsvpRules = new RsvpRulesPanel("pnlRsvpRules");
>>
>> RsvpPage.this.add(
>> new Label("event.title"),
>> new CssFeedbackPanel("feedback"),
>> new Form("frmRsvp", cpm) {
>>   {
>> add(pnlNoRsvp, pnlRsvp, pnlConfirm);
>>   }
>> },
>> pnlRsvpRules
>> );
>>
>> -- or --
>>
>> Form frmRsvp = new Form("frmRsvp", cpm);
>> frmRsvp.add(pnlNoRsvp, pnlRsvp, pnlConfirm);
>>
>> RsvpPage.this.add(
>> new Label("event.title"),
>> new CssFeedbackPanel("feedback"),
>> frmRsvp,
>> pnlRsvpRules
>> );
>>
>> --
>>
>> If Form and the various other Wicket MarkupContainer's had constructors
>> with Component... as their final parameter, it would be possible to do
>> something like:
>>
>> RsvpPage.this.add(
>> new Label("event.title"),
>> new CssFeedbackPanel("feedback"),
>> new Form("frmRsvp", cpm, pnlNoRsvp, pnlRsvp, pnlConfirm),
>> pnlRsvpRules
>> );
>>
>> --
>>
>> Granted, this would balloon the number of constructors throughout the
>> framework just to save a bit of typing.  Curious what others might think...
>>
>> Best regards,
>> Zac Bedell
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com 

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



Re: JPA annotations

2013-01-02 Thread Jochen Mader
I think you should first understand what the different JPA-annotations
actually do.
@Entity, @Table, @Id, @GeneratedValue are annotations used on the
entity level to tell the mapper what to do with properties. These
informations are of no interest to Wicket.
@EJB, @PersistenceUnit, @Resource are annotations used for isntances
injectable by an appropriate container (which can bee CDI, Guice
Spring, ...).

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



A little Christmas present

2012-12-23 Thread Jochen Mader
We (Olaf Siefart and me) have prepared a little christmas present for you.
It's a small Wicket application showcasing different approaches to
doing asynchronous loading in Wicket (WebSockets, HeartBeat, ...).
We built it for our company developer conference and afterward decided
to open source it.
Get it at:
https://github.com/osiefart/wicket-christmas

Have a look, enjoy the snow fall and have a Merry Christmas.

Olaf and Jochen

jochen.ma...@senacor.com
olaf.sief...@senacor.com

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



Re: Why is SortParam.getProperty generic?

2012-11-17 Thread Jochen Mader
I was just about to answer my own question.
We migrated a big part of our application to use LambdaJ instead of
PropertyModels. With getProperty being generic it's now possible to
use it instead of passing around strings.
Thanks,
Jochen

On Sat, Nov 17, 2012 at 4:01 PM, Jochen Mader  wrote:
> On Sat, Nov 17, 2012 at 3:42 PM, Sven Meier  wrote:
>> It's just that some devs wanted to use other things than strings to identify
>> the sort order:
>>
>>   https://issues.apache.org/jira/browse/WICKET-4535
>>
>> Perhaps Jesse has an example?
>>
>> Sven
>>
>>
>> On 11/17/2012 01:19 PM, Jochen Mader wrote:
>>>
>>> SortParam.getProperty doesn't return a String butIt might be due to the
>>> fact that I am sick but I don't get why
>>>
>>>   T.
>>> So far I always used getProperty as vasis for a PropertyModel to resolve
>>> things.
>>> Any hint would be appreciated,
>>> Jochen
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: Why is SortParam.getProperty generic?

2012-11-17 Thread Jochen Mader
On Sat, Nov 17, 2012 at 3:42 PM, Sven Meier  wrote:
> It's just that some devs wanted to use other things than strings to identify
> the sort order:
>
>   https://issues.apache.org/jira/browse/WICKET-4535
>
> Perhaps Jesse has an example?
>
> Sven
>
>
> On 11/17/2012 01:19 PM, Jochen Mader wrote:
>>
>> SortParam.getProperty doesn't return a String butIt might be due to the
>> fact that I am sick but I don't get why
>>
>>   T.
>> So far I always used getProperty as vasis for a PropertyModel to resolve
>> things.
>> Any hint would be appreciated,
>> Jochen
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Why is SortParam.getProperty generic?

2012-11-17 Thread Jochen Mader
It might be due to the fact that I am sick but I don't get why
SortParam.getProperty doesn't return a String but T.
So far I always used getProperty as vasis for a PropertyModel to resolve things.
Any hint would be appreciated,
Jochen

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



Re: Thread safety of various Wicket classes?

2012-10-17 Thread Jochen Mader
First of all:
You shouldn't start optimizing without having an actual problem.
I don't see a real benefit in sharing a validator between several components.

ON THE OTHER SIDE

There shouldn't be a problem using Validators across several component
instances as I am not aware of a single stateful validator.
No state = threadsafe (wack me on the head if I'm wrong)

On Wed, Oct 17, 2012 at 7:39 AM, Ondrej Zizka  wrote:
> Ok, thanks.
>
> So I guess I should assume all classes unsafe, even if I check the code
> - since that can change.
> Maybe it would be worth considering committing to keeping certain class
> groups thread-safe, like validators. Just an idea.
>
> Ondra
>
>
> On Tue, 2012-10-16 at 09:17 +0200, Martin Grigorov wrote:
>
>> Hi,
>>
>> Access to pages in Wicket is synchronized, i.e. only one thread can
>> manipulate the page.
>> So, if you use non-static member fields then there is no problem. If
>> you use static ones then you need to verify that they are thread safe
>> and can be used in such a way.
>>
>> On Mon, Oct 15, 2012 at 5:07 AM, Ondrej Zizka  wrote:
>> > Hi all,
>> >
>> > for repeaters, I didn't like adding a new validators, attribute
>> > modifiers etc for each single row.
>> > So I create just one and pass the reference.
>> >
>> > 1) Is it ok to have just one at component instance level?
>> >
>> > 2) Is it ok to make it a static final instance at app level?
>> >
>> > And about thread safety in general - is there some info about Wicket's
>> > classes, with some Do's and Don't's?
>> > Since Wicket gives a lot of freedom regarding hacking on it, I guess
>> > users should be aware.
>> >
>> > Thanks,
>> > Ondra
>> >
>>
>>
>>
>
>

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



Re: Determine session size for Wicket 1.5

2012-07-17 Thread Jochen Mader
Get a heapdump, use yourkit/visualvm.

On Mon, Jul 16, 2012 at 11:14 AM, Ian Marshall  wrote:
> I don't think that I am getting the session size in the right place. Despite
> my session sizes being logged as very small at ~1.7kB using the Google App
> Engine (GAE) web development server, in GAE production I am getting session
> sizes approaching 1MB (and attempting to breach this GAE-imposed limit of
> 1MB too).
>
> I shall have to try and find somewhere else to get a meaningful session
> size.
>
>
>
> Ian Marshall wrote
>>
>> Thanks Martin,
>>
>> I could not find onDetach() but found detach() so I have done this in my
>> WebSession subclass:
>>
>>   @Override
>>   public void detach()
>>   {
>> long loSize = getSizeInBytes();
>> m_logger.log(Level.FINE, String.format("Session size = %,dB.",
>> loSize));
>> super.detach();
>>   }
>>
>> This seems to be fine (my sessions seem very small at ~1.7kB - I must be
>> doing something wrong) except that this method can be called several times
>> as a result of one request.
>>
>> Thanks again,
>>
>> Ian
>>
>>
>>
>> Martin Grigorov-4 wrote
>>>
>>> Override Session#onDetach() and do it before calling super.onDetach().
>>>
>>> On Fri, Jul 13, 2012 at 2:01 PM, Ian Marshall 
>>> wrote:
 Hello,

 Is there a good way to discover my serialised or about-to-be-serialised
 session size without adding the debug bar to my page?

 I currently use

   @Override
   protected void onAfterRender()
   {
 super.onAfterRender();

 CloudSession ssnSession = (CloudSession)getSession();
 long loSize = ssnSession.getSizeInBytes();
 m_logger.log(Level.FINE, String.format("Session size = %,dB.",
 loSize));
   }

 in my WebPage subclass, but I suspect that this is the wrong place to
 examine the session size.

 My software environment is:

 Web framework: Wicket 1.5.7
 Web server system: Google App Engine for Java version 1.7.0
 Java: 1.6.0_33; Java HotSpot(TM) Client VM 20.8-b03
 Operating system: Microsoft Windows XP Home Edition version 2002 SP3
 (version 5.1 running on x86; Cp1252; en_GB)


 Ian Marshall
>>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Determine-session-size-for-Wicket-1-5-tp4650050p4650543.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Re: Wicket 6 and CDI

2012-07-15 Thread Jochen Mader
Hehehehe, that was easy :)
It's just a couple of package-renames and fixing the
ConversationExpiryChecker to use the new way of getting the
AjaxRequestTarget:
AjaxRequestTarget target = RequestCycle.get().find(AjaxRequestTarget.class);
if (component instanceof Page ||target != null)
Took me like 3 minutes.
I just did a quick smoke test in Glassfish and so far things are looking good.
Will hopefully get some more time tomorrow evening to test a little more.
If I find any problems I will let you know.

CU,

Jochen


On Sun, Jul 15, 2012 at 11:45 PM, Jochen Mader
 wrote:
> Tried it out a few minutes ago.
> Looks a few things got moved into the core package (e.g. IPageRequestHandler).
> I had a quick look and so far I didn't find anything beyond renamed
> packages (but that's just a few minutes of looking).
> I might just give it a shot and try to get it running.
>
> CU
> Jochen
>
> On Sun, Jul 15, 2012 at 11:15 PM, Igor Vaynberg  
> wrote:
>> havent had time to try it out on wicket 6 yet, is anything actually broken?
>>
>> -igor
>>
>> On Sun, Jul 15, 2012 at 11:40 PM, Jochen Mader
>>  wrote:
>>> To get that out of the way: I know that Wicket 6 won't be shipped with
>>> CDI directly :)
>>> I still would like to use Wicket 6 in Glassfish.
>>> Are there plans to port wicket-cdi to Wicket 6? I couldn't find
>>> anything on the 42lines git-repo on that issue.
>>> Help required?
>>>
>>> Thanks,
>>>
>>> Jochen
>>>
>>> -
>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>>> For additional commands, e-mail: users-h...@wicket.apache.org
>>>
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>

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



Re: Wicket 6 and CDI

2012-07-15 Thread Jochen Mader
Tried it out a few minutes ago.
Looks a few things got moved into the core package (e.g. IPageRequestHandler).
I had a quick look and so far I didn't find anything beyond renamed
packages (but that's just a few minutes of looking).
I might just give it a shot and try to get it running.

CU
Jochen

On Sun, Jul 15, 2012 at 11:15 PM, Igor Vaynberg  wrote:
> havent had time to try it out on wicket 6 yet, is anything actually broken?
>
> -igor
>
> On Sun, Jul 15, 2012 at 11:40 PM, Jochen Mader
>  wrote:
>> To get that out of the way: I know that Wicket 6 won't be shipped with
>> CDI directly :)
>> I still would like to use Wicket 6 in Glassfish.
>> Are there plans to port wicket-cdi to Wicket 6? I couldn't find
>> anything on the 42lines git-repo on that issue.
>> Help required?
>>
>> Thanks,
>>
>> Jochen
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>

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



Wicket 6 and CDI

2012-07-15 Thread Jochen Mader
To get that out of the way: I know that Wicket 6 won't be shipped with
CDI directly :)
I still would like to use Wicket 6 in Glassfish.
Are there plans to port wicket-cdi to Wicket 6? I couldn't find
anything on the 42lines git-repo on that issue.
Help required?

Thanks,

Jochen

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



New book on Wicket 1.5

2012-05-02 Thread Jochen Mader
Hey,
Sorry for spamming I couldn't figure out who to contact to (hopefully)
get this listet in your books section:

a few weeks ago my book on Wicket 1.5 got released:
http://www.amazon.de/Wicket-Komponentenbasiert-objektorientiert-alternative-Java-Webframework/dp/3868020810

It's written in German and has been published by Entwickler Press.


Titel   Wicket: Komponentenbasiert und objektorientiert- das alternative
Java-Webframework
Autor   Jochen Mader
Verlag  Software + Support, 2012
ISBN3868020810, 9783868020816
Länge   219 Seiten

Kurzinfo
Apache Wicket ist ein komponentbasiertes Webframework, das sich in den
letzten Jahren zu einem der beliebtesten Vertreter seiner Gattung
gemausert hat. Man könnte diese Beliebtheit mit der einfachen
Integration von Ajax oder der rigorosen Trennung von Markup und Logik
erklären. Aber was Wicket wirklich über die Masse konkurrierender
Frameworks erhebt, sind der Verzicht auf eine eigene Markup-Sprache
und das objektorientierte Programmiermodell. Dadurch rücken Java und
seine Sprachmittel stark in den Vordergrund. Das ermöglicht es
erfahrenen Entwicklern, sehr schnell in die Kernkonzepte von Wicket
einzusteigen und auch komplexeste Anwendungen umzusetzen.

Ziel dieses Buchs ist es, die grundlegenden Konzepte von Wicket zu
vermitteln und im weiteren Verlauf auf fortgeschrittene Aspekte
einzugehen. Hierzu wird eine Beispielanwendung entwickelt und Schritt
für Schritt erweitert. Anhand detaillierte Codebeispiele werden
Sachverhalte wie der Wicket Request Cycle, Models, Validierung und
JUnit Testing erklärt. Des Weiteren werden Themen wie
Deplyoment-Szenarien (JEE6, Spring, ...) , jQuery-Integration und
Performance-Tuning in separaten Kapiteln behandelt. Durch Studium
dieses Buchs soll ein Entwickler befähigt werden, skalierbare,
wartbare Webanwendungen in Wicket zu bauen, und er soll lernen,
eigene, wiederverwendbare Komponenten zu entwickeln und fremde
Komponenten zu erweitern.
Zielgruppe
Entwickler mit soliden Java-Kenntnissen und einem Grundverständnis der
wichtigen Webtechnologien wie HTML und CSS
Der Autor
Jochen Mader hat über zehn Jahre Erfahrung  im Bereich Architektur und
Entwicklung. Derzeit ist er bei der Senacor Technologies AG für
verschiedene Wicket-Projekte als Technical Lead verantwortlich.


Thanks,

Jochen

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



Re: setResponsePage in ajax call

2012-04-26 Thread Jochen Mader
Please provide some code-samples to show us what you are doing.
If it's related to an older issue it would be great if you could give more
details (link to the issue).

Am 26.04.12 11:05 schrieb "Jürgen Lind" unter :

>Hi,
>
>I have difficulties in using the setResponsePage in ajax call as Wicket
>seems to direct the
>call to a relative URL. As a result, the request is made to the root
>context an that gives me
>a 404.
>
>The scenario is as follows: I have a login form and would like to provide
>user feedback on
>submission errors as ajax responses. Upon success, the user should be
>redirected to a new
>page.
>
>I have already found a thread on a similar issue and there it said, that
>this was fixed in 1.4.7.
>As I am using 1.5.3 this should presumably work. Am I doing something
>wrong here?
>
>Cheers,
>
>Jürgen
>
>-
>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>For additional commands, e-mail: users-h...@wicket.apache.org
>



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



Re: Modifying PageParameters

2011-11-10 Thread Jochen Mader
So much more awesome... (goes and cries in a corner)
Am 11.11.2011 01:04 schrieb "Igor Vaynberg" :

> is it more awesome then this one:
>
> https://github.com/42Lines/wicket-cdi
>
> -igor
>
> On Thu, Nov 10, 2011 at 1:22 PM, Jochen Mader 
> wrote:
> > Hello,
> > I am currently working on a Weld-Integration for Wicket 1.5.
> > Got almost everything done but Conversations are giving me a headache.
> > When navigating to another page I need to provide the conversation ID.
> > Only at the very end of a request I am able to figure out if the
> > conversation is valid.
> > For an AjaxLink using setResponsePage I thought the following would be
> > the thing to do:
> > Use onRequestHandlerExecuted to do the stuff at the end of the request.
> > There I look for an IPageRequestHandler and modify its PageParameters
> > using one of the following methods:
> >
> pageHandler.getPage().getPageParameters().add(WeldMetaData.CONVERSATIONID,
> > conversation.getId());
> > pageHandler.getPageParameters().add(WeldMetaData.CONVERSATIONID,
> > conversation.getId());
> >
> > Apparently this doesn't work and parameters set in this way won't end
> > up in the response page.
> > What do I have to do to achieve this?
> >
> > Thanks,
> >
> > Jochen
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Modifying PageParameters

2011-11-10 Thread Jochen Mader
Hello,
I am currently working on a Weld-Integration for Wicket 1.5.
Got almost everything done but Conversations are giving me a headache.
When navigating to another page I need to provide the conversation ID.
Only at the very end of a request I am able to figure out if the
conversation is valid.
For an AjaxLink using setResponsePage I thought the following would be
the thing to do:
Use onRequestHandlerExecuted to do the stuff at the end of the request.
There I look for an IPageRequestHandler and modify its PageParameters
using one of the following methods:
pageHandler.getPage().getPageParameters().add(WeldMetaData.CONVERSATIONID,
conversation.getId());
pageHandler.getPageParameters().add(WeldMetaData.CONVERSATIONID,
conversation.getId());

Apparently this doesn't work and parameters set in this way won't end
up in the response page.
What do I have to do to achieve this?

Thanks,

Jochen

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



Re: Problem with IMarkupResourceStreamProvider

2011-09-09 Thread Jochen Mader
Found the problem:
In an earlier version of the panel I overwrote getMarkupType.
Removing it fixed the problem.

public MarkupType getMarkupType() {
return MarkupType.HTML_MARKUP_TYPE;
}

On Fri, Sep 9, 2011 at 10:17 PM, Jochen Mader  wrote:
> I implemented a panel as a IMarkupResourceStreamProvider.
> It works perfect if I add it to a page using the add method. If I use
> "replaceWith" to replace another panel with this one I get
>
> "Tag expected"
>
> and the following stacktrace
>
>  MarkupStream: [markup =
> org.apache.wicket.util.resource.StringResourceStream@19aea6e2:
>  xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
>                       
>            wicket:id="submit">                    
>  
>  xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
>                       
>            wicket:id="submit">                    
>  , index = 0, current = [Raw markup]]
>        at 
> org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)
>        at org.apache.wicket.markup.MarkupStream.getTag(MarkupStream.java:258)
>
>
> Original Markup:
>         
> xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
>    
>        
>            
>                 wicket:id="submit">
>            
>        
>    
> 
>
> I create a StringResourceStream using the markup stored in a String:
>
> new StringResourceStream(ret);
>
> Any idea?
>

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



Problem with IMarkupResourceStreamProvider

2011-09-09 Thread Jochen Mader
I implemented a panel as a IMarkupResourceStreamProvider.
It works perfect if I add it to a page using the add method. If I use
"replaceWith" to replace another panel with this one I get

"Tag expected"

and the following stacktrace

 MarkupStream: [markup =
org.apache.wicket.util.resource.StringResourceStream@19aea6e2:
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
   
   
  
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>
   
   
  , index = 0, current = [Raw markup]]
at 
org.apache.wicket.markup.MarkupStream.throwMarkupException(MarkupStream.java:526)
at org.apache.wicket.markup.MarkupStream.getTag(MarkupStream.java:258)


Original Markup:
http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd";>









I create a StringResourceStream using the markup stored in a String:

new StringResourceStream(ret);

Any idea?

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



Re: Statful image

2011-09-07 Thread Jochen Mader
Uh, sorry :)
It all comes doen to the handling of shared and-nonshared resources.
If a resource is non-shared (read: not registered with
sharedresources). If the Image resource is null it can't assume that
it's shared, therefore handling is at a non-shared/stateful resource.

On Wed, Sep 7, 2011 at 11:42 AM, Martin Grigorov  wrote:
> Would you share your knowledge with us ? :-)
>
> On Wed, Sep 7, 2011 at 12:33 PM, Jochen Mader  
> wrote:
>> Found it shortly after my mail (as always). Never mind.
>> Am 07.09.2011 09:31 schrieb "Jochen Mader" :
>>> We just stumbled upon the following code in the Wicket(1.4.17) Image
>>> class getStatelessHint method:
>>> return (getImageResource() == null || getImageResource() ==
>>> localizedImageResource.getResource()) &&
>>> localizedImageResource.isStateless)
>>>
>>> My question is:
>>> Why does an image become stateful because of a missing reference?
>>>
>>> Thx
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Re: Statful image

2011-09-07 Thread Jochen Mader
Found it shortly after my mail (as always). Never mind.
Am 07.09.2011 09:31 schrieb "Jochen Mader" :
> We just stumbled upon the following code in the Wicket(1.4.17) Image
> class getStatelessHint method:
> return (getImageResource() == null || getImageResource() ==
> localizedImageResource.getResource()) &&
> localizedImageResource.isStateless)
>
> My question is:
> Why does an image become stateful because of a missing reference?
>
> Thx


Statful image

2011-09-07 Thread Jochen Mader
We just stumbled upon the following code in the Wicket(1.4.17) Image
class getStatelessHint method:
return (getImageResource() == null || getImageResource() ==
localizedImageResource.getResource()) &&
localizedImageResource.isStateless)

My question is:
Why does an image become stateful because of a missing reference?

Thx

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



Re: Lazy loading exception despite of OpenSessionInViewFilter and object loading within a request

2011-09-03 Thread Jochen Mader
Open session in view is a bad idea with a full fledged ajax-Wicket
application as things get unpredictable pretty fast.
Am 02.09.2011 22:34 schrieb "Sven Meier" :
> Hi,
>
> there are multiple requests going on probably (e.g. because of redirects),
>
> You should put a breakpoint into WicketFilter to debug the requests.
>
> HTH
> Sven
>
> On 09/02/2011 08:03 PM, Florian B. wrote:
>> Hi
>>
>> I've got some issues with the OpenSessionInViewFilter I integrated into a
>> Wicket application to get rid of the LazyLoadingException problem.
>>
>> So my problem is. I got a login page with a SignInPanel. When a user
tries
>> to log into the web site his credentials are passed to the
authentication()
>> method of a Session class which extends AuthenticatedWebSession. In this
>> method a AuthenticationService tries to load the user form the database,
>> when it succeeds the user is stored in the session. The method in the
>> AuthenticationService class which loads the user is annotated with
>> @Transactional. After the user is loaded procession of the request goes
on.
>> During this getRoles() of the session class is called to check the user's
>> rights. Therefore getRoles() gets called on the user which was stored in
the
>> session before. getRoles() should normally lazy loads the roles of the
user
>> but unfortunately a LazyLoadingException is thrown.
>>
>> This behavior is really strange as I thought the OpenSessionInViewFilter
>> takes care that all requests to the database within on web request use
the
>> same session.
>>
>> To examine this issue further I activate logging on the
>> OpenSessionInViewFilter. This shows me that the session is opened and
closed
>> multiple times by the OpenSessionInViewFilter during the request.
>>
>> It is normal that the session got opened and closed multiple times by the
>> OpenSessionInViewFilter during a request?
>>
>> Does any one has an idea why this happens and how to fix this?
>>
>> *My web.xml *
>>
>> /
>> http://java.sun.com/xml/ns/javaee";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
>> version="2.5">
>> StoreFinder
>> 
>> contextConfigLocation
>> classpath:/applicationContext.xml
>> 
>> 
>>
>>
org.springframework.web.context.ContextLoaderListener
>> 
>>
>> 
>> wicket.web
>> org.apache.wicket.protocol.http.WicketFilter
>> 
>> applicationClassName
>>
>>
com.appandmore.storefinder.backend.core.web.StoreFinderApplication
>> 
>> 
>> configuration
>>
>> development
>> 
>> 
>> 
>> wicket.session
>>
>>
org.apache.wicket.protocol.http.servlet.WicketSessionFilter
>> 
>> filterName
>> wicket.web
>> 
>> 
>> 
>> open.hibernate.session.in.view
>>
>>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
>> 
>> sessionFactoryBeanName
>> sessionFactory
>> 
>> 
>>
>>
>> 
>> open.hibernate.session.in.view
>> /*
>> 
>> 
>> wicket.web
>> /*
>> 
>> 
>> /
>>
>>
>> *My applicationContext.xml*
>> /
>> 
>> http://www.springframework.org/schema/beans";
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> xmlns:tx="http://www.springframework.org/schema/tx";
>> xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>> http://www.springframework.org/schema/tx
>> http://www.springframework.org/schema/tx/spring-tx-2.5.xsd";>
>>
>>
>> >
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>> 
>> 
>> classpath:application.properties
>>
>> 
>> 
>> 
>> 
>>
>> >
class="com.appandmore.storefinder.backend.core.service.security.AuthenticationServiceImpl">
>> 
>> 
>>
>> >
class="com.appandmore.storefinder.backend.core.infrastructure.hibernate.OfferDaoImpl">
>> 
>> 
>> >
class="com.appandmore.storefinder.backend.core.infrastructure.hibernate.UserDaoImpl">
>> 
>> 
>> >
class="com.appandmore.storefinder.backend.core.infrastructure.hibernate.RoleDaoImpl">
>> 
>> 
>> >
class="com.appandmore.storefinder.backend.core.infrastructure.hibernate.ImageDaoImpl">
>> 
>> 
>> >
class="com.appandmore.storefinder.backend.core.infrastructure.hibernate.StoreDaoImpl">
>> 
>> 
>>
>> > destroy-method="close">
>> 
>> 
>> 
>> 
>> 
>>
>> >
>>
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
>> 
>> 
>> 
>> > key="hibernate.dialect">org.hibernate.dialect.H2Dialect
>> true
>> true
>> > key="hibernate.cache.use_second_level_cache">false
>> true
>> >
key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider

>> create-drop
>> 10
>> 1000
>> > key="hibernate.bytecode.use_reflection_optimizer">true
>> 
>> 
>> 
>> 
>>
>> com.appandmore.storefinder.backend.core.domain.offer.Offer

>>
>> com.appandmore.storefinder.backend.core.domain.store.Image
>>
>> com.appandmore.storefinder.backend.core.domain.store.Store
>>
>>
com.appandmore.storefinder.backend.core.domain.store.OpeningPeriod
>>
>>
com.appandmore.storefinder.backend.core.domain.store.Com

Re: Got some code for you (ObjectSizeOfAgent)

2011-06-10 Thread Jochen Mader
Yes, the differences are really significant, around 60-70% in a lot of
scenarios.

On Thu, Jun 9, 2011 at 11:21 AM, Martin Grigorov  wrote:
> Hi,
>
> Are there big differences between the results from
> DeepInstrumentationSizeOfStrategy and
> InstrumentationObjectSizeOfStrategy ?
>
> On Wed, Jun 8, 2011 at 8:32 PM, Jochen Mader  
> wrote:
>> Hey,
>> a while ago I wrote about the difficulties to get the ObjectSizeOfAgent to 
>> run.
>> As I needed it pretty badly for a project I built something new and
>> added some more accurate size measurement for objects.
>> I put all my code on Github and I am going to add some more
>> performance related things in  there.
>> https://github.com/pflanzenmoerder/object-size/
>>
>> I copied the code from the size of agent (with proper mentioning of
>> where I got it from) and added it as one of the possible strategies to
>> estimate the size of pages in ram.
>> It all uses AspectJ and has no direct dependencies to Wicket and can
>> be deploied as an agent using LoadTimeWeaving.
>> It's all Appache 2 License (I hope that's correct).
>>
>> Would that be of any interest for the Wicket-project?
>>
>> -
>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>> For additional commands, e-mail: users-h...@wicket.apache.org
>>
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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



Got some code for you (ObjectSizeOfAgent)

2011-06-08 Thread Jochen Mader
Hey,
a while ago I wrote about the difficulties to get the ObjectSizeOfAgent to run.
As I needed it pretty badly for a project I built something new and
added some more accurate size measurement for objects.
I put all my code on Github and I am going to add some more
performance related things in  there.
https://github.com/pflanzenmoerder/object-size/

I copied the code from the size of agent (with proper mentioning of
where I got it from) and added it as one of the possible strategies to
estimate the size of pages in ram.
It all uses AspectJ and has no direct dependencies to Wicket and can
be deploied as an agent using LoadTimeWeaving.
It's all Appache 2 License (I hope that's correct).

Would that be of any interest for the Wicket-project?

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



Usage of ObjectSizeOfAgent

2011-04-15 Thread Jochen Mader
I am trying to get the ObjectSizeOfAgent to run in Tomcat.
So far I had no look as it has quite a lot external dependencies.
has anybody got this to run or got some pointers what to do?

What I did so far:
added the javaagent to the commandline and it gets loaded.
I had to put all libs required by the agent into the endorsed dir
(wicket, agentlib, slf4j related stuff) so it can start.
It is starting up but as soon as it tries to start my webapplication
it gives me a ClassNotFoundException when loading javax/servletFilter.


The servlet-api is in the lub directory and there is no other copy of
it in the war or in endorsed.

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



Wicket archetype for hibernate 3.5 and spring 3

2010-07-25 Thread Jochen Mader
I created a Maven archetype for wicket application containing the
following things:

- Everything is configured using Spring 3
- Hibernate 3.5 is used for persistence
- Example classes using JPA-style annotations
- Example DAOs and base classes for CRUD-operations
- Everything runs on an InRam-HSQL

I will add some better unit tests this week.
I added the Apache License so it should be compatible with Wicket.
It is somewhat based on the original Wicket-Archetype. I hope I did
everything right and didn't break any licenses.

Grab your copy from:
http://github.com/pflanzenmoerder/wicket-hibernate-archetype

CU

Jochen

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



Re: Speeding Up HTML Parse???

2010-02-25 Thread Jochen Mader
a) Read the speed tracer output, if the time is spent with the redirect or
loading the actual markup it will tell you.
b) HTML rendering in the browser is influenced by the markup and ajax. Read
the speed tracer output and it will tell you where the time is spent. It's
most likely not wicket that costs the initial 30 second delay but some
resource taking long to load, an AJAX component doing its magic ...
But that's all client(browser)-side stuff.


Re: Wicket, Spring 3 and UnitTesting

2010-01-28 Thread Jochen Mader
Oh man, you are right.
My eyes got a little selective on that line :)


Re: Wicket, Spring 3 and UnitTesting

2010-01-28 Thread Jochen Mader
Sorry for my late answer.
StaticWebApplicationContext doesn't cut it for  me.
Your example contains a small mistake:
Inserting the mock-object won't work as registerSingleton expects to get a
Class.
As I want to create mock objects with EasyMock there are two approaches (as
far as I know).
The one I have shown before, involving the creation of the custom
ApplicationContextMock or using easy mock inside a testing-spring.xml.

CU

Jochen


Re: wicket osgi (not Pax)

2010-01-28 Thread Jochen Mader
I ran into a lot of use-cases for it.
Just take a look at esper and drools. They are packaged as OSGi and need to
be able to work with classes provided by people using them.
But yes, we are getting a little off topic here :D


Re: wicket osgi (not Pax)

2010-01-28 Thread Jochen Mader
Buddy-class loading is real OSGi since 4.1 ;)
The new MANIFEST.MF entry is named "Bundle- *BuddyPolicy".*

Cheers,

Jochen


On Thu, Jan 28, 2010 at 9:55 AM, Ernesto Reinaldo Barreiro <
reier...@gmail.com> wrote:

> Yes I mean buddy class-loading. It might not be real OSGi but it works:-)
>  as far as you only use equinox.
>
> I also do like a lot OSGi. But I know from experience that it might take
> some time for newbies to get the full grasp of it
>
> Cheers,
>
> Ernesto
>
> On Thu, Jan 28, 2010 at 9:47 AM, David Leangen  wrote:
>
> >
> > Hi Ernesto,
> >
> > > Antilia simply use equinox extensions for class-loading that way you
> can
> > use
> > > "normal" Wicket components... No need to modify Wicket or your
> > components.
> >
> > Ok, do you mean buddy classloading?
> >
> > If so, that's not "real" OSGi. :-)
> >
> >
> > > What I wanted to says is that you not always have to face the problems
> > you
> > > mentioned: it might depend on how you build your application. But I do
> > agree
> > > the OSGi road is not for the faint hearted and people should carefully
> > > consider their requirements before jumping into it: moreover if you can
> > > achieve extensibility and modularity with other means.
> >
> > Personally, I'm addicted to OSGi. I wish that somebody would come up with
> a
> > good solution for this that doesn't rely on buddy classloading...
> >
> > Anyway, thanks for the discussion.
> >
> >
> > Cheers,
> > =David
> >
> >
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Wicket, Spring 3 and UnitTesting

2010-01-26 Thread Jochen Mader
Just figured out how to do UnitTesting with Spring 3 and Wicket.
Spring 3 introduced a check to see if a given context was a
WebApplicationContext. That means ApplicationContextMock is not suitable for
testing (giving the infamous " No WebApplicationContext found: no
ContextLoaderListener registered?" message).
I simply extended the class and added WebApplicationContext interface.

The following example shows how to get it going (I hope the code doesn't get
messed up):


public class TestHomePage extends TestCase {

private WicketTester tester;


 @Override

public void setUp() {

final WebApplicationContextMock appctx = new WebApplicationContextMock();


 final ServiceOfDoom mock = createMock(ServiceOfDoom.class);

expect(mock.getIt()).andReturn("whups").anyTimes();

replay(mock);

 tester = new WicketTester(new WicketApplication()) {

@Override

public ServletContext newServletContext(String path) {

MockServletContext servletContext = (MockServletContext) super

.newServletContext(path);

appctx.setServletContext(servletContext);

appctx.putBean("scratchy", mock);

servletContext

.setAttribute(

WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE,

appctx);

return servletContext;

}

};

tester.getApplication().addComponentInstantiationListener(

new SpringComponentInjector(tester.getApplication(), appctx,

false));

}


 public void testRenderMyPage() {

// start and render the test page

tester.startPage(HomePage.class);


 // assert rendered page class

tester.assertRenderedPage(HomePage.class);


 // assert rendered label component

tester

.assertLabel("message",

"whups");

}


 private class WebApplicationContextMock extends ApplicationContextMock

implements WebApplicationContext {

private ServletContext servletContext;


 public  T getBean(Class requiredType) throws BeansException {

// TODO Auto-generated method stub

return null;

}


 public  A findAnnotationOnBean(String beanName,

Class annotationType) {

// TODO Auto-generated method stub

return null;

}


 public Map getBeansWithAnnotation(

Class annotationType)

throws BeansException {

// TODO Auto-generated method stub

return null;

}


 public void setServletContext(ServletContext servletContext) {

this.servletContext = servletContext;

}


 public ServletContext getServletContext() {

return null;

}


 }

}


Re: JSR 330 Spring

2010-01-25 Thread Jochen Mader
Thanks for the quick answer.
I never came across a scenario where somebody did or I would use two IoC
containers in the same application.
Why would you do that?

Cheers,

Jochen


JSR 330 Spring

2010-01-25 Thread Jochen Mader
Hello,
I am using wicket together with spring. Getting it going with @SpringBean
was pretty straight forward but now I am wondering if it is possible to get
it going with JSR 330 annotations as the spring side of my app is already
using it.

Thanks,

Jochen