EOFException(java.net.SocketException: Connection reset by peer: socket write error)

2011-11-16 Thread yadav1776
Hi 

I am getting "EOFException(java.net.SocketException: Connection reset by
peer: socket write error)" exception while returning byte[] from
getImageData() function of DynamicImageResource class in onBeforeRender()
function of component. 

Stack trace is as below. 

org.apache.wicket.WicketRuntimeException: Unable to write the response 
at org.apache.wicket.Response.handleException(Response.java:286) 
at org.apache.wicket.Response.write(Response.java:310) 
at
org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond(ResourceStreamRequestTarget.java:160)
 
at
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
 
at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1269) 
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1336) 
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438) 
at org.apache.wicket.RequestCycle.request(RequestCycle.java:546) 
at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) 
at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) 
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428) 
at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
 
at
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
 
at
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
 
at
org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
 
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:110)
 
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:95)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:79)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:55)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:36)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:108)
 
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
 
at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:150)
 
at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
 
at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
 
at
org.mortbay.jetty.servlet.W

Re: EOFException(java.net.SocketException: Connection reset by peer: socket write error)

2011-11-16 Thread Martin Grigorov
Hi,

I have seen such problems with Internet Explorer.
If the delivered image mime type is not correct (i.e. the response
header says "image/gif" but the image is actually a GIF) then IE
aborts the load of the image and starts a new one.
The first abort causes such "Connection reset by peer" exceptions at the server

On Tue, Nov 15, 2011 at 5:13 PM, yadav1776  wrote:
> Hi
>
> I am getting "EOFException(java.net.SocketException: Connection reset by
> peer: socket write error)" exception while returning byte[] from
> getImageData() function of DynamicImageResource class in onBeforeRender()
> function of component.
>
> Stack trace is as below.
>
> org.apache.wicket.WicketRuntimeException: Unable to write the response
>        at org.apache.wicket.Response.handleException(Response.java:286)
>        at org.apache.wicket.Response.write(Response.java:310)
>        at
> org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond(ResourceStreamRequestTarget.java:160)
>        at
> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
>        at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1269)
>        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1336)
>        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438)
>        at org.apache.wicket.RequestCycle.request(RequestCycle.java:546)
>        at
> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
>        at
> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>        at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>        at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
>        at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>        at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>        at
> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
>        at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:110)
>        at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:95)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:79)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:55)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:36)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:80)
>        at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>        at
> org.springframework.security.web.session.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:108)
>        at
> org.springframework.security.web.FilterCh

Re: integrating CDI into Wicket

2011-11-16 Thread Martijn Dashorst
On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg  wrote:
> if you want to learn how to use CDI with Wicket i just wrote a short blog
> about it:
>
> https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/

Can we use it for the documentation of the CDI project (when we
migrate it to apache)?

Martijn

-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

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



Re: integrating CDI into Wicket

2011-11-16 Thread Igor Vaynberg
sure

-igor

On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
martijn.dasho...@gmail.com> wrote:

> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
> wrote:
> > if you want to learn how to use CDI with Wicket i just wrote a short blog
> > about it:
> >
> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>
> Can we use it for the documentation of the CDI project (when we
> migrate it to apache)?
>
> Martijn
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


wicket-cdi NotSerializableException for injected SLSB proxy

2011-11-16 Thread Phill
I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi) to 
inject an SLSB with Glassfish 3.1.1

MyWebApplication.init()

BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
new CdiConfiguration(manager)
.setPropagation(ConversationPropagation.NONBOOKMARKABLE)
.configure(this);

public class DashboardPage extends AuthorisedBasePage {
@Inject
private AccountingService accountingService;
…
}

Injection is working fine and I can use the session bean but Wicket is unable 
to serialize the proxy.
According to my research previous issues with the Weld proxy not being 
serializable should have been resolved in the version that shipped with GF 3.1.
I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3 and I 
get the same problem.

I'm not really sure if this is a Wicket issue or whether I should be taking it 
up with the Weld team.. any pointers appreciated.


2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR 
org.apache.wicket.serialize.java.JavaSerializer - Error serializing object 
class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class = 
uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
java.io.NotSerializableException: 
com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:397) 
~[na:1.6.0_29]
at 
org.jboss.weld.bean.proxy.util.SerializableProxy.writeObject(SerializableProxy.java:92)
 ~[weld-osgi-bundle.jar:20110404-1554]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[na:1.6.0_29]
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
~[na:1.6.0_29]
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 ~[na:1.6.0_29]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
at 
java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158) 
~[na:1.6.0_29]
at 
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518) 
~[na:1.6.0_29]
  

StringValue.toOptionalLong incorrect behavior

2011-11-16 Thread Илья Нарыжный
Hello,

I have page mounted as @MountPath("/page/#{pageId}")

Also I have following code:

public ViewPagePage(PageParameters params)
{
this(getEntityPkFor(params, Page.class, 1)); //1 - is default ID if
PK in url was not found
}

and:

protected static Long getEntityPkFor(PageParameters params, Class clazz,
Long defaultPk)
{
String pkFieldName = EntitiesDescriptor.get().getPkFieldName(clazz);
Long ret=null;
if(pkFieldName!=null)
{
ret = params.get(pkFieldName).toOptionalLong();
}
if(ret==null)
{
ret = params.get("id").toOptionalLong();
}
return ret==null?defaultPk:ret;
}

But(!!!) if ID was not put to the URL I have following Exception:

Caused by: org.apache.wicket.util.string.StringValueConversionException:
Unable
to convert '' to a Long value
at
org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
va:589)
at
org.apache.wicket.util.string.StringValue.toOptionalLong(StringValue.
java:657)
at ru.ydn.wicket.EntityPage.getEntityPkFor(EntityPage.java:57)
at ru.ydn.wicket.web.ViewPagePage.(ViewPagePage.java:84)
... 37 more
Caused by: java.lang.NumberFormatException: For input string: ""
at
java.lang.NumberFormatException.forInputString(NumberFormatException.
java:48)
at java.lang.Long.parseLong(Long.java:431)
at java.lang.Long.(Long.java:678)
at
org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
va:585)

The problem in following code:

public final Long toOptionalLong() throws StringValueConversionException
{
return (text == null) ? null : toLongObject();
}

text should be checked for emptiness - not only null

What do you think?

Thanks,

Ilia


Re: integrating CDI into Wicket

2011-11-16 Thread Martin Grigorov
speaking of moving it to Apache..

currently we have some inconsistencies between Spring and Guice
integrations and users ask from time to time :
- why we don't use jsr330 @javax.inject.Inject since both Spring and
Guice support it. With CDI I think javax.enterprise.inject.Inject is
used which is yet another ...
- is it possible to not proxy the injected object (we have a ticket
with patch for Spring for that but not for Guice)

now with CDI I see more:
- why Injector.get().inject(me) doesn't work ?
--- because it needs BeanManager, but since it is reachable from
ServletContext then it should be OK
--- because it needs the class - OK, use me.getClass() for that
- why Spring/Guice doesn't support @PostConstruct ?

So my question is: should we try to make them consistent with each
other or we should provide minimal integration and give the user the
possibility to use the full power of his favorite DI framework ?

On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  wrote:
> sure
>
> -igor
>
> On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
> martijn.dasho...@gmail.com> wrote:
>
>> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
>> wrote:
>> > if you want to learn how to use CDI with Wicket i just wrote a short blog
>> > about it:
>> >
>> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>>
>> Can we use it for the documentation of the CDI project (when we
>> migrate it to apache)?
>>
>> Martijn
>>
>> --
>> Become a Wicket expert, learn from the best: http://wicketinaction.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: integrating CDI into Wicket

2011-11-16 Thread Martin Grigorov
one more question: is there anything Weld specific in wicket-cdi or it
should work with other CDI implementations too ?

On Wed, Nov 16, 2011 at 11:20 AM, Martin Grigorov  wrote:
> speaking of moving it to Apache..
>
> currently we have some inconsistencies between Spring and Guice
> integrations and users ask from time to time :
> - why we don't use jsr330 @javax.inject.Inject since both Spring and
> Guice support it. With CDI I think javax.enterprise.inject.Inject is
> used which is yet another ...
> - is it possible to not proxy the injected object (we have a ticket
> with patch for Spring for that but not for Guice)
>
> now with CDI I see more:
> - why Injector.get().inject(me) doesn't work ?
> --- because it needs BeanManager, but since it is reachable from
> ServletContext then it should be OK
> --- because it needs the class - OK, use me.getClass() for that
> - why Spring/Guice doesn't support @PostConstruct ?
>
> So my question is: should we try to make them consistent with each
> other or we should provide minimal integration and give the user the
> possibility to use the full power of his favorite DI framework ?
>
> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
> wrote:
>> sure
>>
>> -igor
>>
>> On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
>> martijn.dasho...@gmail.com> wrote:
>>
>>> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
>>> wrote:
>>> > if you want to learn how to use CDI with Wicket i just wrote a short blog
>>> > about it:
>>> >
>>> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>>>
>>> Can we use it for the documentation of the CDI project (when we
>>> migrate it to apache)?
>>>
>>> Martijn
>>>
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.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
>



-- 
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: StringValue.toOptionalLong incorrect behavior

2011-11-16 Thread Martin Grigorov
Hi,

At least this is what the javadoc says:
"Convert to object types, returning null if text is null."

I think the more appropriate method for you is
org.apache.wicket.util.string.StringValue.toLong(long) but it also
throws exceptions if the provided value is empty string.

On Wed, Nov 16, 2011 at 11:00 AM, Илья Нарыжный  wrote:
> Hello,
>
> I have page mounted as @MountPath("/page/#{pageId}")
>
> Also I have following code:
>
> public ViewPagePage(PageParameters params)
>    {
>        this(getEntityPkFor(params, Page.class, 1)); //1 - is default ID if
> PK in url was not found
>    }
>
> and:
>
> protected static Long getEntityPkFor(PageParameters params, Class clazz,
> Long defaultPk)
>    {
>        String pkFieldName = EntitiesDescriptor.get().getPkFieldName(clazz);
>        Long ret=null;
>        if(pkFieldName!=null)
>        {
>            ret = params.get(pkFieldName).toOptionalLong();
>        }
>        if(ret==null)
>        {
>            ret = params.get("id").toOptionalLong();
>        }
>        return ret==null?defaultPk:ret;
>    }
>
> But(!!!) if ID was not put to the URL I have following Exception:
>
> Caused by: org.apache.wicket.util.string.StringValueConversionException:
> Unable
> to convert '' to a Long value
>        at
> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
> va:589)
>        at
> org.apache.wicket.util.string.StringValue.toOptionalLong(StringValue.
> java:657)
>        at ru.ydn.wicket.EntityPage.getEntityPkFor(EntityPage.java:57)
>        at ru.ydn.wicket.web.ViewPagePage.(ViewPagePage.java:84)
>        ... 37 more
> Caused by: java.lang.NumberFormatException: For input string: ""
>        at
> java.lang.NumberFormatException.forInputString(NumberFormatException.
> java:48)
>        at java.lang.Long.parseLong(Long.java:431)
>        at java.lang.Long.(Long.java:678)
>        at
> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
> va:585)
>
> The problem in following code:
>
> public final Long toOptionalLong() throws StringValueConversionException
>    {
>        return (text == null) ? null : toLongObject();
>    }
>
> text should be checked for emptiness - not only null
>
> What do you think?
>
> Thanks,
>
> Ilia
>



-- 
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: StringValue.toOptionalLong incorrect behavior

2011-11-16 Thread vineet semwal
martin i too think tooptionalMethods in StringValue should behave the
way llia is saying ie. they should return null if text is empty or
null..
for eg. currently  public final Long toOptionalLong() throws
StringValueConversionException
{
return (text == null) ? null : toLongObject();
}

can be changed to
  public final Long toOptionalLong() throws StringValueConversionException
{
return (Strings.isEmpty(text)) ? null : toLongObject();
}

On Wed, Nov 16, 2011 at 2:57 PM, Martin Grigorov  wrote:
> Hi,
>
> At least this is what the javadoc says:
> "Convert to object types, returning null if text is null."
>
> I think the more appropriate method for you is
> org.apache.wicket.util.string.StringValue.toLong(long) but it also
> throws exceptions if the provided value is empty string.
>
> On Wed, Nov 16, 2011 at 11:00 AM, Илья Нарыжный  wrote:
>> Hello,
>>
>> I have page mounted as @MountPath("/page/#{pageId}")
>>
>> Also I have following code:
>>
>> public ViewPagePage(PageParameters params)
>>    {
>>        this(getEntityPkFor(params, Page.class, 1)); //1 - is default ID if
>> PK in url was not found
>>    }
>>
>> and:
>>
>> protected static Long getEntityPkFor(PageParameters params, Class clazz,
>> Long defaultPk)
>>    {
>>        String pkFieldName = EntitiesDescriptor.get().getPkFieldName(clazz);
>>        Long ret=null;
>>        if(pkFieldName!=null)
>>        {
>>            ret = params.get(pkFieldName).toOptionalLong();
>>        }
>>        if(ret==null)
>>        {
>>            ret = params.get("id").toOptionalLong();
>>        }
>>        return ret==null?defaultPk:ret;
>>    }
>>
>> But(!!!) if ID was not put to the URL I have following Exception:
>>
>> Caused by: org.apache.wicket.util.string.StringValueConversionException:
>> Unable
>> to convert '' to a Long value
>>        at
>> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
>> va:589)
>>        at
>> org.apache.wicket.util.string.StringValue.toOptionalLong(StringValue.
>> java:657)
>>        at ru.ydn.wicket.EntityPage.getEntityPkFor(EntityPage.java:57)
>>        at ru.ydn.wicket.web.ViewPagePage.(ViewPagePage.java:84)
>>        ... 37 more
>> Caused by: java.lang.NumberFormatException: For input string: ""
>>        at
>> java.lang.NumberFormatException.forInputString(NumberFormatException.
>> java:48)
>>        at java.lang.Long.parseLong(Long.java:431)
>>        at java.lang.Long.(Long.java:678)
>>        at
>> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
>> va:585)
>>
>> The problem in following code:
>>
>> public final Long toOptionalLong() throws StringValueConversionException
>>    {
>>        return (text == null) ? null : toLongObject();
>>    }
>>
>> text should be checked for emptiness - not only null
>>
>> What do you think?
>>
>> Thanks,
>>
>> Ilia
>>
>
>
>
> --
> 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
>
>



-- 
thank you,

regards,
Vineet Semwal

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



Re: Call an external url setting method and header

2011-11-16 Thread Alberto Brosich

On 11/16/2011 08:16 AM, Martin Grigorov wrote:

Hi,

On Tue, Nov 15, 2011 at 8:45 PM, Alberto  wrote:

Hi,
  I have to call an external url (a rest web service) from onSubmit of a
form.
I found this solution:

|throw new RedirectToUrlException(
"http://www.facebook.com/login.php?api_key="+ _apiKey + "&v=1.0",
HttpServletResponse.SC_MOVED_PERMANENTLY);


but it is just a redirect and I cannot post form data and set the accept 
header. The web service return different type of data (csv, xml, html, json) 
depending on the accept header.

How can I handle that?

Use Apache HttpClient or pure UrlConnection instead.


Yes, I'm using Jersey client for that. But how can I send the output I 
read from web service  to the browser. SetResponsePage() accept only a 
Page class parameter. Sorry if it is a silly question but I'm new to 
Wicket. I'm googling since 2 days without success.



Best regards

Alberto
|









--
Alberto Brosich

Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
Dipartimento di Oceanografia - OGA
National Oceanographic Data Centre/IOC - NODC
Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
Phone: +39 040 2140281
E-mail:abros...@ogs.trieste.it


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



AW: Call an external url setting method and header

2011-11-16 Thread Sven Meier
Hi,

just create you own IRequestHandler.

Instead of interrupting request processing with an exception, just schedule it 
with RequestCycle#scheduleRequestHandlerAfterCurrent() in your form's submit 
method.

Sven

-Ursprüngliche Nachricht-
Von: Alberto Brosich [mailto:abros...@ogs.trieste.it] 
Gesendet: Mittwoch, 16. November 2011 10:51
An: users@wicket.apache.org
Betreff: Re: Call an external url setting method and header

On 11/16/2011 08:16 AM, Martin Grigorov wrote:
> Hi,
>
> On Tue, Nov 15, 2011 at 8:45 PM, Alberto  wrote:
>> Hi,
>>   I have to call an external url (a rest web service) from onSubmit of a
>> form.
>> I found this solution:
>>
>> |throw new RedirectToUrlException(
>> "http://www.facebook.com/login.php?api_key="+ _apiKey + "&v=1.0",
>> HttpServletResponse.SC_MOVED_PERMANENTLY);
>>
>>
>> but it is just a redirect and I cannot post form data and set the accept 
>> header. The web service return different type of data (csv, xml, html, json) 
>> depending on the accept header.
>>
>> How can I handle that?
> Use Apache HttpClient or pure UrlConnection instead.

Yes, I'm using Jersey client for that. But how can I send the output I 
read from web service  to the browser. SetResponsePage() accept only a 
Page class parameter. Sorry if it is a silly question but I'm new to 
Wicket. I'm googling since 2 days without success.

>> Best regards
>>
>> Alberto
>> |
>>
>>
>>
>
>


-- 
Alberto Brosich

Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
Dipartimento di Oceanografia - OGA
National Oceanographic Data Centre/IOC - NODC
Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
Phone: +39 040 2140281
E-mail:abros...@ogs.trieste.it


-
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: StringValue.toOptionalLong incorrect behavior

2011-11-16 Thread Martin Grigorov
Hi,

On Wed, Nov 16, 2011 at 11:50 AM, vineet semwal
 wrote:
> martin i too think tooptionalMethods in StringValue should behave the
> way llia is saying ie. they should return null if text is empty or
> null..

