Question re: stateless pages and setResponsePage()

2012-09-03 Thread Gereon Steffens
Hi,

I have a bunch of stateless pages, each calling setStatelessHint(true) in
the constructor to indicate this. I've now noticed that when one of these
pages calls setResponsePage, the target page is always considered
stateful, since RequestCycle#setResponsePage explicitly resets the hint.

Why is this done?

Gereon


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



Re: Question re: stateless pages and setResponsePage()

2012-09-03 Thread Martin Grigorov
Hi,

Because you pass an instance of a page and this instance to be
reachable in the next request should be stored.
Use setResponsePage(Class) instead. Your page is stateless, so
instantiating a completely new instance in the next request should be
the same.

On Mon, Sep 3, 2012 at 9:19 AM, Gereon Steffens
gereon.steff...@finanzen100.de wrote:
 Hi,

 I have a bunch of stateless pages, each calling setStatelessHint(true) in
 the constructor to indicate this. I've now noticed that when one of these
 pages calls setResponsePage, the target page is always considered
 stateful, since RequestCycle#setResponsePage explicitly resets the hint.

 Why is this done?

 Gereon


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




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

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



Re: Jqwicket

2012-09-03 Thread Decebal Suiu
Hi

In my opinion the main advantage of the jqwicket over
wiquery/wicket-jquery-ui is the impressive list of jquery plugins (ui
components). See http://code.google.com/p/jqwicket/w/list for more details.
Of course, it's not difficult to accommodate these jquery components with
wiquery/wicket-jquery-ui.

Best regards,
Decebal



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Jqwicket-tp4651665p4651704.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Jqwicket

2012-09-03 Thread Ernesto Reinaldo Barreiro
Hi,

For wiquery there is project

http://code.google.com/p/wiquery-plugins/

which contains integrations with several plugins. A fraction of them can be
seen in action at

http://antiliasoft.com/wiquery-plugins/

Plugins are Wicket 1.4.x based but migrating them to 1.5.X and 6.0. should
be in most cases trivial.


On Mon, Sep 3, 2012 at 10:28 AM, Decebal Suiu decebal.s...@asf.ro wrote:

 Hi

 In my opinion the main advantage of the jqwicket over
 wiquery/wicket-jquery-ui is the impressive list of jquery plugins (ui
 components). See http://code.google.com/p/jqwicket/w/list for more
 details.
 Of course, it's not difficult to accommodate these jquery components with
 wiquery/wicket-jquery-ui.

 Best regards,
 Decebal



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




-- 
Regards - Ernesto Reinaldo Barreiro


Re: Jqwicket

2012-09-03 Thread Sebastien
Hi,

Yes, wicket-jquery-ui has been designed to allow the (easy?) implementation
of plugins.

I am little bit late on finishing writing the how-tos to implement the
plugins (the advanced part) but to begin, you already have the 2 first
parts:
http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin1
http://code.google.com/p/wicket-jquery-ui/wiki/HowToCreatePlugin2

If you have some special/complex needs, you can ask for its integration by
opening a ticket here:
https://github.com/sebfz1/wicket-jquery-ui/issues

And if you write a plugin that you think it can take place in
wicket-jquery-ui-plugins, feel free to make a pull request ! :)

Thanks  best regards,
Sebastien.

On Mon, Sep 3, 2012 at 10:28 AM, Decebal Suiu decebal.s...@asf.ro wrote:

 Hi

 In my opinion the main advantage of the jqwicket over
 wiquery/wicket-jquery-ui is the impressive list of jquery plugins (ui
 components). See http://code.google.com/p/jqwicket/w/list for more
 details.
 Of course, it's not difficult to accommodate these jquery components with
 wiquery/wicket-jquery-ui.

 Best regards,
 Decebal



 --
 View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/Jqwicket-tp4651665p4651704.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread Martin Grigorov
Hi,

#error() method and others (info, success, ...) accept Serializable,
so you can even do: error(new ExternalLink(someId, someUrl))
Then you need to extend FeedbackPanel and its
org.apache.wicket.markup.html.panel.FeedbackPanel#newMessageDisplayComponent()
and return directly the link.

