Re: Wicket 1.5 and Tomcat 7 encoding issues?

2011-03-30 Thread Antoine van Wel
Maybe this in application startup?

getMarkupSettings().setDefaultMarkupEncoding(UTF-8);


Antoine


On Wed, Mar 30, 2011 at 8:13 AM, nino martinez wael
nino.martinez.w...@gmail.com wrote:
 A screen shot? it's the text that should have shown this:

 IT support vest æ ø å

 http://www.imageupload.org/?d=4D92CA9C1

 2011/3/29 Attila Király kiralyattila...@gmail.com:
 Could you provide a small example showing the problem?

 Attila

 2011/3/29 nino martinez wael nino.martinez.w...@gmail.com

 Yeah I think so, the file encoding are utf-8

 Although this are in the header :

 !-- DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; --
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
        xmlns:wicket=
 http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd;

 We had the meta tag aswell for utf-8 but it made no difference..

 Is there something else that I am missing?

 2011/3/29 Attila Király kiralyattila...@gmail.com:
  Yep I ment that and it looks ok. Is your html page in UTF-8 as well?
 
  Attila
 
  2011/3/29 nino martinez wael nino.martinez.w...@gmail.com
 
  you mean like this:
 
     Connector port=8080 protocol=HTTP/1.1
                connectionTimeout=2
                redirectPort=8443 URIEncoding=UTF-8 /
 
  Already done so.. Or?
 
  Thanks for helping..
 
  2011/3/29 Attila Király kiralyattila...@gmail.com:
   If this encoding issue is in url: did you configure Tomcat to use
 UTF-8
  for
   uri encoding (URIEncoding attribute on the HTTP connector)? The
 default
   encoding for URI is ISO-8859-1 in Tomcat and UTF-8 in Jetty.
  
   Attila
  
   2011/3/29 nino martinez wael nino.martinez.w...@gmail.com
  
   Hi Guys
  
   Im not sure if this is a wicket issue (I don't think so). But we are
   experiencing encoding(æøå) issues with Tomcat 7.0.11 after using
   Apache Wicket 1.5-rc2. However this issue does not occur when running
   Jetty..
  
   Anyone has an idea on howto fix this?
  
  
   regards Nino
  
   -
   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: shift / ctrl / alt keys + ajax

2011-03-10 Thread Antoine van Wel
Thanks! I'll look into it this weekend and get back here. Preferably
I'd like a solution without forms, but this approach is certainly
better than hacking into the wicket-ajax call.


Antoine


On Wed, Mar 9, 2011 at 6:07 AM, Richard Nichols r...@visural.com wrote:
 You can do this on the client side relatively easily.

 Just bind a javascript event handler to the onkeydown event in the browser.

 When these key(s) are depressed change a form input to indicate which keys
 are pressed.

 When your Ajax event submits, you can check the model of the component the
 input is bound to to determine if the key(s) were pressed.

 cheers,
 Richard.

 On Tue, Mar 8, 2011 at 9:59 PM, Antoine van Wel
 antoine.van@gmail.comwrote:

 Hi,

 when clicking an (ajax)link, or a checkbox, etc, on the server side
 I'd like to know whether the shift, ctrl or alt keys are pressed at
 the same time.

 So I figure I need to fetch via JavaScript and adapt the ajax call
 with some extra parameters.
 Any thoughts how to do that in a nice  clean way in 1.5 without too
 much hacking involved?


 regards,
 Antoine

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




 --
 Richard Nichols
 http://www.richardnichols.net/ :: http://onmydoorstep.com.au/


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



Re: preferred php framework by wicketeers...

2011-03-09 Thread Antoine van Wel
On Tue, Mar 8, 2011 at 3:34 PM, Frank van Lankvelt
f.vanlankv...@onehippo.com wrote:
 On Tue, Mar 8, 2011 at 1:21 PM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Since you can't always have what you want..

 Is there any PHP framework out there which comes even close to Wicket;
 component based, strict separation between HTML and programming,
 stateful, out-of-the-box Ajax support, event handling, URL mapping,
 excellent testing features, and great community support?


 it would probably have turned up in your google search if it existed ;-)
 A prototype is easy to make though; you should get a lot of benefits already
 from adopting the wicket session mgmt, component  rendering model to php.
  In fact, I built something like this for fun some time ago.  No ajax, url
 mapping, models, other fancy stuff.  But event handling and markup/code
 separation is pretty easy to accomplish.
 You'ld probably want to use smarty for the rendering though.  It doesn't
 make a lot of sense to parse html on each request and smarty probably has
 the best tooling for php templating.
 cheers, Frank


Thanks all for your answers and ideas.

Let me summarize by: nothing comes close to Wicket in the PHP world,
except for some individual features. Perhaps in other languages
there's something better, but not in PHP. Excellent :)


Antoine

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



shift / ctrl / alt keys + ajax

2011-03-08 Thread Antoine van Wel
Hi,

when clicking an (ajax)link, or a checkbox, etc, on the server side
I'd like to know whether the shift, ctrl or alt keys are pressed at
the same time.

So I figure I need to fetch via JavaScript and adapt the ajax call
with some extra parameters.
Any thoughts how to do that in a nice  clean way in 1.5 without too
much hacking involved?


regards,
Antoine

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



Re: Just 100K per session? That would be my dream come true! (Anyone here who has tuned session size before?)

2011-03-01 Thread Antoine van Wel
*bump*

I'm one of those people who is reading :-)


Antoine


