WICKET-4500 / WICKET-5140 and RestartResponseAtInterceptPageException.clearOriginalDestination()

2013-06-03 Thread Dirk Forchel
With the fixed bug of WICKET-5140 the public method
Component#clearOriginalDestination() has been added which uses the private
method RestartResponseAtInterceptPageException.clearOriginalDestination(). 
I have no glue how to use this public method as we use the
AuthenticatedWebApplication from the authroles package where we could
override restartResponseAtSignInPage() but not the final method
onUnauthorizedInstantiation. Actually I would like to clear the
InterceptData before redirecting to the intercept page (LoginPage), but the
onUnauthorizedInstantiation is final. The only solution I can think of, is
to add a new implementation of IUnauthorizedComponentInstantiationListener
to the Application in order to call clearOriginalDestination() on my
unauthorized page instance and to reset the InterceptData.
How about to make this method non-final? Or what is the preffered way of
doing this?





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/WICKET-4500-WICKET-5140-and-RestartResponseAtInterceptPageException-clearOriginalDestination-tp4659205.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



AttributeModifier with html in the attribute?

2013-06-03 Thread Simon B
Hello 

I want to add html content in an attribute of an html tag.  

This is for a bootstrap tooltip. 

What is the best way to do this?  When I simply add html to the attribute
modifier e.g.


it gets converted into 



What I'd like is: 



What's the best way to achieve this?

Simon



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-the-attribute-tp4659206.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



Injecting proxy services in page.

2013-06-03 Thread Entropy
We are doing the annotation based approach described in this link
(https://cwiki.apache.org/WICKET/spring.html).  At least, we think we are.

We get:
[6/3/13 8:26:00:907 EDT] 0023 SystemOut O ERROR [WebContainer : 0]
(RequestCycle.java:1521) - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:234)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:735)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:310)
at org.apache.wicket.Session.getPage(Session.java:779)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:458)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
[trimmed for brevity]
Caused by: 
*java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService;
could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when
deserializing proxy*at
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(LazyInitProxyFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[trimmed for brevity]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413)
... 39 more

I thought this might be because that particular service is in the parent
page object and annotated there as well, but I moved it to the child class
and saw no change in behavior.  It is a hibernate service and is annotated
in the page like so:

@SpringBean(name=LogTransService)
private LogTransService userTransService;   

The exception happens when I go to the page, do a few things (which involve
submitting and redisplaying the page), and then hit the browser back button. 
This, as I understand it, causes wicket to deserialize the page from memory. 
But shouldn't it see the @SpringBean and re-inject a new service?

Out app object does this:
addComponentInstantiationListener(new SpringComponentInjector(this,
ctx, true));

Ideas?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page-tp4659209.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



Re: Injecting proxy services in page.

2013-06-03 Thread Bertrand Guay-Paquet

Hi,

I don't use Spring, so I can't help you specifically. However, there is 
a chapter about integration with Spring in the free wicket guide here:

https://code.google.com/p/wicket-guide/
(chapter 17.2)

On 03/06/2013 9:00 AM, Entropy wrote:

We are doing the annotation based approach described in this link
(https://cwiki.apache.org/WICKET/spring.html).  At least, we think we are.

We get:
[6/3/13 8:26:00:907 EDT] 0023 SystemOut O ERROR [WebContainer : 0]
(RequestCycle.java:1521) - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(AbstractPageStore.java:234)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStore.java:735)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCachePageMap.get(SecondLevelCacheSessionStore.java:310)
at org.apache.wicket.Session.getPage(Session.java:779)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:458)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:144)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
[trimmed for brevity]
Caused by:
*java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService;
could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when
deserializing proxy*at
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(LazyInitProxyFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[trimmed for brevity]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
at 
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413)
... 39 more

I thought this might be because that particular service is in the parent
page object and annotated there as well, but I moved it to the child class
and saw no change in behavior.  It is a hibernate service and is annotated
in the page like so:

@SpringBean(name=LogTransService)
private LogTransService userTransService;   

The exception happens when I go to the page, do a few things (which involve
submitting and redisplaying the page), and then hit the browser back button.
This, as I understand it, causes wicket to deserialize the page from memory.
But shouldn't it see the @SpringBean and re-inject a new service?

Out app object does this:
addComponentInstantiationListener(new SpringComponentInjector(this,
ctx, true));