On Mon, Sep 3, 2012 at 11:49 AM, chaitanya b
harikaareddyit...@gmail.com wrote:
 hi,
 how to create the hyper link in the error message itself... and if i click,
 it navigates to another page?

 scenario is... if user login attempts more than 5 times i am showing error
 message like
 error(your account is locked. Please contact administration.);

 I want the hyperlink only for the contact administration in the above
 message?
 how can i do that? can any one of you please help me.



 Thanks
 chaitanya



 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread chaitanya b
hi,

  Thanks for replying. If i use External link i have to provide wicket:id
in corresponding html page..The error message comes dynamically based on
the condition.At that time, we get exception that is missing...


On Mon, Sep 3, 2012 at 3:24 PM, Martin Grigorov-4 [via Apache Wicket] 
ml-node+s1842946n465170...@n4.nabble.com wrote:

 Hi,

 #error() method and others (info, success, ...) accept Serializable,
 so you can even do: error(new ExternalLink(someId, someUrl))
 Then you need to extend FeedbackPanel and its
 org.apache.wicket.markup.html.panel.FeedbackPanel#newMessageDisplayComponent()

 and return directly the link.

 On Mon, Sep 3, 2012 at 11:49 AM, chaitanya b
 [hidden email] http://user/SendEmail.jtp?type=nodenode=4651708i=0
 wrote:

  hi,
  how to create the hyper link in the error message itself... and if i
 click,
  it navigates to another page?
 
  scenario is... if user login attempts more than 5 times i am showing
 error
  message like
  error(your account is locked. Please contact administration.);
 
  I want the hyperlink only for the contact administration in the above
  message?
  how can i do that? can any one of you please help me.
 
 
 
  Thanks
  chaitanya
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4651708i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4651708i=2
 



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

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



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651708.html
  To unsubscribe from How to create the achor in wicket java class without
 using wicket id, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4651707code=aGFyaWthYXJlZGR5aXRzbWVAZ21haWwuY29tfDQ2NTE3MDd8LTE2Mjg0MjM2NTg=
 .
 NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651709.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread Martin Grigorov
See FeedbackPanel.java, it passes message as component id
(newMessageDisplayComponent(message, message);)

Passing a Component to error() maybe is a bad example. The idea is
that you can pass any Serializable, even a Component.
Pass your own Object and then in #newMessageDisplayComponent()
depending on this object decide which component to use.

On Mon, Sep 3, 2012 at 12:35 PM, chaitanya b
harikaareddyit...@gmail.com wrote:
 hi,

   Thanks for replying. If i use External link i have to provide wicket:id
 in corresponding html page..The error message comes dynamically based on
 the condition.At that time, we get exception that is missing...


 On Mon, Sep 3, 2012 at 3:24 PM, Martin Grigorov-4 [via Apache Wicket] 
 ml-node+s1842946n465170...@n4.nabble.com wrote:

 Hi,

 #error() method and others (info, success, ...) accept Serializable,
 so you can even do: error(new ExternalLink(someId, someUrl))
 Then you need to extend FeedbackPanel and its
 org.apache.wicket.markup.html.panel.FeedbackPanel#newMessageDisplayComponent()

 and return directly the link.

 On Mon, Sep 3, 2012 at 11:49 AM, chaitanya b
 [hidden email] http://user/SendEmail.jtp?type=nodenode=4651708i=0
 wrote:

  hi,
  how to create the hyper link in the error message itself... and if i
 click,
  it navigates to another page?
 
  scenario is... if user login attempts more than 5 times i am showing
 error
  message like
  error(your account is locked. Please contact administration.);
 
  I want the hyperlink only for the contact administration in the above
  message?
  how can i do that? can any one of you please help me.
 
 
 
  Thanks
  chaitanya
 
 
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4651708i=1
  For additional commands, e-mail: [hidden 
  email]http://user/SendEmail.jtp?type=nodenode=4651708i=2
 



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

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



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651708.html
  To unsubscribe from How to create the achor in wicket java class without
 using wicket id, click 
 herehttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4651707code=aGFyaWthYXJlZGR5aXRzbWVAZ21haWwuY29tfDQ2NTE3MDd8LTE2Mjg0MjM2NTg=
 .
 NAMLhttp://apache-wicket.1842946.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml





 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651709.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread chaitanya b
hi,

 How can i manipulate the wicket id ? because the error message comes
dynamically if condition is true.. thenonly the external link will be
executed..but what to do in the case of  condition fails?



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651711.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread chaitanya b
I didnt get u exactly.. can you please provide me some sample example

