image inside wicket:link tag

2009-10-02 Thread Gatos
Hello,

wicket:link
  a href=ApplicationPage.htmlimg src=img/id.gif / ID/a
 /wicket:link

When I click the link then image is shown. For some reason src=img/id.gif
interpretates as a link.
How to solve the problem?
Wicket 1.4.1

Thank you


Re: image inside wicket:link tag

2009-10-02 Thread Gatos
I see it's a new feature in 1.4.x. Maybe I could fix it? :-/

On Fri, Oct 2, 2009 at 9:44 AM, Gatos ega...@gmail.com wrote:

 Hello,

 wicket:link
   a href=ApplicationPage.htmlimg src=img/id.gif / ID/a
  /wicket:link

 When I click the link then image is shown. For some reason src=img/id.gif
 interpretates as a link.
 How to solve the problem?
 Wicket 1.4.1

 Thank you



Re: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Ernesto Reinaldo Barreiro
Never done it myself, and don't know if it is a better way to do it, but:
protected IConverterLocator
{
return new ConverterLocator();
}

can be overriden to return your own converter locator and... plug there a
default converter (for Strings?) that will trim strings...

If you want to do this for a particular kind of component, e.g. textareas,
another possibility would be to use a component instantiation listener and
wrap the component model with a trimming model, e.g.

import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

public class TrimmingModel extends ModelString {

private static final long serialVersionUID = 1L;
 private IModelString model;

public TrimmingModel(IModelString model) {
this.model = model;
}
 @Override
public void setObject(String object) {
if(object != null)
this.model.setObject(object.trim());
this.model.setObject(object);
}
 @Override
public String getObject() {
return this.model.getObject();
}
}

Best,

Ernesto

On Fri, Oct 2, 2009 at 5:24 AM, David Chang david_q_zh...@yahoo.com wrote:

 How to set it up in a Wicket application? I would like to set it up in the
 application level.

 Thanks!




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




Re: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Marat Radchenko
It already does that.
FormComponent:

protected T convertValue(String[] value) throws ConversionException
{
return (T)(value != null  value.length  0  value[0] != null ?
trim(value[0]) : null);
}

2009/10/2 David Chang david_q_zh...@yahoo.com

 How to set it up in a Wicket application? I would like to set it up in the
 application level.

 Thanks!




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




InvalidUrlException - how to show 404 page

2009-10-02 Thread Thomas Singer
As I have reported a couple of weeks ago (but can't find the message any
more for a follow-up), Wicket shows an ugly internal-error page if one
somehow modified the stateful URLs, e.g.

http://localhost:8080/?wicket:interface=:8

Following exception is logged:

 org.apache.wicket.protocol.http.request.InvalidUrlException: 
 org.apache.wicket.WicketRuntimeException: Internal error parsing 
 wicket:interface = :6
   at 
 org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
   at org.apache.wicket.Request.getRequestParameters(Request.java:172)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
   at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
   at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

How to configure Wicket to show the configured 404-page instead?

Tom



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



Re: image inside wicket:link tag

2009-10-02 Thread Bert
Hi,

perhaps i just not understand the problem. but the img tag is within
the a tag, so the image
should be part of the link? i 'm not sure i under stand the meaning of:
 'When I click the link then image is shown'

regards


On Fri, Oct 2, 2009 at 09:49, Gatos ega...@gmail.com wrote:
 I see it's a new feature in 1.4.x. Maybe I could fix it? :-/

 On Fri, Oct 2, 2009 at 9:44 AM, Gatos ega...@gmail.com wrote:

 Hello,

 wicket:link
   a href=ApplicationPage.htmlimg src=img/id.gif / ID/a
  /wicket:link

 When I click the link then image is shown. For some reason src=img/id.gif
 interpretates as a link.
 How to solve the problem?
 Wicket 1.4.1

 Thank you



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



Re: InvalidUrlException - how to show 404 page

2009-10-02 Thread Linda van der Pal
I haven't tried such a thing yet, but the last chapter of Wicket in 
Action describes how to do such things.


Here's the example they give for responding with different error pages 
for specific errors.


public class CheesrRequestCycle extends WebRequestCycle {
   public CheesrRequestCycle(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 OutOfCheeseException) {
   return new CheesrErrorPage();
   }
   return super.onRuntimeException(page, e);
   }
}

Regards,
Linda

Thomas Singer wrote:

As I have reported a couple of weeks ago (but can't find the message any
more for a follow-up), Wicket shows an ugly internal-error page if one
somehow modified the stateful URLs, e.g.

http://localhost:8080/?wicket:interface=:8

Following exception is logged:

  

org.apache.wicket.protocol.http.request.InvalidUrlException: 
org.apache.wicket.WicketRuntimeException: Internal error parsing 
wicket:interface = :6
at 
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
at org.apache.wicket.Request.getRequestParameters(Request.java:172)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)



How to configure Wicket to show the configured 404-page instead?

Tom



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




No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.420 / Virus Database: 270.14.2/2408 - Release Date: 10/01/09 18:23:00


  



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



Re: InvalidUrlException - how to show 404 page

2009-10-02 Thread Alex Objelean

Or you can update the settings in your Application class:

getApplicationSettings().setInternalErrorPage(HomePage.class);

Alex Objelean


Thomas Singer-4 wrote:
 
 As I have reported a couple of weeks ago (but can't find the message any
 more for a follow-up), Wicket shows an ugly internal-error page if one
 somehow modified the stateful URLs, e.g.
 
 http://localhost:8080/?wicket:interface=:8
 
 Following exception is logged:
 
 org.apache.wicket.protocol.http.request.InvalidUrlException:
 org.apache.wicket.WicketRuntimeException: Internal error parsing
 wicket:interface = :6
  at
 org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
  at org.apache.wicket.Request.getRequestParameters(Request.java:172)
  at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
  at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
  at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
  at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
  at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
  at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
  at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 
 How to configure Wicket to show the configured 404-page instead?
 
 Tom
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/InvalidUrlException---how-to-show-404-page-tp25712108p25712450.html
Sent from the Wicket - User 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: InvalidUrlException - how to show 404 page

2009-10-02 Thread Jonas
I think it should be possible to have the webserver deliver the standard
404 page by throwing AbortWithWebErrorCodeException

You can hook in at WebRequestCycleProcessor#respond(RuntimeException
e, RequestCycle requestCycle)
and throw the mentioned exception. Works find just like this in our webapp

cheers,
Jonas


On Fri, Oct 2, 2009 at 10:22 AM, Thomas Singer wic...@regnis.de wrote:
 As I have reported a couple of weeks ago (but can't find the message any
 more for a follow-up), Wicket shows an ugly internal-error page if one
 somehow modified the stateful URLs, e.g.

 http://localhost:8080/?wicket:interface=:8

 Following exception is logged:

 org.apache.wicket.protocol.http.request.InvalidUrlException: 
 org.apache.wicket.WicketRuntimeException: Internal error parsing 
 wicket:interface = :6
       at 
 org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
       at org.apache.wicket.Request.getRequestParameters(Request.java:172)
       at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
       at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
       at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
       at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
       at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
       at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
       at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

 How to configure Wicket to show the configured 404-page instead?

 Tom



 -
 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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Bernhard Michal
Afaik there is no way to set this behavior by some flag. But

1) You can extend TextField to wrap it's model with model which on
getObject() trim (ie. remove begging and trailing spaces) returning
string if Model's type is Sting (in other cases it doesn't make
sense)... when value is setted into model trimming is done by wicket
(see FormComponent#shouldTrimInput) automatically (in older version you
have to do this manually by overriding FormComponent#convertInput()
method)

2) you can do aspect (AspectJ?) to do the same as 1) - with aspect there
is no need to make new class of TextField's type so there is no need to
change the code base...

3) you can override implementation of coverters

override Application#newConverterLocator() to

protected IConverterLocator newConverterLocator() {
ConverterLocator locator = new ConverterLocator();
locator.set(String.class, new IConverter() {

   public Object convertToObject(String value,
Locale locale) {
return convertToString(value,
locale);
}

public String convertToString(Object value,
Locale locale) {
return value.toString().trim();
// see trim() which remove trailing and beginning spaces
}
 });

return locator;
}

I didn't test it but you've got the idea... But this solution is really
bad, because if you want to turn off this behaviour (trimming) in some
cases
you can't do it without overriding for example Component#getConverter()
to convert it in default way and it's a mess.

I recommend you to trim it by hand on Model level (make some wrapper
model to do it so) or on tier (layer) where you obtain data (data acces
layer? service level?). It depends on if spaces have some business
meaning. If yes do it on model level otherwise on that layer.

Best wishes

MB

-Original Message-
From: David Chang [mailto:david_q_zh...@yahoo.com] 
Sent: Friday, October 02, 2009 5:25 AM
To: users@wicket.apache.org
Subject: Can Wicket automatically remove beginning and trailing spaces
in a text field?

How to set it up in a Wicket application? I would like to set it up in
the application level.

