You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Christoph Grün <ch...@gmx.at> on 2010/05/18 23:40:33 UTC
wicket serialization problem of guice proxies
Hi all,
I am using Wicket 1.4.8 with Guice 1.0 and Warp Persist/Hibernate.
When injecting DAOs directly into Wicket components, it works fine (I inject
the DAO Interface). However, I would like to inject them, next to other
objects, also in classes that do some business logic. Those classes are
themselves injected in Wicket pages.
As these classes are injected in Wicket, Wicket tries to serialize them as
well.
For example I have the class PoiLoader that is injected in a Wicket page.
@Singleton
public class PoiLoader {
private Multimap<Type, Poi> poisRelatedToSpecificTouristType =
ArrayListMultimap.create();
protected IVectorDao daoVector;
private WorkManager workManager;
private Map<Resource, Poi> pois = Maps.newHashMap();
}
In this setting, none of the fields can be serialized and throw an - Error
serializing object class ecgroup.web.pages.RecommenderPage [object=[Page
class = ecgroup.web.pages.RecommenderPage, id = 1, version = 0]]
org.apache.wicket.util.io.SerializableChecker$WicketNotSerializableException
.
I need the Warp Persist Workmanager in order to do some data loading /
initialization during Wicket startup. How can I tackle the serialization
problems?
Thanks a lot,
Chris
Re: Using google website optimizer with Wicket?
Posted by Igor Vaynberg <ig...@gmail.com>.
alternatively use <wicket:container
wicket:id="foo">foo</wicket:container>, it does the same as
setrenderbodyonly(true)
-igor
On Tue, May 18, 2010 at 5:57 PM, Don Ferguson <do...@gmail.com> wrote:
> Ah Ha!
>
> I knew about setEscapeModelStrings(false), but didn't know about
> setRenderBodyOnly(true).
>
>
> On May 18, 2010, at 5:26 PM, Igor Vaynberg wrote:
>
>> you can always output the </noscript> tag dynamically using a label.
>>
>> -igor
>>
>> On Tue, May 18, 2010 at 5:11 PM, Don Ferguson <do...@gmail.com>
>> wrote:
>>>
>>> Has anyone successfully used google website optimizer (multivariate
>>> tests)
>>> with Wicket?
>>>
>>> Believe it or not, GWO requires you to modify your html with an
>>> unbalanced
>>> HTML tag. Conditional content that is altered during multivariate
>>> testing
>>> is terminated with a
>>> </noscript> tag (presumably GWO javascript inserts a <noscript> tag into
>>> the document at runtime to make the HTML legal):
>>>
>>>
>>> http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_us&answer=64418
>>>
>>> Anyway, Wicket's parser chokes on the malformed HTML. Can anyone think
>>> of a
>>> workaround?
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Using google website optimizer with Wicket?
Posted by Don Ferguson <do...@gmail.com>.
Ah Ha!
I knew about setEscapeModelStrings(false), but didn't know about
setRenderBodyOnly(true).
On May 18, 2010, at 5:26 PM, Igor Vaynberg wrote:
> you can always output the </noscript> tag dynamically using a label.
>
> -igor
>
> On Tue, May 18, 2010 at 5:11 PM, Don Ferguson
> <do...@gmail.com> wrote:
>> Has anyone successfully used google website optimizer (multivariate
>> tests)
>> with Wicket?
>>
>> Believe it or not, GWO requires you to modify your html with an
>> unbalanced
>> HTML tag. Conditional content that is altered during multivariate
>> testing
>> is terminated with a
>> </noscript> tag (presumably GWO javascript inserts a <noscript>
>> tag into
>> the document at runtime to make the HTML legal):
>>
>> http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_us&answer=64418
>>
>> Anyway, Wicket's parser chokes on the malformed HTML. Can anyone
>> think of a
>> workaround?
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Using google website optimizer with Wicket?
Posted by Igor Vaynberg <ig...@gmail.com>.
you can always output the </noscript> tag dynamically using a label.
-igor
On Tue, May 18, 2010 at 5:11 PM, Don Ferguson <do...@gmail.com> wrote:
> Has anyone successfully used google website optimizer (multivariate tests)
> with Wicket?
>
> Believe it or not, GWO requires you to modify your html with an unbalanced
> HTML tag. Conditional content that is altered during multivariate testing
> is terminated with a
> </noscript> tag (presumably GWO javascript inserts a <noscript> tag into
> the document at runtime to make the HTML legal):
>
> http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_us&answer=64418
>
> Anyway, Wicket's parser chokes on the malformed HTML. Can anyone think of a
> workaround?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to replace RelativePathPrefixHandler
Posted by Igor Vaynberg <ig...@gmail.com>.
the javadoc probably has a clue
/**
* Get the (modifiable) list of IComponentResolvers.
*
* @see AutoComponentResolver for an example
* @return List of ComponentResolvers
*/
notice the *modifiable* part
-igor
On Tue, May 18, 2010 at 7:51 PM, <bh...@actrix.gen.nz> wrote:
> Hi,
>
> It looks like Wicket may have the flexibility to replace elements of
> the chain of IMarkupFilters without changing Wicket itself.
>
> How can I replace RelativePathPrefixHandler with my own variant?
>
> I have found
>
> getPageSettings().getComponentResolvers();
>
> But I am definitely missing the important bits.
>
> Many thanks,
>
> Bernard
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How to replace RelativePathPrefixHandler
Posted by bh...@actrix.gen.nz.
Thanks Igor.
That indeed looks very promising, and I replaced
RelativePathPrefixHandler with a variant but that doesn't seem to
work.
I had already filed a Jira issue
https://issues.apache.org/jira/browse/WICKET-2881
before I saw your response.
Regards,
Bernard
On Wed, 19 May 2010 14:51:59 +1200, you wrote:
>Hi,
>
>It looks like Wicket may have the flexibility to replace elements of
>the chain of IMarkupFilters without changing Wicket itself.
>
>How can I replace RelativePathPrefixHandler with my own variant?
>
>I have found
>
>getPageSettings().getComponentResolvers();
>
>But I am definitely missing the important bits.
>
>Many thanks,
>
>Bernard
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
How to replace RelativePathPrefixHandler
Posted by bh...@actrix.gen.nz.
Hi,
It looks like Wicket may have the flexibility to replace elements of
the chain of IMarkupFilters without changing Wicket itself.
How can I replace RelativePathPrefixHandler with my own variant?
I have found
getPageSettings().getComponentResolvers();
But I am definitely missing the important bits.
Many thanks,
Bernard
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Using google website optimizer with Wicket?
Posted by Don Ferguson <do...@gmail.com>.
Has anyone successfully used google website optimizer (multivariate
tests) with Wicket?
Believe it or not, GWO requires you to modify your html with an
unbalanced HTML tag. Conditional content that is altered during
multivariate testing is terminated with a
</noscript> tag (presumably GWO javascript inserts a <noscript> tag
into the document at runtime to make the HTML legal):
http://www.google.com/support/websiteoptimizer/bin/answer.py?hl=en_us&answer=64418
Anyway, Wicket's parser chokes on the malformed HTML. Can anyone
think of a workaround?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: wicket serialization problem of guice proxies
Posted by Uwe Schäfer <us...@thomas-daily.de>.
Am 18.05.2010 23:40, schrieb Christoph Grün:
> I am using Wicket 1.4.8 with Guice 1.0 and Warp Persist/Hibernate.
> When injecting DAOs directly into Wicket components, it works fine (I inject
> the DAO Interface). However, I would like to inject them, next to other
> objects, also in classes that do some business logic. Those classes are
> themselves injected in Wicket pages.
we use a helper class with
public static void injectMembers(final Object o)
{
Application application = Application.get();
Assert.isNotNull(application, "Application is not attached");
Injector injector = getInjector(application);
new GuiceComponentInjector(application, injector).inject(o);
}
to inject into arbritary objects that end up in wicket space.
cu uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org