Hm. Not quite convinced.
?a=b&c=&e=f is a valid query string and 'c' has value "" while 'g' has null

maybe just some of toOptionalXyz() methods should use Strings.isEmpty()
e.g. toOptionalString() and toOptionalBoolean() should not check for ""

> for eg. currently  public final Long toOptionalLong() throws
> StringValueConversionException
>        {
>                return (text == null) ? null : toLongObject();
>        }
>
> can be changed to
>  public final Long toOptionalLong() throws StringValueConversionException
>        {
>                return (Strings.isEmpty(text)) ? null : toLongObject();
>        }
>
> On Wed, Nov 16, 2011 at 2:57 PM, Martin Grigorov  wrote:
>> Hi,
>>
>> At least this is what the javadoc says:
>> "Convert to object types, returning null if text is null."
>>
>> I think the more appropriate method for you is
>> org.apache.wicket.util.string.StringValue.toLong(long) but it also
>> throws exceptions if the provided value is empty string.
>>
>> On Wed, Nov 16, 2011 at 11:00 AM, Илья Нарыжный  wrote:
>>> Hello,
>>>
>>> I have page mounted as @MountPath("/page/#{pageId}")
>>>
>>> Also I have following code:
>>>
>>> public ViewPagePage(PageParameters params)
>>>    {
>>>        this(getEntityPkFor(params, Page.class, 1)); //1 - is default ID if
>>> PK in url was not found
>>>    }
>>>
>>> and:
>>>
>>> protected static Long getEntityPkFor(PageParameters params, Class clazz,
>>> Long defaultPk)
>>>    {
>>>        String pkFieldName = EntitiesDescriptor.get().getPkFieldName(clazz);
>>>        Long ret=null;
>>>        if(pkFieldName!=null)
>>>        {
>>>            ret = params.get(pkFieldName).toOptionalLong();
>>>        }
>>>        if(ret==null)
>>>        {
>>>            ret = params.get("id").toOptionalLong();
>>>        }
>>>        return ret==null?defaultPk:ret;
>>>    }
>>>
>>> But(!!!) if ID was not put to the URL I have following Exception:
>>>
>>> Caused by: org.apache.wicket.util.string.StringValueConversionException:
>>> Unable
>>> to convert '' to a Long value
>>>        at
>>> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
>>> va:589)
>>>        at
>>> org.apache.wicket.util.string.StringValue.toOptionalLong(StringValue.
>>> java:657)
>>>        at ru.ydn.wicket.EntityPage.getEntityPkFor(EntityPage.java:57)
>>>        at ru.ydn.wicket.web.ViewPagePage.(ViewPagePage.java:84)
>>>        ... 37 more
>>> Caused by: java.lang.NumberFormatException: For input string: ""
>>>        at
>>> java.lang.NumberFormatException.forInputString(NumberFormatException.
>>> java:48)
>>>        at java.lang.Long.parseLong(Long.java:431)
>>>        at java.lang.Long.(Long.java:678)
>>>        at
>>> org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
>>> va:585)
>>>
>>> The problem in following code:
>>>
>>> public final Long toOptionalLong() throws StringValueConversionException
>>>    {
>>>        return (text == null) ? null : toLongObject();
>>>    }
>>>
>>> text should be checked for emptiness - not only null
>>>
>>> What do you think?
>>>
>>> Thanks,
>>>
>>> Ilia
>>>
>>
>>
>>
>> --
>> 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
>>
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>
> -
> 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: Call an external url setting method and header

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 12:02 PM, Sven Meier  wrote:
> Hi,
>
> just create you own IRequestHandler.

No need to create, there are default ones: TextRequestHandler (for
success) and ErrorCodeRequestHandler (for failure)

>
> Instead of interrupting request processing with an exception, just schedule 
> it with RequestCycle#scheduleRequestHandlerAfterCurrent() in your form's 
> submit method.
>
> Sven
>
> -Ursprüngliche Nachricht-
> Von: Alberto Brosich [mailto:abros...@ogs.trieste.it]
> Gesendet: Mittwoch, 16. November 2011 10:51
> An: users@wicket.apache.org
> Betreff: Re: Call an external url setting method and header
>
> On 11/16/2011 08:16 AM, Martin Grigorov wrote:
>> Hi,
>>
>> On Tue, Nov 15, 2011 at 8:45 PM, Alberto  wrote:
>>> Hi,
>>>   I have to call an external url (a rest web service) from onSubmit of a
>>> form.
>>> I found this solution:
>>>
>>> |throw new RedirectToUrlException(
>>>     "http://www.facebook.com/login.php?api_key="+ _apiKey + "&v=1.0",
>>>     HttpServletResponse.SC_MOVED_PERMANENTLY);
>>>
>>>
>>> but it is just a redirect and I cannot post form data and set the accept 
>>> header. The web service return different type of data (csv, xml, html, 
>>> json) depending on the accept header.
>>>
>>> How can I handle that?
>> Use Apache HttpClient or pure UrlConnection instead.
>
> Yes, I'm using Jersey client for that. But how can I send the output I
> read from web service  to the browser. SetResponsePage() accept only a
> Page class parameter. Sorry if it is a silly question but I'm new to
> Wicket. I'm googling since 2 days without success.
>
>>> Best regards
>>>
>>> Alberto
>>> |
>>>
>>>
>>>
>>
>>
>
>
> --
> Alberto Brosich
>
> Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
> Dipartimento di Oceanografia - OGA
> National Oceanographic Data Centre/IOC - NODC
> Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
> Phone: +39 040 2140281
> E-mail:abros...@ogs.trieste.it
>
>
> -
> 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
>
>



-- 
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: StringValue.toOptionalLong incorrect behavior

2011-11-16 Thread vineet semwal
 yeah not needed for toOptionalString() but why not for toOptionalBoolean()?

On Wed, Nov 16, 2011 at 3:39 PM, Martin Grigorov  wrote:
> Hi,
>
> On Wed, Nov 16, 2011 at 11:50 AM, vineet semwal
>  wrote:
>> martin i too think tooptionalMethods in StringValue should behave the
>> way llia is saying ie. they should return null if text is empty or
>> null..
>
> Hm. Not quite convinced.
> ?a=b&c=&e=f is a valid query string and 'c' has value "" while 'g' has null
>
> maybe just some of toOptionalXyz() methods should use Strings.isEmpty()
> e.g. toOptionalString() and toOptionalBoolean() should not check for ""
>
>> for eg. currently  public final Long toOptionalLong() throws
>> StringValueConversionException
>>        {
>>                return (text == null) ? null : toLongObject();
>>        }
>>
>> can be changed to
>>  public final Long toOptionalLong() throws StringValueConversionException
>>        {
>>                return (Strings.isEmpty(text)) ? null : toLongObject();
>>        }
>>
>> On Wed, Nov 16, 2011 at 2:57 PM, Martin Grigorov  
>> wrote:
>>> Hi,
>>>
>>> At least this is what the javadoc says:
>>> "Convert to object types, returning null if text is null."
>>>
>>> I think the more appropriate method for you is
>>> org.apache.wicket.util.string.StringValue.toLong(long) but it also
>>> throws exceptions if the provided value is empty string.
>>>
>>> On Wed, Nov 16, 2011 at 11:00 AM, Илья Нарыжный  wrote:
 Hello,

 I have page mounted as @MountPath("/page/#{pageId}")

 Also I have following code:

 public ViewPagePage(PageParameters params)
    {
        this(getEntityPkFor(params, Page.class, 1)); //1 - is default ID if
 PK in url was not found
    }

 and:

 protected static Long getEntityPkFor(PageParameters params, Class clazz,
 Long defaultPk)
    {
        String pkFieldName = EntitiesDescriptor.get().getPkFieldName(clazz);
        Long ret=null;
        if(pkFieldName!=null)
        {
            ret = params.get(pkFieldName).toOptionalLong();
        }
        if(ret==null)
        {
            ret = params.get("id").toOptionalLong();
        }
        return ret==null?defaultPk:ret;
    }

 But(!!!) if ID was not put to the URL I have following Exception:

 Caused by: org.apache.wicket.util.string.StringValueConversionException:
 Unable
 to convert '' to a Long value
        at
 org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
 va:589)
        at
 org.apache.wicket.util.string.StringValue.toOptionalLong(StringValue.
 java:657)
        at ru.ydn.wicket.EntityPage.getEntityPkFor(EntityPage.java:57)
        at ru.ydn.wicket.web.ViewPagePage.(ViewPagePage.java:84)
        ... 37 more
 Caused by: java.lang.NumberFormatException: For input string: ""
        at
 java.lang.NumberFormatException.forInputString(NumberFormatException.
 java:48)
        at java.lang.Long.parseLong(Long.java:431)
        at java.lang.Long.(Long.java:678)
        at
 org.apache.wicket.util.string.StringValue.toLongObject(StringValue.ja
 va:585)

 The problem in following code:

 public final Long toOptionalLong() throws StringValueConversionException
    {
        return (text == null) ? null : toLongObject();
    }

 text should be checked for emptiness - not only null

 What do you think?

 Thanks,

 Ilia

>>>
>>>
>>>
>>> --
>>> 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
>>>
>>>
>>
>>
>>
>> --
>> thank you,
>>
>> regards,
>> Vineet Semwal
>>
>> -
>> 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
>
>



-- 
thank you,

regards,
Vineet Semwal

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



Re: integrating CDI into Wicket

2011-11-16 Thread James Carman
The only thing "external" is the conversation management stuff from
Seam, it looks like.  The user would have to make sure they include
the container-specific "adapter" code on the classpath
(org.jboss.seam.conversation:seam-conversation-weld for example) for
their CDI container.

Another concern would be the fact that they (JBoss) don't "publish"
their artifacts to Maven central.  Aren't they (the managers of Maven
central) frowning upon publishing artifacts up there that depend on
artifacts published elsewhere?


On Wed, Nov 16, 2011 at 4:21 AM, Martin Grigorov  wrote:
> one more question: is there anything Weld specific in wicket-cdi or it
> should work with other CDI implementations too ?
>
> On Wed, Nov 16, 2011 at 11:20 AM, Martin Grigorov  
> wrote:
>> speaking of moving it to Apache..
>>
>> currently we have some inconsistencies between Spring and Guice
>> integrations and users ask from time to time :
>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>> used which is yet another ...
>> - is it possible to not proxy the injected object (we have a ticket
>> with patch for Spring for that but not for Guice)
>>
>> now with CDI I see more:
>> - why Injector.get().inject(me) doesn't work ?
>> --- because it needs BeanManager, but since it is reachable from
>> ServletContext then it should be OK
>> --- because it needs the class - OK, use me.getClass() for that
>> - why Spring/Guice doesn't support @PostConstruct ?
>>
>> So my question is: should we try to make them consistent with each
>> other or we should provide minimal integration and give the user the
>> possibility to use the full power of his favorite DI framework ?
>>
>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
>> wrote:
>>> sure
>>>
>>> -igor
>>>
>>> On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
>>> martijn.dasho...@gmail.com> wrote:
>>>
 On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
 wrote:
 > if you want to learn how to use CDI with Wicket i just wrote a short blog
 > about it:
 >
 > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/

 Can we use it for the documentation of the CDI project (when we
 migrate it to apache)?

 Martijn

 --
 Become a Wicket expert, learn from the best: http://wicketinaction.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
>>
>
>
>
> --
> 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: integrating CDI into Wicket

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 1:49 PM, James Carman
 wrote:
> The only thing "external" is the conversation management stuff from
> Seam, it looks like.  The user would have to make sure they include
> the container-specific "adapter" code on the classpath
> (org.jboss.seam.conversation:seam-conversation-weld for example) for
> their CDI container.
>
> Another concern would be the fact that they (JBoss) don't "publish"
> their artifacts to Maven central.  Aren't they (the managers of Maven
> central) frowning upon publishing artifacts up there that depend on
> artifacts published elsewhere?

See http://www.sonatype.com/people/2011/09/8942/


>
>
> On Wed, Nov 16, 2011 at 4:21 AM, Martin Grigorov  wrote:
>> one more question: is there anything Weld specific in wicket-cdi or it
>> should work with other CDI implementations too ?
>>
>> On Wed, Nov 16, 2011 at 11:20 AM, Martin Grigorov  
>> wrote:
>>> speaking of moving it to Apache..
>>>
>>> currently we have some inconsistencies between Spring and Guice
>>> integrations and users ask from time to time :
>>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>>> used which is yet another ...
>>> - is it possible to not proxy the injected object (we have a ticket
>>> with patch for Spring for that but not for Guice)
>>>
>>> now with CDI I see more:
>>> - why Injector.get().inject(me) doesn't work ?
>>> --- because it needs BeanManager, but since it is reachable from
>>> ServletContext then it should be OK
>>> --- because it needs the class - OK, use me.getClass() for that
>>> - why Spring/Guice doesn't support @PostConstruct ?
>>>
>>> So my question is: should we try to make them consistent with each
>>> other or we should provide minimal integration and give the user the
>>> possibility to use the full power of his favorite DI framework ?
>>>
>>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
>>> wrote:
 sure

 -igor

 On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
 martijn.dasho...@gmail.com> wrote:

> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
> wrote:
> > if you want to learn how to use CDI with Wicket i just wrote a short 
> > blog
> > about it:
> >
> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>
> Can we use it for the documentation of the CDI project (when we
> migrate it to apache)?
>
> Martijn
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.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
>>>
>>
>>
>>
>> --
>> 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
>
>



-- 
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: integrating CDI into Wicket

2011-11-16 Thread James Carman
Is the license compatible?
I am actually going to roll my own in wicketopia.
On Nov 16, 2011 6:59 AM, "Martin Grigorov"  wrote:

> On Wed, Nov 16, 2011 at 1:49 PM, James Carman
>  wrote:
> > The only thing "external" is the conversation management stuff from
> > Seam, it looks like.  The user would have to make sure they include
> > the container-specific "adapter" code on the classpath
> > (org.jboss.seam.conversation:seam-conversation-weld for example) for
> > their CDI container.
> >
> > Another concern would be the fact that they (JBoss) don't "publish"
> > their artifacts to Maven central.  Aren't they (the managers of Maven
> > central) frowning upon publishing artifacts up there that depend on
> > artifacts published elsewhere?
>
> See http://www.sonatype.com/people/2011/09/8942/
>
>
> >
> >
> > On Wed, Nov 16, 2011 at 4:21 AM, Martin Grigorov 
> wrote:
> >> one more question: is there anything Weld specific in wicket-cdi or it
> >> should work with other CDI implementations too ?
> >>
> >> On Wed, Nov 16, 2011 at 11:20 AM, Martin Grigorov 
> wrote:
> >>> speaking of moving it to Apache..
> >>>
> >>> currently we have some inconsistencies between Spring and Guice
> >>> integrations and users ask from time to time :
> >>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
> >>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
> >>> used which is yet another ...
> >>> - is it possible to not proxy the injected object (we have a ticket
> >>> with patch for Spring for that but not for Guice)
> >>>
> >>> now with CDI I see more:
> >>> - why Injector.get().inject(me) doesn't work ?
> >>> --- because it needs BeanManager, but since it is reachable from
> >>> ServletContext then it should be OK
> >>> --- because it needs the class - OK, use me.getClass() for that
> >>> - why Spring/Guice doesn't support @PostConstruct ?
> >>>
> >>> So my question is: should we try to make them consistent with each
> >>> other or we should provide minimal integration and give the user the
> >>> possibility to use the full power of his favorite DI framework ?
> >>>
> >>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg <
> igor.vaynb...@gmail.com> wrote:
>  sure
> 
>  -igor
> 
>  On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
>  martijn.dasho...@gmail.com> wrote:
> 
> > On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg <
> igor.vaynb...@gmail.com>
> > wrote:
> > > if you want to learn how to use CDI with Wicket i just wrote a
> short blog
> > > about it:
> > >
> > > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
> >
> > Can we use it for the documentation of the CDI project (when we
> > migrate it to apache)?
> >
> > Martijn
> >
> > --
> > Become a Wicket expert, learn from the best:
> http://wicketinaction.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
> >>>
> >>
> >>
> >>
> >> --
> >> 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
> >
> >
>
>
>
> --
> 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
>
>


jsessionid not appended for stateful pages

2011-11-16 Thread thomas willomitzer
Dear all,

I've spent quite a bit of time tracking down a problem I'm having using
wicket and stateful pages.
I've enabled the jsessionid url rewriting in tomcat (by simply using the
default settings) but I get a redirect url without the jsessionid.