On Mon, Feb 21, 2011 at 3:11 PM, Per p...@hamburg.de wrote:


 Hi,

 I am measuring it in a profiler after the request has been completed,
 but thanks for the hint.

 In case anyone else is reading, I have been playing with the
 onComponentTag() and onComponentTagBody() methods on the weekend, and
 I've been able to reduce my page sizes significantly. Admittedly, this
 comes at the expense of flexibility and beauty, but I'm only doing this
 in the inner loops of very few pages, so who cares :-)  Will write a
 summary with a couple of hints once I stop drowning in work.

 Cheers,
 Per


  Reading in the other thread that a session size of 100K or less
  is achievable, I'll admit defeat now: I have not been able to shrink
 some of
  my pages(!) to less than 200K, not to mention the sessions. Despite
 LDMs,
  CompoundPropertyModels, and no, there are no domain objects in
 there, and no
  finals.

 How are you measuring this? Keep in mind that if you calculate when a
 request is still processing, you might still be measuring temporary
 data (e.g. for LoadableDetachableModel, you would also measure the
 transientModelObject, and same for any proxies (Spring/ Guice) you
 might use.

 Eelco

 -
 To unsubscribe, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3316743i=0
 For additional commands, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3316743i=1



 
 If you reply to this email, your message will be added to the
 discussion below:
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3316743.html

 To unsubscribe from Just 100K per session? That would be my dream come
 true! (Anyone here who has tuned session size before?), click here
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3308014code=cGVyQGhhbWJ1cmcuZGV8MzMwODAxNHwtMjI2MTAwMzE0.



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3317403.html
 Sent from the Users forum mailing list archive at Nabble.com.

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



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



Re: Just 100K per session? That would be my dream come true! (Anyone here who has tuned session size before?)

2011-03-01 Thread Antoine van Wel
Hi Per,

easy to read, good advice... Even the easiest stuff made me wonder
whether I did that right... Excellent to see all these tips together.


Thanks a bunch!


Antoine


On Tue, Mar 1, 2011 at 8:21 PM, Per p...@hamburg.de wrote:
 Hi Antoine,

 I have started collecting my hints over here:

 http://www.small-improvements.com/blog/technical/tuning-wicket-session-size

 Please note that much of it may be considered hacks and bad practice (I
 am just a Wicket user, not a Wicket master). There may be better ways to
 achieve the same results. I'd love to get feedback on these suggestions!
 So give it a shot and tell me how you went!

 Good luck!
 Per


 *bump*

 I'm one of those people who is reading :-)


 Antoine


 On Mon, Feb 21, 2011 at 3:11 PM, Per [hidden email]
 /user/SendEmail.jtp?type=nodenode=3330006i=0 wrote:

 
 
  Hi,
 
  I am measuring it in a profiler after the request has been completed,
  but thanks for the hint.
 
  In case anyone else is reading, I have been playing with the
  onComponentTag() and onComponentTagBody() methods on the weekend, and
  I've been able to reduce my page sizes significantly. Admittedly, this
  comes at the expense of flexibility and beauty, but I'm only doing this
  in the inner loops of very few pages, so who cares :-)  Will write a
  summary with a couple of hints once I stop drowning in work.
 
  Cheers,
  Per
 
 
   Reading in the other thread that a session size of 100K or less
   is achievable, I'll admit defeat now: I have not been able to shrink
  some of
   my pages(!) to less than 200K, not to mention the sessions. Despite
  LDMs,
   CompoundPropertyModels, and no, there are no domain objects in
  there, and no
   finals.
 
  How are you measuring this? Keep in mind that if you calculate when a
  request is still processing, you might still be measuring temporary
  data (e.g. for LoadableDetachableModel, you would also measure the
  transientModelObject, and same for any proxies (Spring/ Guice) you
  might use.
 
  Eelco
 
  -
  To unsubscribe, e-mail: [hidden email]
  /user/SendEmail.jtp?type=nodenode=3316743i=0
  For additional commands, e-mail: [hidden email]
  /user/SendEmail.jtp?type=nodenode=3316743i=1
 
 
 
 
 
  If you reply to this email, your message will be added to the
  discussion below:
 
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3316743.html
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3316743.html?by-user=t
 
  To unsubscribe from Just 100K per session? That would be my dream come
  true! (Anyone here who has tuned session size before?), click here
 
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3308014code=cGVyQGhhbWJ1cmcuZGV8MzMwODAxNHwtMjI2MTAwMzE0
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3308014code=cGVyQGhhbWJ1cmcuZGV8MzMwODAxNHwtMjI2MTAwMzE0by-user=t.

 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3317403.html
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3317403.html?by-user=t
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3330006i=1
  For additional commands, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3330006i=2
 
 

 -
 To unsubscribe, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3330006i=3
 For additional commands, e-mail: [hidden email]
 /user/SendEmail.jtp?type=nodenode=3330006i=4



 
 If you reply to this email, your message will be added to the
 discussion below:
 http://apache-wicket.1842946.n4.nabble.com/Just-100K-per-session-That-would-be-my-dream-come-true-Anyone-here-who-has-tuned-session-size-before-tp3308014p3330006.html

 To unsubscribe from Just 100K per session? That would be my dream come
 true! (Anyone here who has tuned session size before?), click here
 http://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3308014code=cGVyQGhhbWJ1cmcuZGV8MzMwODAxNHwtMjI2MTAwMzE0.




 --
 View this message in context: 
 

Re: EXception handling in Wicket

2010-08-28 Thread Antoine van Wel
I think you should prevent that SQLException from happening in the first
place by validating the form input.
Then use a FeedbackPanel to display suitable error messages. Just google for
example code with forms, it's basic stuff.

Otherwise, create a FeedbackPanel on your page, put a try .. catch block
around your sql methods and in case of an exception, write to the
FeedbackPanel using error(your message)



Antoine


On Fri, Aug 27, 2010 at 3:02 PM, arunarapole arunakumm...@gmail.com wrote:


 Thank you for replay i am very glad you have sent me the sample code thank
 you so much

 My problem is i have to handle SQLException and only message  to be display
 in hidden field  same webpage

 do u have any idea regarding this

 Aruna

 On Thu, Aug 26, 2010 at 10:14 PM, Nitnatsnok [via Apache Wicket] 
 ml-node+2340562-650873628-136...@n4.nabble.comml-node%2b2340562-650873628-136...@n4.nabble.com
 ml-node%2b2340562-650873628-136...@n4.nabble.comml-node%252b2340562-650873628-136...@n4.nabble.com
 
  wrote:

  Oh, also I set not to show Error Page on exception in WebApplication:
 
 
 getExceptionSettings().setUnexpectedExceptionDisplay(IExceptionSettings.SHOW_NO_EXCEPTION_PAGE);
 
 
  --
   View message @
 
 http://apache-wicket.1842946.n4.nabble.com/EXception-handling-in-Wicket-tp2340439p2340562.html
  To unsubscribe from EXception handling in Wicket, click here
 http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_codenode=2340439code=YXJ1bmFrdW1tYXJpQGdtYWlsLmNvbXwyMzQwNDM5fC00Njg4NjYxODg=
 .
 
 
 


 --


 Regards
 Aruna.R
 404-988-5562

 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/EXception-handling-in-Wicket-tp2340439p2341035.html
 Sent from the Wicket - User mailing list archive at Nabble.com.



Re: [1.5] new wicket URL-related questions

2010-08-28 Thread Antoine van Wel
 Q2: (a little n00b question) how can I find out which component makes my
 page stateful?


Check the wicket-devutils and StatelessChecker. It allows you to use an
annotation to validate the component is really stateless.


Antoine


Re: Correct way of setting charset

2010-07-04 Thread Antoine van Wel
Maybe this is what you need, in your WebApplication's init method :

getMarkupSettings().setDefaultMarkupEncoding(UTF-8);




On Fri, Jul 2, 2010 at 9:29 AM, Sigmar Muuga meedi...@gmail.com wrote:

 Hello,
 what is the correct way of setting my pages charset?

 I did something like this and it didnt have any effect:
 @Override
 protected void configureResponse() {
 super.configureResponse();
 final String encoding = text/ + getMarkupType() + ; charset=UTF-8;
 getResponse().setContentType(encoding);
 }

 I want to set everything in UTF-8.

 Also, when I did something like this(like it is said in docs, I got error:
 final String encoding = text/ + getMarkupType() + ; charset= +
 CharSetUtil.getEncoding(getRequestCycle());
 getResponse().setContentType(encoding);

 And the error:
 java.lang.IndexOutOfBoundsException: Index: 4, Size: 0
 at java.util.ArrayList.add(ArrayList.java:367)
 at

 org.apache.wicket.extensions.util.encoding.CharSetMap.init(CharSetMap.java:238)
 at

 org.apache.wicket.extensions.util.encoding.CharSetUtil.initialize(CharSetUtil.java:72)
 at

 org.apache.wicket.extensions.util.encoding.CharSetUtil.getEncoding(CharSetUtil.java:102)


 Sigmar



Re: MarkupComponentBorder and deprecation

2010-04-15 Thread Antoine van Wel
hmm, interesting, that would be nice-to-have.

now it would be even better if inside this behavior one could add other
markup just like labels which i is not possible with a
MarkupComponentBorder. is that somehow doable?


Antoine


On Wed, Apr 14, 2010 at 5:59 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 no, you cant attach markup to behavior but you can create an
 equivalent of MarkupComponentBorder using a behavior.

 -igor

 On Wed, Apr 14, 2010 at 1:40 AM, Antoine van Wel
 antoine.van@gmail.com wrote:
  Hi,
 
  quick question:
 
  since IComponentBorder and Component.setComponentBorder are deprecated,
 how
  should I use MarkupComponentBorder - or shouldn't I use that at all?
 
  You can't attach a markup file to a behavior, right?
 
 
  Antoine
 

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




MarkupComponentBorder and deprecation

2010-04-14 Thread Antoine van Wel
Hi,

quick question:

since IComponentBorder and Component.setComponentBorder are deprecated, how
should I use MarkupComponentBorder - or shouldn't I use that at all?

You can't attach a markup file to a behavior, right?


Antoine


attaching a border to a component instead of vice versa - how?

2010-04-14 Thread Antoine van Wel
Hi,

is it possible to somehow attach a border to a component?

I.e. currently afaik you have to do this in markup when using a border:
  div wicket:id=border
 span wicket:id=component/
  /div
and in the code something like:
  add(new Border(border)
.add(new Component(component))

Instead I'd just want to specify
  span wicket:id=component/
and in the code
  add(new Component(component).add(new Border());

Since I want to specify markup in a separate file, behaviors don't cut it;
and MarkupComponentBorder cannot handle any wicket components inside its
markup, so that's not an option either.

Any thoughts?


Antoine


Re: Caching components

2010-03-24 Thread Antoine van Wel
Maybe this will get you started

http://twenty-six-wicket-tricks.googlecode.com/svn/trunk/twenty-six-wicket-tricks/src/main/java/com/locke/library/web/panels/caching/CachingPanel.java

After reading Jeremy's reply I think this code suffers some thread-safeness
issues though.


Antoine


On Wed, Mar 24, 2010 at 2:23 PM, zkn z...@abv.bg wrote:

 Thanks Martin!

 If possible can you please give a hint how to use behavior to cache the
 rendered HTML for a component?

 On 24.03.2010, at 10:26, Martin Sachs wrote:

  hi,
 
  we need caching of components, since the construction of huge
  hierarchies is not cheap. The rendering ist fast. We cache the rendered
  HTML of a hole component via a beheaviour and write them on the next
  requests into a Label (unescaped). So instead of creating the complete
  hierarchie on every request, we create a much smaller one. But you must
  check, that the cachable components are stateless. Also we have JQuery
  for client-effects in this components, this would also be cached.
 
  The performance is much better with that: approx. 10-50 times better:
 100ms with cache (the response time is not much depending on count
  of users)
 vs
 1500 ms without cache depending how many parallel users.
 
 
  in near feature i will announce the site officially here.
 
  Martin


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




Re: Avoiding wickety URLs in login form

2010-03-22 Thread Antoine van Wel

 3. I tried setting up the CryptedUrlWebRequestCodingStrategy. This
 successfully managed to encrypt the resulting wicket specific URL to
 ?x=a325u0234usdajfasdf, but the thing is, the login page now started
 expiring again. The reason is that CryptedUrlWebRequestCodingStrategy uses
 a
 key stored in the session, which has the effect of making all stateless
 links stateful again.


According to the javadoc of CryptedUrlWebRequestCodingStrategy you can set
an ICryptFactory using an application-based key rather than a session-based
key. This should solve the looks of your url while keeping the session
stateless. However as the javadoc also mentions this leaves the application
open to CSRF attacks.



Antoine


Re: Trailing / on parameter name/value pairs

2010-03-19 Thread Antoine van Wel
On Fri, Mar 19, 2010 at 6:43 AM, Chris Colman
chr...@stepaheadsoftware.com wrote:
 all servlet containers do that on first request. if you dont care
 about browsers with cookies disabled you can tweak tomcat to never
 append jsessionid to the url, afair there is a setting for that.

 -igor

 I wish I didn't have to care for browsers with cookies disabled but
 there's always some idiot who's preaching to the uninformed that
 'cookies are a security risk' which is bollocks if you ask me.

Having jsessionid's appended to your url can be a security risk...
Besides, it looks ugly and you don't want search engines to end up
displaying url's with jsessionid's in them.

Furthermore if people don't like cookies they can also have them
deleted after they close the browser, at least there's an option for
that in Firefox.

So I wouldn't worry about your preaching idiot and his uninformed followers ;-)


Antoine

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



Re: Bookmarkable Links Session

2010-03-16 Thread Antoine van Wel
When you have a stateless page, no session is created when you land on
such a page first, or to be more precise: a temporary session is
created. So that should explain the difference you see.

Calling Session.get().bind() when logging in should fix that.

Better, call Session.get().replaceSession() when logging in, that
should both solve your problem and fix a potential security hole.



Antoine


On Tue, Mar 16, 2010 at 8:32 PM, Mauro Ciancio maurocian...@gmail.com wrote:
 Hello everyone,

  I'm developing an application that uses a lot of bookmarkable links
 in order to
 get pretty urls. When I log in with my userpassword, I'm redirected
 to the home page. This
 behavior is ok, but the session appears to be not created, so i still see the
 login link (and not the welcome message 'you are logged in').

  However, if before login I browse a page that contains state and
 then i go to the login page,
 it works well.

 I guess the session is not being created, but it should be created
 when I try to login.

 Any ideas?
 Cheers.
 --
 Mauro Ciancio maurociancio at gmail dot com

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



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



Re: jquery/qtip integration troubles - ajax post stopped

2010-03-11 Thread Antoine van Wel
Alright, I got this to work in a clean way.

The problem was that the QTip jQuery plugin *cloned* the panel / form.
This was causing trouble for the form submission. Simply adding a
.remove() which removed the original DOM tree fixed the issue.

I ended up with replacing
.append(   content: $('# + contentMarkupId + ').html(),)

by
.append(   content: $('# + contentMarkupId + ').remove(),)


and now everything works as a charm.


Antoine.


On Wed, Mar 10, 2010 at 6:04 PM, Antoine van Wel
antoine.van@gmail.com wrote:
 Turns out Wicket.$$(this) returned false after all. Thanks Richard!

 I ended up adapting the AjaxButton by simply kicking out the
 Wicket.$$(this) of the pre-condition check.

 So can anybody tell me what this Wicket.$$(this) is good for ... I
 got a gut-feeling what I've done is not such a good idea :-)


 Antoine


 On Tue, Mar 9, 2010 at 6:44 PM, Antoine van Wel
 antoine.van@gmail.com wrote:
 Hi Richard,

 Thanks for the reply. It didn't bring me further though.
 When debugging, Wicket.$$(this) and the other one both return true, so
 that doesn't seem to be the problem.

 When tracking the evaluation of the precondition, I end up in wicket-event.js

 25 if (Function.prototype.bind == null) {
 26 Function.prototype.bind = function(object) {
 27 var __method = this;
 28 return function() {
 29 return __method.apply(object, arguments);
 30 }
 31 }
 32}

 where line 29 will return false.
 Does that ring any bells?


 By the way, in the code I copied-and-pasted in my previous email, two
 lines were not included which needs to be there:
 setOutputMarkupId(true) on parent  content components.


 Antoine

 On Tue, Mar 9, 2010 at 4:37 PM, Richard Wilkinson
 richardjohnwilkin...@googlemail.com wrote:
 Hi,

 'Ajax POST stopped because of precondition check' is probably your
 problem.  all wicket ajax can have a precondition, which is basically
 a function that returns true or false, and will only execute the ajax
 if it returns true.  I expect that for some reason in your case this
 function is returning false.

 for an AjaxButton (well AjaxFormSubmitBehavior) the precondition is
 this: return Wicket.$$(this)Wicket.$$(' + getForm().getMarkupId()
 + ');

 in the wicket ajax javascript file i see this:

 // returns if the element belongs to current document
 // if the argument is not element, function returns true
 Wicket.$$ = function(element) {
 ...
 }

 This must be failing for you, which I presume has something to do with
 how you are passing the content into the qtip;

 content: $('# + contentMarkupId + ').html()

 Hope that helps.

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


 On 9 March 2010 13:05, Antoine van Wel antoine.van@gmail.com wrote:
 Hi everybody,

 Integrating a Jquery tooltip (qtip) went smoothly until I tried to do
 an Ajax form submit.
 The Wicket Ajax Debug panel shows an Ajax POST stopped because of
 precondition check, so an Ajax response is never sent.

 What I'm doing is simply render the text for the tooltip on the same
 page in a hidden div, then pointing the content of the tooltip to that
 div.

 the html:

 wicket:head
        script type=text/javascript 
 src=/js/jquery-1.3.2.min.js/script
        script type=text/javascript 
 src=/js/jquery.qtip-1.0.0-rc3.min.js/script
 /wicket:head

 wicket:extend
        div wicket:id=content style=display: none;
                form wicket:id=form
                        input type=submit wicket:id=clickme 
 value=click me
                /form
        /div

        span wicket:id=tipmehover over me/span
 /wicket:extend

 the page class:

 public class JQueryTestPage extends BasePage {
        public JQueryTestPage() {
                WebMarkupContainer content = new 
 WebMarkupContainer(content);
                add(content);

                FormVoid form = new FormVoid(form);
                content.add(form);
                form.add(new AjaxButton(clickme) {
                       �...@override
                        protected void onSubmit(AjaxRequestTarget target, 
 Form? form) {
                                System.out.println(testing);
                        }

                });

                WebMarkupContainer qtip = new WebMarkupContainer(tipme);
                add(qtip);
                qtip.add(new QTipBehavior(qtip, content));
        }

 }


 and finally the QTipBehavior:

 public class QTipBehavior extends AbstractBehavior {
        private String componentMarkupId;
        private String contentMarkupId;

        public QTipBehavior(Component parent, Component content) {
                contentMarkupId = content.getMarkupId();
                componentMarkupId = parent.getMarkupId();
        }

       �...@override
        public void renderHead(IHeaderResponse response) {
                String javascript = new StringBuilder()
                        .append($(function

Re: jquery/qtip integration troubles - ajax post stopped

2010-03-10 Thread Antoine van Wel
Turns out Wicket.$$(this) returned false after all. Thanks Richard!

I ended up adapting the AjaxButton by simply kicking out the
Wicket.$$(this) of the pre-condition check.

So can anybody tell me what this Wicket.$$(this) is good for ... I
got a gut-feeling what I've done is not such a good idea :-)


Antoine


On Tue, Mar 9, 2010 at 6:44 PM, Antoine van Wel
antoine.van@gmail.com wrote:
 Hi Richard,

 Thanks for the reply. It didn't bring me further though.
 When debugging, Wicket.$$(this) and the other one both return true, so
 that doesn't seem to be the problem.

 When tracking the evaluation of the precondition, I end up in wicket-event.js

 25 if (Function.prototype.bind == null) {
 26 Function.prototype.bind = function(object) {
 27 var __method = this;
 28 return function() {
 29 return __method.apply(object, arguments);
 30 }
 31 }
 32}

 where line 29 will return false.
 Does that ring any bells?


 By the way, in the code I copied-and-pasted in my previous email, two
 lines were not included which needs to be there:
 setOutputMarkupId(true) on parent  content components.


 Antoine

 On Tue, Mar 9, 2010 at 4:37 PM, Richard Wilkinson
 richardjohnwilkin...@googlemail.com wrote:
 Hi,

 'Ajax POST stopped because of precondition check' is probably your
 problem.  all wicket ajax can have a precondition, which is basically
 a function that returns true or false, and will only execute the ajax
 if it returns true.  I expect that for some reason in your case this
 function is returning false.

 for an AjaxButton (well AjaxFormSubmitBehavior) the precondition is
 this: return Wicket.$$(this)Wicket.$$(' + getForm().getMarkupId()
 + ');

 in the wicket ajax javascript file i see this:

 // returns if the element belongs to current document
 // if the argument is not element, function returns true
 Wicket.$$ = function(element) {
 ...
 }

 This must be failing for you, which I presume has something to do with
 how you are passing the content into the qtip;

 content: $('# + contentMarkupId + ').html()

 Hope that helps.

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


 On 9 March 2010 13:05, Antoine van Wel antoine.van@gmail.com wrote:
 Hi everybody,

 Integrating a Jquery tooltip (qtip) went smoothly until I tried to do
 an Ajax form submit.
 The Wicket Ajax Debug panel shows an Ajax POST stopped because of
 precondition check, so an Ajax response is never sent.

 What I'm doing is simply render the text for the tooltip on the same
 page in a hidden div, then pointing the content of the tooltip to that
 div.

 the html:

 wicket:head
        script type=text/javascript 
 src=/js/jquery-1.3.2.min.js/script
        script type=text/javascript 
 src=/js/jquery.qtip-1.0.0-rc3.min.js/script
 /wicket:head

 wicket:extend
        div wicket:id=content style=display: none;
                form wicket:id=form
                        input type=submit wicket:id=clickme 
 value=click me
                /form
        /div

        span wicket:id=tipmehover over me/span
 /wicket:extend

 the page class:

 public class JQueryTestPage extends BasePage {
        public JQueryTestPage() {
                WebMarkupContainer content = new 
 WebMarkupContainer(content);
                add(content);

                FormVoid form = new FormVoid(form);
                content.add(form);
                form.add(new AjaxButton(clickme) {
                       �...@override
                        protected void onSubmit(AjaxRequestTarget target, 
 Form? form) {
                                System.out.println(testing);
                        }

                });

                WebMarkupContainer qtip = new WebMarkupContainer(tipme);
                add(qtip);
                qtip.add(new QTipBehavior(qtip, content));
        }

 }


 and finally the QTipBehavior:

 public class QTipBehavior extends AbstractBehavior {
        private String componentMarkupId;
        private String contentMarkupId;

        public QTipBehavior(Component parent, Component content) {
                contentMarkupId = content.getMarkupId();
                componentMarkupId = parent.getMarkupId();
        }

       �...@override
        public void renderHead(IHeaderResponse response) {
                String javascript = new StringBuilder()
                        .append($(function() {)
                        .append(       $('# + componentMarkupId + 
 ').qtip({)
                        .append(               content: $('# + 
 contentMarkupId + ').html(),)
                        .append(               hide: { fixed: true },)
                        .append(               position: { corner: { 
 target: 'topRight', tooltip:
 'leftTop' } },)
                        .append(       }))
                        .append(});)
                        .toString();
                response.renderOnDomReadyJavascript(javascript);
        }
 }


 All

jquery/qtip integration troubles - ajax post stopped

2010-03-09 Thread Antoine van Wel
Hi everybody,

Integrating a Jquery tooltip (qtip) went smoothly until I tried to do
an Ajax form submit.
The Wicket Ajax Debug panel shows an Ajax POST stopped because of
precondition check, so an Ajax response is never sent.

What I'm doing is simply render the text for the tooltip on the same
page in a hidden div, then pointing the content of the tooltip to that
div.

the html:

wicket:head
script type=text/javascript src=/js/jquery-1.3.2.min.js/script
script type=text/javascript 
src=/js/jquery.qtip-1.0.0-rc3.min.js/script
/wicket:head

wicket:extend
div wicket:id=content style=display: none;
form wicket:id=form
input type=submit wicket:id=clickme value=click 
me
/form
/div

span wicket:id=tipmehover over me/span
/wicket:extend

the page class:

public class JQueryTestPage extends BasePage {
public JQueryTestPage() {
WebMarkupContainer content = new WebMarkupContainer(content);
add(content);

FormVoid form = new FormVoid(form);
content.add(form);
form.add(new AjaxButton(clickme) {
@Override
protected void onSubmit(AjaxRequestTarget target, 
Form? form) {
System.out.println(testing);
}

});

WebMarkupContainer qtip = new WebMarkupContainer(tipme);
add(qtip);
qtip.add(new QTipBehavior(qtip, content));
}

}


and finally the QTipBehavior:

public class QTipBehavior extends AbstractBehavior {
private String componentMarkupId;
private String contentMarkupId;

public QTipBehavior(Component parent, Component content) {
contentMarkupId = content.getMarkupId();
componentMarkupId = parent.getMarkupId();
}

@Override
public void renderHead(IHeaderResponse response) {
String javascript = new StringBuilder()
.append($(function() {)
.append(   $('# + componentMarkupId + ').qtip({)
.append(   content: $('# + 
contentMarkupId + ').html(),)
.append(   hide: { fixed: true },)
.append(   position: { corner: { target: 
'topRight', tooltip:
'leftTop' } },)
.append(   }))
.append(});)
.toString();
response.renderOnDomReadyJavascript(javascript);
}
}


All pretty straightforward.

So my guess is somehow Wicket is not happy about the redirection I
created by not using the rendered button directly.
I've been trying to debug this using Firebug, obviously without success.

Does anybody have any hints how to solve this? Is the approach I'm
taking flawed? Maybe jWicket or wiQuery could help here?



Antoine

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



Re: jquery/qtip integration troubles - ajax post stopped

2010-03-09 Thread Antoine van Wel
Hi Richard,

Thanks for the reply. It didn't bring me further though.
When debugging, Wicket.$$(this) and the other one both return true, so
that doesn't seem to be the problem.

When tracking the evaluation of the precondition, I end up in wicket-event.js

25 if (Function.prototype.bind == null) {
26 Function.prototype.bind = function(object) {
27 var __method = this;
28 return function() {
29 return __method.apply(object, arguments);
30 }
31 }
32}

where line 29 will return false.
Does that ring any bells?


By the way, in the code I copied-and-pasted in my previous email, two
lines were not included which needs to be there:
setOutputMarkupId(true) on parent  content components.


Antoine

On Tue, Mar 9, 2010 at 4:37 PM, Richard Wilkinson
richardjohnwilkin...@googlemail.com wrote:
 Hi,

 'Ajax POST stopped because of precondition check' is probably your
 problem.  all wicket ajax can have a precondition, which is basically
 a function that returns true or false, and will only execute the ajax
 if it returns true.  I expect that for some reason in your case this
 function is returning false.

 for an AjaxButton (well AjaxFormSubmitBehavior) the precondition is
 this: return Wicket.$$(this)Wicket.$$(' + getForm().getMarkupId()
 + ');

 in the wicket ajax javascript file i see this:

 // returns if the element belongs to current document
 // if the argument is not element, function returns true
 Wicket.$$ = function(element) {
 ...
 }

 This must be failing for you, which I presume has something to do with
 how you are passing the content into the qtip;

 content: $('# + contentMarkupId + ').html()

 Hope that helps.

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


 On 9 March 2010 13:05, Antoine van Wel antoine.van@gmail.com wrote:
 Hi everybody,

 Integrating a Jquery tooltip (qtip) went smoothly until I tried to do
 an Ajax form submit.
 The Wicket Ajax Debug panel shows an Ajax POST stopped because of
 precondition check, so an Ajax response is never sent.

 What I'm doing is simply render the text for the tooltip on the same
 page in a hidden div, then pointing the content of the tooltip to that
 div.

 the html:

 wicket:head
        script type=text/javascript src=/js/jquery-1.3.2.min.js/script
        script type=text/javascript 
 src=/js/jquery.qtip-1.0.0-rc3.min.js/script
 /wicket:head

 wicket:extend
        div wicket:id=content style=display: none;
                form wicket:id=form
                        input type=submit wicket:id=clickme value=click 
 me
                /form
        /div

        span wicket:id=tipmehover over me/span
 /wicket:extend

 the page class:

 public class JQueryTestPage extends BasePage {
        public JQueryTestPage() {
                WebMarkupContainer content = new 
 WebMarkupContainer(content);
                add(content);

                FormVoid form = new FormVoid(form);
                content.add(form);
                form.add(new AjaxButton(clickme) {
                       �...@override
                        protected void onSubmit(AjaxRequestTarget target, 
 Form? form) {
                                System.out.println(testing);
                        }

                });

                WebMarkupContainer qtip = new WebMarkupContainer(tipme);
                add(qtip);
                qtip.add(new QTipBehavior(qtip, content));
        }

 }


 and finally the QTipBehavior:

 public class QTipBehavior extends AbstractBehavior {
        private String componentMarkupId;
        private String contentMarkupId;

        public QTipBehavior(Component parent, Component content) {
                contentMarkupId = content.getMarkupId();
                componentMarkupId = parent.getMarkupId();
        }

       �...@override
        public void renderHead(IHeaderResponse response) {
                String javascript = new StringBuilder()
                        .append($(function() {)
                        .append(       $('# + componentMarkupId + 
 ').qtip({)
                        .append(               content: $('# + 
 contentMarkupId + ').html(),)
                        .append(               hide: { fixed: true },)
                        .append(               position: { corner: { target: 
 'topRight', tooltip:
 'leftTop' } },)
                        .append(       }))
                        .append(});)
                        .toString();
                response.renderOnDomReadyJavascript(javascript);
        }
 }


 All pretty straightforward.

 So my guess is somehow Wicket is not happy about the redirection I
 created by not using the rendered button directly.
 I've been trying to debug this using Firebug, obviously without success.

 Does anybody have any hints how to solve this? Is the approach I'm
 taking flawed? Maybe jWicket or wiQuery could help here?



 Antoine

Re: How to encrypt/obfuscate resource reference?

2010-03-02 Thread Antoine van Wel
A flag has been introduced that when set will throw an error when an
fqn would be used. It will be in 1.4.7, which is currently in the
voting phase, so it will be available within a week.

But this would mean you'd have to alias all the classes anyway.


Antoine


On Tue, Mar 2, 2010 at 12:33 PM, Sergey Olefir solf.li...@gmail.com wrote:


 Thing is, I already toyed with WebRequestCodingStrategy -- specifically I
 changed how resources are encoded by replacing URL path with URL parameter.
 And I broke CSS/relative references in the process as I found out much later
 :) (as you found out already in your another post ;))

 Although if I do something less drastic -- such as simply encoding the
 section with FQN -- I might break less stuff... Ah well, as you pointed out
 (and special thanks for that :)), 1.4.7 hopefully will be out soon with the
 some fix for the issue, maybe I can just wait it out.


 bgooren wrote:

 So I had a quick look at the source code of WebRequestCodingStrategy, and
 I think it should be possible to create a solution for your problem quite
 easily:


 --
 View this message in context: 
 http://old.nabble.com/How-to-encrypt-obfuscate-resource-reference--tp27744679p27754796.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





-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: jWicket release 0.5.0

2010-03-01 Thread Antoine van Wel
Hi Stefan,

I'm a bit lost in the wicketstuff maven repository - when I browse I
only see 1.4.1 and 1.4.2-SNAPSHOT. Any idea when this version will be
in the maven repo? But for now it would be great if you could send me
the pre-build jar.

Thanks!


Antoine


On Fri, Feb 26, 2010 at 2:57 PM, Stefan Lindner lind...@visionet.de wrote:
 I have committed jWicket version 0.5.0 to wicketstuff

 Changes:
 - jQuery update to Version 1.4.2
 - jQuery UI update to 1.8RC2
 - drag/drop/resize improvements to work in IE 6/7/8 after AJAX update or
 in LazyLoad panels
 - drag/drop/resize improvements for less footprint in HTML, smaller js
 code generation
 - Effects rewritten completely, now covering all effects
 - Effects now support a chain of multiple effects

 Known Issues
 - Example application not very attractive
 - Example applicatioin contains some debugging code

 Let me know if someone needs prebuild jar files.

 Stefan

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





-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: How to encrypt/obfuscate resource reference?

2010-03-01 Thread Antoine van Wel
for a discussion and suggestion see

http://old.nabble.com/CryptedUrlWebRequestCodingStrategy-%2B-WebRequestCodingStrategy-%3D-resource-URLs-are-not-encrypted-(bug-).-td27209560.html

quote I was able to get around this by subclassing WebRequestCodingStrategy and
overriding methods:
addResourceParameters(..);
encode(RequestCycle requestCycle, ISharedResourceRequestTarget
requestTarget);
to use arguments rather than path as resource reference. 


haven't tried that myself yet, but will need it in the near future.


IMHO it would make sense to include this in the
CryptedUrlWebRequestCodingStrategy.


regards
Antoine.





On Mon, Mar 1, 2010 at 4:01 PM, Sergey Olefir solf.li...@gmail.com wrote:
 Hi,

 out of the box Wicket generates urls for packaged resources that
 contain fully-qualified class names, e.g.:
 link rel=stylesheet type=text/css
 href=resources/org.example.MyClassName/decorations/style.css /

 Now in accordance with our security policies we are not allowed to
 expose internal application details -- and fully qualified class name
 certainly fits that category.

 On the other hand we do very much want to package resources together
 with the components that use them -- this approach seems to be way
 more convenient in practice than any other option.

 So I've been looking into whether it is possible to encrypt resource
 references (at least the class name part). My research led me to
 SharedResources.resourceKey(final Class? scope, final String path,
 final Locale locale, final String style)
 method which apparently is responsible for inserting FQNs into urls.

 Unfortunately this place seems to be locked down hard -- method is
 'NOT PART OF THE WICKET PUBLIC API' and corresponding accessor method
 in Application is final. Moreover the field containing the instance in
 Application is private final -- so even reflection is no help.

 So any ideas how can I encrypt/obfuscate resource references without
 resorting to aliasing every single class on the classloader path?
 (aliasing 'as needed' is not really an option as it would be
 devilishly hard to ensure that there are no un-aliased urls as the
 system is developed in the future and new components/resources are
 added)

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





-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: How to encrypt/obfuscate resource reference?

2010-03-01 Thread Antoine van Wel
Oops :-)

can't you just take the path and encrypt that using the same strategy
as the cryptedurl.. thingy is using?


Antoine


On Mon, Mar 1, 2010 at 5:43 PM, Sergey Olefir solf.li...@gmail.com wrote:

 He he, that was my old thread there :)

 Thing is, I just recently discovered, that encoding resources as arguments
 (rather than paths) completely breaks relative URLs discussed there:
 http://old.nabble.com/How-to-'resolve'-URL-in-stylesheet--td27720293.html
 (for the simple reason that browser strips out arguments when resolving
 relative url).

 So it is necessary to come up with some other solution.



 Antoine van Wel wrote:

 for a discussion and suggestion see

 http://old.nabble.com/CryptedUrlWebRequestCodingStrategy-%2B-WebRequestCodingStrategy-%3D-resource-URLs-are-not-encrypted-(bug-).-td27209560.html


 --
 View this message in context: 
 http://old.nabble.com/How-to-encrypt-obfuscate-resource-reference--tp27744679p27745911.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





-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: Validate with info messages, instead of errors

2010-02-25 Thread Antoine van Wel
As for the link you show, the author is building something which is
available in the Wicket core, which he seems to have missed or perhaps
it's just an outdated article.

Make a FeedbackPanel for every FormComponent you want to have messages
for and initialize it with a ComponentFeedbackMessageFilter so you
will only see the info/error messages relevant to the FormComponent
you attach that filter to.

I don't really see the problem with adapting a MaximumValidator output
info messages instead of errors, just override validate or copy and
paste the whole thing and adapt it, it's a small class.


Antoine.

On Thu, Feb 25, 2010 at 1:27 PM,  espen.peder...@husbanken.no wrote:
 Hi all!

 I'm Looking for a way to perform validation, but print the messages as
 INFO (with Ajax), instead of ERRORs. I'd like to have a combination of
 error and info validators. An error will prevent the user from submitting
 the form, the info message will give the user a warning/info message. The
 messages should popup during an onblur event from the component and be
 displayed in a way similar to:
 http://stuq.nl/weblog/2008-09-03/user-friendly-form-validation-with-wicket
 .

 I've been looking into extending for instance MaximumValidator and let it
 report info messages, unfortunately I'm unable to get hold og the
 Component through the IValidatable interface impl. The error message,
 which I'd like to use, is built up inside the FromComponents error method
 and unavailable for me. Maybe I'm on the wrong the wrong path here?
 Anybody that has done something similar?

 --
 Espen Ønvik Pedersen

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



Re: Form validation without a form component

2010-02-11 Thread Antoine van Wel
for the archive-searchers :)

simply override onValidate in the Form class, check your listsize
there  call error() when applicable


Antoine

On Fri, Apr 3, 2009 at 12:25 PM, triswork tristan.k...@gmail.com wrote:

 Thanks for the suggestion Martijn.
 I tried return new FormComponent[0]; and got exactly the same error.

 I think my use-case is quite fringe, so I have resigned myself to using the
 hidden field that you previously suggested.

  - Tristan


 Martijn Dashorst wrote:

 You might try to return an empty array..

 Martijn


 --
 View this message in context: 
 http://www.nabble.com/Form-validation-without-a-form-component-tp22682572p22866535.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



expecting different behavior from form validation - potential bug?

2010-02-11 Thread Antoine van Wel
hi,

In a nested form the onValidate() is overridden.
It sets an error message on a component inside this form - so not on
the form itself.

However the submit on the form itself is executed as if no error
exists. What I see when debugging is that hasErrorMessages on the
inside nested form returns false. Is this correct? Should I explicitly
set an error on the form, or something else to indicate the form
itself has an error?

..using 1.4.6


Antoine.

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



Re: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?).

2010-02-09 Thread Antoine van Wel
ok, added WICKET-2731



Antoine




On Thu, Jan 21, 2010 at 4:52 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 not sure that is possible currently. the aliasing only works on a per
 class level. see SharedResources.putClassAlias().

 you can add an rfe to have it enhanced.

 seems like a quiet arbitrary requirement, especially when it comes to
 security. an fqn does not give anything away security-wise.

 -igor



 On Thu, Jan 21, 2010 at 1:18 AM, Antoine van Wel
 antoine.van@gmail.com wrote:
 What can you do if you need to enforce that no fqn's are ever
 generated in (resource) paths?

 Best I can think of now is putting a breakpoint in the resourceKey
 method where the fqn is retrieved, and then stepping through your full
 webapp - which is a rather poor solution. Any other ideas?


 Antoine





 On Mon, Jan 18, 2010 at 5:18 PM, Igor Vaynberg igor.vaynb...@gmail.com 
 wrote:
 the original design goal of the crypted strategy was to only encrypt
 what the user sees in the url bar. since they never see resource urls
 there was no reason to encrypt those.

 re fqns, you can add class aliases into SharedResources to hide those.

 -igor

 2010/1/18 Sergejs Olefirs sergejs.olef...@parex.lv:
 Hi,

 I started using Wicket rather recently. As part of our security
 considerations, we do not want immediately expose the underlying
 framework(s) we are using, so we went ahead with URL encryption. We used
 standard approach as described in examples:

 @Override
 protected IRequestCycleProcessor newRequestCycleProcessor() {

 return new WebRequestCycleProcessor(){
  protected IRequestCodingStrategy newRequestCodingStrategy(){
        return new CryptedUrlWebRequestCodingStrategy(new
 WebRequestCodingStrategy());
       }
 };

 }


 Unfortunately I later discovered that this approach doesn't encrypt 
 resource
 URLs, e.g. from:
 CSSPackageResource.getHeaderContribution(..);
 or
 link.add(new Image(logoImage));

 What's worse such resource references include FQN of related classes.


 After some investigation I found out that the problem is that
 CryptedUrlWebRequestCodingStrategy only encrypts arguments string of the 
 URL
 and WebRequestCodingStrategy encodes resource references as path rather 
 than
 as argument.

 I was able to get around this by subclassing WebRequestCodingStrategy and
 overriding methods:
 addResourceParameters(..);
 encode(RequestCycle requestCycle, ISharedResourceRequestTarget
 requestTarget);
 to use arguments rather than path as resource reference.


 However I'm unsure as to original reasoning behind original
 CryptedUrlWebRequestCodingStrategy and WebRequestCodingStrategy. Is the
 resource behaviour simply a bug? Or is it there for some reason that is
 going to bite me down the road if I use my own 'fix'?


 Best regards,
 Sergey

 -
 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





 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

 -
 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: CryptedUrlWebRequestCodingStrategy + WebRequestCodingStrategy = resource URLs are not encrypted (bug?).

2010-01-21 Thread Antoine van Wel
What can you do if you need to enforce that no fqn's are ever
generated in (resource) paths?

Best I can think of now is putting a breakpoint in the resourceKey
method where the fqn is retrieved, and then stepping through your full
webapp - which is a rather poor solution. Any other ideas?


Antoine





On Mon, Jan 18, 2010 at 5:18 PM, Igor Vaynberg igor.vaynb...@gmail.com wrote:
 the original design goal of the crypted strategy was to only encrypt
 what the user sees in the url bar. since they never see resource urls
 there was no reason to encrypt those.

 re fqns, you can add class aliases into SharedResources to hide those.

 -igor

 2010/1/18 Sergejs Olefirs sergejs.olef...@parex.lv:
 Hi,

 I started using Wicket rather recently. As part of our security
 considerations, we do not want immediately expose the underlying
 framework(s) we are using, so we went ahead with URL encryption. We used
 standard approach as described in examples:

 @Override
 protected IRequestCycleProcessor newRequestCycleProcessor() {

 return new WebRequestCycleProcessor(){
  protected IRequestCodingStrategy newRequestCodingStrategy(){
        return new CryptedUrlWebRequestCodingStrategy(new
 WebRequestCodingStrategy());
       }
 };

 }


 Unfortunately I later discovered that this approach doesn't encrypt resource
 URLs, e.g. from:
 CSSPackageResource.getHeaderContribution(..);
 or
 link.add(new Image(logoImage));

 What's worse such resource references include FQN of related classes.


 After some investigation I found out that the problem is that
 CryptedUrlWebRequestCodingStrategy only encrypts arguments string of the URL
 and WebRequestCodingStrategy encodes resource references as path rather than
 as argument.

 I was able to get around this by subclassing WebRequestCodingStrategy and
 overriding methods:
 addResourceParameters(..);
 encode(RequestCycle requestCycle, ISharedResourceRequestTarget
 requestTarget);
 to use arguments rather than path as resource reference.


 However I'm unsure as to original reasoning behind original
 CryptedUrlWebRequestCodingStrategy and WebRequestCodingStrategy. Is the
 resource behaviour simply a bug? Or is it there for some reason that is
 going to bite me down the road if I use my own 'fix'?


 Best regards,
 Sergey

 -
 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





-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
On a page there's a form with a textarea.
Somewhere else on the page there is a wicket link, which is not inside the form.
The user types something in the textarea and then presses the link.

Now what I'd like to achieve is when the code of the link is executed,
the model of the form is up-to-date - so what the user has typed,
should be inside the model. The form should not be submitted.


Any suggestions how this can be done - preferably without writing Javascript?



Thanks,
Antoine


-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Thanks for the replies.

Peter: that won't work - the contents of the textarea are not
transferred to the wicket app without some javascript / ajax magic
happening under the hood

Pedro: Using that I could let the component listen to onchange event
but that would cause an unacceptable load. I really want the model
update action to be initiated by the link. Or can I let clicking the
link generate an event which then will be picked up by the component?




Antoine


On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
 you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
 the model updated

 On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.dewrote:

 Have you tried assign a Model to the component which needs to be updated?

 ModelString model = new ModelString();
 --- assign to the component of the form.
 i.e. final TextField tf = new TextField(txt, model);

 in Link Execution
 - tf.setModel(mode);



 - Ursprüngliche Mail 
 Von: Antoine van Wel antoine.van@gmail.com
 An: users@wicket.apache.org
 Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
 Betreff: how to update a form model when clicking a link

 On a page there's a form with a textarea.
 Somewhere else on the page there is a wicket link, which is not inside the
 form.
 The user types something in the textarea and then presses the link.

 Now what I'd like to achieve is when the code of the link is executed,
 the model of the form is up-to-date - so what the user has typed,
 should be inside the model. The form should not be submitted.


 Any suggestions how this can be done - preferably without writing
 Javascript?



 Thanks,
 Antoine


 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

 -
 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




 --
 Pedro Henrique Oliveira dos Santos




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Thanks, it works!

In my case submitting the form is not natural at all - the form submit
does a lot of actions while all I want is the text that the user
entered to show up in the next page. (The link that is being clicked
is not directly related to the form.)

Now I got a new question related to this... Instead of attaching this
behavior to a link, I want this behavior attached to a form submit. So
got 2 forms on the page, that event needs to get triggered on form
submit.. Guess I need to put the same hook in the action of the
form. But how to do that and afterwards continue with the original
action? (The headache is caused when pressing the enter key in that
second form.)



Antoine

On Wed, Oct 21, 2009 at 2:52 PM, Pedro Santos pedros...@gmail.com wrote:
  Or can I let clicking the link generate an event which then will be picked
 up by the component

 you can, but is an workaround:
 1 - add AjaxFormComponentUpdatingBehavior on your textarea for 'metal' event
 2 - add
 eval(Wicket.$('mytextareamarkupid').getAttribute('metal'))
 on 'onclick' event of your link

 But... seems very natural require the user submit the form that contains the
 textarea.

 On Wed, Oct 21, 2009 at 10:18 AM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Thanks for the replies.

 Peter: that won't work - the contents of the textarea are not
 transferred to the wicket app without some javascript / ajax magic
 happening under the hood

 Pedro: Using that I could let the component listen to onchange event
 but that would cause an unacceptable load. I really want the model
 update action to be initiated by the link. Or can I let clicking the
 link generate an event which then will be picked up by the component?




 Antoine


 On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
  you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
  the model updated
 
  On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:
 
  Have you tried assign a Model to the component which needs to be
 updated?
 
  ModelString model = new ModelString();
  --- assign to the component of the form.
  i.e. final TextField tf = new TextField(txt, model);
 
  in Link Execution
  - tf.setModel(mode);
 
 
 
  - Ursprüngliche Mail 
  Von: Antoine van Wel antoine.van@gmail.com
  An: users@wicket.apache.org
  Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
  Betreff: how to update a form model when clicking a link
 
  On a page there's a form with a textarea.
  Somewhere else on the page there is a wicket link, which is not inside
 the
  form.
  The user types something in the textarea and then presses the link.
 
  Now what I'd like to achieve is when the code of the link is executed,
  the model of the form is up-to-date - so what the user has typed,
  should be inside the model. The form should not be submitted.
 
 
  Any suggestions how this can be done - preferably without writing
  Javascript?
 
 
 
  Thanks,
  Antoine
 
 
  --
  take your photos everywhere you go - https://www.memolio.com
  follow us on Twitter - http://twitter.com/Memolio
 
  -
  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
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

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




 --
 Pedro Henrique Oliveira dos Santos




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: how to update a form model when clicking a link

2009-10-21 Thread Antoine van Wel
Problem solved, no need to touch the action attribute, just put the
call in onsubmit and leave the action untouched.



Antoine


On Wed, Oct 21, 2009 at 10:30 PM, Antoine van Wel
antoine.van@gmail.com wrote:
 Thanks, it works!

 In my case submitting the form is not natural at all - the form submit
 does a lot of actions while all I want is the text that the user
 entered to show up in the next page. (The link that is being clicked
 is not directly related to the form.)

 Now I got a new question related to this... Instead of attaching this
 behavior to a link, I want this behavior attached to a form submit. So
 got 2 forms on the page, that event needs to get triggered on form
 submit.. Guess I need to put the same hook in the action of the
 form. But how to do that and afterwards continue with the original
 action? (The headache is caused when pressing the enter key in that
 second form.)



 Antoine

 On Wed, Oct 21, 2009 at 2:52 PM, Pedro Santos pedros...@gmail.com wrote:
  Or can I let clicking the link generate an event which then will be picked
 up by the component

 you can, but is an workaround:
 1 - add AjaxFormComponentUpdatingBehavior on your textarea for 'metal' event
 2 - add
 eval(Wicket.$('mytextareamarkupid').getAttribute('metal'))
 on 'onclick' event of your link

 But... seems very natural require the user submit the form that contains the
 textarea.

 On Wed, Oct 21, 2009 at 10:18 AM, Antoine van Wel antoine.van@gmail.com
 wrote:

 Thanks for the replies.

 Peter: that won't work - the contents of the textarea are not
 transferred to the wicket app without some javascript / ajax magic
 happening under the hood

 Pedro: Using that I could let the component listen to onchange event
 but that would cause an unacceptable load. I really want the model
 update action to be initiated by the link. Or can I let clicking the
 link generate an event which then will be picked up by the component?




 Antoine


 On Wed, Oct 21, 2009 at 2:03 PM, Pedro Santos pedros...@gmail.com wrote:
  you can add an AjaxFormComponentUpdatingBehavior on your textarea to keep
  the model updated
 
  On Wed, Oct 21, 2009 at 9:58 AM, Peter Arnulf Lustig u...@yahoo.de
 wrote:
 
  Have you tried assign a Model to the component which needs to be
 updated?
 
  ModelString model = new ModelString();
  --- assign to the component of the form.
  i.e. final TextField tf = new TextField(txt, model);
 
  in Link Execution
  - tf.setModel(mode);
 
 
 
  - Ursprüngliche Mail 
  Von: Antoine van Wel antoine.van@gmail.com
  An: users@wicket.apache.org
  Gesendet: Mittwoch, den 21. Oktober 2009, 13:22:01 Uhr
  Betreff: how to update a form model when clicking a link
 
  On a page there's a form with a textarea.
  Somewhere else on the page there is a wicket link, which is not inside
 the
  form.
  The user types something in the textarea and then presses the link.
 
  Now what I'd like to achieve is when the code of the link is executed,
  the model of the form is up-to-date - so what the user has typed,
  should be inside the model. The form should not be submitted.
 
 
  Any suggestions how this can be done - preferably without writing
  Javascript?
 
 
 
  Thanks,
  Antoine
 
 
  --
  take your photos everywhere you go - https://www.memolio.com
  follow us on Twitter - http://twitter.com/Memolio
 
  -
  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
 
 
 
 
  --
  Pedro Henrique Oliveira dos Santos
 



 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio

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




 --
 Pedro Henrique Oliveira dos Santos




 --
 take your photos everywhere you go - https://www.memolio.com
 follow us on Twitter - http://twitter.com/Memolio




-- 
take your photos everywhere you go - https://www.memolio.com
follow us on Twitter - http://twitter.com/Memolio

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



Re: better way to strip wicket markup / tags per page?

2009-09-30 Thread Antoine van Wel
Craig: didn't consider that. So, no clean solution seems to be possible.

Pedro: yes I was talking about having the wicket-tags turned on for the
application except for a certain (xml) page, since it is causing parse
errors in the xml there.


Antoine

On Tue, Sep 29, 2009 at 9:23 PM, Craig McIlwee 
craig.mcil...@openroadsconsulting.com wrote:

 I don't see how this can work reliably when there is more than 1 user,
 AFAIK wicket has no synchronization in place that prevents 2 pages from
 going through the render phase at the same time.  So if one page finishes
 rendering and changes the setting to false while another page has just
 started rendering (e.g. the line immediately after change the setting to
 true) then that page will render with the wrong value.

 Craig

 -Original Message-
 From: Antoine van Wel [mailto:antoine.van@gmail.com]
 Sent: Tuesday, September 29, 2009 9:03 AM
 To: users@wicket.apache.org
 Subject: Re: better way to strip wicket markup / tags per page?

 Thanks for the lightning fast reply.

 Yes it works fine under development. Still I don't like it - after all
 these
 statements are also executed during production mode, and even though they
 can't do any harm there, I'd rather not see them there at all. More a
 matter
 of personal taste I guess.

 Anyway I have something in mind to improve it according to my taste. Will
 implement that when I got time... This is not really an urgent issue to me.
 Thanks anyway for the reply - I'm assuming now there really is no other way
 to do this than temporarily changing the global settings.


 Antoine


 On Tue, Sep 29, 2009 at 7:46 PM, Marat Radchenko 
 slonopotamusor...@gmail.com wrote:

  
   In some situations during development...
 
  With that in mind, this solution is absolutely ok.
 
  2009/9/29 Antoine van Wel antoine.van@gmail.com
 
   Hi,
  
   on the wiki[1] it is described how to get rid of wicket markup such as
   wicket:id attributes on a page basis.
   The solution looks like a dirty hack to me which may go wrong when for
   instance exceptions occur. Does anybody know of a better way?
  
   For completeness sake, here is the code duplicated from the wiki:
  
   private boolean stripTags;
  
   public TestPage() {
  stripTags =
Application.get().getMarkupSettings().getStripWicketTags();
   }
   @Override
   protected void onBeforeRender() {
  Application.get().getMarkupSettings().setStripWicketTags(true);
   }
   @Override
   protected void onAfterRender() {
  
   Application.get().getMarkupSettings().setStripWicketTags(stripTags);
   }
  
  
  
   Thanks in advance,
  
   Antoine.
  
  
   References:
   [1]
  
 
 http://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html
  
 

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




better way to strip wicket markup / tags per page?

2009-09-29 Thread Antoine van Wel
Hi,

on the wiki[1] it is described how to get rid of wicket markup such as
wicket:id attributes on a page basis.
The solution looks like a dirty hack to me which may go wrong when for
instance exceptions occur. Does anybody know of a better way?

For completeness sake, here is the code duplicated from the wiki:

private boolean stripTags;

public TestPage() {
stripTags =  Application.get().getMarkupSettings().getStripWicketTags();
}
@Override
protected void onBeforeRender() {
Application.get().getMarkupSettings().setStripWicketTags(true);
}
@Override
protected void onAfterRender() {
Application.get().getMarkupSettings().setStripWicketTags(stripTags);
}



Thanks in advance,

Antoine.


References:
[1]
http://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html


Re: better way to strip wicket markup / tags per page?

2009-09-29 Thread Antoine van Wel
Thanks for the lightning fast reply.

Yes it works fine under development. Still I don't like it - after all these
statements are also executed during production mode, and even though they
can't do any harm there, I'd rather not see them there at all. More a matter
of personal taste I guess.

Anyway I have something in mind to improve it according to my taste. Will
implement that when I got time... This is not really an urgent issue to me.
Thanks anyway for the reply - I'm assuming now there really is no other way
to do this than temporarily changing the global settings.


Antoine


On Tue, Sep 29, 2009 at 7:46 PM, Marat Radchenko 
slonopotamusor...@gmail.com wrote:

 
  In some situations during development...

 With that in mind, this solution is absolutely ok.

 2009/9/29 Antoine van Wel antoine.van@gmail.com

  Hi,
 
  on the wiki[1] it is described how to get rid of wicket markup such as
  wicket:id attributes on a page basis.
  The solution looks like a dirty hack to me which may go wrong when for
  instance exceptions occur. Does anybody know of a better way?
 
  For completeness sake, here is the code duplicated from the wiki:
 
  private boolean stripTags;
 
  public TestPage() {
 stripTags =
   Application.get().getMarkupSettings().getStripWicketTags();
  }
  @Override
  protected void onBeforeRender() {
 Application.get().getMarkupSettings().setStripWicketTags(true);
  }
  @Override
  protected void onAfterRender() {
 
  Application.get().getMarkupSettings().setStripWicketTags(stripTags);
  }
 
 
 
  Thanks in advance,
 
  Antoine.
 
 
  References:
  [1]
 
 http://cwiki.apache.org/WICKET/how-to-remove-wicket-markup-from-output.html
 




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: UTF-8

2009-09-02 Thread Antoine van Wel
On Tue, Sep 1, 2009 at 3:39 PM, Johan Compagner jcompag...@gmail.comwrote:

 Everybody should stop using any other encoding then UTF-8
 Common people we should start this change from happening now :)

 Drop all charsets and all over the world. ban them everywhere, it should be
 illegal to use them, if you do still use them you should be thrown in to
 prison for at least 5 years.
 UTF-8 everywhere!



Agreed! So let's set the default settings to UTF-8, instead of the system
settings. Would have saved me some time debugging... My development
environment uses UTF-8, deployment environment does not, so that was causing
some trouble.


Antoine


htmlvalidator / responsefilter not executed through wickettester?

2009-08-24 Thread Antoine van Wel
Hi,

HtmlValidator [1] turns out to be a great help for those who care about
valid (x)html.
Now I'm trying to get it to work in my unit tests, it doesn't seem to be
picked up; in fact I wonder if any responsefilter is being executed at all
when running from wickettester. What do you think? The filter is added
exactly as described in the blog through
getRequestCycleSettings().addResponseFilter(htmlValidator) and I'm sure that
is being executed.

thanks
Antoine

[1] http://wicketinaction.com/2009/06/wicket-html-validator-12/

-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: htmlvalidator / responsefilter not executed through wickettester?

2009-08-24 Thread Antoine van Wel
Thanks for the quick response.
Somehow I get the feeling a patch will take quite some effort and time is
kind of scarce now... :-)

Antoine


On Mon, Aug 24, 2009 at 12:00 PM, Martijn Dashorst 
martijn.dasho...@gmail.com wrote:

 HtmlValidator was not designed for use in WicketTester, see my
 response to this question [1].

 That said, I'd like to extend HtmlValidator to be useful with
 wickettester and will gladly accept patches :-)

 Martijn

 [1] http://osdir.com/ml/users-wicket.apache.org/2009-08/msg00260.html

 On Mon, Aug 24, 2009 at 11:55 AM, Antoine van
 Welantoine.van@gmail.com wrote:
  Hi,
 
  HtmlValidator [1] turns out to be a great help for those who care about
  valid (x)html.
  Now I'm trying to get it to work in my unit tests, it doesn't seem to be
  picked up; in fact I wonder if any responsefilter is being executed at
 all
  when running from wickettester. What do you think? The filter is added
  exactly as described in the blog through
  getRequestCycleSettings().addResponseFilter(htmlValidator) and I'm sure
 that
  is being executed.
 
  thanks
  Antoine
 
  [1] http://wicketinaction.com/2009/06/wicket-html-validator-12/
 
  --
 
  --8--8--
  take your photos everywhere you go - http://www.memolio.com
  --8--8--
  We don't see things as they are, we see things as we are. - Anais Nin
  Whether you think you can or whether you think you can't, you're right. -
  Henry Ford
  --8--8--
 



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




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: Failed to handle wicket:container

2009-07-01 Thread Antoine van Wel
replace the wicket:container by a div, and a better error message may
appear.
in my case the error appeared for a wrong wicket:id
(using 1.3.6)

it would be helpful if the error message made more sense, shall i file a
jira issue for this? (don't know if the same message occurs in 1.4)


Antoine

On Thu, Apr 10, 2008 at 1:20 AM, Jonathan Locke jonathan.lo...@gmail.comwrote:



 I am currently trying to debug a markup handling problem where Wicket is
 complaining that it Failed to handle: wicket:container wicket:id=xyz

 I suspect that the problem is mine as I am mucking around with content
 types
 to deal with mobile devices.  Any ideas on what might be wrong or what
 might
 be a good approach for debugging this? Also, I've changed markup loading a
 bit so it switches back and forth between .wml and .html files (falling
 back
 on the .html if the .wml does not exist). Would this cause any havoc with
 resolving this wicket:container tag?

 Thanks,

Jon



 --
 View this message in context:
 http://www.nabble.com/Failed-to-handle-wicket%3Acontainer-tp16598980p16598980.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




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


form inside table not displayed on ajax call

2009-07-01 Thread Antoine van Wel
Hi all,


I have a table with various rows in them with an action link per row.
When pressing the action link, that row disappears, and new rows are
inserted.
It works as a charm, except when the newly inserted rows are surrounded by a
form tag, so inside the form, there are tr tags.
What happens then is... nothing! The row with the action link disappears as
it should, but the new rows are not rendered.
In the Ajax-debug-window I see the table is returned as expected, including
the form and new rows.

When I turn on these extra rows on the initial run (so everything visible)
the table renders correctly, showing everything.
When I move the form inside a row, it works fine... but that's not enough..

Cannot imagine this is really a Wicket problem... Using Wicket 1.3.6 +
Firefox


Any tips appreciated!

Antoine.

-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: form inside table not displayed on ajax call

2009-07-01 Thread Antoine van Wel
why, of course...

thanks for your quick reply!


Antoine.


On Wed, Jul 1, 2009 at 11:47 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:

 html spec does not allow you to nest a form tag inside a table tag
 unless the form is inside a td

 -igor

 On Wed, Jul 1, 2009 at 2:06 PM, Antoine van
 Welantoine.van@gmail.com wrote:
  Hi all,
 
 
  I have a table with various rows in them with an action link per row.
  When pressing the action link, that row disappears, and new rows are
  inserted.
  It works as a charm, except when the newly inserted rows are surrounded
 by a
  form tag, so inside the form, there are tr tags.
  What happens then is... nothing! The row with the action link disappears
 as
  it should, but the new rows are not rendered.
  In the Ajax-debug-window I see the table is returned as expected,
 including
  the form and new rows.
 
  When I turn on these extra rows on the initial run (so everything
 visible)
  the table renders correctly, showing everything.
  When I move the form inside a row, it works fine... but that's not
 enough..
 
  Cannot imagine this is really a Wicket problem... Using Wicket 1.3.6 +
  Firefox
 
 
  Any tips appreciated!
 
  Antoine.
 
  --
 
  --8--8--
  take your photos everywhere you go - http://www.memolio.com
  --8--8--
  We don't see things as they are, we see things as we are. - Anais Nin
  Whether you think you can or whether you think you can't, you're right. -
  Henry Ford
  --8--8--
 

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




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: QueryStringUrlCodingStrategy not encoding te?t - is this correct?

2009-04-24 Thread Antoine van Wel
Hi Liam,

thanks for your response. I'm really surprised - I'll undo my fix then..


regards,
Antoine

On Thu, Apr 23, 2009 at 2:34 PM, Liam Clarke-Hutchinson l...@steelsky.co.nz
 wrote:

 Unless I'm reading the RFC wrong,  the behaviour of
 QueryStringUrlCodingStrategy is correct...

 http://labs.apache.org/webarch/uri/rfc/rfc3986.html#components

 The query component contains non-hierarchical data that, along with
 data in the path component, serves to identify a resource within the
 scope of the URI's scheme and naming authority (if any). The query
 component is indicated by the first question mark (?) character and
 terminated by a number sign (#) character or by the end of the URI.

   query   = *( pchar / / / ? )

 The characters slash (/) and question mark (?) may represent data
 within the query component. Beware that some older, erroneous
 implementations may not handle such data correctly when it is used as
 the base URI for relative references (Section 5.1), apparently because
 they fail to distinguish query data from path data when looking for
 hierarchical separators. However, as query components are often used
 to carry identifying information in the form of key=value pairs and
 one frequently used value is a reference to another URI, it is
 sometimes better for usability to avoid percent-encoding those
 characters.



 On 4/23/09, Antoine van Wel antoine.van@gmail.com wrote:
  Hi all,
 
  using 1.3.5 :
  mounted a bookmarkable page using the QueryStringUrlCodingStrategy, now
 I'm
  passing in a page parameter with key search and value te?t -- the
 target
  url is
 
  ?search=te?t
 
  tracing this, turns out the QueryStringUrlCodingStrategy just applies
 UTF-8
  encoding (or whatever has been set on the application level).
 
  Are this behavior and the constructed URL correct? I would expect a URL
 like
 
  ?search=te%3Ft
 
 
  regards
  Antoine
 
  --
 
  --8--8--
  take your photos everywhere you go - http://www.memolio.com
  --8--8--
  We don't see things as they are, we see things as we are. - Anais Nin
  Whether you think you can or whether you think you can't, you're right. -
  Henry Ford
  --8--8--
 

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




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


QueryStringUrlCodingStrategy not encoding te?t - is this correct?

2009-04-23 Thread Antoine van Wel
Hi all,

using 1.3.5 :
mounted a bookmarkable page using the QueryStringUrlCodingStrategy, now I'm
passing in a page parameter with key search and value te?t -- the target
url is

?search=te?t

tracing this, turns out the QueryStringUrlCodingStrategy just applies UTF-8
encoding (or whatever has been set on the application level).

Are this behavior and the constructed URL correct? I would expect a URL like

?search=te%3Ft


regards
Antoine

-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


urlFor troubles

2009-04-20 Thread Antoine van Wel
One issue I keep running into when programming with Wicket is using
urlFor... I guess I am missing something.

Now I am trying to redirect to a page;

/hello is mounted to HelloPage using an indexed mounting strategy
/user is mounted to UserPage

when a user types /hello/username, HelloPage captures this and should
redirect to /user ; for that I am using

throw new RedirectToUrlException(urlFor(UserPage.class, params).toString());


However, urlFor will generate ../user/username  instead of /user/username
which will result in a wrong URL in a browser.

Using RequestUtils.toAbsolutePath ( .. ) on it will break my unit test,
since it doesn't like the full path including http://... in combination with
the RedirectToUrlException. (It won't find the UserPage class).

Any thoughts what's the best way to tackle this? Now I just strip off all
the ../ which is being output by urlFor, but that really feels like a
dirty hack.


Using 1.3.5


- Antoine


PS the common setResponsePage or throw RestartResponseException won't do in
this case, since I want the URL in the browser to be displaying
/user/username


-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: urlFor troubles

2009-04-20 Thread Antoine van Wel
Nope, didn't. Great, I didn't know that one, really simple. Saves me from
using the urlFor this time, thanks!

If there's a way to use urlFor in this case without the hacky approach,
I'm still interested to know.


Antoine

On Mon, Apr 20, 2009 at 9:20 PM, Jeremy Thomerson jer...@wickettraining.com
 wrote:

 Have you tried setResponsePage after calling setRedirect(true)?

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



 On Mon, Apr 20, 2009 at 2:14 PM, Antoine van Wel
 antoine.van@gmail.comwrote:

  One issue I keep running into when programming with Wicket is using
  urlFor... I guess I am missing something.
 
  Now I am trying to redirect to a page;
 
  /hello is mounted to HelloPage using an indexed mounting strategy
  /user is mounted to UserPage
 
  when a user types /hello/username, HelloPage captures this and should
  redirect to /user ; for that I am using
 
  throw new RedirectToUrlException(urlFor(UserPage.class,
  params).toString());
 
 
  However, urlFor will generate ../user/username  instead of
 /user/username
  which will result in a wrong URL in a browser.
 
  Using RequestUtils.toAbsolutePath ( .. ) on it will break my unit test,
  since it doesn't like the full path including http://... in combination
  with
  the RedirectToUrlException. (It won't find the UserPage class).
 
  Any thoughts what's the best way to tackle this? Now I just strip off all
  the ../ which is being output by urlFor, but that really feels like a
  dirty hack.
 
 
  Using 1.3.5
 
 
  - Antoine
 
 
  PS the common setResponsePage or throw RestartResponseException won't do
 in
  this case, since I want the URL in the browser to be displaying
  /user/username
 
 
  --
 
  --8--8--
  take your photos everywhere you go - http://www.memolio.com
  --8--8--
  We don't see things as they are, we see things as we are. - Anais Nin
  Whether you think you can or whether you think you can't, you're right. -
  Henry Ford
  --8--8--
 




-- 

--8--8--
take your photos everywhere you go - http://www.memolio.com
--8--8--
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford
--8--8--


Re: Have a feature, want to contribute

2009-03-14 Thread Antoine van Wel
Same here!

Great idea Marat... I missed the original post. And I can use it right
now...


Antoine.

On Fri, Mar 13, 2009 at 11:10 PM, Alex Objelean
alexandru.objel...@isdc.rowrote:


 Marat, as you can see people are interested and waiting for this
 feature
 to be published somewhere

 Alex


 Marat Radchenko-2 wrote:
 
  Wicket pages/components can be either stateful or stateless. Wicket
  manages hem transparently and it is very easy to write any complex
  page you want. Stateful pages are much more powerful than stateless.
  However that comes at  a cost of using page store for their state. On
  highload sites it is usually desired to minimize session-scope data,
  and move it to request-scope. That's when Wicket users approach a task
  of making stateful pages stateless. However stateless state (sic!) is
  very fragile, if you add a single stateful component to a page, it
  instantly becomes stateful (and you even might not notice that if your
  other page content can work in both modes. And here comes my lovely
  feature - @StatelessComponent. It is an annotation that you should put
  on components which you want to be stateless. It doesn't do any magic,
  it simply uses postComponentOnBeforeRender to assert that annotated
  component (and all its children) are stateless. If it doesn't, an
  exception is thrown, indicating what component tries to be stateful.
 
  This feature isn't large enough to be put in a separate project (just
  one annotation and one listener) but wee find it extremely useful on
  our project.
 
  I'd be happy to give it to Wicket project (or wicketstuff?) at
  absolutely no cost (tests included) under same license as wicket
  itself, if Wicket developers are interested in it.
 
  I'll file a feature request with a patch, if Wicket team finds this
  useful in Wicket core.
 
  -
  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/Have-a-feature%2C-want-to-contribute-tp21079751p22498471.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




-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford


bug? RequestUtils.toAbsolutePath using AJAX is not constructing a valid path

2009-03-07 Thread Antoine van Wel
Hey hey,


trying to construct a URL like this:

RequestUtils.toAbsolutePath(urlFor(MyPage.class, null).toString());


this works fine in general, but when executed using AJAX calls, it produces
 http:/mypagemountpath 
instead of the expected  http://my.host.name/mypagemountpath 


Am I missing something or is this a bug?


- Antoine


-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're right. -
Henry Ford


error messages due to hack/search-bots

2008-12-22 Thread Antoine van Wel
Heya,

we're trying to catch all errors caused by hack  search-bots on our
wicket-app. AFAIK these bots take existing links, chop 'em up in
smaller chunks and try to append all kind of . We've caught most
of the errors which result due to these bots, but this one still
stands:

XXX.XXX.XXX.XXX - - [22/Dec/2008:00:03:37 +0100] GET
/resources/org.apache.wicket.markup.html.WicketEventReference_false_61497/
HTTP/1.1 404 952 - - -

Causing errors such as

2008-12-22 00:03:41,654 ERROR -
[TP-Processor7][org.apache.wicket.request.target.resource.SharedResourceRequestTarget:172]
unable to lazily register shared resource
org.apache.wicket.ajax.WicketAjaxReference_false_61497/
java.lang.ClassNotFoundException:
org.apache.wicket.ajax.WicketAjaxReference_false_61497
  at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

[...snip...]


So... any ideas to catch these errors?



Antoine



-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're
right. - Henry Ford

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



Re: error messages due to hack/search-bots

2008-12-22 Thread Antoine van Wel
Hmm, actually you have a point.

Errors we've caught until now where mis-constructed URLs for pages;
those could be user errors too so we wanted to identify all places
where it could break and present a good feedback message to the user.
But in this particular case something/someone is clearly messing
around. Since these errors don't hurt, we don't want to be spammed by
error messages. Hence filtering this one out sounds like a good idea.
If somebody disagrees, then speak up now :-)


thanks !!

Antoine.



On Mon, Dec 22, 2008 at 2:18 PM, Pointbreak
pointbreak+wicketst...@ml1.net wrote:
 Not an answer to your question, but why fight this kind of stuff? It's
 an invalid request, so it should result in an error.

 If you don't want these entries in your log, you could just add a filter
 to your logger (e.g. filtering out error messages from
 org.apache.wicket.request.target.resource.SharedResourceRequestTarget
 where the message equals unable to lazily register shared resource).


 On Mon, 22 Dec 2008 14:05 +0100, Antoine van Wel
 antoine.van@gmail.com wrote:
 Heya,

 we're trying to catch all errors caused by hack  search-bots on our
 wicket-app. AFAIK these bots take existing links, chop 'em up in
 smaller chunks and try to append all kind of . We've caught most
 of the errors which result due to these bots, but this one still
 stands:

 XXX.XXX.XXX.XXX - - [22/Dec/2008:00:03:37 +0100] GET
 /resources/org.apache.wicket.markup.html.WicketEventReference_false_61497/
 HTTP/1.1 404 952 - - -

 Causing errors such as

 2008-12-22 00:03:41,654 ERROR -
 [TP-Processor7][org.apache.wicket.request.target.resource.SharedResourceRequestTarget:172]
 unable to lazily register shared resource
 org.apache.wicket.ajax.WicketAjaxReference_false_61497/
 java.lang.ClassNotFoundException:
 org.apache.wicket.ajax.WicketAjaxReference_false_61497
   at
   
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

 [...snip...]


 So... any ideas to catch these errors?



 Antoine



 --
 We don't see things as they are, we see things as we are. - Anais Nin
 Whether you think you can or whether you think you can't, you're
 right. - Henry Ford

 -
 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





-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're
right. - Henry Ford

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



Re: error messages due to hack/search-bots

2008-12-22 Thread Antoine van Wel
Hmm, actually you have a point.

Errors we've caught until now where mis-constructed URLs for pages;
those could be user errors too so we wanted to identify all places
where it could break and present a good feedback message to the user.
But in this particular case something/someone is clearly messing
around. Since these errors don't hurt, we don't want to be spammed by
error messages. Hence filtering this one out sounds like a good idea.
If somebody disagrees, then speak up now :-)


thanks !!

Antoine.



On Mon, Dec 22, 2008 at 2:18 PM, Pointbreak
pointbreak+wicketst...@ml1.net wrote:
 Not an answer to your question, but why fight this kind of stuff? It's
 an invalid request, so it should result in an error.

 If you don't want these entries in your log, you could just add a filter
 to your logger (e.g. filtering out error messages from
 org.apache.wicket.request.target.resource.SharedResourceRequestTarget
 where the message equals unable to lazily register shared resource).


 On Mon, 22 Dec 2008 14:05 +0100, Antoine van Wel
 antoine.van@gmail.com wrote:
 Heya,

 we're trying to catch all errors caused by hack  search-bots on our
 wicket-app. AFAIK these bots take existing links, chop 'em up in
 smaller chunks and try to append all kind of . We've caught most
 of the errors which result due to these bots, but this one still
 stands:

 XXX.XXX.XXX.XXX - - [22/Dec/2008:00:03:37 +0100] GET
 /resources/org.apache.wicket.markup.html.WicketEventReference_false_61497/
 HTTP/1.1 404 952 - - -

 Causing errors such as

 2008-12-22 00:03:41,654 ERROR -
 [TP-Processor7][org.apache.wicket.request.target.resource.SharedResourceRequestTarget:172]
 unable to lazily register shared resource
 org.apache.wicket.ajax.WicketAjaxReference_false_61497/
 java.lang.ClassNotFoundException:
 org.apache.wicket.ajax.WicketAjaxReference_false_61497
   at
   
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

 [...snip...]


 So... any ideas to catch these errors?



 Antoine



 --
 We don't see things as they are, we see things as we are. - Anais Nin
 Whether you think you can or whether you think you can't, you're
 right. - Henry Ford

 -
 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





-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're
right. - Henry Ford

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



Re: error messages due to hack/search-bots

2008-12-22 Thread Antoine van Wel
agree with Sebastiaan and Michael here

when a user types a wrong url, you're not going to log that
404 - client error, file not found - no fixes necessary, so not logged
500 - server error - log it, needs to be fixed


so instead of implementing the filter, I prefer waiting for a Wicket
patch..  :-)


Antoine

On Mon, Dec 22, 2008 at 7:16 PM, Michael Sparer michael.spa...@gmx.at wrote:

 the thing is that 404 is a client error. I'd only log server errors (i.e.
 errors in the code) as Error. Of course a 404 can also happen due to a error
 in the code, but logging 404 as errors will flood your log file ...

 just my two cents



 Jeremy Thomerson-5 wrote:

 A 404 is an error - so on the one hand you say it is an error, but on the
 other, you say it isn't.  I think it should remain an error.

 Just my 0.02 though.

 On Mon, Dec 22, 2008 at 7:56 AM, Sebastiaan van Erk
 sebs...@sebster.comwrote:

 Pointbreak wrote:

 Not an answer to your question, but why fight this kind of stuff? It's
 an invalid request, so it should result in an error.


 I actually prefer it would result in a 404 for the client and nothing
 more.
 Perhaps, when enabling DEBUG, it can log the message + exception it is
 currently logging as ERROR.

 If you don't want these entries in your log, you could just add a filter
 to your logger (e.g. filtering out error messages from
 org.apache.wicket.request.target.resource.SharedResourceRequestTarget
 where the message equals unable to lazily register shared resource).


 It is annoying (and dangerous) to filter your log in this way. The
 problem
 is that you may accidentally filter too much and miss real errors. Also,
 it
 requires you to know a lot about wicket internals (is this a real error,
 or
 should this be considered a warning?). And it is cumbersome (every time a
 new exception appears, you have to go through this process again).

 To the Wicket developers: why is this logged using log.error and not
 using
 log.debug (in SharedResourceRequestTarget#respond? It's not really an
 error,
 it's a reference to a resource that does not exist, and a 404 should be
 sufficient (without ERRORs in the log).

 Regards,
 Sebastiaan


 On Mon, 22 Dec 2008 14:05 +0100, Antoine van Wel
 antoine.van@gmail.com wrote:

 Heya,

 we're trying to catch all errors caused by hack  search-bots on our
 wicket-app. AFAIK these bots take existing links, chop 'em up in
 smaller chunks and try to append all kind of . We've caught most
 of the errors which result due to these bots, but this one still
 stands:

 XXX.XXX.XXX.XXX - - [22/Dec/2008:00:03:37 +0100] GET

 /resources/org.apache.wicket.markup.html.WicketEventReference_false_61497/
 HTTP/1.1 404 952 - - -

 Causing errors such as

 2008-12-22 00:03:41,654 ERROR -

 [TP-Processor7][org.apache.wicket.request.target.resource.SharedResourceRequestTarget:172]
 unable to lazily register shared resource
 org.apache.wicket.ajax.WicketAjaxReference_false_61497/
 java.lang.ClassNotFoundException:
 org.apache.wicket.ajax.WicketAjaxReference_false_61497
  at


 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

 [...snip...]


 So... any ideas to catch these errors?



 Antoine



 --
 We don't see things as they are, we see things as we are. - Anais Nin
 Whether you think you can or whether you think you can't, you're
 right. - Henry Ford

 -
 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




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




 -
 Michael Sparer
 http://talk-on-tech.blogspot.com
 --
 View this message in context: 
 http://www.nabble.com/error-messages-due-to-hack-search-bots-tp21127488p21132409.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





-- 
We don't see things as they are, we see things as we are. - Anais Nin
Whether you think you can or whether you think you can't, you're
right. - Henry Ford

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



getRequestUrl behavior difference between page call and ajax call

2008-07-30 Thread Antoine van Wel
Hi,

When calling

(WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getRequestURL()

on a page with page parameters, I'm seeing different results:

- when loading the page from the browser, the URL is returned
including the page parameters;
- when updating through AJAX, the URL is returned without the page parameters.

Shouldn't the AJAX call incorporate these page parameters such that
the results are consistent?
What's your opinion on this?


Thanks,

Antoine.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getRequestUrl behavior difference between page call and ajax call

2008-07-30 Thread Antoine van Wel
by the way, this is the case for url coding strategies
which use /par/ such as the default
BookmarkablePageRequestTargetUrlCodingStrategy

IMHO these parameters should be stripped but perhaps not in the
getRequest method; any method available which does just this?



On Wed, Jul 30, 2008 at 11:52 AM, Antoine van Wel
[EMAIL PROTECTED] wrote:
 Hi,

 When calling

 (WebRequest)RequestCycle.get().getRequest()).getHttpServletRequest().getRequestURL()

 on a page with page parameters, I'm seeing different results:

 - when loading the page from the browser, the URL is returned
 including the page parameters;
 - when updating through AJAX, the URL is returned without the page parameters.

 Shouldn't the AJAX call incorporate these page parameters such that
 the results are consistent?
 What's your opinion on this?


 Thanks,

 Antoine.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: users, please give us your opinion: what is your take on generics with Wicket

2008-06-02 Thread Antoine van Wel
 1) Generifying* Wicket
   [X] Can best be done like currently in the 1.4 branch, where models
 and components are both generified. I care most about the improved
 static type checking generified models and components give Wicket.

This is the only solution that makes sense, the other options are
either a partial solution (which is a *very, very* bad thing, mixing
generic with non-generic code INSIDE a framework!?!?) or no solution
at all (which has my preference over a partial solution, since at
least it is concise).


 2) How strongly do you feel about your choice above?
   [X] I might rethink upgrading if my choice doesn't win.

Seriously, no generics at all is better than a partial solution. Since
upgrading involves more issues than generics alone, I may rethink
only... If the decision to upgrade boils down to this issue, then I
won't.


Antoine

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: IllegalStateException with AjaxFallbackDefaultDataTable

2008-02-28 Thread Antoine van Wel
Any updates on this one?

I think I'm experiencing the same issue; I'm building a DataView, in
its nodes there's a TextField with an OnChangeAjaxBehavior added to
it.

Then, from the RequestCycle, an error occurs when cleaning up the
AjaxRequestTarget, followed by an IllegalStateException: no page found
for component ... referring to this textfield.


Thanks,
Antoine.


On Sat, Feb 9, 2008 at 12:59 AM, jwray [EMAIL PROTECTED] wrote:


  Igor,

  thanks for the help, I'll have to look at in detail next week.

  What is odd to me is that I'm not doing anything out of the ordinary. I add
  the table to the ajax target, and I don't remove any components myself.

  Jonny




  igor.vaynberg wrote:
  
   hm, i still dont see the problem spot
  
   the error is apparent
  
   you are adding something to the ajax request target that is then
   removed from the page, so when ajaxrequesttarget is trying to detach
   the page it cant, because it does
  
   component.getPage().detach();
  
   apparently the component is removed from the page, so getpage() throws
   that error you see.
  
   if i were you i would set a breakpoint at that line, and see what
   component exactly is removed from the page, and then try to figure out
   why it is removed from the page and yet is added to the ajax target.
  
   -igor
  
  
   On Feb 8, 2008 9:47 AM, jwray [EMAIL PROTECTED] wrote:
  
   Hi Igor,
  
   I was hoping it would be an obvious problem. Here's my table construction
   code (is there a better way of posting code?)
  
   ListIColumn columns = new ArrayListIColumn();
   PostOnSubmitAction peptideUpdateAction = new PostOnSubmitAction();
   columns.add(new AjaxEditablePropertyColumn(peptideUpdateAction, new
   Model(Comments), comments, comments, REQUIRED_ROLE));
   PeptideDataProvider dataProvider = new PeptideDataProvider(service);
   peptideViewTable = new AjaxFallbackDefaultDataTable(dataTable, columns,
   dataProvider, 25);
  
  
   where the PostOnSubmitAction below is called from the onSubmit method of
   the
   AjaxEditableLabel within the AjaxEditablePropertyColumn. I'm attempting
   to
   refresh the table when an OptimisticLockingFailureException occurs (and
   so
   load the data altered by another user).
  
   private class PostOnSubmitAction implements
   AjaxEditablePropertyColumn.PostOnSubmitAction{
  
   public void postOnSubmit(AjaxRequestTarget target, Object value)
   {
   target.addComponent(getStatusPanel());
   Peptide peptide = (Peptide)value;
   try{
   peptideServices.updatePeptide(peptide);
   }
   catch(AccessDeniedException e){
   String message = You don't have permission to
   perform this operation;
   PeptidePage.this.error(message);
   }
   catch(OptimisticLockingFailureException e){
   String message = Another user modified this data
   before you. Review the
   new data and resubmit changes if needed.;
   PeptidePage.this.error(message);
   target.addComponent(peptideViewTable);
   }
   catch(RuntimeException e){
   String message = An unexpected error occured.
   +e.getMessage();
   PeptidePage.this.error(message);
   }
   }
   }
  
   thanks
   Jonny
  
  
  
   igor.vaynberg wrote:
   
some code would help us help you...
   
-igor
   
  
   --
   View this message in context:
   
 http://www.nabble.com/IllegalStateException-with-AjaxFallbackDefaultDataTable-tp15347366p15360512.html
  
   Sent from the Wicket - User mailing list archive at Nabble.com.
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  

  --
  View this message in context: 
 http://www.nabble.com/IllegalStateException-with-AjaxFallbackDefaultDataTable-tp15347366p15366611.html


 Sent from the Wicket - User mailing list archive at Nabble.com.


  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]





-- 
Antoine van Wel
http://www.wellawaretech.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]