Ideas?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page-tp4659209.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: Injecting proxy services in page.

2013-06-03 Thread Paul Bors
I find it easier to configure Spring via the XML rather than code.

Hence I have my applicationContext.xml inside my war's WEB-INF/classes/ with
all the bean definitions and then configure Wicket via the context specific
configuration from inside my web.xml:

!--
There are three means to configure Wickets configuration mode and
they 
are tested in the order given.

1) A system property: -Dwicket.configuration 
2) servlet specific init-param 
3) context specific context-param

The value might be either development (reloading when templates
change) or 
deployment. If no configuration is found, development is the
default. --

context-param
param-namecontextConfigLocation/param-name
param-valueclasspath:applicationContext.xml/param-value
/context-param

filter
filter-namepersistence/filter-name
 
filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFil
ter/filter-class
init-param
param-nameentityManagerFactoryBeanName/param-name
param-valueentityManagerFactory/param-value
/init-param
init-param
param-namesingleSession/param-name
param-valuetrue/param-value
/init-param
/filter

...

listener
 
listener-classorg.springframework.web.context.ContextLoaderListener/liste
ner-class
/listener

Whenever I need to inject a service I use Wicket's @SpringBean.

~ Thank you,
  Paul Bors

-Original Message-
From: Entropy [mailto:blmulholl...@gmail.com] 
Sent: Monday, June 03, 2013 9:01 AM
To: users@wicket.apache.org
Subject: Injecting proxy services in page.

We are doing the annotation based approach described in this link
(https://cwiki.apache.org/WICKET/spring.html).  At least, we think we are.

We get:
[6/3/13 8:26:00:907 EDT] 0023 SystemOut O ERROR [WebContainer : 0]
(RequestCycle.java:1521) - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(
AbstractPageStore.java:234)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStor
e.java:735)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCach
ePageMap.get(SecondLevelCacheSessionStore.java:310)
at org.apache.wicket.Session.getPage(Session.java:779)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(
AbstractRequestCycleProcessor.java:458)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestC
ycleProcessor.java:144)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:188)
[trimmed for brevity]
Caused by: 
*java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService;
could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when
deserializing proxy*at
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(La
zyInitProxyFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[trimmed for brevity]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413)
... 39 more

I thought this might be because that particular service is in the parent
page object and annotated there as well, but I moved it to the child class
and saw no change in behavior.  It is a hibernate service and is annotated
in the page like so:

@SpringBean(name=LogTransService)
private LogTransService userTransService;   

The exception happens when I go to the page, do a few things (which involve
submitting and redisplaying the page), and then hit the browser back button.

This, as I understand it, causes wicket to deserialize the page from memory.

But shouldn't it see the @SpringBean and re-inject a new service?

Out app object does this:
addComponentInstantiationListener(new
SpringComponentInjector(this, ctx, true));

Ideas?



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Injecting-proxy-services-in-page-
tp4659209.html
Sent from the Users forum 

RE: AttributeModifier with html in the attribute?

2013-06-03 Thread Paul Bors
AttributeModifier?

You might be interested in taking a quick look at (Section 4.2 Modifying
Tag Attributes):
http://wicket.apache.org/learn/books/freeguide.html

~ Thank you,
  Paul Bors

-Original Message-
From: Simon B [mailto:simon.bott...@gmail.com] 
Sent: Monday, June 03, 2013 6:28 AM
To: users@wicket.apache.org
Subject: AttributeModifier with html in the attribute?

Hello 

I want to add html content in an attribute of an html tag.  

This is for a bootstrap tooltip. 

What is the best way to do this?  When I simply add html to the attribute
modifier e.g.


it gets converted into 



What I'd like is: 



What's the best way to achieve this?

Simon



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-th
e-attribute-tp4659206.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: AttributeModifier with html in the attribute?

2013-06-03 Thread Bertrand Guay-Paquet
I believe AttributeModifier is the appropriate class to use to modify 
tag attributes. Moreover, it is described in the section you refer to.


For reference, ComponentTag#writeOutput() is the method which calls 
Strings.escapeMarkup(value); and escapes your tag value. This is called 
by Component#renderComponentTag().


Unfortunately, there doesn't seem to currently be a way to not escape 
the markup of the tag values. It is possible for labels but not for the 
tag attributes. I can think of 3 options:


1) [unsafe] remove the tag escaping at large
2) modify Wicket to add a flag somewhere to disable tag escaping
3) create your Component subclass which overrides getMarkup() to weave 
in your raw html


Either way, I think this should be added to Wicket because html data- 
attributes seem to gain popularity.


Regards,
Bertrand

On 03/06/2013 10:22 AM, Paul Bors wrote:

AttributeModifier?

You might be interested in taking a quick look at (Section 4.2 Modifying
Tag Attributes):
http://wicket.apache.org/learn/books/freeguide.html

~ Thank you,
   Paul Bors

-Original Message-
From: Simon B [mailto:simon.bott...@gmail.com]
Sent: Monday, June 03, 2013 6:28 AM
To: users@wicket.apache.org
Subject: AttributeModifier with html in the attribute?

Hello

I want to add html content in an attribute of an html tag.

This is for a bootstrap tooltip.

What is the best way to do this?  When I simply add html to the attribute
modifier e.g.


it gets converted into



What I'd like is:



What's the best way to achieve this?

Simon



--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-th
e-attribute-tp4659206.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




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



Important: My previous mail is spam don't open it

2013-06-03 Thread ayman elwany
Dear all ,
if you recieved any mail from today , dont open it , and if you did change
your passoword please ,my account got hacked and something sends emails in
my behalf and i dont know what as it doesnt appear in my sent box .
I did changed my account password , and this will
Stop sending mails from my account i hope

Ayman Elwany


Important: My previuos mail is spam don't open it

2013-06-03 Thread ayman elwany
Dear all ,

 If you recieved any mail from me today , don't open it
and if you did, change your passoword please ,
my account got hacked and something sends emails in my behalf and i dont
know what as it doesnt appear in my sent box .
I did change my account password , and this will Stop sending mails from my
account i hope.


Ayman Elwany


RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-03 Thread divad91
Hi,

Im not sure if my problem is related to wicket or jQuery but since I
upgraded from wicket 6.6.0 to 6.8.0, my required validation on RadioChoice
is not working anymore.

The problems occurs on every RadioChoice with an
AjaxFormChoiceComponentUpdatingBehavior behavior.
If I removed the behavior, my validation works perfectly. When the behavior
is on my radioChoice, my ajax listener is called but my field stays in
error.

I didn't change anycode. I just upgraded from 6.6.0 to 6.8.0.

I am using jQuery Validation Plugin 1.11.1 for validation.
Do we still need to use AjaxFormChoiceComponentUpdatingBehavior on
RadioChoice ? Does anyone encounter  a similar problem ?

Thanks
David




--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216.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



Re: Browser Back Button Question

2013-06-03 Thread dhongyt
I think maybe it is because I have objects in my session service that connect
to the hiberlayer, to be more specific my Product API is a class that talks
with the hiberlayer.

1. Does that mean that I want to make my Product APIobject transient?
2. If an object implements serializable is that bad?
3. Easy way to hunt down the root cause?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Browser-Back-Button-Question-tp4658397p4659217.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



Re: How I get the internal html content of a dynamically updated div tag using Apache Wicket

2013-06-03 Thread Andun Sameera
Hi All,

I have tried further with AjaxEditableLabel in following way to get the
cotent of div tag.

String value=Type.;
AjaxEditableLabel ajaxEditableLabel=new
AjaxEditableLabel(editorArea,new Model(value)){
@Override
public void onEdit(AjaxRequestTarget target){
String value=getEditor().getValue();
System.out.println(value);
}
@Override
protected void onModelChanged() {
String value=getEditor().getValue();
System.out.println(value);
}
@Override
protected void onModelChanging() {
String value=getEditor().getValue();
System.out.println(value);
}
protected void onSubmit(AjaxRequestTarget target){
String value=getEditor().getValue();
System.out.println(value);
}
};
ajaxEditableLabel.setOutputMarkupId(true);
ajaxEditableLabel.setMarkupId(editorArea);
form.add(ajaxEditableLabel);

When this applies Wysiwyg is working properly. The markup is updated. But
the onEdit,onModelChaging methods are not invoked to update the model
object value. Thus what will be the way to get the updated cotent from the
ajax editable label?