My problem is basically, i have to generate the  link in the error message
it self when the condition is true.

i want like this  error(please  *  contact admin *);


if i click the link , it navigates to another page. (onclick functionality
will be executed)..

but i am unable to create the link in the message.






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651712.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: How to create the achor in wicket java class without using wicket id

2012-09-03 Thread Martin Grigorov
class Error implements Serializable {
  String msg;
  String url;
}

class MyFeedbackPanel() {
  @Override protected Component newMessageDisplayComponent(String id,
FeedbackMessage fm) {

Serializable ser = fm.getMessage();
if (ser instanceof Error) {
  Error err = ser;
  return new ExternalLink(id, err.url).setBody(Model.of(msg))
}
else {
  return super.newMessageDisplayComponent(id, fm);
}
  }
}

error(new Error(msg, url));

On Mon, Sep 3, 2012 at 1:29 PM, chaitanya b harikaareddyit...@gmail.com wrote:
 I didnt get u exactly.. can you please provide me some sample example

 My problem is basically, i have to generate the  link in the error message
 it self when the condition is true.

 i want like this  error(please  *  contact admin *);


 if i click the link , it navigates to another page. (onclick functionality
 will be executed)..

 but i am unable to create the link in the message.






 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/How-to-create-the-achor-in-wicket-java-class-without-using-wicket-id-tp4651707p4651712.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: Wicket 6 and Atmosphere framework integration

2012-09-03 Thread esajjkh
Thank you Martin. I have created an issue, looking forward for a fix. 
https://issues.apache.org/jira/browse/WICKET-4742





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-6-and-Atmosphere-framework-integration-tp4651637p4651714.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Wicket Ajax and Session expiry

2012-09-03 Thread Arjun Dhar
Hi,
I have implemented authentication on my  Wicket Pages by them extending a
Base Class that checks the session.

Those pages also add Panels and Ajax components. Its been really long but I
have forgotten if how Ajax requests works with sessions.

Also, I want to intercept it and re-direct it to a custom page; it seems to
be going to the default landing page of the site. I have not put any code
for this.
Does it use some error-page in web.xml to determine the path?

If I have a page that requires no Session and one which requires a session;
how will it differentiate.
Currently I cant find the code that makes any Ajax bind to the session so
where is this magic happening?

I have to go back and debug stuff, help appreciated to shorten this. I think
there is a some magic ... which is scary when you have to go back a year
later!

thanks



-
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-and-Session-expiry-tp4651715.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Ajax and Session expiry

2012-09-03 Thread Martin Grigorov
Hi,

On Mon, Sep 3, 2012 at 3:33 PM, Arjun Dhar dhar...@yahoo.com wrote:
 Hi,
 I have implemented authentication on my  Wicket Pages by them extending a
 Base Class that checks the session.

Where exactly is this check ?

Do you use IAuthorizationStrategy ? Check it. This is what you need.


 Those pages also add Panels and Ajax components. Its been really long but I
 have forgotten if how Ajax requests works with sessions.

Yes, Ajax requests are like non-Ajax ones.


 Also, I want to intercept it and re-direct it to a custom page; it seems to
 be going to the default landing page of the site. I have not put any code
 for this.
 Does it use some error-page in web.xml to determine the path?

 If I have a page that requires no Session and one which requires a session;
 how will it differentiate.
 Currently I cant find the code that makes any Ajax bind to the session so
 where is this magic happening?

 I have to go back and debug stuff, help appreciated to shorten this. I think
 there is a some magic ... which is scary when you have to go back a year
 later!

 thanks



 -
 Software documentation is like sex: when it is good, it is very, very good; 
 and when it is bad, it is still better than nothing!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-and-Session-expiry-tp4651715.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



Re: Wicket Ajax and Session expiry

2012-09-03 Thread Arjun Dhar
Yess!

I found the an implementation of IAuthorizationStrategy and in the Site
Application I do:
getSecuritySettings().setAuthorizationStrategy(authStrategy);

I built an Annotation, where all pages using that annotation are mapped to
the Authorization Strategy. Its all come back on that front thanks.

However, the Auth Strategy is on the WebPage's. How are the Ajax Links and
components protected?
Furthermore I have :


..The redirection works well for Web-Pages, but for Ajax calls on failure
goes to Site landing page which is not consistent with the code above.

So on the Ajax Front I'm still not clear.