Thanks!


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



Re: urls with localization

2009-10-02 Thread ivilis vytautas.civi...@gmail.com
Hi, Alex.

Could you repost LocaleUrlCodingStrategyDecorator to pastebin, as it has
been expired?

Thanks!

Vytautas

Alex Objelean wrote:
 RequestDecorator is nothing but a decorator implementation of Request
 class...
 [CODE]
 public class RequestDecorator
   extends Request {
   /**
* Decorated request.
*/
   private final Request request;
 
 
   /**
* Constructor.
*
* @param request to decorate.
*/
   public RequestDecorator(final Request request) {
 if (request == null) {
   throw new IllegalArgumentException(Decorated Request cannot be
 NULL!);
 }
 this.request = request;
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public Locale getLocale() {
 return request.getLocale();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getParameter(final String key) {
 return request.getParameter(key);
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public MapString, String[] getParameterMap() {
 return request.getParameterMap();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String[] getParameters(final String key) {
 return request.getParameters(key);
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getPath() {
 return request.getPath();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getQueryString() {
 return request.getQueryString();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToContextRoot() {
 return request.getRelativePathPrefixToContextRoot();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToWicketHandler() {
 return request.getRelativePathPrefixToWicketHandler();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getURL() {
 return request.getURL();
   }
 }
 [/CODE]
 
 
 Gatos wrote:
 I'm using wicket 1.3.5 and RequestDecorator could not be found.

 On Mon, Jul 27, 2009 at 1:05 PM, Alex Objelean
 alex_objel...@yahoo.comwrote:


 There is another thread where I have posted a link with implementation
 (which is currently in production)... so, you can just reuse it:

 http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330

 Alex Objelean


 Gatos wrote:
 Hello,

 How is it possible to use such urls in wicket?
 If users clicks that link then appropriate page with defined locale
 will
 be
 shown.
 www.domain.com/uk/home
 www.domain.com/nl/home

 Thank you


 --
 View this message in context:
 http://www.nabble.com/urls-with-localization-tp24676709p24677616.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



 

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



inMethod DataGrid initial selection

2009-10-02 Thread Swanthe Lindgren
Does anybody know how to get a row initially selected when the grid is 
first drawn?


//Swanthe


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



Re: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Ernesto Reinaldo Barreiro
Why use aspects for 2 when you have IComponentInstantiationListener? All you
have to do is set you components model to use the TrimmingModel pasted
before on the listener. I didn't try it myself but I guess that should work.
Best,

Ernesto

On Fri, Oct 2, 2009 at 10:57 AM, Bernhard Michal
michal.bernh...@tigra.czwrote:

 Afaik there is no way to set this behavior by some flag. But

 1) You can extend TextField to wrap it's model with model which on
 getObject() trim (ie. remove begging and trailing spaces) returning
 string if Model's type is Sting (in other cases it doesn't make
 sense)... when value is setted into model trimming is done by wicket
 (see FormComponent#shouldTrimInput) automatically (in older version you
 have to do this manually by overriding FormComponent#convertInput()
 method)

 2) you can do aspect (AspectJ?) to do the same as 1) - with aspect there
 is no need to make new class of TextField's type so there is no need to
 change the code base...

 3) you can override implementation of coverters

 override Application#newConverterLocator() to

 protected IConverterLocator newConverterLocator() {
ConverterLocator locator = new ConverterLocator();
locator.set(String.class, new IConverter() {

   public Object convertToObject(String value,
 Locale locale) {
return convertToString(value,
 locale);
}

public String convertToString(Object value,
 Locale locale) {
return value.toString().trim();
 // see trim() which remove trailing and beginning spaces
}
 });

return locator;
 }

 I didn't test it but you've got the idea... But this solution is really
 bad, because if you want to turn off this behaviour (trimming) in some
 cases
 you can't do it without overriding for example Component#getConverter()
 to convert it in default way and it's a mess.

 I recommend you to trim it by hand on Model level (make some wrapper
 model to do it so) or on tier (layer) where you obtain data (data acces
 layer? service level?). It depends on if spaces have some business
 meaning. If yes do it on model level otherwise on that layer.

 Best wishes

 MB

 -Original Message-
 From: David Chang [mailto:david_q_zh...@yahoo.com]
 Sent: Friday, October 02, 2009 5:25 AM
 To: users@wicket.apache.org
 Subject: Can Wicket automatically remove beginning and trailing spaces
 in a text field?

 How to set it up in a Wicket application? I would like to set it up in
 the application level.

 Thanks!


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




Re: urls with localization

2009-10-02 Thread Alex Objelean

I've created a draft version of the page in wiki:
http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs
http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs 

Now it will not expire ;).

Alex Objelean


Vytautas C(ivilis wrote:
 
 Hi, Alex.
 
 Could you repost LocaleUrlCodingStrategyDecorator to pastebin, as it has
 been expired?
 
 Thanks!
 
 Vytautas
 
 Alex Objelean wrote:
 RequestDecorator is nothing but a decorator implementation of Request
 class...
 [CODE]
 public class RequestDecorator
   extends Request {
   /**
* Decorated request.
*/
   private final Request request;
 
 
   /**
* Constructor.
*
* @param request to decorate.
*/
   public RequestDecorator(final Request request) {
 if (request == null) {
   throw new IllegalArgumentException(Decorated Request cannot be
 NULL!);
 }
 this.request = request;
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public Locale getLocale() {
 return request.getLocale();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getParameter(final String key) {
 return request.getParameter(key);
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public MapString, String[] getParameterMap() {
 return request.getParameterMap();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String[] getParameters(final String key) {
 return request.getParameters(key);
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getPath() {
 return request.getPath();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getQueryString() {
 return request.getQueryString();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToContextRoot() {
 return request.getRelativePathPrefixToContextRoot();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToWicketHandler() {
 return request.getRelativePathPrefixToWicketHandler();
   }
 
 
   /**
* {...@inheritdoc}
*/
   @Override
   public String getURL() {
 return request.getURL();
   }
 }
 [/CODE]
 
 
 Gatos wrote:
 I'm using wicket 1.3.5 and RequestDecorator could not be found.

 On Mon, Jul 27, 2009 at 1:05 PM, Alex Objelean
 alex_objel...@yahoo.comwrote:


 There is another thread where I have posted a link with implementation
 (which is currently in production)... so, you can just reuse it:

 http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330

 Alex Objelean


 Gatos wrote:
 Hello,

 How is it possible to use such urls in wicket?
 If users clicks that link then appropriate page with defined locale
 will
 be
 shown.
 www.domain.com/uk/home
 www.domain.com/nl/home

 Thank you


 --
 View this message in context:
 http://www.nabble.com/urls-with-localization-tp24676709p24677616.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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



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

-- 
View this message in context: 
http://www.nabble.com/urls-with-localization-tp24676709p25713262.html
Sent from the Wicket - User 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: urls with localization

2009-10-02 Thread ivilis vytautas.civi...@gmail.com
Good work, thank you!

Vytautas

Alex Objelean wrote:
 I've created a draft version of the page in wiki:
 http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs
 http://cwiki.apache.org/confluence/display/WICKET/Wicket+and+localized+URLs 
 
 Now it will not expire ;).
 
 Alex Objelean
 
 
 Vytautas C(ivilis wrote:
 Hi, Alex.

 Could you repost LocaleUrlCodingStrategyDecorator to pastebin, as it has
 been expired?

 Thanks!

 Vytautas

 Alex Objelean wrote:
 RequestDecorator is nothing but a decorator implementation of Request
 class...
 [CODE]
 public class RequestDecorator
   extends Request {
   /**
* Decorated request.
*/
   private final Request request;


   /**
* Constructor.
*
* @param request to decorate.
*/
   public RequestDecorator(final Request request) {
 if (request == null) {
   throw new IllegalArgumentException(Decorated Request cannot be
 NULL!);
 }
 this.request = request;
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public Locale getLocale() {
 return request.getLocale();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getParameter(final String key) {
 return request.getParameter(key);
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public MapString, String[] getParameterMap() {
 return request.getParameterMap();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String[] getParameters(final String key) {
 return request.getParameters(key);
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getPath() {
 return request.getPath();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getQueryString() {
 return request.getQueryString();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToContextRoot() {
 return request.getRelativePathPrefixToContextRoot();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getRelativePathPrefixToWicketHandler() {
 return request.getRelativePathPrefixToWicketHandler();
   }


   /**
* {...@inheritdoc}
*/
   @Override
   public String getURL() {
 return request.getURL();
   }
 }
 [/CODE]


 Gatos wrote:
 I'm using wicket 1.3.5 and RequestDecorator could not be found.

 On Mon, Jul 27, 2009 at 1:05 PM, Alex Objelean
 alex_objel...@yahoo.comwrote:

 There is another thread where I have posted a link with implementation
 (which is currently in production)... so, you can just reuse it:

 http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330

 Alex Objelean


 Gatos wrote:
 Hello,

 How is it possible to use such urls in wicket?
 If users clicks that link then appropriate page with defined locale
 will
 be
 shown.
 www.domain.com/uk/home
 www.domain.com/nl/home

 Thank you


 --
 View this message in context:
 http://www.nabble.com/urls-with-localization-tp24676709p24677616.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


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


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



 

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



Re: inMethod DataGrid initial selection

2009-10-02 Thread Martin Grigorov
grid.selectItem(rowModel);

El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:
 Does anybody know how to get a row initially selected when the grid is 
 first drawn?
 
 //Swanthe
 
 
 -
 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



Problems with refreshing captcha.

2009-10-02 Thread RG

Hi,

I'm trying to create a form with captcha for a demo I was building, but 
am having problems with the update when the password is incorrect.  What 
I wanted to achieve was the captcha being
regenerated with a new word on each try.  On submit I can see the 
captcha being regenerated, but it does not update (the feedback form 
is.),  if I do a 'view image' in

firefox I see the updated image.

I think this is because the image is being cached by firefox, but am not 
certain.


I'm probably missing something stupid, but for the life of me can't work 
it out.  Any help greatly appreciated.


Thanks

Rory

---

package org.sourceforge.jemm.jemmblog.pages.blog;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.util.value.ValueMap;
import org.sourceforge.jemm.jemmblog.domain.Blog;
import org.sourceforge.jemm.jemmblog.domain.DuplicateUserException;
import org.sourceforge.jemm.jemmblog.domain.dto.BlogDTO;
import org.sourceforge.jemm.jemmblog.pages.BasePage;
import org.sourceforge.jemm.jemmblog.util.CaptchaHelper;

/**
* Form for creating blog with captcha.
*
* n.b. captchaHelper.refreshCaptcha() creates a new 
CaptchaImageResource with a different

* password on each invocation.
*/
public class CreateBlogPage extends BasePage {

   private final FeedbackPanel feedbackPanel;
   private final ValueMap properties = new ValueMap();

   private final CaptchaHelper captchaHelper = new CaptchaHelper();
   private final Image captchaImage;
  
   public CreateBlogPage() {

   ;
   FormBlogDTO form = new FormBlogDTO(form);
   form.setModel(new CompoundPropertyModelBlogDTO(new BlogDTO()));

   form.add(new TextAreaString(blogName).setRequired(true));
   form.add(new TextAreaString(username).setRequired(true));
   form.add(new TextAreaString(password).setRequired(true));

   
//*
   // create teh captcha components  
   captchaImage = new Image(captchaImage,  
captchaHelper.refreshCaptcha());
  
   captchaImage.setOutputMarkupId(true);

   form.add(captchaImage);
  
   form.add(new RequiredTextFieldString(captchaField, new 
PropertyModelString(properties, captchaField)) {

   private static final long serialVersionUID = 1L;

   @Override
   protected void onComponentTag(final ComponentTag tag) {
   super.onComponentTag(tag);
   // 
**

   //  this does not work either...

   // clear the field after each render
   tag.put(value, );
   }
   });



   add(form);

   AjaxButton ajaxBtn = new AjaxButton(ajaxButton) {
   private static final long serialVersionUID = 1L;

   @Override
   protected void onSubmit(AjaxRequestTarget target, Form? 
form) {

   super.onSubmit();
   if (!captchaHelper.captchaMatches(getPassword())) {
   error(Captcha value incorrect.);
  
   } else {

   BlogDTO blogDTO = (BlogDTO) form.getModelObject();
   try {
   Blog blog = getManager().createBlog(blogDTO);
   setResponsePage(new BlogOverviewPage(blog));
   }catch(DuplicateUserException due) {
   error(Blog user  + blogDTO.getUsername() +  
already exists);

   }
   }

   
//***

   //  update the captcha image, add it to the ajax response
   
captchaImage.setImageResource(captchaHelper.refreshCaptcha());

   target.addComponent(captchaImage,captchaImage);
   }

   @Override
   protected void onError(AjaxRequestTarget target, Form? form) {
   target.addComponent(feedbackPanel);
   }
   };
   form.add(ajaxBtn);
  
   feedbackPanel = new FeedbackPanel(feedback);

   // need to set output markupid to true
   feedbackPanel.setOutputMarkupId(true);
   add(feedbackPanel);
   }

   private String getPassword() {
   return properties.getString(captchaField);
   }

   /** Utility method used for testing */
   public String getCaptchaChallenge() {
 

Re: [WicketStuff] Iolite

2009-10-02 Thread jWeekend

Nino,

We developed these archetypes primarily for commercial usage (training and
client apps) but are now looking to make them publicly available (ideally
with Apache or GPL/MIT licences) because they could be useful for other
developers, not least people new to Wicket (or new to JPA or Guice or
Spring, all with or without Wicket experience) and give them a way to get
started quickly with a fully functional project; POM, simple working code,
database with test data (where appropriate) and the config that makes it all
hang together. As you've no doubt experienced, one also has to test very
carefully that the various versions of all the included frameworks/libraries
play nicely together (eg Spring 2.5.6 is fussy about the version of JUnit4
to use ...) etc, and the possible combinations are quite overwhelming, even
off-putting for someone who just wants to try stuff out without spending all
day getting the config right.

Many of our archetypes include Wicket, but some don't. WicketStuff is not
the right place for them to live, for now.

We will make this stuff publicly available later this month, either on one
of jWeekend's servers or one of the popular project hosting sites. Then
we'll know better if people even find them useful and can reconsider whether
or not we should merge with any existing projects and/or host our archetypes
elsewhere.

Regards - Cemal
jWeekend
OO  Java Technologies, Wicket Training and Development 
http://jWeekend.com





nino martinez wael wrote:
 
 Great! So should these be merged into Iolite? Anyhow the nice thing
 would
 be to put it into wicketstuff..
 
 regards Nino
 
 2009/9/29 richardwilko richardjohnwilkin...@gmail.com
 

 Hi,

 We have been developing a few useful archetypes for our own client
 projects
 and courses.
 Amongst others, we have

 Wicket/Guice
 Wicket/Guice/Warp/Hibernate
 Wicket/Guice/Warp/JPA
 Wicket/Spring/JPA
 Spring/JPA/openJPA
 Spring/JPA/EclipseLink
 Spring/JDBC

 All include a running sample application with correct dependencies.


 We're currently deciding which jWeekend server to host these on (and
 their
 catalog) and probably the source


 Regards - Richard Wilkinson
 Developer, jWeekend
 OO  Java Technologies, Wicket Training and Development
 http://jWeekend.com




 nino martinez wael wrote:
 
  Hi Guys
 
  I've been using Guice for a while together with warp persist and
 dynamic
  finders. Would it be of any interest to switch Iolite to Guice? Please
 say
  if it has interest then I might do it, but won't if nobody uses it.
 
 
  http://www.wideplay.com/guicewebextensions2
  http://www.wideplay.com/dynamicfinders
  http://code.google.com/p/google-guice/
 
  Regards Nino
 
 


 -
 http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk
 --
 View this message in context:
 http://www.nabble.com/-WicketStuff--Iolite-tp25652619p25659568.html
 Sent from the Wicket - User 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


 
 

-- 
View this message in context: 
http://www.nabble.com/-WicketStuff--Iolite-tp25652619p25713893.html
Sent from the Wicket - User 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: Problems with refreshing captcha.

2009-10-02 Thread Sjoerd Schunselaar
I had the same problem with generating statistics.

If your're extending the wicket Image class, you should override
getImageResource.
Simply add this method in getImageResource:

   @Override
protected void setHeaders(WebResponse response) {
if (isCacheable()) {
super.setHeaders(response);
} else {
response.setHeader(Pragma, no-cache);
response.setHeader(Cache-Control, no-cache);
response.setDateHeader(Expires, 0);
}
}

And you're done.


Good luck.


On Fri, Oct 2, 2009 at 12:51 PM, RG r...@playonthego.com wrote:
 Hi,

 I'm trying to create a form with captcha for a demo I was building, but am
 having problems with the update when the password is incorrect.  What I
 wanted to achieve was the captcha being
 regenerated with a new word on each try.  On submit I can see the captcha
 being regenerated, but it does not update (the feedback form is.),  if I do
 a 'view image' in
 firefox I see the updated image.

 I think this is because the image is being cached by firefox, but am not
 certain.

 I'm probably missing something stupid, but for the life of me can't work it
 out.  Any help greatly appreciated.

 Thanks

 Rory

 ---

 package org.sourceforge.jemm.jemmblog.pages.blog;

 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.ajax.markup.html.form.AjaxButton;
 import org.apache.wicket.markup.ComponentTag;
 import org.apache.wicket.markup.html.form.Form;
 import org.apache.wicket.markup.html.form.RequiredTextField;
 import org.apache.wicket.markup.html.form.TextArea;
 import org.apache.wicket.markup.html.image.Image;
 import org.apache.wicket.markup.html.panel.FeedbackPanel;
 import org.apache.wicket.model.CompoundPropertyModel;
 import org.apache.wicket.model.PropertyModel;
 import org.apache.wicket.util.value.ValueMap;
 import org.sourceforge.jemm.jemmblog.domain.Blog;
 import org.sourceforge.jemm.jemmblog.domain.DuplicateUserException;
 import org.sourceforge.jemm.jemmblog.domain.dto.BlogDTO;
 import org.sourceforge.jemm.jemmblog.pages.BasePage;
 import org.sourceforge.jemm.jemmblog.util.CaptchaHelper;

 /**
 * Form for creating blog with captcha.
 *
 * n.b. captchaHelper.refreshCaptcha() creates a new CaptchaImageResource
 with a different
 * password on each invocation.
 */
 public class CreateBlogPage extends BasePage {

   private final FeedbackPanel feedbackPanel;
   private final ValueMap properties = new ValueMap();

   private final CaptchaHelper captchaHelper = new CaptchaHelper();
   private final Image captchaImage;
     public CreateBlogPage() {
       ;
       FormBlogDTO form = new FormBlogDTO(form);
       form.setModel(new CompoundPropertyModelBlogDTO(new BlogDTO()));

       form.add(new TextAreaString(blogName).setRequired(true));
       form.add(new TextAreaString(username).setRequired(true));
       form.add(new TextAreaString(password).setRequired(true));


 //*
       // create teh captcha components             captchaImage = new
 Image(captchaImage,  captchaHelper.refreshCaptcha());
             captchaImage.setOutputMarkupId(true);
       form.add(captchaImage);
             form.add(new RequiredTextFieldString(captchaField, new
 PropertyModelString(properties, captchaField)) {
           private static final long serialVersionUID = 1L;

           @Override
           protected void onComponentTag(final ComponentTag tag) {
               super.onComponentTag(tag);
               //
 **
               //  this does not work either...

               // clear the field after each render
               tag.put(value, );
           }
       });



       add(form);

       AjaxButton ajaxBtn = new AjaxButton(ajaxButton) {
           private static final long serialVersionUID = 1L;

           @Override
           protected void onSubmit(AjaxRequestTarget target, Form? form) {
               super.onSubmit();
               if (!captchaHelper.captchaMatches(getPassword())) {
                   error(Captcha value incorrect.);
             } else {
                   BlogDTO blogDTO = (BlogDTO) form.getModelObject();
                   try {
                       Blog blog = getManager().createBlog(blogDTO);
                       setResponsePage(new BlogOverviewPage(blog));
                   }catch(DuplicateUserException due) {
                       error(Blog user  + blogDTO.getUsername() +  already
 exists);
                   }
               }


 //***
               //  update the captcha image, add it to the ajax response
               

Re: inMethod DataGrid initial selection

2009-10-02 Thread Swanthe Lindgren
Yes, I got that part right, thank you. But somehow the item is not 
hi-lighted in my grid.
When the grid instance is constructed and added to the page, the data to 
be shown in the grid has not yet been loaded. I know that the row i want 
selected is going to be there once the data is loaded and the grid is 
displayed, so I tried to create a Model containing the selected object 
and setting it on the grid with DataGrid.selectItem(), and obviously it 
partially works since other components that are depending on the grid 
for model data is displaying the item correct information from the 
preselected item.

But still, the row in the displayed grid remains unselected.

So far I have configured my grid with
datagrid.setRowsPerPage(10);
datagrid.setClickRowToSelect(true);
datagrid.setClickRowToDeselect(false);
datagrid.setAllowSelectMultiple(false);
datagrid.selectItem(preselectedModel, true);


Any other suggestions?

Martin Grigorov wrote:

grid.selectItem(rowModel);

El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:
  
Does anybody know how to get a row initially selected when the grid is 
first drawn?


//Swanthe


-
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: ModalWindow and LazyLoading Exception

2009-10-02 Thread Albert Romanius
The line that throws the exception is below:
CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
   subMessages, new PropertyModel(this,
selectedSubs), showMessage.getLazyList());

The problem is the showMessage.getLazyList() call. When wicket renders
this combobox, spring filter have already closed the EntityManager.
If I uncomment this line (ugly hack):
 //showMessage.getLazyList().size();
Everything works.

I am using tomcat 6.0.18 (bundled with Netbeans).


The stacktrace:

ERROR - azyInitializationException - failed to lazily initialize a
collection of role: com.mycompany.persistence.domain.Message.lazyList,
no session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize
a collection of role:
com.mycompany.persistence.domain.Message.lazyList, no session or
session was closed
at 
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at 
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at 
org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
at 
org.apache.wicket.markup.html.form.ListMultipleChoice.onComponentTag(ListMultipleChoice.java:246)
at 
org.apache.wicket.markup.html.form.CheckBoxMultipleChoice.onComponentTag(CheckBoxMultipleChoice.java:359)
at org.apache.wicket.Component.renderComponent(Component.java:2597)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
at org.apache.wicket.Component.render(Component.java:2457)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
at 
org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1601)
at 
org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525)
at 
org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1926)
at org.apache.wicket.Component.renderComponent(Component.java:2626)
at org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1997)
at org.apache.wicket.Component.render(Component.java:2457)
at 
org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
at 
org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1552)
at org.apache.wicket.Page.onRender(Page.java:1545)
at org.apache.wicket.Component.render(Component.java:2457)
at org.apache.wicket.Page.renderPage(Page.java:914)
at 
org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63)
at 
org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at 
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at 
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at 

Re: Problems with refreshing captcha.

2009-10-02 Thread RG

Hi Sjoerd,

Thanks for the response.

I;m using the wicket-extensions CaptchaImageResource, I can't override 
this, and assume it would set the cache headers itself.
My guess is the the resource reference inthe generated html doesn't 
change and that the page does not feel a need to reload it,

(I could be barking up completely the wrong tree mind ;)

Cheers

Rory

Sjoerd Schunselaar wrote:

I had the same problem with generating statistics.

If your're extending the wicket Image class, you should override
getImageResource.
Simply add this method in getImageResource:

   @Override
protected void setHeaders(WebResponse response) {
if (isCacheable()) {
super.setHeaders(response);
} else {
response.setHeader(Pragma, no-cache);
response.setHeader(Cache-Control, no-cache);
response.setDateHeader(Expires, 0);
}
}

And you're done.


Good luck.


On Fri, Oct 2, 2009 at 12:51 PM, RG r...@playonthego.com wrote:
  

Hi,

I'm trying to create a form with captcha for a demo I was building, but am
having problems with the update when the password is incorrect.  What I
wanted to achieve was the captcha being
regenerated with a new word on each try.  On submit I can see the captcha
being regenerated, but it does not update (the feedback form is.),  if I do
a 'view image' in
firefox I see the updated image.

I think this is because the image is being cached by firefox, but am not
certain.

I'm probably missing something stupid, but for the life of me can't work it
out.  Any help greatly appreciated.

Thanks

Rory

---

package org.sourceforge.jemm.jemmblog.pages.blog;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.RequiredTextField;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.util.value.ValueMap;
import org.sourceforge.jemm.jemmblog.domain.Blog;
import org.sourceforge.jemm.jemmblog.domain.DuplicateUserException;
import org.sourceforge.jemm.jemmblog.domain.dto.BlogDTO;
import org.sourceforge.jemm.jemmblog.pages.BasePage;
import org.sourceforge.jemm.jemmblog.util.CaptchaHelper;

/**
* Form for creating blog with captcha.
*
* n.b. captchaHelper.refreshCaptcha() creates a new CaptchaImageResource
with a different
* password on each invocation.
*/
public class CreateBlogPage extends BasePage {

  private final FeedbackPanel feedbackPanel;
  private final ValueMap properties = new ValueMap();

  private final CaptchaHelper captchaHelper = new CaptchaHelper();
  private final Image captchaImage;
public CreateBlogPage() {
  ;
  FormBlogDTO form = new FormBlogDTO(form);
  form.setModel(new CompoundPropertyModelBlogDTO(new BlogDTO()));

  form.add(new TextAreaString(blogName).setRequired(true));
  form.add(new TextAreaString(username).setRequired(true));
  form.add(new TextAreaString(password).setRequired(true));


//*
  // create teh captcha components captchaImage = new
Image(captchaImage,  captchaHelper.refreshCaptcha());
captchaImage.setOutputMarkupId(true);
  form.add(captchaImage);
form.add(new RequiredTextFieldString(captchaField, new
PropertyModelString(properties, captchaField)) {
  private static final long serialVersionUID = 1L;

  @Override
  protected void onComponentTag(final ComponentTag tag) {
  super.onComponentTag(tag);
  //
**
  //  this does not work either...

  // clear the field after each render
  tag.put(value, );
  }
  });



  add(form);

  AjaxButton ajaxBtn = new AjaxButton(ajaxButton) {
  private static final long serialVersionUID = 1L;

  @Override
  protected void onSubmit(AjaxRequestTarget target, Form? form) {
  super.onSubmit();
  if (!captchaHelper.captchaMatches(getPassword())) {
  error(Captcha value incorrect.);
} else {
  BlogDTO blogDTO = (BlogDTO) form.getModelObject();
  try {
  Blog blog = getManager().createBlog(blogDTO);
  setResponsePage(new BlogOverviewPage(blog));
  }catch(DuplicateUserException due) {
  error(Blog user  

Re: ModalWindow and LazyLoading Exception

2009-10-02 Thread Pedro Santos
use *OpenSessionInViewFilter* to avoid lazy initialization exceptions

On Fri, Oct 2, 2009 at 8:42 AM, Albert Romanius a.roman...@gmail.comwrote:

 The line that throws the exception is below:
 CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
   subMessages, new PropertyModel(this,
 selectedSubs), showMessage.getLazyList());

 The problem is the showMessage.getLazyList() call. When wicket renders
 this combobox, spring filter have already closed the EntityManager.
 If I uncomment this line (ugly hack):
  //showMessage.getLazyList().size();
 Everything works.

 I am using tomcat 6.0.18 (bundled with Netbeans).


 The stacktrace:

 ERROR - azyInitializationException - failed to lazily initialize a
 collection of role: com.mycompany.persistence.domain.Message.lazyList,
 no session or session was closed
 org.hibernate.LazyInitializationException: failed to lazily initialize
 a collection of role:
 com.mycompany.persistence.domain.Message.lazyList, no session or
 session was closed
at
 org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at
 org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at
 org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at
 org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
at
 org.apache.wicket.markup.html.form.ListMultipleChoice.onComponentTag(ListMultipleChoice.java:246)
at
 org.apache.wicket.markup.html.form.CheckBoxMultipleChoice.onComponentTag(CheckBoxMultipleChoice.java:359)
at org.apache.wicket.Component.renderComponent(Component.java:2597)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
at org.apache.wicket.Component.render(Component.java:2457)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1601)
at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525)
at
 org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1926)
at org.apache.wicket.Component.renderComponent(Component.java:2626)
at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1997)
at org.apache.wicket.Component.render(Component.java:2457)
at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
at
 org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1552)
at org.apache.wicket.Page.onRender(Page.java:1545)
at org.apache.wicket.Component.render(Component.java:2457)
at org.apache.wicket.Page.renderPage(Page.java:914)
at
 org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63)
at
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
 org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at
 

Re: inMethod DataGrid initial selection

2009-10-02 Thread Matej Knopp
Make sure that the equals method on your model(s) is properly
implemented. Also check equals on your entities.

-Matej

On Fri, Oct 2, 2009 at 1:37 PM, Swanthe Lindgren
swanthe.lindg...@megasol.se wrote:
 Yes, I got that part right, thank you. But somehow the item is not
 hi-lighted in my grid.
 When the grid instance is constructed and added to the page, the data to be
 shown in the grid has not yet been loaded. I know that the row i want
 selected is going to be there once the data is loaded and the grid is
 displayed, so I tried to create a Model containing the selected object and
 setting it on the grid with DataGrid.selectItem(), and obviously it
 partially works since other components that are depending on the grid for
 model data is displaying the item correct information from the preselected
 item.
 But still, the row in the displayed grid remains unselected.

 So far I have configured my grid with
 datagrid.setRowsPerPage(10);
 datagrid.setClickRowToSelect(true);
 datagrid.setClickRowToDeselect(false);
 datagrid.setAllowSelectMultiple(false);
 datagrid.selectItem(preselectedModel, true);


 Any other suggestions?

 Martin Grigorov wrote:

 grid.selectItem(rowModel);

 El vie, 02-10-2009 a las 11:25 +0200, Swanthe Lindgren escribió:


 Does anybody know how to get a row initially selected when the grid is
 first drawn?

 //Swanthe


 -
 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



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



Re: [WicketStuff] Iolite

2009-10-02 Thread nino martinez wael
Okay.. I might still do the guice/warp etc archetype then.. And look forward
to when your archetypes go under MIT / ASL and are available..

regards Nino

2009/10/2 jWeekend jweekend_for...@cabouge.com


 Nino,

 We developed these archetypes primarily for commercial usage (training and
 client apps) but are now looking to make them publicly available (ideally
 with Apache or GPL/MIT licences) because they could be useful for other
 developers, not least people new to Wicket (or new to JPA or Guice or
 Spring, all with or without Wicket experience) and give them a way to get
 started quickly with a fully functional project; POM, simple working code,
 database with test data (where appropriate) and the config that makes it
 all
 hang together. As you've no doubt experienced, one also has to test very
 carefully that the various versions of all the included
 frameworks/libraries
 play nicely together (eg Spring 2.5.6 is fussy about the version of JUnit4
 to use ...) etc, and the possible combinations are quite overwhelming, even
 off-putting for someone who just wants to try stuff out without spending
 all
 day getting the config right.

 Many of our archetypes include Wicket, but some don't. WicketStuff is not
 the right place for them to live, for now.

 We will make this stuff publicly available later this month, either on one
 of jWeekend's servers or one of the popular project hosting sites. Then
 we'll know better if people even find them useful and can reconsider
 whether
 or not we should merge with any existing projects and/or host our
 archetypes
 elsewhere.

 Regards - Cemal
 jWeekend
 OO  Java Technologies, Wicket Training and Development
 http://jWeekend.com





 nino martinez wael wrote:
 
  Great! So should these be merged into Iolite? Anyhow the nice thing
  would
  be to put it into wicketstuff..
 
  regards Nino
 
  2009/9/29 richardwilko richardjohnwilkin...@gmail.com
 
 
  Hi,
 
  We have been developing a few useful archetypes for our own client
  projects
  and courses.
  Amongst others, we have
 
  Wicket/Guice
  Wicket/Guice/Warp/Hibernate
  Wicket/Guice/Warp/JPA
  Wicket/Spring/JPA
  Spring/JPA/openJPA
  Spring/JPA/EclipseLink
  Spring/JDBC
 
  All include a running sample application with correct dependencies.
 
 
  We're currently deciding which jWeekend server to host these on (and
  their
  catalog) and probably the source
 
 
  Regards - Richard Wilkinson
  Developer, jWeekend
  OO  Java Technologies, Wicket Training and Development
  http://jWeekend.com
 
 
 
 
  nino martinez wael wrote:
  
   Hi Guys
  
   I've been using Guice for a while together with warp persist and
  dynamic
   finders. Would it be of any interest to switch Iolite to Guice? Please
  say
   if it has interest then I might do it, but won't if nobody uses it.
  
  
   http://www.wideplay.com/guicewebextensions2
   http://www.wideplay.com/dynamicfinders
   http://code.google.com/p/google-guice/
  
   Regards Nino
  
  
 
 
  -
  http://richard-wilkinson.co.uk My blog: http://richard-wilkinson.co.uk
  --
  View this message in context:
  http://www.nabble.com/-WicketStuff--Iolite-tp25652619p25659568.html
  Sent from the Wicket - User 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
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/-WicketStuff--Iolite-tp25652619p25713893.html
 Sent from the Wicket - User 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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread David Chang
For this to work, I have to overwrite this method either for each form or write 
a custom class extending FormComponent. Correct?

If yes, then it is not what I hope to get. I dont want to do it for each form 
or a custom class.

I came from Spring MVC camp. This task is very easy in Spring.

Cheers.

--- On Fri, 10/2/09, Marat Radchenko slonopotamusor...@gmail.com wrote:

 From: Marat Radchenko slonopotamusor...@gmail.com
 Subject: Re: Can Wicket automatically remove beginning and trailing spaces in 
  a text field?
 To: users@wicket.apache.org
 Date: Friday, October 2, 2009, 4:00 AM
 It already does that.
 FormComponent:
 
 protected T convertValue(String[] value) throws
 ConversionException
 {
 return (T)(value != null  value.length  0
  value[0] != null ?
 trim(value[0]) : null);
 }
 
 2009/10/2 David Chang david_q_zh...@yahoo.com
 
  How to set it up in a Wicket application? I would like
 to set it up in the
  application level.
 
  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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread David Chang

I feel the recommended solutions are complicated. 

Thanks.


--- On Fri, 10/2/09, Ernesto Reinaldo Barreiro reier...@gmail.com wrote:

 From: Ernesto Reinaldo Barreiro reier...@gmail.com
 Subject: Re: Can Wicket automatically remove beginning and trailing spaces in 
  a text field?
 To: users@wicket.apache.org
 Date: Friday, October 2, 2009, 5:39 AM
 Why use aspects for 2 when you have
 IComponentInstantiationListener? All you
 have to do is set you components model to use the
 TrimmingModel pasted
 before on the listener. I didn't try it myself but I guess
 that should work.
 Best,
 
 Ernesto
 
 On Fri, Oct 2, 2009 at 10:57 AM, Bernhard Michal
 michal.bernh...@tigra.czwrote:
 
  Afaik there is no way to set this behavior by some
 flag. But
 
  1) You can extend TextField to wrap it's model with
 model which on
  getObject() trim (ie. remove begging and trailing
 spaces) returning
  string if Model's type is Sting (in other cases it
 doesn't make
  sense)... when value is setted into model trimming is
 done by wicket
  (see FormComponent#shouldTrimInput) automatically (in
 older version you
  have to do this manually by overriding
 FormComponent#convertInput()
  method)
 
  2) you can do aspect (AspectJ?) to do the same as 1) -
 with aspect there
  is no need to make new class of TextField's type so
 there is no need to
  change the code base...
 
  3) you can override implementation of coverters
 
  override Application#newConverterLocator() to
 
  protected IConverterLocator newConverterLocator() {
         ConverterLocator locator =
 new ConverterLocator();
         locator.set(String.class,
 new IConverter() {
 
                
            public Object
 convertToObject(String value,
  Locale locale) {
                
                
         return convertToString(value,
  locale);
                
             }
 
                
             public String
 convertToString(Object value,
  Locale locale) {
                
                
         return value.toString().trim();
  // see trim() which remove trailing and beginning
 spaces
                
             }
          
    });
 
         return locator;
  }
 
  I didn't test it but you've got the idea... But this
 solution is really
  bad, because if you want to turn off this behaviour
 (trimming) in some
  cases
  you can't do it without overriding for example
 Component#getConverter()
  to convert it in default way and it's a mess.
 
  I recommend you to trim it by hand on Model level
 (make some wrapper
  model to do it so) or on tier (layer) where you obtain
 data (data acces
  layer? service level?). It depends on if spaces have
 some business
  meaning. If yes do it on model level otherwise on that
 layer.
 
  Best wishes
 
  MB
 
  -Original Message-
  From: David Chang [mailto:david_q_zh...@yahoo.com]
  Sent: Friday, October 02, 2009 5:25 AM
  To: users@wicket.apache.org
  Subject: Can Wicket automatically remove beginning and
 trailing spaces
  in a text field?
 
  How to set it up in a Wicket application? I would like
 to set it up in
  the application level.
 
  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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Martijn Dashorst
Not sure what the fuzz is all about: wicket trims the whitespace
before and after the input by default (like Marat already mentioned in
this thread).

Marat's code example is taken *directly* from Wicket's FormComponent.
You don't have to do anything.

Martijn

On Fri, Oct 2, 2009 at 3:06 PM, David Chang david_q_zh...@yahoo.com wrote:
 For this to work, I have to overwrite this method either for each form or 
 write a custom class extending FormComponent. Correct?

 If yes, then it is not what I hope to get. I dont want to do it for each form 
 or a custom class.

 I came from Spring MVC camp. This task is very easy in Spring.

 Cheers.

 --- On Fri, 10/2/09, Marat Radchenko slonopotamusor...@gmail.com wrote:

 From: Marat Radchenko slonopotamusor...@gmail.com
 Subject: Re: Can Wicket automatically remove beginning and trailing spaces 
 in  a text field?
 To: users@wicket.apache.org
 Date: Friday, October 2, 2009, 4:00 AM
 It already does that.
 FormComponent:

 protected T convertValue(String[] value) throws
 ConversionException
 {
 return (T)(value != null  value.length  0
  value[0] != null ?
 trim(value[0]) : null);
 }

 2009/10/2 David Chang david_q_zh...@yahoo.com

  How to set it up in a Wicket application? I would like
 to set it up in the
  application level.
 
  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





-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com
Apache Wicket 1.4 increases type safety for web applications
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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



Re: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread David Chang
No fuss, just confusion. Thanks for the clarification, which helps not only to 
me.

Cheers!

--- On Fri, 10/2/09, Martijn Dashorst martijn.dasho...@gmail.com wrote:

 From: Martijn Dashorst martijn.dasho...@gmail.com
 Subject: Re: Can Wicket automatically remove beginning and trailing spaces in 
  a text field?
 To: users@wicket.apache.org
 Date: Friday, October 2, 2009, 9:19 AM
 Not sure what the fuzz is all about:
 wicket trims the whitespace
 before and after the input by default (like Marat already
 mentioned in
 this thread).
 
 Marat's code example is taken *directly* from Wicket's
 FormComponent.
 You don't have to do anything.
 
 Martijn
 
 On Fri, Oct 2, 2009 at 3:06 PM, David Chang david_q_zh...@yahoo.com
 wrote:
  For this to work, I have to overwrite this method
 either for each form or write a custom class extending
 FormComponent. Correct?
 
  If yes, then it is not what I hope to get. I dont want
 to do it for each form or a custom class.
 
  I came from Spring MVC camp. This task is very easy in
 Spring.
 
  Cheers.
 
  --- On Fri, 10/2/09, Marat Radchenko slonopotamusor...@gmail.com
 wrote:
 
  From: Marat Radchenko slonopotamusor...@gmail.com
  Subject: Re: Can Wicket automatically remove
 beginning and trailing spaces in  a text field?
  To: users@wicket.apache.org
  Date: Friday, October 2, 2009, 4:00 AM
  It already does that.
  FormComponent:
 
  protected T convertValue(String[] value) throws
  ConversionException
  {
  return (T)(value != null  value.length
  0
   value[0] != null ?
  trim(value[0]) : null);
  }
 
  2009/10/2 David Chang david_q_zh...@yahoo.com
 
   How to set it up in a Wicket application? I
 would like
  to set it up in the
   application level.
  
   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
 
 
 
 
 
 -- 
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web
 applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0
 
 -
 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: Can Wicket automatically remove beginning and trailing spaces in a text field?

2009-10-02 Thread Ernesto Reinaldo Barreiro
Just one question... on method protected void convertInput() I
see convertValue(getInputAsArray()) is only called if typeName==null,
otherwise IConverter is used. It is always guarantied that trim behavior?
Thanks for your explanations and time!

Cheers,

Ernesto

On Fri, Oct 2, 2009 at 3:19 PM, Martijn Dashorst martijn.dasho...@gmail.com
 wrote:

 Not sure what the fuzz is all about: wicket trims the whitespace
 before and after the input by default (like Marat already mentioned in
 this thread).

 Marat's code example is taken *directly* from Wicket's FormComponent.
 You don't have to do anything.

 Martijn

 On Fri, Oct 2, 2009 at 3:06 PM, David Chang david_q_zh...@yahoo.com
 wrote:
  For this to work, I have to overwrite this method either for each form or
 write a custom class extending FormComponent. Correct?
 
  If yes, then it is not what I hope to get. I dont want to do it for each
 form or a custom class.
 
  I came from Spring MVC camp. This task is very easy in Spring.
 
  Cheers.
 
  --- On Fri, 10/2/09, Marat Radchenko slonopotamusor...@gmail.com
 wrote:
 
  From: Marat Radchenko slonopotamusor...@gmail.com
  Subject: Re: Can Wicket automatically remove beginning and trailing
 spaces in  a text field?
  To: users@wicket.apache.org
  Date: Friday, October 2, 2009, 4:00 AM
  It already does that.
  FormComponent:
 
  protected T convertValue(String[] value) throws
  ConversionException
  {
  return (T)(value != null  value.length  0
   value[0] != null ?
  trim(value[0]) : null);
  }
 
  2009/10/2 David Chang david_q_zh...@yahoo.com
 
   How to set it up in a Wicket application? I would like
  to set it up in the
   application level.
  
   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
 
 



 --
 Become a Wicket expert, learn from the best: http://wicketinaction.com
 Apache Wicket 1.4 increases type safety for web applications
 Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

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




Re: InvalidUrlException - how to show 404 page

2009-10-02 Thread Thomas Singer
Hi Linda, Alex and Jonas,

Thank you for your answers.

Just for the records: I'm now setting the internal error page in
WebApplication.init() as Alex suggested and override
WebApplication.newRequestCycle(Request, Response) to return a subclass of
WebRequestCycle which overrides logRuntimeException(RuntimeException) to not
log this InvalidUrlException.

Tom


Jonas wrote:
 I think it should be possible to have the webserver deliver the standard
 404 page by throwing AbortWithWebErrorCodeException
 
 You can hook in at WebRequestCycleProcessor#respond(RuntimeException
 e, RequestCycle requestCycle)
 and throw the mentioned exception. Works find just like this in our webapp
 
 cheers,
 Jonas
 
 
 On Fri, Oct 2, 2009 at 10:22 AM, Thomas Singer wic...@regnis.de wrote:
 As I have reported a couple of weeks ago (but can't find the message any
 more for a follow-up), Wicket shows an ugly internal-error page if one
 somehow modified the stateful URLs, e.g.

 http://localhost:8080/?wicket:interface=:8

 Following exception is logged:

 org.apache.wicket.protocol.http.request.InvalidUrlException: 
 org.apache.wicket.WicketRuntimeException: Internal error parsing 
 wicket:interface = :6
   at 
 org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
   at org.apache.wicket.Request.getRequestParameters(Request.java:172)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
   at 
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
   at 
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
   at 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 How to configure Wicket to show the configured 404-page instead?

 Tom



 -
 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



ProgressBar demo doesn't work for firefox 3.5.3

2009-10-02 Thread Paul Huang
I copy and paste the single file upload demo at
http://www.wicket-library.com/wicket-examples/upload/single; to my
local machine and found the the ajax progressbar doesn't work on my
firefox 3.5.3 on winxp. But It works on my ie 8 though. Any idea what
might be the cause? ( I did not change a single a line of code, I am
using wicket 1.4.1)

BTW: the file upload demo on wick-library.com does not work. I got a
internal error message every time when trying to upload a file.

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



Re: ProgressBar demo doesn't work for firefox 3.5.3

2009-10-02 Thread Altuğ B . Altıntaş
You are right;  it doesn't work properly.
I am using swfupload tool. it is flash and it works great.

Regards.

Altug.

2009/10/2 Paul Huang paulhuan...@gmail.com

 I copy and paste the single file upload demo at
 http://www.wicket-library.com/wicket-examples/upload/single; to my
 local machine and found the the ajax progressbar doesn't work on my
 firefox 3.5.3 on winxp. But It works on my ie 8 though. Any idea what
 might be the cause? ( I did not change a single a line of code, I am
 using wicket 1.4.1)

 BTW: the file upload demo on wick-library.com does not work. I got a
 internal error message every time when trying to upload a file.

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




-- 
Altuğ.


Re: Preventing Copy Pasting URL's In Same Browser Session

2009-10-02 Thread Douglas Ferguson
Added this field and notice that it writes additional params to the  
url for pagemap.

Preliminary testing indicated that the page map url parameter doesn't  
have to exist.

Are there any concerns with using this option?

Douglas

On Oct 1, 2009, at 7:14 PM, Douglas Ferguson wrote:

 What are the implications of turning this one?

 D/


 On Sep 30, 2009, at 1:23 AM, Igor Vaynberg wrote:

 the javadoc in the later versions mentions that it is enabled by
 default, however if you are using the default secondlevel caching  
 page
 store it will be disabled...

 -igor

 On Tue, Sep 29, 2009 at 11:10 PM, Carlo Camerino
 carlo.camer...@gmail.com wrote:
 hi,

 actually i'm able to make it work some how using this setting

 getPageSettings().setAutomaticMultiWindowSupport(true);

 it creates a new page map everytime i open a page in a new tab or
 new window.
 however in the wicket documentation it says that it is enabled by
 default. but upon checking it seems that it is not enabled by  
 default
 that's why i'm confused.

 any recommendations regarding this?

 i can now check the page map name for each page and throw a redirect
 if a new page map is encountered other than the default.

 carlo

 On Wed, Sep 30, 2009 at 5:50 AM, Phil Housley undeconstruc...@gmail.com
 wrote:
 2009/9/29 Carlo Camerino carlo.camer...@gmail.com:
 Hi everyone,

 We have this requirement in which we cannot allow the customer to
 copy
 paste the url that's appearing in the address bar into the same
 browser. For example in a different tab or in a new window. This
 can
 easily be done in Wicket Framework since the url has a
 corresponding
 page attached to it. For example if i get
 http://localhost/wicket:interface=1 appearing in the address  
 bar, I
 can open anew tab paste the url and I could get into the same  
 page.
 The users don't want this behavior. Could I make it work in such
 a way
 that I copy http://localhost/wicket:inteface=1, when i try to
 copy and
 paste it, it will redirect me to an error page? This happens even
 after the user has already logged in. Really need help on this
 one.


 I've been playing with the ideas from
 http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html
 for something of my own, which might fit the bill in a way.
 Following
 that you can convince wicket to serve up every instance of a  
 mounted
 page from exactly the same URL.  That means if you copy the url,  
 you
 get a brand new instance of the page.  You lose the ability to
 refresh, but if you are being strict on that sort of thing, I guess
 you will have a refresh button on the page when and only when it is
 appropriate.

 --
 Phil Housley

 -
 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



 -
 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: After 1 minute the Pagemap null is still locked

2009-10-02 Thread mfs

Hi Guys,

We are facing a similar problem on an Import Page which at times does take
more than a minute for large data-set, which breaks the import. I wonder if
there is a way we can bypass OR avoid this exception so as to make the
import finish properly. I understand one way can be to break the import into
smaller data-set or yet otherwise make the import an asynchronous call but I
still want to explore what other options exists

Farhan.
 

Johan Compagner wrote:
 
 it does say the thread:
 
 Thread[http-8080-Processor23,5,main]
 
 So look what that is doing
 
 
 On Fri, Jun 20, 2008 at 1:32 PM, lienok
 lienok...@gmail.comlienok%2...@gmail.com
 wrote:
 

 Hello,

 I am using now yourkit, but still can not recognize the problematic
 thread.
 In the point when exception appeared, I have some threads running, but
 they
 seems to be proper ones, expected according request what was clicked in a
 webapplication.

 see below my exception, and please give me some advice

 20.6.2008 12:57:04 org.apache.wicket.RequestCycle logRuntimeException
 SEVERE: After 1 minute the Pagemap null is still locked by:
 Thread[http-8080-Processor23,5,main], giving up trying to get the page
 for
 path: 11
 org.apache.wicket.WicketRuntimeException: After 1 minute the Pagemap null
 is
 still locked by: Thread[http-8080-Processor23,5,main], giving up trying t
 o get the page for path: 11
at org.apache.wicket.Session.getPage(Session.java:740)
at

 org.apache.wicket.request.AbstractRequestCycleProcessor.resolveRenderedPage(AbstractRequestCycleProcessor.java:448)
at

 org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:139)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1224)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1331)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:493)
at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:363)
at

 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:194)
at

 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at

 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at

 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at

 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at

 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at

 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at

 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at

 org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at

 org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at

 org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at

 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:619)


 Johan Compagner wrote:
 
  start tomcat or jetty just with java in the command prompt. So that you
  have
  a console window
 
  Also you can use other tools like yourkit to see the stack traces (or
 jmx)
  johan
 
 
  On Tue, Jun 17, 2008 at 12:14 PM, lienok
  lienok...@gmail.com
 lienok%2...@gmail.comlienok%2...@gmail.comlienok%252...@gmail.com
 
  wrote:
 
 
  Hi Johan,
 
  I am sorry but I don't understand. How can I run wicket application
 just
  from the console?
  Which class should I lunch to start it?
 
 
  Johan Compagner wrote:
  
   run java.exe in a console and do CTRL-BREAK
  
  
  
   On Tue, Jun 17, 2008 at 11:57 AM, lienok
   lienok...@gmail.com lienok%2...@gmail.com
  lienok%2...@gmail.com
 lienok%252...@gmail.comlienok%2...@gmail.comlienok%252...@gmail.com
 lienok%252...@gmail.com lienok%25252...@gmail.com
  
   wrote:
  
  
   Hello
  
   I have the similar problem, but not running on Unix. Can you please
  help
   me
   how can get thread dump in windows?
  
   any advice appreciated
   Lenka
  
  
   On 18/03/2008, Martijn Dashorst martijn.dasho...@gmail.com wrote:
Glad to be of help. kill -3 is one of those gems you should never
 forget as it can save your life. Kill to save your life: nice
 slogan... :D
   
   
 Martijn
   
   
 On 3/19/08, Jeremy Levy jer...@meetmoi.com wrote:
  Thanks Igor / Martijn for your help.
 
   As you mentioned Wicket had nothing to do with it.  I had a
  piece
   of
code
   that was executed when a user clicked a certain link and was
   blocking
by
   

Re: ModalWindow and LazyLoading Exception

2009-10-02 Thread Marcelo Fukushima
weird... I'd expect that the CheckboxMultipleChoice would force the
initialization of the list before the EntityManager is closed. Is the
exception thrown on the form submission?

On Fri, Oct 2, 2009 at 8:48 AM, Pedro Santos pedros...@gmail.com wrote:
 use *OpenSessionInViewFilter* to avoid lazy initialization exceptions

 On Fri, Oct 2, 2009 at 8:42 AM, Albert Romanius a.roman...@gmail.comwrote:

 The line that throws the exception is below:
 CheckBoxMultipleChoice subMessagesCB = new CheckBoxMultipleChoice(
               subMessages, new PropertyModel(this,
 selectedSubs), showMessage.getLazyList());

 The problem is the showMessage.getLazyList() call. When wicket renders
 this combobox, spring filter have already closed the EntityManager.
 If I uncomment this line (ugly hack):
  //showMessage.getLazyList().size();
 Everything works.

 I am using tomcat 6.0.18 (bundled with Netbeans).


 The stacktrace:

 ERROR - azyInitializationException - failed to lazily initialize a
 collection of role: com.mycompany.persistence.domain.Message.lazyList,
 no session or session was closed
 org.hibernate.LazyInitializationException: failed to lazily initialize
 a collection of role:
 com.mycompany.persistence.domain.Message.lazyList, no session or
 session was closed
        at
 org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
        at
 org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
        at
 org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
        at
 org.hibernate.collection.PersistentBag.size(PersistentBag.java:225)
        at
 org.apache.wicket.markup.html.form.ListMultipleChoice.onComponentTag(ListMultipleChoice.java:246)
        at
 org.apache.wicket.markup.html.form.CheckBoxMultipleChoice.onComponentTag(CheckBoxMultipleChoice.java:359)
        at org.apache.wicket.Component.renderComponent(Component.java:2597)
        at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
        at org.apache.wicket.Component.render(Component.java:2457)
        at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
        at
 org.apache.wicket.MarkupContainer.renderComponentTagBody(MarkupContainer.java:1601)
        at
 org.apache.wicket.MarkupContainer.onComponentTagBody(MarkupContainer.java:1525)
        at
 org.apache.wicket.markup.html.form.Form.onComponentTagBody(Form.java:1926)
        at org.apache.wicket.Component.renderComponent(Component.java:2626)
        at
 org.apache.wicket.MarkupContainer.onRender(MarkupContainer.java:1536)
        at org.apache.wicket.markup.html.form.Form.onRender(Form.java:1997)
        at org.apache.wicket.Component.render(Component.java:2457)
        at
 org.apache.wicket.MarkupContainer.renderNext(MarkupContainer.java:1414)
        at
 org.apache.wicket.MarkupContainer.renderAll(MarkupContainer.java:1552)
        at org.apache.wicket.Page.onRender(Page.java:1545)
        at org.apache.wicket.Component.render(Component.java:2457)
        at org.apache.wicket.Page.renderPage(Page.java:914)
        at
 org.apache.wicket.request.target.component.PageRequestTarget.respond(PageRequestTarget.java:63)
        at
 org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:105)
        at
 org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1258)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
        at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
        at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
        at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
 org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:112)
        at
 org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at
 

Re: Preventing Copy Pasting URL's In Same Browser Session

2009-10-02 Thread Douglas Ferguson
Are there no pros and cons of using this?


On Oct 2, 2009, at 11:39 AM, Douglas Ferguson wrote:

 Added this field and notice that it writes additional params to the
 url for pagemap.

 Preliminary testing indicated that the page map url parameter doesn't
 have to exist.

 Are there any concerns with using this option?

 Douglas

 On Oct 1, 2009, at 7:14 PM, Douglas Ferguson wrote:

 What are the implications of turning this one?

 D/


 On Sep 30, 2009, at 1:23 AM, Igor Vaynberg wrote:

 the javadoc in the later versions mentions that it is enabled by
 default, however if you are using the default secondlevel caching
 page
 store it will be disabled...

 -igor

 On Tue, Sep 29, 2009 at 11:10 PM, Carlo Camerino
 carlo.camer...@gmail.com wrote:
 hi,

 actually i'm able to make it work some how using this setting

 getPageSettings().setAutomaticMultiWindowSupport(true);

 it creates a new page map everytime i open a page in a new tab or
 new window.
 however in the wicket documentation it says that it is enabled by
 default. but upon checking it seems that it is not enabled by
 default
 that's why i'm confused.

 any recommendations regarding this?

 i can now check the page map name for each page and throw a  
 redirect
 if a new page map is encountered other than the default.

 carlo

 On Wed, Sep 30, 2009 at 5:50 AM, Phil Housley undeconstruc...@gmail.com
 wrote:
 2009/9/29 Carlo Camerino carlo.camer...@gmail.com:
 Hi everyone,

 We have this requirement in which we cannot allow the customer to
 copy
 paste the url that's appearing in the address bar into the same
 browser. For example in a different tab or in a new window. This
 can
 easily be done in Wicket Framework since the url has a
 corresponding
 page attached to it. For example if i get
 http://localhost/wicket:interface=1 appearing in the address
 bar, I
 can open anew tab paste the url and I could get into the same
 page.
 The users don't want this behavior. Could I make it work in such
 a way
 that I copy http://localhost/wicket:inteface=1, when i try to
 copy and
 paste it, it will redirect me to an error page? This happens even
 after the user has already logged in. Really need help on this
 one.


 I've been playing with the ideas from
 http://day-to-day-stuff.blogspot.com/2008/10/wicket-extreme-consistent-urls.html
 for something of my own, which might fit the bill in a way.
 Following
 that you can convince wicket to serve up every instance of a
 mounted
 page from exactly the same URL.  That means if you copy the url,
 you
 get a brand new instance of the page.  You lose the ability to
 refresh, but if you are being strict on that sort of thing, I  
 guess
 you will have a refresh button on the page when and only when it  
 is
 appropriate.

 --
 Phil Housley

 -
 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



 -
 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



setAutomaticMultiWindowSupport SecondLevelCacheSessionStore

2009-10-02 Thread Douglas Ferguson
I see this in the JavaDoc for setAutomaticMultiWindowSupport
If two windows would share the same page map, the non-bookmarkable links on 
one window could refer to stale state after working a while in the other 
window.

I am getting some bug reports from clients and I think they they are 
experiencing this exact problem

If I set this to true what effect will it have on the 
SecondLevelCacheSessionStore. Are there other things to consider?

Douglass


Another page expired question on modal window

2009-10-02 Thread Mathias Nilsson
Wicket 1.4.1

Hi,

I have tried to search the forum but with no luck. I open a modal window
that displays an applet. If I don't open any more tabs in IE7 or Firefox I
can close the modal window with no problems. However, if I open more than
one tab I'll get an Page expired exception and a confirm javascript window
closing this window when I try to close the modal window.

If I open another browser instance instead everything works fine. It's only
when using the tabs. I have tried to use different page map names in the
modalwindow.setPageMapName() but it doesn't work anyway.

Any suggestions?

// Mathias


Re: Another page expired question on modal window

2009-10-02 Thread Mathias Nilsson

Sorry my bad.

I thought I had checked Serialization on every object but I missed two of
them.

// Mathias
-- 
View this message in context: 
http://www.nabble.com/Another-page-expired-question-on-modal-window-tp25724641p25724693.html
Sent from the Wicket - User 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: Another page expired question on modal window

2009-10-02 Thread Jeremy Thomerson
easiest way to catch this is to watch the logging output

--
Jeremy Thomerson
http://www.wickettraining.com



On Fri, Oct 2, 2009 at 7:51 PM, Mathias Nilsson wicket.program...@gmail.com
 wrote:


 Sorry my bad.

 I thought I had checked Serialization on every object but I missed two of
 them.

 // Mathias
 --
 View this message in context:
 http://www.nabble.com/Another-page-expired-question-on-modal-window-tp25724641p25724693.html
 Sent from the Wicket - User 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: InvalidUrlException - how to show 404 page

2009-10-02 Thread Alex Objelean

You should know that InvalidUrlException can be quite useful... if user try
to tweak the url, that means he is attempting to hack your application
(which is impossible anyway). In such cases, you can display a nice message
like: don't try to hack the application, it won't work or you cand display
404 page.. 

Alex Objelean


Thomas Singer-4 wrote:
 
 Hi Linda, Alex and Jonas,
 
 Thank you for your answers.
 
 Just for the records: I'm now setting the internal error page in
 WebApplication.init() as Alex suggested and override
 WebApplication.newRequestCycle(Request, Response) to return a subclass of
 WebRequestCycle which overrides logRuntimeException(RuntimeException) to
 not
 log this InvalidUrlException.
 
 Tom
 
 
 Jonas wrote:
 I think it should be possible to have the webserver deliver the standard
 404 page by throwing AbortWithWebErrorCodeException
 
 You can hook in at WebRequestCycleProcessor#respond(RuntimeException
 e, RequestCycle requestCycle)
 and throw the mentioned exception. Works find just like this in our
 webapp
 
 cheers,
 Jonas
 
 
 On Fri, Oct 2, 2009 at 10:22 AM, Thomas Singer wic...@regnis.de wrote:
 As I have reported a couple of weeks ago (but can't find the message any
 more for a follow-up), Wicket shows an ugly internal-error page if one
 somehow modified the stateful URLs, e.g.

 http://localhost:8080/?wicket:interface=:8

 Following exception is logged:

 org.apache.wicket.protocol.http.request.InvalidUrlException:
 org.apache.wicket.WicketRuntimeException: Internal error parsing
 wicket:interface = :6
   at
 org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.decode(WebRequestCodingStrategy.java:231)
   at
 org.apache.wicket.Request.getRequestParameters(Request.java:172)
   at org.apache.wicket.RequestCycle.step(RequestCycle.java:1301)
   at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1419)
   at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
   at
 org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:456)
   at
 org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:289)
   at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 How to configure Wicket to show the configured 404-page instead?

 Tom



 -
 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
 
 
 

-- 
View this message in context: 
http://www.nabble.com/InvalidUrlException---how-to-show-404-page-tp25712108p25726016.html
Sent from the Wicket - User 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