Thanks!
On Mon, Jun 3, 2013 at 5:17 AM, Andun Sameera andun...@gmail.com wrote:

 Hi All,

 Also cant we use AjaxEditableMultiLineLabel which is used in [1] for the
 task?

 Thanks!

 [1] -
 http://www.wicket-library.com/wicket-examples/ajax/wicket/bookmarkable/org.apache.wicket.examples.source.SourcesPage?1SourcesPage_class=org.apache.wicket.examples.ajax.builtin.EditableLabelPage


 On Sun, Jun 2, 2013 at 10:24 AM, Maxim Solodovnik solomax...@gmail.comwrote:

 Hello Martin,

 Thanks for the reply

 Is it possible to wrap component into its own form and add some behavior
 which will trigger adding DynamicExtraParameters on upper form submit?

 I have added new AjaxFormSubmitBehavior(this, submit) to my component
 form but it is not triggered on upper form submit :(




 On Sat, Jun 1, 2013 at 3:25 PM, Martin Grigorov mgrigo...@apache.org
 wrote:

  Hi Maxim,
 
  It depends what is the markup you have to work with.
  Usually WYSIWYG widgets work with just a div or textarea and create
  other HTML elements dynamically with JavaScript to do their job, e.g. an
  iframe.
  Additionally they almost always give you API to get the produced rich
  content (html, markdown, ...).
  For example:
  var richEditor = $.myWysiwyg(#myTextArea);
  var richContent = richEditor.getContent();
 
  doSomethingWithRichContent(richContent);
 
  So it is not always possible to create 1:1 mapping between the client
 and
  the server usage of form components.
 
 
 
  On Sat, Jun 1, 2013 at 11:11 AM, Maxim Solodovnik solomax...@gmail.com
  wrote:
 
   Hello Martin,
  
   Is it possible to create FormComponentPanel as in following example
  
  
 
 https://cwiki.apache.org/WICKET/creating-custom-formcomponentpanels-to-build-valid-objects-using-wickets-form-validation-logic.html
  
   but taking the value from the div.innerHtml and not the textfield?
  
  
   On Sat, Jun 1, 2013 at 2:19 PM, Martin Grigorov mgrigo...@apache.org
   wrote:
  
Hi,
   
I guess you want to get the new entered text via Ajax submit.
You can extend AjaxSubmitButton and implement
 #updateAjaxAttributes() {
   
   attributes.getDynamicExtraParameters().add(return [ {name:
   'richText',
value: $('#editorArea').html() } ]);
}
   
Then use
   
   
  
 
 getRequest().getRequestParameters().getParameterValue(richText).toString()
to get the produced HTML.
   
   
On Sat, Jun 1, 2013 at 8:04 AM, Andun Sameera andun...@gmail.com
   wrote:
   
 Hi,

 In my html file I have a div tag like this,

 div wicket:id=editorAreaType Here/div

 I am using a JavaScript library called bootstrap-wysiwyg to make
 this
 div tag a text are which we can type rich text. When the person
 types
 text, div tag's html content updates to represent the text
 content in
 html. I want to retrieve it in to the Java code of the html file
 in
 wicket. I tried to do it by creating reference variable to div tag
 like following,

 WebMarkupContainer editorArea=new
 WebMarkupContainer(editorArea);
 String text=editorArea.getMarkup().toString(true)

 But this don't give me the updated HTML content. I give only the
 initial html content. what is the problem here?

 Thanks!

 --
 Regards
 Andun S.L. Gunawardana
 Undergraduate
 Department of Computer Science And Engineering
 University of Moratuwa
 Sri Lanka

 Blog - http://www.insightforfuture.blogspot.com/
 LinkedIn -
   http://www.linkedin.com/pub/andun-s-l-gunawardana/34/646/703
 Twitter -http://twitter.com/AndunSLG


 

wicket-guice HttpServletRequest

2013-06-03 Thread Watrous, Daniel
I'm having some trouble getting my unittests to work when I use Guice to get an 
instance of the HttpServletRequest object. The page works fine when running in 
jetty, but in the unittests I get these errors.

org.apache.wicket.WicketRuntimeException: Can't instantiate page using 
constructor 'public 
com.hp.honeybadger.console.HomePage(org.apache.wicket.request.mapper.parameter.PageParameters)'
 and argument ''. Might be it doesn't exist, may be it is not visible (public).

1) Error in custom provider, com.google.inject.OutOfScopeException: Cannot 
access scoped object. Either we are not currently inside an HTTP Servlet 
request, or you may have forgotten to apply 
com.google.inject.servlet.GuiceFilter as a servlet filter for this request.
  at 