-
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-and-Session-expiry-tp4651715p4651717.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Ajax and Session expiry

2012-09-03 Thread Martin Grigorov
On Mon, Sep 3, 2012 at 4:27 PM, Arjun Dhar dhar...@yahoo.com wrote:
 Yess!

 I found the an implementation of IAuthorizationStrategy and in the Site
 Application I do:
 getSecuritySettings().setAuthorizationStrategy(authStrategy);

 I built an Annotation, where all pages using that annotation are mapped to
 the Authorization Strategy. Its all come back on that front thanks.

 However, the Auth Strategy is on the WebPage's. How are the Ajax Links and
 components protected?

 public void onUnauthorizedInstantiation(Component component) {

As you see it is actually on Component, rather than on a Page.

 Furthermore I have :


 ..The redirection works well for Web-Pages, but for Ajax calls on failure
 goes to Site landing page which is not consistent with the code above.

 So on the Ajax Front I'm still not clear.

Attach the debugger and see what happens.




 -
 Software documentation is like sex: when it is good, it is very, very good; 
 and when it is bad, it is still better than nothing!
 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-and-Session-expiry-tp4651715p4651717.html
 Sent from the Users forum mailing list archive at Nabble.com.

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




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

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



exception handling (get cause page)

2012-09-03 Thread Alfonso Quiroga
Hi! I have a custom exception handler, and I have this method:

onException(RequestCycle cycle, Exception anException) {
  
}


Inside this method, how can I get the original page who caused the
exception? in other Wicket version, I had  onRuntimeException
method, who already had the original page.

Thanks in advance!

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



Re: exception handling (get cause page)

2012-09-03 Thread Martin Grigorov
Hi,

See 
https://github.com/apache/wicket/blob/master/wicket-core/src/main/java/org/apache/wicket/request/cycle/PageRequestHandlerTracker.java
Register it, then use it:
PageRequestHandlerTracker.getLastHandler(cycle).getPage()


On Mon, Sep 3, 2012 at 8:00 PM, Alfonso Quiroga alfonsose...@gmail.com wrote:
 Hi! I have a custom exception handler, and I have this method:

 onException(RequestCycle cycle, Exception anException) {
   
 }


 Inside this method, how can I get the original page who caused the
 exception? in other Wicket version, I had  onRuntimeException
 method, who already had the original page.

 Thanks in advance!

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




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

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



Re: how to prevent the log file was full of exceptions

2012-09-03 Thread Korbinian
Hi,

exceptions are usually thrown with a reason - and the main reason why you 
get so much in your log is that brix with wicket 6 isnt yet finished. 
Especially the url-sharing part between brix and wicket is quite a problem 
as brix relies on full control of the space while wickt 5 + 6 introduced 
the concept of multiple url handlers - a concept brix itself never cared 
for as it was created against 1.4 once and the traversal to wicket 5 and 
wicket 6 never got finished yed. Especially the introduction of wicket 5 
into brix is full of errors. I started to clear out many of them on the 6 
branch, but hadn't enough time yet. Beside that I wanted to wait till 
wicket 6 is released, as programming against dailies is problematic when 
your low on time.

What brix currently needs is a logic similar to the SSL Url handler in 
wicket 6, where requests go dont the flow while still the brix handler is 
the master of these requests. I've done that on an experimental 
base. 

Best,

Kobinian

Am Samstag, 1. September 2012 12:20:10 UTC+2 schrieb wickeria:

 Hi,

 I am looking for some solution how to log all exceptions in my code. I 
 tried to override onException method in RequestCycleListener but log file 
 was full of exceptions like this:

 org.apache.wicket.protocol.http.servlet.ResponseIOException: 
 ClientAbortException:  java.net.SocketException: Broken pipe

 So I am thinking about something like this:

 private static Class[] KNOWN_EXCEPTIONS = 
 {ListenerInvocationNotAllowedException.class, ResponseIOException.class};

 @Override
 public IRequestHandler onException(RequestCycle cycle, Exception ex) {
 HttpServletRequest request = (HttpServletRequest) 
 cycle.getRequest().getContainerRequest();
 if (ex instanceof PageExpiredException) {
 LOG.debug(MessageFormat.format(PageExpiredException for 
 request ''{0}'', request.toString()));
 }else if(isKnownException(ex)){
 LOG.warn(MessageFormat.format(InternalErrorPage for request 
 ''{0}'', Exception message ''{1}'', request.toString(), ex.getMessage()));
 } else {
 LOG.error(MessageFormat.format(InternalErrorPage for request 
 ''{0}'', request.toString()), ex);
 }
 return super.onException(cycle, ex);
 }

 private boolean isKnownException(Exception ex) {
 for (Class? extends Throwable clazz : KNOWN_EXCEPTIONS) {
 if(Exceptions.findCause(ex, clazz) != null){
 return true;
 }
 }
 return false;
 }


 Is this right approach? If yes, another question is how to deal with this 
 exception:

 2012-08-17 09:58:43,184 [http-77.48.124.51-80-32] ERROR 
 c.w.web.WicketRequestCycleListener - InternalErrorPage for request '
 http://sportave.com/wicket/resource/com.wickeria.web.WickeriaApplication/jquery-and-wicket-ver-134BD6850DBC85F8DCBCD3A0DB7207C6.js
 '
 java.lang.IllegalStateException: Header was already written to response!
 at 
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.checkHeader(HeaderBufferingWebResponse.java:64)
  
 ~[wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.protocol.http.HeaderBufferingWebResponse.sendError(HeaderBufferingWebResponse.java:105)
  
 ~[wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.http.handler.ErrorCodeRequestHandler.respond(ErrorCodeRequestHandler.java:77)
  
 ~[wicket-request-6.0-20120809.004719-1476.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:814)
  
 ~[wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:64)
  
 ~[wicket-request-6.0-20120809.004719-1476.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:302)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 [wicket-core-6.0-20120809.004947-1468.jar:6.0-SNAPSHOT]
 at 
 org.apache.wicket.request.cycle.RequestCycle.executeExceptionRequestHandler(RequestCycle.java:311)
  
 

Wicket 1.5 migration questions

2012-09-03 Thread Alec Swan
Hello,

I finally decided to bite the bullet and migrate to Wicket 1.5. It
turned out a lot harder than I expected. Here are some of the issues I
ran into:

* How to implement HybridUrlCodingStrategy in 1.5?

* I saw a ticket related to putClassAlias, but I couldn't figure out
how to port this one line to 1.5:
getSharedResources().putClassAlias(GlobalResourceScope.class, global);

* How do I modify the following line to use HTTP in DEVELOPMENT mode?
setRootRequestMapper(new HttpsMapper(getRootRequestMapper(), new
HttpsConfig(80, 443)));

* WicketTester#setupRequestAndResponse() - what should be used instead?

* How do I integrate WicketTester and Spring? I used the following
code in 1.4.x:
 InjectorHolder.setInjector(new AnnotSpringInjector(new
MockContextLocator(myAppContext)));
 InjectorHolder.getInjector().inject(this);

Thanks,

Alec

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



Re: Wicket Ajax and Session expiry

2012-09-03 Thread Arjun Dhar
BTW this code is on Wicket 1.4 (just FYI)

There seems to be a slight complication when protecting components in a
hierarchy.

I have protected some pages/Web-Components by marking them as protected via
Annotation / Marker Interfaces. In the following code of an impl of
IAuthorizationStrategy, the code gets the list of Protected
components/classes getPageTypesProtected().



..this works well for the components it is intended to protect. However it
interferes with the construction hierarchy of the components. Example: if
there is an AjaxLink somewhere in a Page that is Protected by the code
above, then there is some issue and it gets redirected to landing page
instead of login page.
Ideally what I would want is using component.findParent(Page.class); get
the Page the Link is on. But in the event Auth failed on the page, this
comes null and the code has no way of knowing if the component is on which
page.

Also unlike protecting pages by annotating them, I cant do this a at a link
Level; so I have to know where the link sits. Logically if the LINK is ON a
Protected COMPONENT then it itself inherits the PROTECTION --- Clean Magic
and Logic. But I cant seem to perfect this :(

I tried to code the AjaxLink Auth inpublic boolean
isActionAuthorized(Component component, Action action)  instead, but in
vain. Looks like Wicket component construction hierarchy prevents the page
from being constructed in the first place, so I have no way of knowing where
my AjaxLink sits if the page itself is un-authorized.

However on processing the link, instead of invoking the page protection
mechanism it just dies.



-
Software documentation is like sex: when it is good, it is very, very good; and 
when it is bad, it is still better than nothing!
--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Ajax-and-Session-expiry-tp4651715p4651724.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