I've traced into tomcat's Response.encodeUrl and saw that the jsessionid is
in fact appended (but later removed for in page references by wicket -
that's fine).

What am I doing wrong and am I right in the assumption that wicket should
work without cookies?

When using curl I first get a redirect to ?1, then to /. and then a 404

$ curl -v http://localhost
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
zlib/1.2.3
> Host: localhost
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=
CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
< Date: Wed, 16 Nov 2011 12:16:15 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, no-store
< Location: http://localhost/?1
< Content-Length: 0
<
* Connection #0 to host localhost left intact
* Closing connection #0

thomas@willo ~
$ curl -v http://localhost?1 
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /?1 HTTP/1.1
> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
zlib/1.2.3
> Host: localhost
> Accept: */*
>
< HTTP/1.1 302 Moved Temporarily
< Server: Apache-Coyote/1.1
< Date: Wed, 16 Nov 2011 12:16:21 GMT
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Pragma: no-cache
< Cache-Control: no-cache, no-store
< Location: http://localhost/.
< Content-Length: 0
<
* Connection #0 to host localhost left intact
* Closing connection #0

thomas@willo ~
$ curl -v http://localhost/.
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /. HTTP/1.1
> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
zlib/1.2.3
> Host: localhost
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: Apache-Coyote/1.1
< Content-Type: text/html;charset=utf-8
< Content-Length: 958
< Date: Wed, 16 Nov 2011 12:16:24 GMT
<
Apache Tomcat/6.0.33 - Error report HTTP Status 404 - /.type Status
reportmessage /.description The requested resource (/.) is not
available.Apache
Tomcat/6.0.33*
Connection #0 to host localhost left intact
* Closing connection #0


Re: jsessionid not appended for stateful pages

2011-11-16 Thread Martin Grigorov
Hi,

On Wed, Nov 16, 2011 at 2:29 PM, thomas willomitzer
 wrote:
> Dear all,
>
> I've spent quite a bit of time tracking down a problem I'm having using
> wicket and stateful pages.
> I've enabled the jsessionid url rewriting in tomcat (by simply using the
> default settings) but I get a redirect url without the jsessionid.
>
> I've traced into tomcat's Response.encodeUrl and saw that the jsessionid is
> in fact appended (but later removed for in page references by wicket -
> that's fine).

What do you mean by that ? Where Wicket removes the jsessionid from the url ?
Before issuing a redirect Wicket calls
javax.servlet.http.HttpServletResponse.encodeRedirectURL(String) which
is responsible to put jsessionid if cookies are disabled.
See 
org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)

The application I work on works without cookies and all if fine. (Wicket 1.5.3)

>
> What am I doing wrong and am I right in the assumption that wicket should
> work without cookies?
>
> When using curl I first get a redirect to ?1, then to /. and then a 404
>
> $ curl -v http://localhost
> * About to connect() to localhost port 80 (#0)
> *   Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 80 (#0)
>> GET / HTTP/1.1
>> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> zlib/1.2.3
>> Host: localhost
>> Accept: */*
>>
> < HTTP/1.1 302 Moved Temporarily
> < Server: Apache-Coyote/1.1
> < Set-Cookie: JSESSIONID=
> CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
> < Date: Wed, 16 Nov 2011 12:16:15 GMT
> < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> < Pragma: no-cache
> < Cache-Control: no-cache, no-store
> < Location: http://localhost/?1
> < Content-Length: 0
> <
> * Connection #0 to host localhost left intact
> * Closing connection #0
>
> thomas@willo ~
> $ curl -v http://localhost?1 
> * About to connect() to localhost port 80 (#0)
> *   Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 80 (#0)
>> GET /?1 HTTP/1.1
>> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> zlib/1.2.3
>> Host: localhost
>> Accept: */*
>>
> < HTTP/1.1 302 Moved Temporarily
> < Server: Apache-Coyote/1.1
> < Date: Wed, 16 Nov 2011 12:16:21 GMT
> < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> < Pragma: no-cache
> < Cache-Control: no-cache, no-store
> < Location: http://localhost/.
> < Content-Length: 0
> <
> * Connection #0 to host localhost left intact
> * Closing connection #0
>
> thomas@willo ~
> $ curl -v http://localhost/.
> * About to connect() to localhost port 80 (#0)
> *   Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 80 (#0)
>> GET /. HTTP/1.1
>> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> zlib/1.2.3
>> Host: localhost
>> Accept: */*
>>
> < HTTP/1.1 404 Not Found
> < Server: Apache-Coyote/1.1
> < Content-Type: text/html;charset=utf-8
> < Content-Length: 958
> < Date: Wed, 16 Nov 2011 12:16:24 GMT
> <
> Apache Tomcat/6.0.33 - Error report HTTP Status 404 - /. size="1" noshade="noshade">type Status
> reportmessage /. u>description The requested resource (/.) is not
> available.Apache
> Tomcat/6.0.33*
> Connection #0 to host localhost left intact
> * Closing connection #0
>



-- 
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: Call an external url setting method and header

2011-11-16 Thread Alberto Brosich

On 11/16/2011 11:10 AM, Martin Grigorov wrote:

On Wed, Nov 16, 2011 at 12:02 PM, Sven Meier  wrote:

Hi,

just create you own IRequestHandler.

No need to create, there are default ones: TextRequestHandler (for
success) and ErrorCodeRequestHandler (for failure)


Ok, it's working. I use the following statement:
onSubmit()

...
this.getRequestCycle().scheduleRequestHandlerAfterCurrent(new 
TextRequestHandler(contentType, "utf-8", result));

...
)

But is there a way to control the http header (for content location, for 
example)? When the result is a csv file the browser uses a weird 
filename to write to.




Instead of interrupting request processing with an exception, just schedule it 
with RequestCycle#scheduleRequestHandlerAfterCurrent() in your form's submit 
method.

Sven

-Ursprüngliche Nachricht-
Von: Alberto Brosich [mailto:abros...@ogs.trieste.it]
Gesendet: Mittwoch, 16. November 2011 10:51
An: users@wicket.apache.org
Betreff: Re: Call an external url setting method and header

On 11/16/2011 08:16 AM, Martin Grigorov wrote:

Hi,

On Tue, Nov 15, 2011 at 8:45 PM, Albertowrote:

Hi,
   I have to call an external url (a rest web service) from onSubmit of a
form.
I found this solution:

|throw new RedirectToUrlException(
 "http://www.facebook.com/login.php?api_key="+ _apiKey + "&v=1.0",
 HttpServletResponse.SC_MOVED_PERMANENTLY);


but it is just a redirect and I cannot post form data and set the accept 
header. The web service return different type of data (csv, xml, html, json) 
depending on the accept header.

How can I handle that?

Use Apache HttpClient or pure UrlConnection instead.

Yes, I'm using Jersey client for that. But how can I send the output I
read from web service  to the browser. SetResponsePage() accept only a
Page class parameter. Sorry if it is a silly question but I'm new to
Wicket. I'm googling since 2 days without success.


Best regards

Alberto
|







--
Alberto Brosich

Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
Dipartimento di Oceanografia - OGA
National Oceanographic Data Centre/IOC - NODC
Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
Phone: +39 040 2140281
E-mail:abros...@ogs.trieste.it


-
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








--
Alberto Brosich

Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
Dipartimento di Oceanografia - OGA
National Oceanographic Data Centre/IOC - NODC
Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
Phone: +39 040 2140281
E-mail:abros...@ogs.trieste.it


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



Forum vs list question

2011-11-16 Thread Neill Rosenthal
Can someone please explain how I can participate in the User forum on
Nabble without having to join the mailing list? 
Or if I do need to join, how can I avoid receiving all emails generated
by the list?


Dealing with 3 choice components

2011-11-16 Thread Alberto Brosich


I have a form with with 3 choice components:

A) DropDownChoice
B) DropDownChoice
C) ListMultipleChoice

The values of B depend on selected value of A.
The values of C depend on selected values of A and B

I override the wantOnSelectionChangedNotifications() and 
onSelectionChanged() methods of A and B.


A#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
   super.onSelectionChanged(newSelection);
   SearchForm.this.getModelObject().setInstrument(null);
   SearchForm.this.getModelObject().setParams(null);
}

B#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
   super.onSelectionChanged(newSelection);
   SearchForm.this.getModelObject().setParams(null);
}

In A I set to null the model value of both B and C.
In B I set to null the model value only of B.

This code works only on the startup of the form. When I change the value 
in A the list of C become empty. I have to change the value of B to fill C.


How can I manage this?

A

--
Alberto Brosich

Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
Dipartimento di Oceanografia - OGA
National Oceanographic Data Centre/IOC - NODC
Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
Phone: +39 040 2140281
E-mail:abros...@ogs.trieste.it


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



Re: Call an external url setting method and header

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 2:57 PM, Alberto Brosich
 wrote:
> On 11/16/2011 11:10 AM, Martin Grigorov wrote:
>>
>> On Wed, Nov 16, 2011 at 12:02 PM, Sven Meier  wrote:
>>>
>>> Hi,
>>>
>>> just create you own IRequestHandler.
>>
>> No need to create, there are default ones: TextRequestHandler (for
>> success) and ErrorCodeRequestHandler (for failure)
>
> Ok, it's working. I use the following statement:
> onSubmit()
>
> ...
> this.getRequestCycle().scheduleRequestHandlerAfterCurrent(new
> TextRequestHandler(contentType, "utf-8", result));
> ...
> )
>
> But is there a way to control the http header (for content location, for
> example)? When the result is a csv file the browser uses a weird filename to
> write to.

Use another IRequestHandler implementation. Like
org.apache.wicket.request.handler.resource.ResourceRequestHandler,
just wrap your response in IResource.

>
>
>>> Instead of interrupting request processing with an exception, just
>>> schedule it with RequestCycle#scheduleRequestHandlerAfterCurrent() in your
>>> form's submit method.
>>>
>>> Sven
>>>
>>> -Ursprüngliche Nachricht-
>>> Von: Alberto Brosich [mailto:abros...@ogs.trieste.it]
>>> Gesendet: Mittwoch, 16. November 2011 10:51
>>> An: users@wicket.apache.org
>>> Betreff: Re: Call an external url setting method and header
>>>
>>> On 11/16/2011 08:16 AM, Martin Grigorov wrote:

 Hi,

 On Tue, Nov 15, 2011 at 8:45 PM, Alberto
  wrote:
>
> Hi,
>   I have to call an external url (a rest web service) from onSubmit of
> a
> form.
> I found this solution:
>
> |throw new RedirectToUrlException(
>     "http://www.facebook.com/login.php?api_key="+ _apiKey + "&v=1.0",
>     HttpServletResponse.SC_MOVED_PERMANENTLY);
>
>
> but it is just a redirect and I cannot post form data and set the
> accept header. The web service return different type of data (csv, xml,
> html, json) depending on the accept header.
>
> How can I handle that?

 Use Apache HttpClient or pure UrlConnection instead.
>>>
>>> Yes, I'm using Jersey client for that. But how can I send the output I
>>> read from web service  to the browser. SetResponsePage() accept only a
>>> Page class parameter. Sorry if it is a silly question but I'm new to
>>> Wicket. I'm googling since 2 days without success.
>>>
> Best regards
>
> Alberto
> |
>
>
>

>>>
>>> --
>>> Alberto Brosich
>>>
>>> Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
>>> Dipartimento di Oceanografia - OGA
>>> National Oceanographic Data Centre/IOC - NODC
>>> Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
>>> Phone: +39 040 2140281
>>> E-mail:abros...@ogs.trieste.it
>>>
>>>
>>> -
>>> 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
>>>
>>>
>>
>>
>
>
> --
> Alberto Brosich
>
> Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS
> Dipartimento di Oceanografia - OGA
> National Oceanographic Data Centre/IOC - NODC
> Borgo Grotta Gigante 42/c, 34010 Sgonico, Trieste (ITALY)
> Phone: +39 040 2140281
> E-mail:abros...@ogs.trieste.it
>
>
> -
> 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: jsessionid not appended for stateful pages

2011-11-16 Thread thomas willomitzer
Hi Martin,

Sorry for the confusion I meant that i've seen
org.apache.wicket.util.string.Strings.stripJSessionId(uri) being called for
ResourceReferences to Javascript and Css.

I'm using wicket 1.5.1 and tomcat 6.0.33.

You're right - I've traced from
org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
and it seems like there is a problem with "?1" and
org.apache.catalina.connector.toEncoded(String url, String sessionId).

In toEncoded(String url, String sessionId) when url = "?1" it seems that
the parameter is NOT appended since variable path is of length zero and if(
sb.length() > 0 ) is false. (in order to see a value of "?1" i set a
breakpoint in ServletWebResponse.sendRedirect followed by a breakpoint in
toEncoded)

Since it seems to work for the rest of the world I guess I'm doing
something wrong ...

protected String toEncoded(String url, String sessionId) {

if ((url == null) || (sessionId == null))
return (url);

String path = url;
String query = "";
String anchor = "";
int question = url.indexOf('?');
if (question >= 0) {
path = url.substring(0, question);
query = url.substring(question);
}
int pound = path.indexOf('#');
if (pound >= 0) {
anchor = path.substring(pound);
path = path.substring(0, pound);
}
StringBuffer sb = new StringBuffer(path);
if( sb.length() > 0 ) { // jsessionid can't be first.
sb.append(";");
sb.append(Globals.SESSION_PARAMETER_NAME);
sb.append("=");
sb.append(sessionId);
}
sb.append(anchor);
sb.append(query);
return (sb.toString());

}


Thanks
Thomas


On Wed, Nov 16, 2011 at 1:39 PM, Martin Grigorov wrote:

> Hi,
>
> On Wed, Nov 16, 2011 at 2:29 PM, thomas willomitzer
>  wrote:
> > Dear all,
> >
> > I've spent quite a bit of time tracking down a problem I'm having using
> > wicket and stateful pages.
> > I've enabled the jsessionid url rewriting in tomcat (by simply using the
> > default settings) but I get a redirect url without the jsessionid.
> >
> > I've traced into tomcat's Response.encodeUrl and saw that the jsessionid
> is
> > in fact appended (but later removed for in page references by wicket -
> > that's fine).
>
> What do you mean by that ? Where Wicket removes the jsessionid from the
> url ?
> Before issuing a redirect Wicket calls
> javax.servlet.http.HttpServletResponse.encodeRedirectURL(String) which
> is responsible to put jsessionid if cookies are disabled.
> See
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
>
> The application I work on works without cookies and all if fine. (Wicket
> 1.5.3)
>
> >
> > What am I doing wrong and am I right in the assumption that wicket should
> > work without cookies?
> >
> > When using curl I first get a redirect to ?1, then to /. and then a 404
> >
> > $ curl -v http://localhost
> > * About to connect() to localhost port 80 (#0)
> > *   Trying 127.0.0.1... connected
> > * Connected to localhost (127.0.0.1) port 80 (#0)
> >> GET / HTTP/1.1
> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> > zlib/1.2.3
> >> Host: localhost
> >> Accept: */*
> >>
> > < HTTP/1.1 302 Moved Temporarily
> > < Server: Apache-Coyote/1.1
> > < Set-Cookie: JSESSIONID=
> > CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
> > < Date: Wed, 16 Nov 2011 12:16:15 GMT
> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> > < Pragma: no-cache
> > < Cache-Control: no-cache, no-store
> > < Location: http://localhost/?1
> > < Content-Length: 0
> > <
> > * Connection #0 to host localhost left intact
> > * Closing connection #0
> >
> > thomas@willo ~
> > $ curl -v http://localhost?1 
> > * About to connect() to localhost port 80 (#0)
> > *   Trying 127.0.0.1... connected
> > * Connected to localhost (127.0.0.1) port 80 (#0)
> >> GET /?1 HTTP/1.1
> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> > zlib/1.2.3
> >> Host: localhost
> >> Accept: */*
> >>
> > < HTTP/1.1 302 Moved Temporarily
> > < Server: Apache-Coyote/1.1
> > < Date: Wed, 16 Nov 2011 12:16:21 GMT
> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> > < Pragma: no-cache
> > < Cache-Control: no-cache, no-store
> > < Location: http://localhost/.
> > < Content-Length: 0
> > <
> > * Connection #0 to host localhost left intact
> > * Closing connection #0
> >
> > thomas@willo ~
> > $ curl -v http://localhost/.
> > * About to connect() to localhost port 80 (#0)
> > *   Trying 127.0.0.1... connected
> > * Connected to localhost (127.0.0.1) port 80 (#0)
> >> GET /. HTTP/1.1
> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
> > zlib/1.2.3
> >> Host: localhost
> >> Accept: */*
> >>
> > < HTTP/1.1 404 Not Found
> > < Server: Apache-Coyote/1.1
> > < Content-Type: text/html;charset=utf-8
> > < Content-Length: 958
> > < Date: Wed

Re: jsessionid not appended for stateful pages

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 4:02 PM, thomas willomitzer  wrote:
> Hi Martin,
>
> Sorry for the confusion I meant that i've seen
> org.apache.wicket.util.string.Strings.stripJSessionId(uri) being called for
> ResourceReferences to Javascript and Css.

This is used to check whether a given resource is already contributed or not.

>
> I'm using wicket 1.5.1 and tomcat 6.0.33.

Try with Wicket 1.5.3. I remember a ticket about such problems with
the home page without filter path.
We have a workaround in Wicket but I remember Tomcat also fixed it in
7.x, not sure about 6.x.

>
> You're right - I've traced from
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
> and it seems like there is a problem with "?1" and
> org.apache.catalina.connector.toEncoded(String url, String sessionId).
>
> In toEncoded(String url, String sessionId) when url = "?1" it seems that
> the parameter is NOT appended since variable path is of length zero and if(
> sb.length() > 0 ) is false. (in order to see a value of "?1" i set a
> breakpoint in ServletWebResponse.sendRedirect followed by a breakpoint in
> toEncoded)
>
> Since it seems to work for the rest of the world I guess I'm doing
> something wrong ...
>
>    protected String toEncoded(String url, String sessionId) {
>
>        if ((url == null) || (sessionId == null))
>            return (url);
>
>        String path = url;
>        String query = "";
>        String anchor = "";
>        int question = url.indexOf('?');
>        if (question >= 0) {
>            path = url.substring(0, question);
>            query = url.substring(question);
>        }
>        int pound = path.indexOf('#');
>        if (pound >= 0) {
>            anchor = path.substring(pound);
>            path = path.substring(0, pound);
>        }
>        StringBuffer sb = new StringBuffer(path);
>        if( sb.length() > 0 ) { // jsessionid can't be first.
>            sb.append(";");
>            sb.append(Globals.SESSION_PARAMETER_NAME);
>            sb.append("=");
>            sb.append(sessionId);
>        }
>        sb.append(anchor);
>        sb.append(query);
>        return (sb.toString());
>
>    }
>
>
> Thanks
> Thomas
>
>
> On Wed, Nov 16, 2011 at 1:39 PM, Martin Grigorov wrote:
>
>> Hi,
>>
>> On Wed, Nov 16, 2011 at 2:29 PM, thomas willomitzer
>>  wrote:
>> > Dear all,
>> >
>> > I've spent quite a bit of time tracking down a problem I'm having using
>> > wicket and stateful pages.
>> > I've enabled the jsessionid url rewriting in tomcat (by simply using the
>> > default settings) but I get a redirect url without the jsessionid.
>> >
>> > I've traced into tomcat's Response.encodeUrl and saw that the jsessionid
>> is
>> > in fact appended (but later removed for in page references by wicket -
>> > that's fine).
>>
>> What do you mean by that ? Where Wicket removes the jsessionid from the
>> url ?
>> Before issuing a redirect Wicket calls
>> javax.servlet.http.HttpServletResponse.encodeRedirectURL(String) which
>> is responsible to put jsessionid if cookies are disabled.
>> See
>> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
>>
>> The application I work on works without cookies and all if fine. (Wicket
>> 1.5.3)
>>
>> >
>> > What am I doing wrong and am I right in the assumption that wicket should
>> > work without cookies?
>> >
>> > When using curl I first get a redirect to ?1, then to /. and then a 404
>> >
>> > $ curl -v http://localhost
>> > * About to connect() to localhost port 80 (#0)
>> > *   Trying 127.0.0.1... connected
>> > * Connected to localhost (127.0.0.1) port 80 (#0)
>> >> GET / HTTP/1.1
>> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
>> > zlib/1.2.3
>> >> Host: localhost
>> >> Accept: */*
>> >>
>> > < HTTP/1.1 302 Moved Temporarily
>> > < Server: Apache-Coyote/1.1
>> > < Set-Cookie: JSESSIONID=
>> > CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
>> > < Date: Wed, 16 Nov 2011 12:16:15 GMT
>> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
>> > < Pragma: no-cache
>> > < Cache-Control: no-cache, no-store
>> > < Location: http://localhost/?1
>> > < Content-Length: 0
>> > <
>> > * Connection #0 to host localhost left intact
>> > * Closing connection #0
>> >
>> > thomas@willo ~
>> > $ curl -v http://localhost?1 
>> > * About to connect() to localhost port 80 (#0)
>> > *   Trying 127.0.0.1... connected
>> > * Connected to localhost (127.0.0.1) port 80 (#0)
>> >> GET /?1 HTTP/1.1
>> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k
>> > zlib/1.2.3
>> >> Host: localhost
>> >> Accept: */*
>> >>
>> > < HTTP/1.1 302 Moved Temporarily
>> > < Server: Apache-Coyote/1.1
>> > < Date: Wed, 16 Nov 2011 12:16:21 GMT
>> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
>> > < Pragma: no-cache
>> > < Cache-Control: no-cache, no-store
>> > < Location: http://localhost/.
>> > < Content-Length: 0
>> > <
>> > * Connection #0 to host localhost left intact
>> > * Closing connection #0
>> 

pagemap problem ??

2011-11-16 Thread klyver
Hi,

we have a critical problem. Some of our users get access to other users
data.

We don't understand why it happens. Occasionally, when we render a panel it
shows data that belongs to another user.
Here is a boiled down example of a panel in our application.

public class TestPanel extends Panel {
   private static final Logger logger =
LoggerFactory.getLogger(TestPanel.class);

   private String cachedEmployeeName;

   public TestPanel() {
   super("testPanel");
   String employeeName = ((TestSession) getSession()).getEmployeeName();
   cachedEmployeeName = employeeName;
   add(new Label("heading", "Heading for " + employeeName));
   }

   // onBeforeRender is only used for debugging purposes
   @Override
   protected void onBeforeRender() {
   super.onBeforeRender();
   String employeeName = ((TestSession) getSession()).getEmployeeName();

   if (!cachedEmployeeName.equals(employeeName)) {
   logger.error(String.format("ERROR!! cached[%s] <> session[%s]",
cachedEmployeeName, employeeName));
   }
   }
}

Occasionally, when a user hits the browser back button, he sees a wrong
'employeeName'. When the wrong name is shown, the error log tells us that
the CachedEmployeeName is wrong. 

We have found out that ((TestSession) getSession()).getEmployeeName() always
returns the correct value. (We know this from other log statements including
the sessionId - they are not shown in this example)

We thought we could be sure that a panel instance belongs to the session,
which is also true at least 99% of the time in our application. Have we
misunderstood something here?


For info:
- We have not been able to reproduce the problem in development, but we see
it from time to time in production
- We use wicket 1.4.18
- We use CryptedUrlWebRequestCodingStrategy
- It turns out that the wrong CachedEmployeeName is always the name of a
user who have had logged in earlier that day (and also from the same IP
address, but not the same machine).  

Any ideas why we are experiencing this.

Thanks
/Klyver


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/pagemap-problem-tp4076410p4076410.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: pagemap problem ??

2011-11-16 Thread Martin Grigorov
Hi,

On Wed, Nov 16, 2011 at 4:11 PM, klyver  wrote:
> Hi,
>
> we have a critical problem. Some of our users get access to other users
> data.
>
> We don't understand why it happens. Occasionally, when we render a panel it
> shows data that belongs to another user.
> Here is a boiled down example of a panel in our application.
>
> public class TestPanel extends Panel {
>   private static final Logger logger =
> LoggerFactory.getLogger(TestPanel.class);
>
>   private String cachedEmployeeName;
>
>   public TestPanel() {
>       super("testPanel");
>       String employeeName = ((TestSession) getSession()).getEmployeeName();
>       cachedEmployeeName = employeeName;
>       add(new Label("heading", "Heading for " + employeeName));
>   }
>
>   // onBeforeRender is only used for debugging purposes
>   @Override
>   protected void onBeforeRender() {
>       super.onBeforeRender();
>       String employeeName = ((TestSession) getSession()).getEmployeeName();
>
>       if (!cachedEmployeeName.equals(employeeName)) {
>           logger.error(String.format("ERROR!! cached[%s] <> session[%s]",
> cachedEmployeeName, employeeName));
>       }
>   }
> }
>
> Occasionally, when a user hits the browser back button, he sees a wrong
> 'employeeName'. When the wrong name is shown, the error log tells us that
> the CachedEmployeeName is wrong.
>
> We have found out that ((TestSession) getSession()).getEmployeeName() always
> returns the correct value. (We know this from other log statements including
> the sessionId - they are not shown in this example)
>
> We thought we could be sure that a panel instance belongs to the session,
> which is also true at least 99% of the time in our application. Have we
> misunderstood something here?

100% correct. Each Session has access to its pages, i.e. the components inside.

No idea what goes wrong.
Wicket had similar problem in its early 1.4.x versions but no one
complained with something similar since then.
>
>
> For info:
> - We have not been able to reproduce the problem in development, but we see
> it from time to time in production
> - We use wicket 1.4.18
> - We use CryptedUrlWebRequestCodingStrategy
> - It turns out that the wrong CachedEmployeeName is always the name of a
> user who have had logged in earlier that day (and also from the same IP
> address, but not the same machine).
>
> Any ideas why we are experiencing this.
>
> Thanks
> /Klyver
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/pagemap-problem-tp4076410p4076410.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: integrating CDI into Wicket

2011-11-16 Thread Peter Ertl
> - why we don't use jsr330 @javax.inject.Inject since both Spring and
> Guice support it. With CDI I think javax.enterprise.inject.Inject is used 
> which is yet another …

I would not try to support @javax.inject.Inject which means using the lowest 
common denominator of all these injection technologies.

We still could but then it would be the second-best choice...

For instance @javax.inject.Inject does not support optional injection like 
guice @Inject(optional=true) does. Or @SpringBean(required=true). Or control if 
we want to create a proxy for the injected bean or not, and so on...

I would favor the usage of one common wicket-specific(!) injection annotation 
(e.g. @WicketInject ) so we can add options to it which might be implemented 
differently depending on the framework (guice/spring/cdi).

So swapping one technologie for another will not affect the code of your wicket 
application (except the initialization part).

my 2%

Cheers
Peter

Am 16.11.2011 um 10:20 schrieb Martin Grigorov:

> speaking of moving it to Apache..
> 
> currently we have some inconsistencies between Spring and Guice
> integrations and users ask from time to time :
> - why we don't use jsr330 @javax.inject.Inject since both Spring and
> Guice support it. With CDI I think javax.enterprise.inject.Inject is
> used which is yet another ...
> - is it possible to not proxy the injected object (we have a ticket
> with patch for Spring for that but not for Guice)
> 
> now with CDI I see more:
> - why Injector.get().inject(me) doesn't work ?
> --- because it needs BeanManager, but since it is reachable from
> ServletContext then it should be OK
> --- because it needs the class - OK, use me.getClass() for that
> - why Spring/Guice doesn't support @PostConstruct ?
> 
> So my question is: should we try to make them consistent with each
> other or we should provide minimal integration and give the user the
> possibility to use the full power of his favorite DI framework ?
> 
> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
> wrote:
>> sure
>> 
>> -igor
>> 
>> On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
>> martijn.dasho...@gmail.com> wrote:
>> 
>>> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
>>> wrote:
 if you want to learn how to use CDI with Wicket i just wrote a short blog
 about it:
 
 https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>>> 
>>> Can we use it for the documentation of the CDI project (when we
>>> migrate it to apache)?
>>> 
>>> Martijn
>>> 
>>> --
>>> Become a Wicket expert, learn from the best: http://wicketinaction.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
> 


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



Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Jablow, Eric R
First, let me thank Igor Vaynberg for being so responsive updating the 
net.ftlines.wicket-bean-validation
 project.

I still have one final problem configuring it. I have a test that checks that 
setting a field to a value that violates an @Size constraint should fail 
validation. I get the following stacktrace:

codeMustBeAtMost4Chars(com.example.wicket.components.classification.CategoryPanelTest)
  Time elapsed: 0.344 sec  <<< ERROR!
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface 
org.apache.wicket.markup.html.form.IFormSubmitListener targeted at 
[ValidationForm [Component id = form]] on component [ValidationForm [Component 
id = form]] threw an exception
  at 
org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:270)
  at 
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
  at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
  at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
  at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
  at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  at 
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
  at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
  at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
  at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:626)
  at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:546)
  at 
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:518)
  at 
org.apache.wicket.util.tester.BaseWicketTester.submitForm(BaseWicketTester.java:1900)
  at org.apache.wicket.util.tester.FormTester.submit(FormTester.java:755)
  at 
com.example.wicket.components.classification.CategoryPanelTest.codeMustBeAtMost4Chars(CategoryPanelTest.java:81)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
  at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
  at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
  at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
  at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
  at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
  at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
  at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
  at 
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
  at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
  at 
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
  at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at 
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
  at 
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
Caused by: java.lang.reflect.InvocationTargetException
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at 
sun.reflect.DelegatingMethodAccessorImpl.i

Re: Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Martin Grigorov
Hi,

Looking at the stacktrace I think you should add this line to Wicket's
resource bundle.
Just add it to YourApplication.properties and it should be fine.

On Wed, Nov 16, 2011 at 5:12 PM, Jablow, Eric R  wrote:
> First, let me thank Igor Vaynberg for being so responsive updating the 
> net.ftlines.wicket-bean-validation
>  project.
>
> I still have one final problem configuring it. I have a test that checks that 
> setting a field to a value that violates an @Size constraint should fail 
> validation. I get the following stacktrace:
>
> codeMustBeAtMost4Chars(com.example.wicket.components.classification.CategoryPanelTest)
>   Time elapsed: 0.344 sec  <<< ERROR!
> org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface 
> org.apache.wicket.markup.html.form.IFormSubmitListener targeted at 
> [ValidationForm [Component id = form]] on component [ValidationForm 
> [Component id = form]] threw an exception
>      at 
> org.apache.wicket.RequestListenerInterface.internalInvoke(RequestListenerInterface.java:270)
>      at 
> org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:216)
>      at 
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.invokeListener(ListenerInterfaceRequestHandler.java:248)
>      at 
> org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:234)
>      at 
> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
>      at 
> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
>      at 
> org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
>      at 
> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
>      at 
> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
>      at 
> org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:626)
>      at 
> org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:546)
>      at 
> org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:518)
>      at 
> org.apache.wicket.util.tester.BaseWicketTester.submitForm(BaseWicketTester.java:1900)
>      at org.apache.wicket.util.tester.FormTester.submit(FormTester.java:755)
>      at 
> com.example.wicket.components.classification.CategoryPanelTest.codeMustBeAtMost4Chars(CategoryPanelTest.java:81)
>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>      at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>      at java.lang.reflect.Method.invoke(Method.java:597)
>      at 
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
>      at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
>      at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
>      at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
>      at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
>      at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
>      at 
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
>      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
>      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
>      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
>      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
>      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
>      at 
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
>      at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
>      at 
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
>      at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
>      at 
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
>      at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
>      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>      at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>      at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>      at java.lang.reflect.Method.invoke(Method.java:597)
>      at 
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
>      at

RE: Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Jablow, Eric R
From: Martin Grigorov [mailto:mgrigo...@apache.org] 

>Hi,

>Looking at the stacktrace I think you should add this line to Wicket's 
>resource bundle. Just add it to YourApplication.properties and it should be 
>fine.

That must be it. The library project tries to get its validation messages via 
the standard Wicket mechanisms. This does not know about the Hibernate 
Validator's scheme.  So, I'' copy my custom messages and the ones from the 
Hibernate validator jar into the application properties file.  I hope 
WicketTester can figure it out.

Respectfully,
Eric Jablow

This communication, along with any attachments, is covered by federal and state 
law governing electronic communications and may contain company proprietary and 
legally privileged information.  If the reader of this message is not the 
intended recipient, you are hereby notified that any dissemination, 
distribution, use or copying of this message is strictly prohibited.  If you 
have received this in error, please reply immediately to the sender and delete 
this message.  Thank you.


Re: EOFException(java.net.SocketException: Connection reset by peer: socket write error)

2011-11-16 Thread yadav1776
Hi Martin

Thanks for reply.

But when I set content type of response
"*this.getRequestCycle().getOriginalResponse().setContentType("jpg");*"
then getImageData() function for *DynamicImageResource* class is not called.
So image on the page in not rendered.
I am using *NonCachingImage* class.

Thanks in advance.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/EOFException-java-net-SocketException-Connection-reset-by-peer-socket-write-error-tp4043286p4076778.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: Wizard finish button prevent double click

2011-11-16 Thread Jeffrey Schneller
Any additional thoughts on this.

I tried just putting an onclick on the button itself.  But it still
prevents the form from submitting.  If I remove the onclick then
everything works fine.  This should not be this hard.  The button is
defined below:




The showBusysign() javascript function is below.  And this does what I
expect it should.

 function showBusysign() {
$('#finishbtn').css('backgroundImage',
'url(images/button_disable.gif)');
$('#previousbtn').css('backgroundImage',
'url(images/button_disable.gif)');
$('#nextbtn').css('backgroundImage',
'url(images/button_disable.gif)');
$('#cancel').css('backgroundImage',
'url(images/button_disable.gif)');

$('#finishbtn').attr('disabled', 'disabled');
$('#previousbtn').attr('disabled', 'disabled');
$('#nextbtn').attr('disabled', 'disabled');
$('#cancel').attr('disabled', 'disabled');
 }




-Original Message-
From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com] 
Sent: Tuesday, November 15, 2011 6:41 PM
To: users@wicket.apache.org
Subject: RE: Wizard finish button prevent double click

I have.  I even added a breakpoint in my onFinish code to be sure that
it was getting there.

I do the bind to the click event in the document onReady.  It definitely
fires the jquery but the onFinish code is never executed.



-Original Message-
From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
Sent: Tuesday, November 15, 2011 6:34 PM
To: users@wicket.apache.org
Subject: Re: Wizard finish button prevent double click

with jquery have you tried saying $(button).attr("disabled", "disabled")
?

-igor

On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller <
jeffrey.schnel...@envisa.com> wrote:

> I was using version 1.4.3 and recently updated to 1.4.19.  I am trying

> to prevent the double click of the Finish button causing a double 
> submit on the finish step of a wizard.
>
>
>
> Was this resolved between version 1.4.3 and 1.4.19?  Hopefully it was.
> If not...
>
>
>
> There was mention of this in the following thread:
> http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click
> -w ithout-breaking-Form-setDefaultButton-td3018140.html
>
>
>
> The proposed solution of adding a Boolean flag to form itself is a bit

> confusing.  How do you go about doing this.  Do you add a Boolean 
> field to the model that backs the form that is initially set to false 
> and then when the onFinish() method fires the field is checked and 
> only continue if false and then set it to true.  How does this prevent

> the double submit from occurring?
>
>
>
> Is there a way to disable the button visually?  In the Apache Wicket 
> Cookbook (btw, great book) there is the section on blocking until an 
> Ajax request is complete but the default wizard doesn't appear to be 
> ajax enabled.
>
>
>
> If I could bind a click event to the button via jquery that disables 
> the buttons and then continues with the wizard submit, that would be
ideal.
> I can get the jquery bind to occur but the wizard is never submitted 
> to the onFinish() method. It is like jquery prevents the wicket 
> javascript from firing.
>
>
>
> Thanks.
>
>
>
>

-
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: jsessionid not appended for stateful pages

2011-11-16 Thread thomas willomitzer
Martin,

Upgrading to 1.5.2 and using tomcat 7.0.22 fixed my issue - now I get

> Location: https://localhost/.;jsessionid=176D66D946CA33F54798F8EE1863C475

Thanks
Thomas

On Wed, Nov 16, 2011 at 3:09 PM, Martin Grigorov wrote:

> On Wed, Nov 16, 2011 at 4:02 PM, thomas willomitzer  wrote:
> > Hi Martin,
> >
> > Sorry for the confusion I meant that i've seen
> > org.apache.wicket.util.string.Strings.stripJSessionId(uri) being called
> for
> > ResourceReferences to Javascript and Css.
>
> This is used to check whether a given resource is already contributed or
> not.
>
> >
> > I'm using wicket 1.5.1 and tomcat 6.0.33.
>
> Try with Wicket 1.5.3. I remember a ticket about such problems with
> the home page without filter path.
> We have a workaround in Wicket but I remember Tomcat also fixed it in
> 7.x, not sure about 6.x.
>
> >
> > You're right - I've traced from
> >
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
> > and it seems like there is a problem with "?1" and
> > org.apache.catalina.connector.toEncoded(String url, String sessionId).
> >
> > In toEncoded(String url, String sessionId) when url = "?1" it seems that
> > the parameter is NOT appended since variable path is of length zero and
> if(
> > sb.length() > 0 ) is false. (in order to see a value of "?1" i set a
> > breakpoint in ServletWebResponse.sendRedirect followed by a breakpoint in
> > toEncoded)
> >
> > Since it seems to work for the rest of the world I guess I'm doing
> > something wrong ...
> >
> >protected String toEncoded(String url, String sessionId) {
> >
> >if ((url == null) || (sessionId == null))
> >return (url);
> >
> >String path = url;
> >String query = "";
> >String anchor = "";
> >int question = url.indexOf('?');
> >if (question >= 0) {
> >path = url.substring(0, question);
> >query = url.substring(question);
> >}
> >int pound = path.indexOf('#');
> >if (pound >= 0) {
> >anchor = path.substring(pound);
> >path = path.substring(0, pound);
> >}
> >StringBuffer sb = new StringBuffer(path);
> >if( sb.length() > 0 ) { // jsessionid can't be first.
> >sb.append(";");
> >sb.append(Globals.SESSION_PARAMETER_NAME);
> >sb.append("=");
> >sb.append(sessionId);
> >}
> >sb.append(anchor);
> >sb.append(query);
> >return (sb.toString());
> >
> >}
> >
> >
> > Thanks
> > Thomas
> >
> >
> > On Wed, Nov 16, 2011 at 1:39 PM, Martin Grigorov  >wrote:
> >
> >> Hi,
> >>
> >> On Wed, Nov 16, 2011 at 2:29 PM, thomas willomitzer
> >>  wrote:
> >> > Dear all,
> >> >
> >> > I've spent quite a bit of time tracking down a problem I'm having
> using
> >> > wicket and stateful pages.
> >> > I've enabled the jsessionid url rewriting in tomcat (by simply using
> the
> >> > default settings) but I get a redirect url without the jsessionid.
> >> >
> >> > I've traced into tomcat's Response.encodeUrl and saw that the
> jsessionid
> >> is
> >> > in fact appended (but later removed for in page references by wicket -
> >> > that's fine).
> >>
> >> What do you mean by that ? Where Wicket removes the jsessionid from the
> >> url ?
> >> Before issuing a redirect Wicket calls
> >> javax.servlet.http.HttpServletResponse.encodeRedirectURL(String) which
> >> is responsible to put jsessionid if cookies are disabled.
> >> See
> >>
> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
> >>
> >> The application I work on works without cookies and all if fine. (Wicket
> >> 1.5.3)
> >>
> >> >
> >> > What am I doing wrong and am I right in the assumption that wicket
> should
> >> > work without cookies?
> >> >
> >> > When using curl I first get a redirect to ?1, then to /. and then a
> 404
> >> >
> >> > $ curl -v http://localhost
> >> > * About to connect() to localhost port 80 (#0)
> >> > *   Trying 127.0.0.1... connected
> >> > * Connected to localhost (127.0.0.1) port 80 (#0)
> >> >> GET / HTTP/1.1
> >> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1
> OpenSSL/0.9.8k
> >> > zlib/1.2.3
> >> >> Host: localhost
> >> >> Accept: */*
> >> >>
> >> > < HTTP/1.1 302 Moved Temporarily
> >> > < Server: Apache-Coyote/1.1
> >> > < Set-Cookie: JSESSIONID=
> >> > CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
> >> > < Date: Wed, 16 Nov 2011 12:16:15 GMT
> >> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
> >> > < Pragma: no-cache
> >> > < Cache-Control: no-cache, no-store
> >> > < Location: http://localhost/?1
> >> > < Content-Length: 0
> >> > <
> >> > * Connection #0 to host localhost left intact
> >> > * Closing connection #0
> >> >
> >> > thomas@willo ~
> >> > $ curl -v http://localhost?1 
> >> > * About to connect() to localhost port 80 (#0)
> >> > *   Trying 127.0.0.1... connected
> >> > * Connected to localhost (127.0.0.1) port 80 (#0)
> >> >> GET /?1 HTTP/1.1
>

Re: jsessionid not appended for stateful pages

2011-11-16 Thread thomas willomitzer
Sorry ... wicket 1.5.3

On Wed, Nov 16, 2011 at 5:11 PM, thomas willomitzer  wrote:

> Martin,
>
> Upgrading to 1.5.2 and using tomcat 7.0.22 fixed my issue - now I get
>
> > Location:
> https://localhost/.;jsessionid=176D66D946CA33F54798F8EE1863C475
>
> Thanks
> Thomas
>
>
> On Wed, Nov 16, 2011 at 3:09 PM, Martin Grigorov wrote:
>
>> On Wed, Nov 16, 2011 at 4:02 PM, thomas willomitzer 
>> wrote:
>> > Hi Martin,
>> >
>> > Sorry for the confusion I meant that i've seen
>> > org.apache.wicket.util.string.Strings.stripJSessionId(uri) being called
>> for
>> > ResourceReferences to Javascript and Css.
>>
>> This is used to check whether a given resource is already contributed or
>> not.
>>
>> >
>> > I'm using wicket 1.5.1 and tomcat 6.0.33.
>>
>> Try with Wicket 1.5.3. I remember a ticket about such problems with
>> the home page without filter path.
>> We have a workaround in Wicket but I remember Tomcat also fixed it in
>> 7.x, not sure about 6.x.
>>
>> >
>> > You're right - I've traced from
>> >
>> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
>> > and it seems like there is a problem with "?1" and
>> > org.apache.catalina.connector.toEncoded(String url, String sessionId).
>> >
>> > In toEncoded(String url, String sessionId) when url = "?1" it seems that
>> > the parameter is NOT appended since variable path is of length zero and
>> if(
>> > sb.length() > 0 ) is false. (in order to see a value of "?1" i set a
>> > breakpoint in ServletWebResponse.sendRedirect followed by a breakpoint
>> in
>> > toEncoded)
>> >
>> > Since it seems to work for the rest of the world I guess I'm doing
>> > something wrong ...
>> >
>> >protected String toEncoded(String url, String sessionId) {
>> >
>> >if ((url == null) || (sessionId == null))
>> >return (url);
>> >
>> >String path = url;
>> >String query = "";
>> >String anchor = "";
>> >int question = url.indexOf('?');
>> >if (question >= 0) {
>> >path = url.substring(0, question);
>> >query = url.substring(question);
>> >}
>> >int pound = path.indexOf('#');
>> >if (pound >= 0) {
>> >anchor = path.substring(pound);
>> >path = path.substring(0, pound);
>> >}
>> >StringBuffer sb = new StringBuffer(path);
>> >if( sb.length() > 0 ) { // jsessionid can't be first.
>> >sb.append(";");
>> >sb.append(Globals.SESSION_PARAMETER_NAME);
>> >sb.append("=");
>> >sb.append(sessionId);
>> >}
>> >sb.append(anchor);
>> >sb.append(query);
>> >return (sb.toString());
>> >
>> >}
>> >
>> >
>> > Thanks
>> > Thomas
>> >
>> >
>> > On Wed, Nov 16, 2011 at 1:39 PM, Martin Grigorov > >wrote:
>> >
>> >> Hi,
>> >>
>> >> On Wed, Nov 16, 2011 at 2:29 PM, thomas willomitzer
>> >>  wrote:
>> >> > Dear all,
>> >> >
>> >> > I've spent quite a bit of time tracking down a problem I'm having
>> using
>> >> > wicket and stateful pages.
>> >> > I've enabled the jsessionid url rewriting in tomcat (by simply using
>> the
>> >> > default settings) but I get a redirect url without the jsessionid.
>> >> >
>> >> > I've traced into tomcat's Response.encodeUrl and saw that the
>> jsessionid
>> >> is
>> >> > in fact appended (but later removed for in page references by wicket
>> -
>> >> > that's fine).
>> >>
>> >> What do you mean by that ? Where Wicket removes the jsessionid from the
>> >> url ?
>> >> Before issuing a redirect Wicket calls
>> >> javax.servlet.http.HttpServletResponse.encodeRedirectURL(String) which
>> >> is responsible to put jsessionid if cookies are disabled.
>> >> See
>> >>
>> org.apache.wicket.protocol.http.servlet.ServletWebResponse.sendRedirect(String)
>> >>
>> >> The application I work on works without cookies and all if fine.
>> (Wicket
>> >> 1.5.3)
>> >>
>> >> >
>> >> > What am I doing wrong and am I right in the assumption that wicket
>> should
>> >> > work without cookies?
>> >> >
>> >> > When using curl I first get a redirect to ?1, then to /. and then a
>> 404
>> >> >
>> >> > $ curl -v http://localhost
>> >> > * About to connect() to localhost port 80 (#0)
>> >> > *   Trying 127.0.0.1... connected
>> >> > * Connected to localhost (127.0.0.1) port 80 (#0)
>> >> >> GET / HTTP/1.1
>> >> >> User-Agent: curl/7.21.1 (i686-pc-mingw32) libcurl/7.21.1
>> OpenSSL/0.9.8k
>> >> > zlib/1.2.3
>> >> >> Host: localhost
>> >> >> Accept: */*
>> >> >>
>> >> > < HTTP/1.1 302 Moved Temporarily
>> >> > < Server: Apache-Coyote/1.1
>> >> > < Set-Cookie: JSESSIONID=
>> >> > CA5649F5EA37AC7CDB2D5E06170923A1; Path=/
>> >> > < Date: Wed, 16 Nov 2011 12:16:15 GMT
>> >> > < Expires: Thu, 01 Jan 1970 00:00:00 GMT
>> >> > < Pragma: no-cache
>> >> > < Cache-Control: no-cache, no-store
>> >> > < Location: http://localhost/?1
>> >> > < Content-Length: 0
>> >> > <
>> >> > * Connection #0 to host localhost left intact
>> >> > * Closing connection #0
>> >> >
>

Re: Wizard finish button prevent double click

2011-11-16 Thread Martin Grigorov
Hi,

On Wed, Nov 16, 2011 at 5:50 PM, Jeffrey Schneller
 wrote:
> Any additional thoughts on this.
>
> I tried just putting an onclick on the button itself.  But it still
> prevents the form from submitting.  If I remove the onclick then
> everything works fine.  This should not be this hard.  The button is
> defined below:
>
>  onclick="showBusysign();return true;"> key=wizardFinishButton">
>
>
> The showBusysign() javascript function is below.  And this does what I
> expect it should.
>
>         function showBusysign() {
>                        $('#finishbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#previousbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#nextbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#cancel').css('backgroundImage',
> 'url(images/button_disable.gif)');
>
>                        $('#finishbtn').attr('disabled', 'disabled');
>                        $('#previousbtn').attr('disabled', 'disabled');
>                        $('#nextbtn').attr('disabled', 'disabled');
>                        $('#cancel').attr('disabled', 'disabled');

you can combine this selector into jQuery('#btn1,
#btn2').css(...).prop('disabled', 'disabled')

use prop() instead of attr() check their docs

>         }
>
>
>
>
> -Original Message-
> From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com]
> Sent: Tuesday, November 15, 2011 6:41 PM
> To: users@wicket.apache.org
> Subject: RE: Wizard finish button prevent double click
>
> I have.  I even added a breakpoint in my onFinish code to be sure that
> it was getting there.
>
> I do the bind to the click event in the document onReady.  It definitely
> fires the jquery but the onFinish code is never executed.
>
>
>
> -Original Message-
> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
> Sent: Tuesday, November 15, 2011 6:34 PM
> To: users@wicket.apache.org
> Subject: Re: Wizard finish button prevent double click
>
> with jquery have you tried saying $(button).attr("disabled", "disabled")
> ?
>
> -igor
>
> On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller <
> jeffrey.schnel...@envisa.com> wrote:
>
>> I was using version 1.4.3 and recently updated to 1.4.19.  I am trying
>
>> to prevent the double click of the Finish button causing a double
>> submit on the finish step of a wizard.
>>
>>
>>
>> Was this resolved between version 1.4.3 and 1.4.19?  Hopefully it was.
>> If not...
>>
>>
>>
>> There was mention of this in the following thread:
>> http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-click
>> -w ithout-breaking-Form-setDefaultButton-td3018140.html
>>
>>
>>
>> The proposed solution of adding a Boolean flag to form itself is a bit
>
>> confusing.  How do you go about doing this.  Do you add a Boolean
>> field to the model that backs the form that is initially set to false
>> and then when the onFinish() method fires the field is checked and
>> only continue if false and then set it to true.  How does this prevent
>
>> the double submit from occurring?
>>
>>
>>
>> Is there a way to disable the button visually?  In the Apache Wicket
>> Cookbook (btw, great book) there is the section on blocking until an
>> Ajax request is complete but the default wizard doesn't appear to be
>> ajax enabled.
>>
>>
>>
>> If I could bind a click event to the button via jquery that disables
>> the buttons and then continues with the wizard submit, that would be
> ideal.
>> I can get the jquery bind to occur but the wizard is never submitted
>> to the onFinish() method. It is like jquery prevents the wicket
>> javascript from firing.
>>
>>
>>
>> Thanks.
>>
>>
>>
>>
>
> -
> 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
>
>



-- 
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: Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Jablow, Eric R


From: Martin Grigorov [mailto:mgrigo...@apache.org] 
>Hi,

>Looking at the stacktrace I think you should add this line to Wicket's 
>resource bundle. Just add it to YourApplication.properties and it should be 
>fine.

I'm a lot closer to fine, now. However, I think I've exposed a usability 
problem with the net.ftlines.wicket-bean-validation project. I put  the 
Hibernate validation properties into the WicketTester's application in the test 
class (since it does not recognize the properties from the surrounding web 
project):

@BeforeClass
public static void initValidation() {
conf = new ValidationConfiguration();
}

@Before
public void initTester() {
tester = new WicketTester();
WebApplication application = tester.getApplication();
List stringResourceLoaders = 
application.getResourceSettings().getStringResourceLoaders();
// My custom messages from a project this depends on.
stringResourceLoaders.add(new 
BundleStringResourceLoader("ValidationMessages"));
// The messages from the Hibernate Validator jar.
stringResourceLoaders.add(new 
BundleStringResourceLoader("org.hibernate.validator.ValidationMessages"));
conf.configure(application);
tester.startPanel(NCategoryTestPanel.class);
formTester = tester.newFormTester("form");
}

When this validates a field that violates an @Size(min=3, max=4) annotation, 
the message that comes out is:
size must be between {min} and {max}

The Hibernate validator running on its own interpolates the values of min and 
max from the annotation, and it would give the error message.
size must be between 3 and 4
I'm verified that in testing of the POJOs and their HibernateValidator. I do 
have to suggest that the messages somehow be obtained from the Hibernate 
Validator framework, and not from pure Wicket. Also, the validator can be 
driven either by annotations or by an XML file, and so one cannot depend on the 
annotations to actually exist.

Respectfully,
Eric Jablow

This communication, along with any attachments, is covered by federal and state 
law governing electronic communications and may contain company proprietary and 
legally privileged information.  If the reader of this message is not the 
intended recipient, you are hereby notified that any dissemination, 
distribution, use or copying of this message is strictly prohibited.  If you 
have received this in error, please reply immediately to the sender and delete 
this message.  Thank you.


Re: wicket-cdi NotSerializableException for injected SLSB proxy

2011-11-16 Thread Igor Vaynberg
looks like a weld/glassfish bug, especially since other kinds of proxies
(even for application-scoped objects) are serializable.

-igor

On Wed, Nov 16, 2011 at 12:52 AM, Phill  wrote:

> I'm using the wicket-cdi module (https://github.com/42Lines/wicket-cdi)
> to inject an SLSB with Glassfish 3.1.1
>
> MyWebApplication.init()
>
> BeanManager  manager = (BeanManager) ic.lookup("java:comp/BeanManager");
> new CdiConfiguration(manager)
>.setPropagation(ConversationPropagation.NONBOOKMARKABLE)
>.configure(this);
>
> public class DashboardPage extends AuthorisedBasePage {
>@Inject
>private AccountingService accountingService;
> …
> }
>
> Injection is working fine and I can use the session bean but Wicket is
> unable to serialize the proxy.
> According to my research previous issues with the Weld proxy not being
> serializable should have been resolved in the version that shipped with GF
> 3.1.
> I've also tried the latest GF 3.1.2 promoted build which uses Weld 1.1.3
> and I get the same problem.
>
> I'm not really sure if this is a Wicket issue or whether I should be
> taking it up with the Weld team.. any pointers appreciated.
>
>
> 2011-11-16 09:05:17,201 [http-thread-pool-8181(4)] ERROR
> org.apache.wicket.serialize.java.JavaSerializer - Error serializing object
> class uk.co.leadseeker.webapp.user.DashboardPage [object=[Page class =
> uk.co.leadseeker.webapp.user.DashboardPage, id = 3, render count = 1]]
> java.io.NotSerializableException:
> com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeUnshared(ObjectOutputStream.java:397)
> ~[na:1.6.0_29]
>at
> org.jboss.weld.bean.proxy.util.SerializableProxy.writeObject(SerializableProxy.java:92)
> ~[weld-osgi-bundle.jar:20110404-1554]
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.6.0_29]
>at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> ~[na:1.6.0_29]
>at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> ~[na:1.6.0_29]
>at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_29]
>at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:945)
> ~[na:1.6.0_29]
>at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1469)

Re: Exception Handling in 1.5

2011-11-16 Thread Nelson Segura
Great. Thanks for your help.

On Mon, Nov 14, 2011 at 7:06 PM, Igor Vaynberg  wrote:
> application.getrequestcyclelisteners().add(new abstractrequestcyclelistener() 
> {
>  irequsthandler onexception(e) {
>       Throwable cause = e;
>       if (cause instanceof WicketRuntimeException) {
>           cause = cause.getCause();
>       }
>
>       if (cause instanceof InvocationTargetException) {
>           cause = cause.getCause();
>       }
>
>       if (cause instanceof WicketResourceGoneException
>               || cause instanceof ResourceGoneException) {
>           return new renderpagerequesthandler(new
> ResourceGonePage((WicketResourceGoneException)cause));
>       }
>
>       if (cause instanceof ResourceNotFoundException) {
>           return new renderpagerequesthandler(new
> NotFoundPage((ResourceNotFoundException)cause));
>       }
> });
>
> -igor
>
> On Mon, Nov 14, 2011 at 3:34 PM, Nelson Segura  wrote:
>> Hello,
>> I am starting to migrate from 1.4 to 1.5.
>> I am having problems trying to figure out exactly what is the best way
>> to do the following.
>>
>> I have some custom exception and some custom pages for when the code
>> throws those exception. In 1.4 this seemed trivial. For example
>>
>>
>> ..
>>
>> public class MyRequestLifecycle extends WebRequestCycle {
>>
>>    public MyRequestLifecycle(org.apache.wicket.protocol.http.WebApplication
>> application,
>>                                         WebRequest request,
>>                                         Response response) {
>>        super(application, request, response);
>>    }
>>
>>    @Override
>>    public Page onRuntimeException(Page page, RuntimeException e) {
>>        Throwable cause = e;
>>        if (cause instanceof WicketRuntimeException) {
>>            cause = cause.getCause();
>>        }
>>
>>        if (cause instanceof InvocationTargetException) {
>>            cause = cause.getCause();
>>        }
>>
>>        if (cause instanceof WicketResourceGoneException
>>                || cause instanceof ResourceGoneException) {
>>            return new ResourceGonePage((WicketResourceGoneException)cause);
>>        }
>>
>>        if (cause instanceof ResourceNotFoundException) {
>>            return new NotFoundPage((ResourceNotFoundException)cause);
>>        }
>>        return super.onRuntimeException(page, e);
>>    }
>>
>> }
>>
>>
>> But I can't figure out a clean / easy way to do this in 1.5. I seems
>> that I need to write a lot of code to accomplish this.
>>
>> I am looking at the following links:
>>
>> https://cwiki.apache.org/WICKET/migration-to-wicket-15.html
>> https://cwiki.apache.org/WICKET/requestcycle-in-wicket-15.html
>>
>> Problems are:
>> - Which class should I be extend or implementing.
>> AbstractRequestCycleListener? IExceptionMapper? IRequestHandler?
>> - How do I get access to the current page?
>> If I return a IRequestHandler, how do I create one. Do I need to
>> create one? Can I use the current one? do I need to worry if this is
>> part of an AjaxRequest? I have looked at code in
>> AbstractRequestCycleListener, SystemMapper, CompoundRequestMapper,
>> DefaultExceptionMapper, etc. It all seems too low level compared to
>> other Wicket APIs, that makes me think I am missing something.
>>
>> What should I do?
>>
>> -Nelson
>>
>> -
>> 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: Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 6:23 PM, Jablow, Eric R  wrote:
>
>
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
>>Hi,
>
>>Looking at the stacktrace I think you should add this line to Wicket's 
>>resource bundle. Just add it to YourApplication.properties and it should be 
>>fine.
>
> I'm a lot closer to fine, now. However, I think I've exposed a usability 
> problem with the net.ftlines.wicket-bean-validation project. I put  the 
> Hibernate validation properties into the WicketTester's application in the 
> test class (since it does not recognize the properties from the surrounding 
> web project):
>
> @BeforeClass
> public static void initValidation() {
>        conf = new ValidationConfiguration();
> }
>
> @Before
> public void initTester() {
>        tester = new WicketTester();
>        WebApplication application = tester.getApplication();
>        List stringResourceLoaders = 
> application.getResourceSettings().getStringResourceLoaders();
>        // My custom messages from a project this depends on.
>        stringResourceLoaders.add(new 
> BundleStringResourceLoader("ValidationMessages"));
>        // The messages from the Hibernate Validator jar.
>        stringResourceLoaders.add(new 
> BundleStringResourceLoader("org.hibernate.validator.ValidationMessages"));
>        conf.configure(application);
>        tester.startPanel(NCategoryTestPanel.class);
>        formTester = tester.newFormTester("form");
> }
>
> When this validates a field that violates an @Size(min=3, max=4) annotation, 
> the message that comes out is:
>        size must be between {min} and {max}
>
> The Hibernate validator running on its own interpolates the values of min and 
> max from the annotation, and it would give the error message.
>        size must be between 3 and 4
> I'm verified that in testing of the POJOs and their HibernateValidator. I do 
> have to suggest that the messages somehow be obtained from the Hibernate 
> Validator framework, and not from pure Wicket. Also, the validator can be 
> driven either by annotations or by an XML file, and so one cannot depend on 
> the annotations to actually exist.

Do HibernateValidator provide bundles for all languages ?
I doubt.
Loading those from YourApplication.properties,
YourApplication_xx_YY.properties will be much easier for you.
I guess you can add xx_YY locale by creating your own
org/hibernate/validator/ValidationMessages_xx_YY.properties
but even then if you want to use xml based properties it will become
nasty with \u0123 escapes ...

>
> Respectfully,
> Eric Jablow
>
> This communication, along with any attachments, is covered by federal and 
> state law governing electronic communications and may contain company 
> proprietary and legally privileged information.  If the reader of this 
> message is not the intended recipient, you are hereby notified that any 
> dissemination, distribution, use or copying of this message is strictly 
> prohibited.  If you have received this in error, please reply immediately to 
> the sender and delete this message.  Thank you.
>



-- 
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



wicket 302 redirect loop

2011-11-16 Thread thomas willomitzer
Dear All,

I've managed to get the jsessionid appended correctly when requesting a
page without cookies enabled (wicket 1.5.3, tomcat 7.0.22).

I get
curl -v --insecure https://localhost/ -> Location: https://localhost/?1
curl -v --insecure https://localhost/?1 -> Location:
https://localhost/.;jsessionid=D62D2D693854214C847E7A75439909A3
curl -v --insecure
https://localhost/.;jsessionid=D62D2D693854214C847E7A75439909A3 -> HTTP 404

change URL (erasing ".") to
curl -v --insecure
https://localhost/;jsessionid=D62D2D693854214C847E7A75439909A3 -> Location:
https://localhost/?1

When trying in a browser I get the warning that it's a redirect loop.

Can somebody please point me to what I'm doing wrong here?

Many Thanks
Thomas


Re: integrating CDI into Wicket

2011-11-16 Thread Igor Vaynberg
using @javax.inject.Inject is perfectly fine. the rest (required, dont
proxy, blah) can be done using qualifier annotations

@javax.inject.Inject @org.apache.wicket.ioc.Dependency(required=true,
proxy=false)

-igor


On Wed, Nov 16, 2011 at 6:36 AM, Peter Ertl  wrote:

> > - why we don't use jsr330 @javax.inject.Inject since both Spring and
> > Guice support it. With CDI I think javax.enterprise.inject.Inject is
> used which is yet another …
>
> I would not try to support @javax.inject.Inject which means using the
> lowest common denominator of all these injection technologies.
>
> We still could but then it would be the second-best choice...
>
> For instance @javax.inject.Inject does not support optional injection like
> guice @Inject(optional=true) does. Or @SpringBean(required=true). Or
> control if we want to create a proxy for the injected bean or not, and so
> on...
>
> I would favor the usage of one common wicket-specific(!) injection
> annotation (e.g. @WicketInject ) so we can add options to it which might be
> implemented differently depending on the framework (guice/spring/cdi).
>
> So swapping one technologie for another will not affect the code of your
> wicket application (except the initialization part).
>
> my 2%
>
> Cheers
> Peter
>
> Am 16.11.2011 um 10:20 schrieb Martin Grigorov:
>
> > speaking of moving it to Apache..
> >
> > currently we have some inconsistencies between Spring and Guice
> > integrations and users ask from time to time :
> > - why we don't use jsr330 @javax.inject.Inject since both Spring and
> > Guice support it. With CDI I think javax.enterprise.inject.Inject is
> > used which is yet another ...
> > - is it possible to not proxy the injected object (we have a ticket
> > with patch for Spring for that but not for Guice)
> >
> > now with CDI I see more:
> > - why Injector.get().inject(me) doesn't work ?
> > --- because it needs BeanManager, but since it is reachable from
> > ServletContext then it should be OK
> > --- because it needs the class - OK, use me.getClass() for that
> > - why Spring/Guice doesn't support @PostConstruct ?
> >
> > So my question is: should we try to make them consistent with each
> > other or we should provide minimal integration and give the user the
> > possibility to use the full power of his favorite DI framework ?
> >
> > On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg 
> wrote:
> >> sure
> >>
> >> -igor
> >>
> >> On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
> >> martijn.dasho...@gmail.com> wrote:
> >>
> >>> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg <
> igor.vaynb...@gmail.com>
> >>> wrote:
>  if you want to learn how to use CDI with Wicket i just wrote a short
> blog
>  about it:
> 
>  https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
> >>>
> >>> Can we use it for the documentation of the CDI project (when we
> >>> migrate it to apache)?
> >>>
> >>> Martijn
> >>>
> >>> --
> >>> Become a Wicket expert, learn from the best: http://wicketinaction.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
> >
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: NullPointerException in WicketTester

2011-11-16 Thread sudeivas
Thanks for the update. I add velocity.jar to my classpath. Now I am getting
PageExpiredException. 

org.apache.wicket.protocol.http.PageExpiredException: Page with id '0' has
expired.
at
org.apache.wicket.request.handler.PageProvider.getPageInstance(PageProvider.java:169)
at
org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider.get(BaseWicketTester.java:2578)
at
org.apache.wicket.util.tester.BaseWicketTester$LastPageRecordingPageRendererProvider.get(BaseWicketTester.java:2565)
at
org.apache.wicket.request.handler.RenderPageRequestHandler.respond(RenderPageRequestHandler.java:166)
at
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:750)
at
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
at
org.apache.wicket.request.cycle.RequestCycle.execute(RequestCycle.java:252)
at
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:209)
at
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:280)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:626)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:676)
at
org.apache.wicket.util.tester.BaseWicketTester.processRequest(BaseWicketTester.java:546)
at
org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:757)
at
org.apache.wicket.util.tester.BaseWicketTester.startPage(BaseWicketTester.java:773)
at xxxTest.Test(xxxTest.java:67)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Has anyone successfully written unit tests under 1.5.3? If yes, I could use
some documentation. 

I saw this jira - https://issues.apache.org/jira/browse/WICKET-4045 when I
did some research on this issue. 

Pls help to fix this. 

-Suresh



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-in-WicketTester-tp4073967p4076980.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: integrating CDI into Wicket

2011-11-16 Thread Igor Vaynberg
On Wed, Nov 16, 2011 at 1:20 AM, Martin Grigorov  wrote:
>
> speaking of moving it to Apache..
>
> currently we have some inconsistencies between Spring and Guice
> integrations and users ask from time to time :
> - why we don't use jsr330 @javax.inject.Inject since both Spring and
> Guice support it. With CDI I think javax.enterprise.inject.Inject is
> used which is yet another ...

cdi uses the standard javax.inject.Inject...not sure where you found
the enterprise.inject.Inject variation

> - is it possible to not proxy the injected object (we have a ticket
> with patch for Spring for that but not for Guice)

not as far as i know. proxying is part of the spec. im sure, if
needed, we can write the container-specific logic to unwrap the proxy,
but why would we want to? id like to see a good usecase first...

> now with CDI I see more:
> - why Injector.get().inject(me) doesn't work ?
> --- because it needs BeanManager, but since it is reachable from
> ServletContext then it should be OK
> --- because it needs the class - OK, use me.getClass() for that

it doesnt work because we use cdi-specific functionality to inject
noncontextual objects - not the framework provided by wicket-ioc such
as IFieldValueFactory, etc.

we can probably wire it in, but NonContextualManager in wicket-cdi
provides more then just inject(), it also has postConstruct() and
preDestroy()

https://github.com/42Lines/wicket-cdi/blob/master/wicket-cdi/src/main/java/net/ftlines/wicket/cdi/NonContextualManager.java

> - why Spring/Guice doesn't support @PostConstruct ?

guice does via an addon lib, not sure what spring's status is.

> So my question is: should we try to make them consistent with each
> other or we should provide minimal integration and give the user the
> possibility to use the full power of his favorite DI framework ?

we should provide minimal integration. we should not start normalizing
across containers, its a huge job that is worthy of its own project.

-igor

>
> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
> wrote:
> > sure
> >
> > -igor
> >
> > On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
> > martijn.dasho...@gmail.com> wrote:
> >
> >> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
> >> wrote:
> >> > if you want to learn how to use CDI with Wicket i just wrote a short blog
> >> > about it:
> >> >
> >> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
> >>
> >> Can we use it for the documentation of the CDI project (when we
> >> migrate it to apache)?
> >>
> >> Martijn
> >>
> >> --
> >> Become a Wicket expert, learn from the best: http://wicketinaction.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: integrating CDI into Wicket

2011-11-16 Thread Igor Vaynberg
On Wed, Nov 16, 2011 at 3:49 AM, James Carman
 wrote:
> The only thing "external" is the conversation management stuff from
> Seam, it looks like.  The user would have to make sure they include
> the container-specific "adapter" code on the classpath
> (org.jboss.seam.conversation:seam-conversation-weld for example) for
> their CDI container.

yes. this will go away once cdi 1.1 is release which provides the
conversation scope api

> Another concern would be the fact that they (JBoss) don't "publish"
> their artifacts to Maven central.  Aren't they (the managers of Maven
> central) frowning upon publishing artifacts up there that depend on
> artifacts published elsewhere?

yeah. this is really annoying. i tried to talk to them about it but
eventually got the good old "we dont have time for this , you go talk
to the sonatype folks for us". blah.

until seam is in central this will have to stay an outside module. and
until weld is in central the examples also have to be outside. i can
probably rewrite the examples using something that is in central, like
openbeans or whatever the apache thing is.

-igor

>
> On Wed, Nov 16, 2011 at 4:21 AM, Martin Grigorov  wrote:
>> one more question: is there anything Weld specific in wicket-cdi or it
>> should work with other CDI implementations too ?
>>
>> On Wed, Nov 16, 2011 at 11:20 AM, Martin Grigorov  
>> wrote:
>>> speaking of moving it to Apache..
>>>
>>> currently we have some inconsistencies between Spring and Guice
>>> integrations and users ask from time to time :
>>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>>> used which is yet another ...
>>> - is it possible to not proxy the injected object (we have a ticket
>>> with patch for Spring for that but not for Guice)
>>>
>>> now with CDI I see more:
>>> - why Injector.get().inject(me) doesn't work ?
>>> --- because it needs BeanManager, but since it is reachable from
>>> ServletContext then it should be OK
>>> --- because it needs the class - OK, use me.getClass() for that
>>> - why Spring/Guice doesn't support @PostConstruct ?
>>>
>>> So my question is: should we try to make them consistent with each
>>> other or we should provide minimal integration and give the user the
>>> possibility to use the full power of his favorite DI framework ?
>>>
>>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
>>> wrote:
 sure

 -igor

 On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
 martijn.dasho...@gmail.com> wrote:

> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
> wrote:
> > if you want to learn how to use CDI with Wicket i just wrote a short 
> > blog
> > about it:
> >
> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>
> Can we use it for the documentation of the CDI project (when we
> migrate it to apache)?
>
> Martijn
>
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.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
>>>
>>
>>
>>
>> --
>> 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
>
>

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



Re: integrating CDI into Wicket

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 6:45 PM, Igor Vaynberg  wrote:
> On Wed, Nov 16, 2011 at 1:20 AM, Martin Grigorov  wrote:
>>
>> speaking of moving it to Apache..
>>
>> currently we have some inconsistencies between Spring and Guice
>> integrations and users ask from time to time :
>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>> used which is yet another ...
>
> cdi uses the standard javax.inject.Inject...not sure where you found
> the enterprise.inject.Inject variation
>
>> - is it possible to not proxy the injected object (we have a ticket
>> with patch for Spring for that but not for Guice)
>
> not as far as i know. proxying is part of the spec. im sure, if
> needed, we can write the container-specific logic to unwrap the proxy,
> but why would we want to? id like to see a good usecase first...

there is an open ticket in our Jira
iirc it was about injecting a j.l.Class
close it :-)

>
>> now with CDI I see more:
>> - why Injector.get().inject(me) doesn't work ?
>> --- because it needs BeanManager, but since it is reachable from
>> ServletContext then it should be OK
>> --- because it needs the class - OK, use me.getClass() for that
>
> it doesnt work because we use cdi-specific functionality to inject
> noncontextual objects - not the framework provided by wicket-ioc such
> as IFieldValueFactory, etc.
>
> we can probably wire it in, but NonContextualManager in wicket-cdi
> provides more then just inject(), it also has postConstruct() and
> preDestroy()
>
> https://github.com/42Lines/wicket-cdi/blob/master/wicket-cdi/src/main/java/net/ftlines/wicket/cdi/NonContextualManager.java
>
>> - why Spring/Guice doesn't support @PostConstruct ?
>
> guice does via an addon lib, not sure what spring's status is.

Spring supports it too. Wicket-Spring doesn't do that for Wicket
components/behaviors

>
>> So my question is: should we try to make them consistent with each
>> other or we should provide minimal integration and give the user the
>> possibility to use the full power of his favorite DI framework ?
>
> we should provide minimal integration. we should not start normalizing
> across containers, its a huge job that is worthy of its own project.
>
> -igor
>
>>
>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg  
>> wrote:
>> > sure
>> >
>> > -igor
>> >
>> > On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
>> > martijn.dasho...@gmail.com> wrote:
>> >
>> >> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg 
>> >> wrote:
>> >> > if you want to learn how to use CDI with Wicket i just wrote a short 
>> >> > blog
>> >> > about it:
>> >> >
>> >> > https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
>> >>
>> >> Can we use it for the documentation of the CDI project (when we
>> >> migrate it to apache)?
>> >>
>> >> Martijn
>> >>
>> >> --
>> >> Become a Wicket expert, learn from the best: http://wicketinaction.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
>
>



-- 
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: integrating CDI into Wicket

2011-11-16 Thread Peter Ertl
+1 very nice, igor :-)

Am 16.11.2011 um 17:33 schrieb Igor Vaynberg:

> using @javax.inject.Inject is perfectly fine. the rest (required, dont
> proxy, blah) can be done using qualifier annotations
> 
> @javax.inject.Inject @org.apache.wicket.ioc.Dependency(required=true,
> proxy=false)
> 
> -igor
> 
> 
> On Wed, Nov 16, 2011 at 6:36 AM, Peter Ertl  wrote:
> 
>>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>> used which is yet another …
>> 
>> I would not try to support @javax.inject.Inject which means using the
>> lowest common denominator of all these injection technologies.
>> 
>> We still could but then it would be the second-best choice...
>> 
>> For instance @javax.inject.Inject does not support optional injection like
>> guice @Inject(optional=true) does. Or @SpringBean(required=true). Or
>> control if we want to create a proxy for the injected bean or not, and so
>> on...
>> 
>> I would favor the usage of one common wicket-specific(!) injection
>> annotation (e.g. @WicketInject ) so we can add options to it which might be
>> implemented differently depending on the framework (guice/spring/cdi).
>> 
>> So swapping one technologie for another will not affect the code of your
>> wicket application (except the initialization part).
>> 
>> my 2%
>> 
>> Cheers
>> Peter
>> 
>> Am 16.11.2011 um 10:20 schrieb Martin Grigorov:
>> 
>>> speaking of moving it to Apache..
>>> 
>>> currently we have some inconsistencies between Spring and Guice
>>> integrations and users ask from time to time :
>>> - why we don't use jsr330 @javax.inject.Inject since both Spring and
>>> Guice support it. With CDI I think javax.enterprise.inject.Inject is
>>> used which is yet another ...
>>> - is it possible to not proxy the injected object (we have a ticket
>>> with patch for Spring for that but not for Guice)
>>> 
>>> now with CDI I see more:
>>> - why Injector.get().inject(me) doesn't work ?
>>> --- because it needs BeanManager, but since it is reachable from
>>> ServletContext then it should be OK
>>> --- because it needs the class - OK, use me.getClass() for that
>>> - why Spring/Guice doesn't support @PostConstruct ?
>>> 
>>> So my question is: should we try to make them consistent with each
>>> other or we should provide minimal integration and give the user the
>>> possibility to use the full power of his favorite DI framework ?
>>> 
>>> On Wed, Nov 16, 2011 at 10:52 AM, Igor Vaynberg 
>> wrote:
 sure
 
 -igor
 
 On Wed, Nov 16, 2011 at 12:49 AM, Martijn Dashorst <
 martijn.dasho...@gmail.com> wrote:
 
> On Tue, Nov 15, 2011 at 7:00 PM, Igor Vaynberg <
>> igor.vaynb...@gmail.com>
> wrote:
>> if you want to learn how to use CDI with Wicket i just wrote a short
>> blog
>> about it:
>> 
>> https://www.42lines.net/2011/11/15/integrating-cdi-into-wicket/
> 
> Can we use it for the documentation of the CDI project (when we
> migrate it to apache)?
> 
> Martijn
> 
> --
> Become a Wicket expert, learn from the best: http://wicketinaction.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
>>> 
>> 
>> 
>> -
>> 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 302 redirect loop

2011-11-16 Thread Bertrand Guay-Paquet

Hi,

I had a redirect loop once because I added an override to 
Page#getPageParameters() by mistake. I wanted to use my method to 
generate a new PageParameters instance for a page but overriding the 
Page method gave your result.


It's worth a shot!

Regards,
Bertrand

On 16/11/2011 11:40 AM, thomas willomitzer wrote:

Dear All,

I've managed to get the jsessionid appended correctly when requesting a
page without cookies enabled (wicket 1.5.3, tomcat 7.0.22).

I get
curl -v --insecure https://localhost/ ->  Location: https://localhost/?1
curl -v --insecure https://localhost/?1 ->  Location:
https://localhost/.;jsessionid=D62D2D693854214C847E7A75439909A3
curl -v --insecure
https://localhost/.;jsessionid=D62D2D693854214C847E7A75439909A3 ->  HTTP 404

change URL (erasing ".") to
curl -v --insecure
https://localhost/;jsessionid=D62D2D693854214C847E7A75439909A3 ->  Location:
https://localhost/?1

When trying in a browser I get the warning that it's a redirect loop.

Can somebody please point me to what I'm doing wrong here?

Many Thanks
Thomas



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



Re: Dealing with 3 choice components

2011-11-16 Thread Andrea Del Bene

Hi,

can you elaborate a little bit more what behavior you want to achieve? I 
mean, C becomes empty because  A#onSelectionChanged sets its model to 
null. This should not be strange.


I have a form with with 3 choice components:

A) DropDownChoice
B) DropDownChoice
C) ListMultipleChoice

The values of B depend on selected value of A.
The values of C depend on selected values of A and B

I override the wantOnSelectionChangedNotifications() and 
onSelectionChanged() methods of A and B.


A#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
   super.onSelectionChanged(newSelection);
   SearchForm.this.getModelObject().setInstrument(null);
   SearchForm.this.getModelObject().setParams(null);
}

B#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
   super.onSelectionChanged(newSelection);
   SearchForm.this.getModelObject().setParams(null);
}

In A I set to null the model value of both B and C.
In B I set to null the model value only of B.

This code works only on the startup of the form. When I change the 
value in A the list of C become empty. I have to change the value of B 
to fill C.


How can I manage this?

A




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



Re: Configuration problem with net.ftlines.wicket-bean-validation

2011-11-16 Thread Igor Vaynberg
since we use wicket's localization to resolve errors (which allows you
to override them on component/page/foo) level we have to use wicket's
placeholder syntax which is ${key} instead of {key}. fix that in your
message and you will be fine.

-igor

On Wed, Nov 16, 2011 at 8:23 AM, Jablow, Eric R  wrote:
>
>
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
>>Hi,
>
>>Looking at the stacktrace I think you should add this line to Wicket's 
>>resource bundle. Just add it to YourApplication.properties and it should be 
>>fine.
>
> I'm a lot closer to fine, now. However, I think I've exposed a usability 
> problem with the net.ftlines.wicket-bean-validation project. I put  the 
> Hibernate validation properties into the WicketTester's application in the 
> test class (since it does not recognize the properties from the surrounding 
> web project):
>
> @BeforeClass
> public static void initValidation() {
>        conf = new ValidationConfiguration();
> }
>
> @Before
> public void initTester() {
>        tester = new WicketTester();
>        WebApplication application = tester.getApplication();
>        List stringResourceLoaders = 
> application.getResourceSettings().getStringResourceLoaders();
>        // My custom messages from a project this depends on.
>        stringResourceLoaders.add(new 
> BundleStringResourceLoader("ValidationMessages"));
>        // The messages from the Hibernate Validator jar.
>        stringResourceLoaders.add(new 
> BundleStringResourceLoader("org.hibernate.validator.ValidationMessages"));
>        conf.configure(application);
>        tester.startPanel(NCategoryTestPanel.class);
>        formTester = tester.newFormTester("form");
> }
>
> When this validates a field that violates an @Size(min=3, max=4) annotation, 
> the message that comes out is:
>        size must be between {min} and {max}
>
> The Hibernate validator running on its own interpolates the values of min and 
> max from the annotation, and it would give the error message.
>        size must be between 3 and 4
> I'm verified that in testing of the POJOs and their HibernateValidator. I do 
> have to suggest that the messages somehow be obtained from the Hibernate 
> Validator framework, and not from pure Wicket. Also, the validator can be 
> driven either by annotations or by an XML file, and so one cannot depend on 
> the annotations to actually exist.
>
> Respectfully,
> Eric Jablow
>
> This communication, along with any attachments, is covered by federal and 
> state law governing electronic communications and may contain company 
> proprietary and legally privileged information.  If the reader of this 
> message is not the intended recipient, you are hereby notified that any 
> dissemination, distribution, use or copying of this message is strictly 
> prohibited.  If you have received this in error, please reply immediately to 
> the sender and delete this message.  Thank you.
>

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



Re: Forum vs list question

2011-11-16 Thread Igor Vaynberg
posting from nabble was disabled because sometimes it would post the
same message ten times or start a new thread for a reply.

subscribing to the list is the best way.

-igor

On Wed, Nov 16, 2011 at 5:18 AM, Neill Rosenthal  wrote:
> Can someone please explain how I can participate in the User forum on
> Nabble without having to join the mailing list?
> Or if I do need to join, how can I avoid receiving all emails generated
> by the list?
>

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



Re: wicket 302 redirect loop

2011-11-16 Thread thomas willomitzer
Hi,

Thanks I checked but no getPageParameters() override ;)

Regards
Thomas

On Wed, Nov 16, 2011 at 6:04 PM, Bertrand Guay-Paquet <
ber...@step.polymtl.ca> wrote:

> Hi,
>
> I had a redirect loop once because I added an override to
> Page#getPageParameters() by mistake. I wanted to use my method to generate
> a new PageParameters instance for a page but overriding the Page method
> gave your result.
>
> It's worth a shot!
>
> Regards,
> Bertrand
>
>
> On 16/11/2011 11:40 AM, thomas willomitzer wrote:
>
>> Dear All,
>>
>> I've managed to get the jsessionid appended correctly when requesting a
>> page without cookies enabled (wicket 1.5.3, tomcat 7.0.22).
>>
>> I get
>> curl -v --insecure https://localhost/ ->  Location: https://localhost/?1
>> curl -v --insecure https://localhost/?1 ->  Location:
>> https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3
>> curl -v --insecure
>> https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3->
>>   HTTP 404
>>
>> change URL (erasing ".") to
>> curl -v --insecure
>> https://localhost/;jsessionid=**D62D2D693854214C847E7A75439909**A3->
>>   Location:
>> https://localhost/?1
>>
>> When trying in a browser I get the warning that it's a redirect loop.
>>
>> Can somebody please point me to what I'm doing wrong here?
>>
>> Many Thanks
>> Thomas
>>
>>
> --**--**-
> To unsubscribe, e-mail: 
> users-unsubscribe@wicket.**apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: NullPointerException in WicketTester

2011-11-16 Thread Igor Vaynberg
there are hundreds of tests in the wicket jar, and they work just fine...

-igor

On Wed, Nov 16, 2011 at 8:43 AM, sudeivas  wrote:
> Has anyone successfully written unit tests under 1.5.3? If yes, I could use
> some documentation.
>
> I saw this jira - https://issues.apache.org/jira/browse/WICKET-4045 when I
> did some research on this issue.
>
> Pls help to fix this.
>
> -Suresh

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



Help with AjaxLazyLoadPanel

2011-11-16 Thread heapifyman
Hello everyone,

I'm using an AjaxLazyLoadPanel in one of my pages to lazily load a
datatable where the data is read in from some files, which might take a
while. This is working fine so far.
However, I also need to provide functionality to clear the whole table and
read in the data from the files again. I would like to do that without
reloading the whole page, so I'm using an IndicatingAjaxButton for that.
Now when reloading the data for the table again, I get the nice spinning
Indicator next to the button but the table is still visible. I would like
to have the same visual effect as when the page is loaded and
the AjaxLazyLoadPanel shows the Indicator instead of the table and then
replaces it with the actual table once it's loaded.

How would I do that? Any hints would be appreciated.

Thanks.


Re: Dealing with 3 choice components

2011-11-16 Thread Alberto
On 11/16/2011 06:06 PM, Andrea Del Bene wrote:
> Hi,
>
> can you elaborate a little bit more what behavior you want to achieve?
> I mean, C becomes empty because  A#onSelectionChanged sets its model
> to null. This should not be strange.

Yes, sounds obvious to me too. But I found an examples with 2
dropdownchoice where in onSelectionChanged() of the first one is set to
null the model of the second one.
For two choices works well.
Maybe is a wrong pattern, but I not found anything useful.
Do you have other solutions?

A

>>
>> I have a form with with 3 choice components:
>>
>> A) DropDownChoice
>> B) DropDownChoice
>> C) ListMultipleChoice
>>
>> The values of B depend on selected value of A.
>> The values of C depend on selected values of A and B
>>
>> I override the wantOnSelectionChangedNotifications() and
>> onSelectionChanged() methods of A and B.
>>
>> A#onSelectionChanged
>> @Override
>> protected void onSelectionChanged(IntegerSelectChoice newSelection) {
>>super.onSelectionChanged(newSelection);
>>SearchForm.this.getModelObject().setInstrument(null);
>>SearchForm.this.getModelObject().setParams(null);
>> }
>>
>> B#onSelectionChanged
>> @Override
>> protected void onSelectionChanged(IntegerSelectChoice newSelection) {
>>super.onSelectionChanged(newSelection);
>>SearchForm.this.getModelObject().setParams(null);
>> }
>>
>> In A I set to null the model value of both B and C.
>> In B I set to null the model value only of B.
>>
>> This code works only on the startup of the form. When I change the
>> value in A the list of C become empty. I have to change the value of
>> B to fill C.
>>
>> How can I manage this?
>>
>> A
>>
>
>
> -
> 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: Migrating a ResourceStreamRequestTarget to a ResourceStreamRequestHandler (2)

2011-11-16 Thread hfriederichs
Hello,

Yes, I did, realizing that it's a bit of a coarse solution. As it happens,
my application main function is to execute scripts for automated deployment
on a WebSphere platform, so users work with a JEE-application they select
from a wicket Ajax-textfield with application build versions that's
connected with our Nexus repository (that at it's turn is populated with
Maven-builds by Hudson).
So, these users want to download builds, installation manuals, reports, and
the like for inspection and reference. As a result, /any/ download is
dynamically created at runtime, so there is no wish for caching, on the
contrary, and it's not to be expected that it will be.

Nevertheless, I will delve into the
org.apache.wicket.request.resource.AbstractResource.ResourceResponse#setCacheDuration,
because I like fitting solutions, and not over-sized ones: I tend to believe
that that is what you are hinting at in your reply.

I just have to figure out how the setCacheDuration can be applied to the
AbstractResourceStreams that I use.

Many thanks!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Migrating-a-ResourceStreamRequestTarget-to-a-ResourceStreamRequestHandler-2-tp4019661p4077423.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: wicket 302 redirect loop

2011-11-16 Thread Bertrand Guay-Paquet

I don't know of any other specific causes unfortunately...

Try setting a breakpoint in RequestCycle#onBeginRequest() and see what 
happens. Try your page constructor too since it might be closer to the 
source of the problem.


Good luck!
Bertrand

On 16/11/2011 12:21 PM, thomas willomitzer wrote:

Hi,

Thanks I checked but no getPageParameters() override ;)

Regards
Thomas

On Wed, Nov 16, 2011 at 6:04 PM, Bertrand Guay-Paquet<
ber...@step.polymtl.ca>  wrote:


Hi,

I had a redirect loop once because I added an override to
Page#getPageParameters() by mistake. I wanted to use my method to generate
a new PageParameters instance for a page but overriding the Page method
gave your result.

It's worth a shot!

Regards,
Bertrand


On 16/11/2011 11:40 AM, thomas willomitzer wrote:


Dear All,

I've managed to get the jsessionid appended correctly when requesting a
page without cookies enabled (wicket 1.5.3, tomcat 7.0.22).

I get
curl -v --insecure https://localhost/ ->   Location: https://localhost/?1
curl -v --insecure https://localhost/?1 ->   Location:
https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3
curl -v --insecure
https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3->
   HTTP 404

change URL (erasing ".") to
curl -v --insecure
https://localhost/;jsessionid=**D62D2D693854214C847E7A75439909**A3->
   Location:
https://localhost/?1

When trying in a browser I get the warning that it's a redirect loop.

Can somebody please point me to what I'm doing wrong here?

Many Thanks
Thomas



--**--**-
To unsubscribe, e-mail: 
users-unsubscribe@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



InMethod grid, Hidden Field in column does not get updated

2011-11-16 Thread Warren Bell
I have an Inmethod grid with a HiddenField in a panel in a column. This 
HiddenField does not get updated after a SubmitCancelColumn is clicked. All the 
other fields get updated correctly except for the HiddenField. There is also a 
TextField in the same panel as the HiddenField, the TextField gets updated 
correctly. Here is the column code, newPriceTextField gets updated correctly 
and oldNewPriceHiddenField does not get updated:

WicketColumnAdapter newPriceColumn = new 
WicketColumnAdapter("newPriceColumnAdapter", new 
org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn(new
 Model("New Price"), "newPrice"))
{


 @Override
 public Component newCell(WebMarkupContainer parent, String componentId, IModel 
rowModel)
 {
  final PriceChange priceChange = (PriceChange)rowModel.getObject();

  final TextField newPriceTextField = new TextField("newPrice", 
new PropertyModel(priceChange, "newPrice"), Double.class)
  final HiddenField oldNewPriceHiddenField = new 
HiddenField("oldNewPrice", new PropertyModel(priceChange, 
"oldNewPrice"), Double.class);

  CostNewPricePanel panel = new CostNewPricePanel(newPriceTextField, 
oldNewPriceHiddenField);
  return panel;
 }

};



Also, the "oldNewPrice" property of the oldNewPriceHiddenField does change 
after SubmitCancelColumn gets clicked.

What do I need to do to get the HiddenField to update correctly?

Thanks,

Warren Bell


-- 
This email was Virus checked by Clark's Nutrition's Astaro Security Gateway. 

The information contained in this e-mail is intended only for use of
the individual or entity named above. This e-mail, and any documents,
files, previous e-mails or other information attached to it, may contain
confidential information that is legally privileged. If you are not the
intended recipient of this e-mail, or the employee or agent responsible
for delivering it to the intended recipient, you are hereby notified
that any disclosure, dissemination, distribution, copying or other use
of this e-mail or any of the information contained in or attached to it
is strictly prohibited. If you have received this e-mail in error,
please immediately notify us by return e-mail or by telephone at
(951)321-1960, and destroy the original e-mail and its attachments
without reading or saving it in any manner. Thank you.



Re: wicket 302 redirect loop

2011-11-16 Thread Martin Grigorov
The best place to find out why it happens is
org.apache.wicket.request.handler.render.WebPageRenderer.respond(RequestCycle)
Just don't be scared to follow the code inside :-)

On Wed, Nov 16, 2011 at 8:57 PM, Bertrand Guay-Paquet
 wrote:
> I don't know of any other specific causes unfortunately...
>
> Try setting a breakpoint in RequestCycle#onBeginRequest() and see what
> happens. Try your page constructor too since it might be closer to the
> source of the problem.
>
> Good luck!
> Bertrand
>
> On 16/11/2011 12:21 PM, thomas willomitzer wrote:
>>
>> Hi,
>>
>> Thanks I checked but no getPageParameters() override ;)
>>
>> Regards
>> Thomas
>>
>> On Wed, Nov 16, 2011 at 6:04 PM, Bertrand Guay-Paquet<
>> ber...@step.polymtl.ca>  wrote:
>>
>>> Hi,
>>>
>>> I had a redirect loop once because I added an override to
>>> Page#getPageParameters() by mistake. I wanted to use my method to
>>> generate
>>> a new PageParameters instance for a page but overriding the Page method
>>> gave your result.
>>>
>>> It's worth a shot!
>>>
>>> Regards,
>>> Bertrand
>>>
>>>
>>> On 16/11/2011 11:40 AM, thomas willomitzer wrote:
>>>
 Dear All,

 I've managed to get the jsessionid appended correctly when requesting a
 page without cookies enabled (wicket 1.5.3, tomcat 7.0.22).

 I get
 curl -v --insecure https://localhost/ ->   Location:
 https://localhost/?1
 curl -v --insecure https://localhost/?1 ->   Location:

 https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3
 curl -v --insecure

 https://localhost/.;**jsessionid=**D62D2D693854214C847E7A75439909**A3->
   HTTP 404

 change URL (erasing ".") to
 curl -v --insecure

 https://localhost/;jsessionid=**D62D2D693854214C847E7A75439909**A3->
   Location:
 https://localhost/?1

 When trying in a browser I get the warning that it's a redirect loop.

 Can somebody please point me to what I'm doing wrong here?

 Many Thanks
 Thomas


>>> --**--**-
>>> To unsubscribe, e-mail:
>>> users-unsubscribe@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
>
>



-- 
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: integrating CDI into Wicket

2011-11-16 Thread James Carman
On Nov 16, 2011 11:49 AM, "Igor Vaynberg"  wrote:
>
> On Wed, Nov 16, 2011 at 3:49 AM, James Carman
>  wrote:
> > The only thing "external" is the conversation management stuff from
> > Seam, it looks like.  The user would have to make sure they include
> > the container-specific "adapter" code on the classpath
> > (org.jboss.seam.conversation:seam-conversation-weld for example) for
> > their CDI container.
>
> yes. this will go away once cdi 1.1 is release which provides the
> conversation scope api
>

This will be great!  Do they have an eta?  For now I'll write my own
abstraction similar to your CdiContainer


RE: Wizard finish button prevent double click

2011-11-16 Thread Jeffrey Schneller
Problem has been solved.  The finish button needs to remain enabled for the 
wizard to submit to the onFinish() method.  So I was not able to mark the 
finish button as disabled.  The javascript/jquery that I had was correct.

To resolve the problem I just hide the finish button once it is pressed and 
show an image of the finish button it's disabled state.



-Original Message-
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Wednesday, November 16, 2011 11:15 AM
To: users@wicket.apache.org
Subject: Re: Wizard finish button prevent double click

Hi,

On Wed, Nov 16, 2011 at 5:50 PM, Jeffrey Schneller 
 wrote:
> Any additional thoughts on this.
>
> I tried just putting an onclick on the button itself.  But it still 
> prevents the form from submitting.  If I remove the onclick then 
> everything works fine.  This should not be this hard.  The button is 
> defined below:
>
>  onclick="showBusysign();return true;"> key=wizardFinishButton">
>
>
> The showBusysign() javascript function is below.  And this does what I 
> expect it should.
>
>         function showBusysign() {
>                        $('#finishbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#previousbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#nextbtn').css('backgroundImage',
> 'url(images/button_disable.gif)');
>                        $('#cancel').css('backgroundImage',
> 'url(images/button_disable.gif)');
>
>                        $('#finishbtn').attr('disabled', 'disabled');
>                        $('#previousbtn').attr('disabled', 'disabled');
>                        $('#nextbtn').attr('disabled', 'disabled');
>                        $('#cancel').attr('disabled', 'disabled');

you can combine this selector into jQuery('#btn1, 
#btn2').css(...).prop('disabled', 'disabled')

use prop() instead of attr() check their docs

>         }
>
>
>
>
> -Original Message-
> From: Jeffrey Schneller [mailto:jeffrey.schnel...@envisa.com]
> Sent: Tuesday, November 15, 2011 6:41 PM
> To: users@wicket.apache.org
> Subject: RE: Wizard finish button prevent double click
>
> I have.  I even added a breakpoint in my onFinish code to be sure that 
> it was getting there.
>
> I do the bind to the click event in the document onReady.  It 
> definitely fires the jquery but the onFinish code is never executed.
>
>
>
> -Original Message-
> From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com]
> Sent: Tuesday, November 15, 2011 6:34 PM
> To: users@wicket.apache.org
> Subject: Re: Wizard finish button prevent double click
>
> with jquery have you tried saying $(button).attr("disabled", 
> "disabled") ?
>
> -igor
>
> On Tue, Nov 15, 2011 at 3:29 PM, Jeffrey Schneller < 
> jeffrey.schnel...@envisa.com> wrote:
>
>> I was using version 1.4.3 and recently updated to 1.4.19.  I am 
>> trying
>
>> to prevent the double click of the Finish button causing a double 
>> submit on the finish step of a wizard.
>>
>>
>>
>> Was this resolved between version 1.4.3 and 1.4.19?  Hopefully it was.
>> If not...
>>
>>
>>
>> There was mention of this in the following thread:
>> http://apache-wicket.1842946.n4.nabble.com/Disable-button-double-clic
>> k -w ithout-breaking-Form-setDefaultButton-td3018140.html
>>
>>
>>
>> The proposed solution of adding a Boolean flag to form itself is a 
>> bit
>
>> confusing.  How do you go about doing this.  Do you add a Boolean 
>> field to the model that backs the form that is initially set to false 
>> and then when the onFinish() method fires the field is checked and 
>> only continue if false and then set it to true.  How does this 
>> prevent
>
>> the double submit from occurring?
>>
>>
>>
>> Is there a way to disable the button visually?  In the Apache Wicket 
>> Cookbook (btw, great book) there is the section on blocking until an 
>> Ajax request is complete but the default wizard doesn't appear to be 
>> ajax enabled.
>>
>>
>>
>> If I could bind a click event to the button via jquery that disables 
>> the buttons and then continues with the wizard submit, that would be
> ideal.
>> I can get the jquery bind to occur but the wizard is never submitted 
>> to the onFinish() method. It is like jquery prevents the wicket 
>> javascript from firing.
>>
>>
>>
>> Thanks.
>>
>>
>>
>>
>
> -
> 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
>
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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

Re: integrating CDI into Wicket

2011-11-16 Thread Igor Vaynberg
why would you write your own when one is already there?

-igor

On Wed, Nov 16, 2011 at 12:37 PM, James Carman
 wrote:
> On Nov 16, 2011 11:49 AM, "Igor Vaynberg"  wrote:
>>
>> On Wed, Nov 16, 2011 at 3:49 AM, James Carman
>>  wrote:
>> > The only thing "external" is the conversation management stuff from
>> > Seam, it looks like.  The user would have to make sure they include
>> > the container-specific "adapter" code on the classpath
>> > (org.jboss.seam.conversation:seam-conversation-weld for example) for
>> > their CDI container.
>>
>> yes. this will go away once cdi 1.1 is release which provides the
>> conversation scope api
>>
>
> This will be great!  Do they have an eta?  For now I'll write my own
> abstraction similar to your CdiContainer
>

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



Re: Dealing with 3 choice components

2011-11-16 Thread Andrea Del Bene
Are you referring to the example from book "Apache-Wicket-Cookbook", 
page n°34? If so, how do you populate the list of C? Maybe you should 
not set to null B model when you change value in A.

If you can try to give an example of values from A,B and C.


On 11/16/2011 07:33 PM, Alberto wrote:

On 11/16/2011 06:06 PM, Andrea Del Bene wrote:

Hi,

can you elaborate a little bit more what behavior you want to achieve?
I mean, C becomes empty because  A#onSelectionChanged sets its model
to null. This should not be strange.

Yes, sounds obvious to me too. But I found an examples with 2
dropdownchoice where in onSelectionChanged() of the first one is set to
null the model of the second one.
For two choices works well.
Maybe is a wrong pattern, but I not found anything useful.
Do you have other solutions?

A


I have a form with with 3 choice components:

A) DropDownChoice
B) DropDownChoice
C) ListMultipleChoice

The values of B depend on selected value of A.
The values of C depend on selected values of A and B

I override the wantOnSelectionChangedNotifications() and
onSelectionChanged() methods of A and B.

A#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
super.onSelectionChanged(newSelection);
SearchForm.this.getModelObject().setInstrument(null);
SearchForm.this.getModelObject().setParams(null);
}

B#onSelectionChanged
@Override
protected void onSelectionChanged(IntegerSelectChoice newSelection) {
super.onSelectionChanged(newSelection);
SearchForm.this.getModelObject().setParams(null);
}

In A I set to null the model value of both B and C.
In B I set to null the model value only of B.

This code works only on the startup of the form. When I change the
value in A the list of C become empty. I have to change the value of
B to fill C.
http://www.corriere.it/index.shtml?refresh_ce
How can I manage this?

A



-
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: integrating CDI into Wicket

2011-11-16 Thread James Carman
That's just how I roll!  :)  it's a learning exercise for me.  I started a
cdi integration project long ago and it got lost in the shuffle
On Nov 16, 2011 3:42 PM, "Igor Vaynberg"  wrote:

> why would you write your own when one is already there?
>
> -igor
>
> On Wed, Nov 16, 2011 at 12:37 PM, James Carman
>  wrote:
> > On Nov 16, 2011 11:49 AM, "Igor Vaynberg" 
> wrote:
> >>
> >> On Wed, Nov 16, 2011 at 3:49 AM, James Carman
> >>  wrote:
> >> > The only thing "external" is the conversation management stuff from
> >> > Seam, it looks like.  The user would have to make sure they include
> >> > the container-specific "adapter" code on the classpath
> >> > (org.jboss.seam.conversation:seam-conversation-weld for example) for
> >> > their CDI container.
> >>
> >> yes. this will go away once cdi 1.1 is release which provides the
> >> conversation scope api
> >>
> >
> > This will be great!  Do they have an eta?  For now I'll write my own
> > abstraction similar to your CdiContainer
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: NullPointerException in WicketTester

2011-11-16 Thread sudeivas
Finally got the issue resolved. I removed the dependency on wicket-velocity
and also I was using some mock libraries. Removed everything and tried a
simple test case and it worked. 

Thanks
Suresh

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/NullPointerException-in-WicketTester-tp4073967p4078074.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



wicket 1.5.3 problems with cookies

2011-11-16 Thread kamiseq
hej,
it seems that wicket is not storing cookies :/.

im adding TEST cookie with

final Cookie cookie = new Cookie(name, value);
cookie.setMaxAge(Integer.MAX_VALUE);
((WebResponse)getResponse()).addCookie(cookie);

and reading it on different page

final List cookies = ((WebRequest) getRequest()).getCookies();
Cookie result = null;
for (Cookie cookie : cookies)
{
final String name = cookie.getName();
log.fine("checking cookie name="+ name);
if (name.equals(cookieName))
result = cookie;
}
return result;

but only
checking cookie name=JSESSIONID is logged

this is very odd :/ any ideas?

pozdrawiam
Paweł Kamiński

kami...@gmail.com
pkaminski@gmail.com
__


Re: wicket 1.5.3 problems with cookies

2011-11-16 Thread Martin Grigorov
See CookieUtils helper class
and make sure that you don't use ResetResponseException or any of its
specializations like RestartResponseException

On Thu, Nov 17, 2011 at 1:52 AM, kamiseq  wrote:
> hej,
> it seems that wicket is not storing cookies :/.
>
> im adding TEST cookie with
>
> final Cookie cookie = new Cookie(name, value);
> cookie.setMaxAge(Integer.MAX_VALUE);
> ((WebResponse)getResponse()).addCookie(cookie);
>
> and reading it on different page
>
> final List cookies = ((WebRequest) getRequest()).getCookies();
> Cookie result = null;
> for (Cookie cookie : cookies)
> {
>    final String name = cookie.getName();
>    log.fine("checking cookie name="+ name);
>    if (name.equals(cookieName))
>        result = cookie;
> }
> return result;
>
> but only
> checking cookie name=JSESSIONID is logged
>
> this is very odd :/ any ideas?
>
> pozdrawiam
> Paweł Kamiński
>
> kami...@gmail.com
> pkaminski@gmail.com
> __
>



-- 
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: wicket 1.5.3 problems with cookies

2011-11-16 Thread Dirk Forchel
Why is it important not to use RestartResponseException? In Wicket 1.4 it was
the preferred way to redirect to another (error) page e.g. in case of a
missing resource during construction time of a page.

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-3-problems-with-cookies-tp4078351p4079137.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: wicket 1.5.3 problems with cookies

2011-11-16 Thread Martin Grigorov
On Thu, Nov 17, 2011 at 8:54 AM, Dirk Forchel  wrote:
> Why is it important not to use RestartResponseException? In Wicket 1.4 it was
> the preferred way to redirect to another (error) page e.g. in case of a
> missing resource during construction time of a page.

1) response.addCookie(cookie)
2) reset the response
3) no cookies in this response anymore

I'm not saying to not use RestartResponseException at all. I'm just
saying that it will lose any headers you set to the current response
so far.

>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/wicket-1-5-3-problems-with-cookies-tp4078351p4079137.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: EOFException(java.net.SocketException: Connection reset by peer: socket write error)

2011-11-16 Thread Wilhelmsen Tor Iver
> "*this.getRequestCycle().getOriginalResponse().setContentType("jpg");*"

Looks wrong, typically the content type is a MIME content type, which has two 
components, e.g. "image/jpeg"

- Tor Iver

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



Re: EOFException(java.net.SocketException: Connection reset by peer: socket write error)

2011-11-16 Thread Martin Grigorov
On Wed, Nov 16, 2011 at 10:47 AM, Martin Grigorov  wrote:
> Hi,
>
> I have seen such problems with Internet Explorer.
> If the delivered image mime type is not correct (i.e. the response
> header says "image/gif" but the image is actually a GIF) then IE

Sorry.
I meant if the content type says "image/gif" but the actual type is
image/png or image/jpeg or ...
I.e. if the header is incorrect then IE aborts the request before
reading the whole response and starts a new request that ignores the
header

> aborts the load of the image and starts a new one.
> The first abort causes such "Connection reset by peer" exceptions at the 
> server
>
> On Tue, Nov 15, 2011 at 5:13 PM, yadav1776  wrote:
>> Hi
>>
>> I am getting "EOFException(java.net.SocketException: Connection reset by
>> peer: socket write error)" exception while returning byte[] from
>> getImageData() function of DynamicImageResource class in onBeforeRender()
>> function of component.
>>
>> Stack trace is as below.
>>
>> org.apache.wicket.WicketRuntimeException: Unable to write the response
>>        at org.apache.wicket.Response.handleException(Response.java:286)
>>        at org.apache.wicket.Response.write(Response.java:310)
>>        at
>> org.apache.wicket.request.target.resource.ResourceStreamRequestTarget.respond(ResourceStreamRequestTarget.java:160)
>>        at
>> org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
>>        at org.apache.wicket.RequestCycle.respond(RequestCycle.java:1269)
>>        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1336)
>>        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1438)
>>        at org.apache.wicket.RequestCycle.request(RequestCycle.java:546)
>>        at
>> org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
>>        at
>> org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>        at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>>        at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:830)
>>        at
>> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
>>        at
>> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>>        at
>> org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:821)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:344)
>>        at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:110)
>>        at
>> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:98)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:95)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:79)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:55)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:36)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:188)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:106)
>>        at
>> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:356)
>>        at
>> org.springframework.