com.google.inject.servlet.InternalServletModule.provideHttpServletRequest(InternalServletModule.java:95)
  while locating javax.servlet.http.HttpServletRequest

Caused by: com.google.inject.OutOfScopeException: Cannot access scoped object. 
Either we are not currently inside an HTTP Servlet request, or you may have 
forgotten to apply com.google.inject.servlet.GuiceFilter as a servlet filter 
for this request.

This is my page

public class HomePage extends WebPage {

private static final long serialVersionUID = 1L;
@Inject private HttpServletRequest request;

public HomePage(final PageParameters parameters) {
super(parameters);

add(new Label(version, 
getApplication().getFrameworkSettings().getVersion()));

// TODO Add your page's components here
add(new Label(method, request.getMethod()));

}
}

QUESTION

How can I get around this issue or make use of a mock object to enable 
unittests?


Re: RadioChoice AjaxFormChoiceComponentUpdatingBehavior and validation

2013-06-03 Thread Igor Vaynberg
you might have to override updateAttributes on the behavior and say
attributes.allowdefault(true)

-igor

On Mon, Jun 3, 2013 at 11:28 AM, divad91 diva...@hotmail.com wrote:
 Hi,

 Im not sure if my problem is related to wicket or jQuery but since I
 upgraded from wicket 6.6.0 to 6.8.0, my required validation on RadioChoice
 is not working anymore.

 The problems occurs on every RadioChoice with an
 AjaxFormChoiceComponentUpdatingBehavior behavior.
 If I removed the behavior, my validation works perfectly. When the behavior
 is on my radioChoice, my ajax listener is called but my field stays in
 error.

 I didn't change anycode. I just upgraded from 6.6.0 to 6.8.0.

 I am using jQuery Validation Plugin 1.11.1 for validation.
 Do we still need to use AjaxFormChoiceComponentUpdatingBehavior on
 RadioChoice ? Does anyone encounter  a similar problem ?

 Thanks
 David




 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/RadioChoice-AjaxFormChoiceComponentUpdatingBehavior-and-validation-tp4659216.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: Injecting proxy services in page.

2013-06-03 Thread Edvard Fonsell

Hi,

I'm not sure if this is the issue here but I've seen similar problems 
when I used AnnotationConfigApplicationContext as a Spring context, but 
got it working by using AnnotationConfig*Web*ApplicationContext.


br, Edvard

On 03.06.2013 17:19, Paul Bors wrote:

I find it easier to configure Spring via the XML rather than code.

Hence I have my applicationContext.xml inside my war's WEB-INF/classes/ with
all the bean definitions and then configure Wicket via the context specific
configuration from inside my web.xml:

 !--
 There are three means to configure Wickets configuration mode and
they
 are tested in the order given.

 1) A system property: -Dwicket.configuration
 2) servlet specific init-param
 3) context specific context-param

 The value might be either development (reloading when templates
change) or
 deployment. If no configuration is found, development is the
default. --

 context-param
 param-namecontextConfigLocation/param-name
 param-valueclasspath:applicationContext.xml/param-value
 /context-param

 filter
 filter-namepersistence/filter-name

filter-classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFil
ter/filter-class
 init-param
 param-nameentityManagerFactoryBeanName/param-name
 param-valueentityManagerFactory/param-value
 /init-param
 init-param
 param-namesingleSession/param-name
 param-valuetrue/param-value
 /init-param
 /filter

 ...

 listener

listener-classorg.springframework.web.context.ContextLoaderListener/liste
ner-class
 /listener

Whenever I need to inject a service I use Wicket's @SpringBean.

~ Thank you,
   Paul Bors

-Original Message-
From: Entropy [mailto:blmulholl...@gmail.com]
Sent: Monday, June 03, 2013 9:01 AM
To: users@wicket.apache.org
Subject: Injecting proxy services in page.

We are doing the annotation based approach described in this link
(https://cwiki.apache.org/WICKET/spring.html).  At least, we think we are.

We get:
[6/3/13 8:26:00:907 EDT] 0023 SystemOut O ERROR [WebContainer : 0]
(RequestCycle.java:1521) - Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
java.lang.RuntimeException: Could not deserialize object using
`org.apache.wicket.util.io.IObjectStreamFactory$DefaultObjectStreamFactory`
object factory
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:435)
at
org.apache.wicket.protocol.http.pagestore.AbstractPageStore.deserializePage(
AbstractPageStore.java:234)
at
org.apache.wicket.protocol.http.pagestore.DiskPageStore.getPage(DiskPageStor
e.java:735)
at
org.apache.wicket.protocol.http.SecondLevelCacheSessionStore$SecondLevelCach
ePageMap.get(SecondLevelCacheSessionStore.java:310)
at org.apache.wicket.Session.getPage(Session.java:779)
at
org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(
AbstractRequestCycleProcessor.java:458)
at
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestC
ycleProcessor.java:144)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:479)
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:312)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:188)
[trimmed for brevity]
Caused by:
*java.io.InvalidClassException: gov.usdoj.afms.umc.services.LogTransService;
could not resolve class [gov.usdoj.afms.umc.services.LogTransService] when
deserializing proxy*at
org.apache.wicket.proxy.LazyInitProxyFactory$ProxyReplacement.readResolve(La
zyInitProxyFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[trimmed for brevity]
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:365)
at
org.apache.wicket.util.lang.Objects.byteArrayToObject(Objects.java:413)
... 39 more

I thought this might be because that particular service is in the parent
page object and annotated there as well, but I moved it to the child class
and saw no change in behavior.  It is a hibernate service and is annotated
in the page like so:

@SpringBean(name=LogTransService)
private LogTransService userTransService;   

The exception happens when I go to the page, do a few things (which involve
submitting and redisplaying the page), and then hit the browser back button.

This, as I understand it, causes wicket to deserialize the page from memory.

But shouldn't it see the @SpringBean and re-inject a new service?

Out app object does 

ResourceReference serving video files

2013-06-03 Thread Maxim Solodovnik
Hello All,

I have weird problem:
1) wicket 6.8.0
2) resources are mounted in Application [1] using mountResource
3) video files are viewable in IE, Chrome, FF, Safari (iMac)
4) I got huge stack trace while accessing the files using iPad (Safari,
latest iOS) [3]

The code of resource references can be found at [2]

Mp4 file served by Tomcat itself displayed on iPad with no issues.

Can anyone please help me to find out what is wrong with my Resource
references? Maybe some headers should be set?

[1]
https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/app/Application.java
[2]
https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/Mp4RecordingResourceReference.java
https://svn.apache.org/repos/asf/openmeetings/trunk/singlewebapp/src/org/apache/openmeetings/web/util/RecordingResourceReference.java

[3]
DEBUG 06-04 12:43:28.897 ServletWebRequest.java 6865150 202
org.apache.wicket.protocol.http.servlet.ServletWebRequest
[http-bio-0.0.0.0-5080-exec-6] - Calculating context relative path from:
context path '/openmeetings', filterPrefix '', uri
'/openmeetings/recordings/mp4/69'
ERROR 06-04 12:43:29.355 DefaultExceptionMapper.java 6865608 114
org.apache.wicket.DefaultExceptionMapper [http-bio-0.0.0.0-5080-exec-6] -
Connection lost, give up responding.
org.apache.wicket.protocol.http.servlet.ResponseIOException:
ClientAbortException:  java.net.SocketException: Broken pipe
at
org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:139)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:191)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.Response$StreamAdapter.write(Response.java:148)
~[wicket-request-jar-6.8.0.jar:6.8.0]
at org.apache.wicket.util.io.Streams.copy(Streams.java:109)
~[wicket-util-jar-6.8.0.jar:6.8.0]
at org.apache.wicket.util.io.Streams.copy(Streams.java:76)
~[wicket-util-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.resource.AbstractResource$WriteCallback.writeStream(AbstractResource.java:707)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.resource.ResourceStreamResource$2.writeData(ResourceStreamResource.java:207)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:528)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:75)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:108)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:861)
~[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
~[wicket-request-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:261)
[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:218)
[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:289)
[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.protocol.ws.AbstractUpgradeFilter.processRequestCycle(AbstractUpgradeFilter.java:59)
[wicket-native-websocket-core-jar-0.9.jar:0.9]
at
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:201)
[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:282)
[wicket-core-jar-6.8.0.jar:6.8.0]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.red5.logging.LoggerContextFilter.doFilter(LoggerContextFilter.java:77)
[red5-server.jar:na]
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
[tomcat-embed-core-jar-7.0.34.jar:7.0.34]
at