Update of wicketstuff-tinymce's set of javascript
Hi. According to: http://wicketstuff.org/jira/browse/WCTINYMCE-6 Are somebody planning to do an update of javascripts ? - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
javascript effects before an ajax call
Was this ever implemented / solved?: Nov 21, 2006; 07:09am Re: Using Javascript Effects Before An Ajax Call This is possible to do with wicket, however it would require minor enhancement of the ajax processing code. We already have infrastructure for asynchronously postponing processing steps. However, I can't do that right now. Maybe in a week or so. So if anyone really needs to pause between executing scripts from prependJavascript and replacing the elements (which is I understand right this is all about), keep bugging me, I will eventually implement that. :) -Matej cygnusx2112 wrote: Thanks for the clarification Igor. I ended up achieving the desired affect by using an AjaxCallDecarator in combination with a server side pause. Basically I was trying to do the following: 1) Run animation effect on element 2) Use Ajax request to replace element 3) Run another animation effect on the element As you noticed, I needed a way to block so that #2 and #3 would not step on #1. As a non-Javascript guru I was unable to find a way to block the Javascript thread without some kind of CPU beating hack loop. However, the solution I am using seems to work well. In my efforts to accomplish this I have built some pretty interesting subclasses of AjaxEventBehavior that might be worth contributing. They basically allow you to cleanly add pre/post visual effects to components around an Ajax event. Regards, -MT igor.vaynberg wrote: the effect is clearly executed asynchronously from the rest of the javascript thread so you need to find a way to block until the effect is complete. -igor ... [show rest of quote] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list wicket-u...@... https://lists.sourceforge.net/lists/listinfo/wicket-user Cheers, Antony Stubbs, sharca.com
Is Accordion example at wicketstuff-core.jquery broken?
Hi all, I run wicketstuff-core.jquery-examples (revision #4859 from Jul26, using mvn jetty:run) and it seems that accordion's example does not work in all tested browsers (Chrome,IE,FF,Opera): all items are shown as expanded and only observable activity is cursor change to pointer over title. Looking at rendered page source, Accordion scripts are included, accordion content is rendered and acordion is initialized by $('#id5').Accordion({header: 'h3'}); It seems it should work but it does not. Please, does anybody know what I'm missing or what is wrong? Thanks, Petr - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Disabled Auto link bookmarkable page
I guess the view is that using a span gives safe markup in any situation. The disableLink() method can be overriden it if you need cleaner markup in a particular situation. Cassio wrote: But it would change only the em and /em default markups and not the span that replace the a tag at org.apache.wicket.markup.html.link.AbstractLink.disableLink(final ComponentTag tag) method. code: // Change anchor link to span tag tag.setName(span); 2009/7/24 Iain Reddick iain.redd...@beatsystems.com The wrapping markup used can be set via methods in AbstractLink: setAfterDisabledLink() setBeforeDisabledLink() or, you can set a default at application level: setDefaultAfterDisabledLink() setDefaultBeforeDisabledLink() Cassio wrote: Hello everybody! Does anyone know for what reason an disabled auto link gets nested inside a span tag? It's messing the page layout... Thanks... Cássio Landim Ribeiro - 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: javascript effects before an ajax call
Not 100% sure if it's already done, but I've bugged Matej with this request for 1.5's new Ajax implementation. Martijn On Mon, Jul 27, 2009 at 9:40 AM, Antony Stubbsantony.stu...@gmail.com wrote: Was this ever implemented / solved?: Nov 21, 2006; 07:09am Re: Using Javascript Effects Before An Ajax Call This is possible to do with wicket, however it would require minor enhancement of the ajax processing code. We already have infrastructure for asynchronously postponing processing steps. However, I can't do that right now. Maybe in a week or so. So if anyone really needs to pause between executing scripts from prependJavascript and replacing the elements (which is I understand right this is all about), keep bugging me, I will eventually implement that. :) -Matej cygnusx2112 wrote: Thanks for the clarification Igor. I ended up achieving the desired affect by using an AjaxCallDecarator in combination with a server side pause. Basically I was trying to do the following: 1) Run animation effect on element 2) Use Ajax request to replace element 3) Run another animation effect on the element As you noticed, I needed a way to block so that #2 and #3 would not step on #1. As a non-Javascript guru I was unable to find a way to block the Javascript thread without some kind of CPU beating hack loop. However, the solution I am using seems to work well. In my efforts to accomplish this I have built some pretty interesting subclasses of AjaxEventBehavior that might be worth contributing. They basically allow you to cleanly add pre/post visual effects to components around an Ajax event. Regards, -MT igor.vaynberg wrote: the effect is clearly executed asynchronously from the rest of the javascript thread so you need to find a way to block until the effect is complete. -igor ... [show rest of quote] - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV ___ Wicket-user mailing list wicket-u...@... https://lists.sourceforge.net/lists/listinfo/wicket-user Cheers, Antony Stubbs, sharca.com -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
On 26 jul 2009, at 22:59, Alex Objelean wrote: If you think this would help, then you could remove InvalidUrlException and invalidate the jira RFE created by me... I don't think this would heart anyone... Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? At any time, somehing was a WicketRuntimeException and only a PageExpired (original or as cause) is now rethrown. All others are wrapped. Is there a case that in the AbstractRequestCycleProcessor the following works then ? else if (e instanceof AuthorizationException) { // are authorization exceptions always thrown Kind Regards, Olger Alex igor.vaynberg wrote: my point is that this case is on the fence. it is an invalid url, and it is a security violation. so which one should take precendence? my other concern is that we would have to maintain a long list of exceptions that should be passed through, which becomes a pita. -igor On Sun, Jul 26, 2009 at 1:32 PM, Alex Objeleanalex_objel...@yahoo.com wrote: I just want to remind the reason why the InvalidUrlException was introduced: to avoid situations when user would tweak somehow the url and get the InternalError Page... I introduced a request for enhancement for InvalidUrlException feature and if there are any problems related to it, you can blame me..:( Alex Objelean igor.vaynberg wrote: then we are getting in a debate of what use an invalidurlexception really is. if we forward page expired and a bunch of other exceptions, why do we even need an invalidurlexception... the point is the user has submitted a form that they should not have been able to, it is an invalid url... i dont know off the top of my head what the best approach is. -igor On Sun, Jul 26, 2009 at 12:46 PM, Olger Warnierol...@xs4all.nl wrote: Hi Igor, if the form is disabled why is it allowed to be submitted? In a test you can ;) When you know what to submit, it is possible to submit those values without a page, although I can imagine that it is quite hard to achieve due to the way wicket handles form variables and stuff (via the session). Even with that in mind, I wonder if it is possible to have the UnauthorizedException thrown directly (without the InvalidUrlException). Kind Regards, Olger -igor On Sun, Jul 26, 2009 at 10:58 AM, Olger Warnierol...@xs4all.nl wrote: Hi Developers, Slowly but surely I move through the tests of the wicket security framework. In one test, the SecureFormTest, i ran into some strange behaviour. It starts with an exception like this: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.authorization.UnauthorizedActionException: Component [MarkupContainer [Component id = form]] does not permit action ENABLE (note, the test is commented in order to prevent build failures) There is a secureform that has no rights to be filled an submitted. Normal behaviour till now was the return of a login page. In some cases I found the return of the UnauthorizedActionException - all fine till now. (running 1.4-rc7) In this test though, I there is no redirection to a Login Page and I can't catch the UnauthorizedActionException. This started my quest into the originating throws, this happens to be the throw of an InvalidUrlException in WebRequestCycleProcessor (line 248 and on) catch (WicketRuntimeException e) { // we need to let page expired exception sift through instead of covering it up if (e instanceof PageExpiredException) { throw e; } else if (e.getCause() instanceof PageExpiredException) { throw e; } else { throw new InvalidUrlException(e); } } The UnauthorizedActionException is catched here and thereafter thrown wrapped in an InvalidUrlException. This is not the end of it, the RequestCycle catches this exception and has some logic for it (line 1337 starting) : catch (RuntimeException e) { /* * check if the raised exception wraps an abort exception. if so, it is probably wise to * unwrap and rethrow the abort exception */ Throwable cause = e.getCause(); while (cause != null) { if (cause instanceof AbortException) { throw ((AbortException)cause); } cause = cause.getCause();
Re: Questions about Wicket sessions
Igor Vaynberg wrote: 2. If I start IE or FF in another window, visitor activities on the same Wicket app are considered in the same or different session? always a different sessions, browsers do not share sessions. I think it depends on what David meant by 'another window'. I assumed it to be the 'open in new window' function. Then you still have the same browser, but another window. Regards. Erik. -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
Olger Warnier schreef: Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? https://issues.apache.org/jira/browse/WICKET-2200 -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
This is the link of the RFE: https://issues.apache.org/jira/browse/WICKET-2307 Olger Warnier-2 wrote: On 26 jul 2009, at 22:59, Alex Objelean wrote: If you think this would help, then you could remove InvalidUrlException and invalidate the jira RFE created by me... I don't think this would heart anyone... Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? At any time, somehing was a WicketRuntimeException and only a PageExpired (original or as cause) is now rethrown. All others are wrapped. Is there a case that in the AbstractRequestCycleProcessor the following works then ? else if (e instanceof AuthorizationException) { // are authorization exceptions always thrown Kind Regards, Olger Alex igor.vaynberg wrote: my point is that this case is on the fence. it is an invalid url, and it is a security violation. so which one should take precendence? my other concern is that we would have to maintain a long list of exceptions that should be passed through, which becomes a pita. -igor On Sun, Jul 26, 2009 at 1:32 PM, Alex Objeleanalex_objel...@yahoo.com wrote: I just want to remind the reason why the InvalidUrlException was introduced: to avoid situations when user would tweak somehow the url and get the InternalError Page... I introduced a request for enhancement for InvalidUrlException feature and if there are any problems related to it, you can blame me..:( Alex Objelean igor.vaynberg wrote: then we are getting in a debate of what use an invalidurlexception really is. if we forward page expired and a bunch of other exceptions, why do we even need an invalidurlexception... the point is the user has submitted a form that they should not have been able to, it is an invalid url... i dont know off the top of my head what the best approach is. -igor On Sun, Jul 26, 2009 at 12:46 PM, Olger Warnierol...@xs4all.nl wrote: Hi Igor, if the form is disabled why is it allowed to be submitted? In a test you can ;) When you know what to submit, it is possible to submit those values without a page, although I can imagine that it is quite hard to achieve due to the way wicket handles form variables and stuff (via the session). Even with that in mind, I wonder if it is possible to have the UnauthorizedException thrown directly (without the InvalidUrlException). Kind Regards, Olger -igor On Sun, Jul 26, 2009 at 10:58 AM, Olger Warnierol...@xs4all.nl wrote: Hi Developers, Slowly but surely I move through the tests of the wicket security framework. In one test, the SecureFormTest, i ran into some strange behaviour. It starts with an exception like this: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.authorization.UnauthorizedActionException: Component [MarkupContainer [Component id = form]] does not permit action ENABLE (note, the test is commented in order to prevent build failures) There is a secureform that has no rights to be filled an submitted. Normal behaviour till now was the return of a login page. In some cases I found the return of the UnauthorizedActionException - all fine till now. (running 1.4-rc7) In this test though, I there is no redirection to a Login Page and I can't catch the UnauthorizedActionException. This started my quest into the originating throws, this happens to be the throw of an InvalidUrlException in WebRequestCycleProcessor (line 248 and on) catch (WicketRuntimeException e) { // we need to let page expired exception sift through instead of covering it up if (e instanceof PageExpiredException) { throw e; } else if (e.getCause() instanceof PageExpiredException) { throw e; } else { throw new InvalidUrlException(e); } } The UnauthorizedActionException is catched here and thereafter thrown wrapped in an InvalidUrlException. This is not the end of it, the RequestCycle catches this exception and has some logic for it (line 1337 starting) : catch (RuntimeException e) { /* * check if the raised exception wraps an abort exception. if so, it is probably wise to * unwrap and rethrow the abort exception */ Throwable cause = e.getCause(); while (cause != null) { if (cause
Re: urls with localization
Hi, How is it possible to use such urls in wicket? If users clicks that link then appropriate page with defined locale will be shown. www.domain.com/uk/home www.domain.com/nl/home see this thread: http://www.nabble.com/Localization%2C-Bookmarkable-pages%2C-and-mounting-strategies-to16676213.html#a16682606 Best regards, --- Jan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
Sorry Olger, that was a copy paste error. Please see Alex' e-mail. Regards, Erik. Erik van Oosten schreef: Olger Warnier schreef: Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? https://issues.apache.org/jira/browse/WICKET-2200 -- Erik van Oosten http://day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: log4j question with wicket
On Fri, Jul 24, 2009 at 3:47 PM, pieter claassen pie...@claassen.co.ukwrote: I think that slf4j is not working in my setup and it might have nothing to do with Tomcat. As a matter of fact, I assume I don't even have to have log4j or slf4j working with tomcat, but that as long as my POM references the correct dependencies, my application should log correctly? To overcome the following error, I had to upgrade by slf4j and log4j deps to the latest version. Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory These are my maven deps. dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.6/version /dependency dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.5.6/version /dependency You still need log4j itself. add this dependency: dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.14/version /dependency Maarten I see the same behaviour in Glassfish and tomcat. Does anybody have slf4j-1.5.6 working with log4j-1.2.14? I am stumped?! P On Fri, Jul 24, 2009 at 9:22 AM, pieter claassen pie...@claassen.co.uk wrote: I am trying to get my application to log to a separate file with the following log4j.properties (server is tomcat6 in netbeans). I enabled the following in my wicketapplication. getRequestLoggerSettings().setRequestLoggerEnabled(true); What I find is that catalina.{date}.out logs the requests correctly, but I get tomcat startup info in my logfile and then nothing else. Any ideas? Thanks, Pieter /var/log/webapp/application.log 2009-07-24 09:21:28,052 INFO - ContextLoader - Root WebApplicationContext: initialization started 2009-07-24 09:21:28,082 INFO - XmlWebApplicationContext - Refreshing org.springframework.web.context.support.xmlwebapplicationcont...@1077092 : display name [Root WebApplicationContext]; startup date [Fri Jul 24 09:21:28 CEST 2009]; root of context hierarchy 2009-07-24 09:21:28,134 INFO - XmlBeanDefinitionReader- Loading XML bean definitions from ServletContext resource [/WEB-INF/WicketApplicationDefinition.xml] 2009-07-24 09:21:28,555 INFO - XmlWebApplicationContext - Bean factory for application context [org.springframework.web.context.support.xmlwebapplicationcont...@1077092 ]: org.springframework.beans.factory.support.defaultlistablebeanfact...@1ab5e0b 2009-07-24 09:21:28,582 INFO - DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.defaultlistablebeanfact...@1ab5e0b : defining beans [myDataSource,appConfig,WicketApplication]; root of factory hierarchy 2009-07-24 09:21:29,172 INFO - ContextLoader - Root WebApplicationContext: initialization completed in 1120 ms log4j.properties == log4j.rootLogger=INFO, file log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.maxFileSize=100KB log4j.appender.file.maxBackupIndex=5 log4j.appender.file.File=/var/log/${application.name}/application.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d %-5p - %-26.26c{1} - %m\n log4j.catagory.org.apache.wicket.protocol.http.RequestLogger=INFO log4j.logger.org.apache.wicket=INFO log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO log4j.logger.org.apache.wicket.version=INFO log4j.logger.org.apache.wicket.RequestCycle=INFO -- Pieter Claassen -- Pieter Claassen musmato.com
executing wicketSubmitFormById
Hello, Wicket lovers! I'm trying to execute wicketSubmitFormById from my custom function. Function itselft looks like this: function wicketSubmitFormById(formId, url, submitButton, successHandler, failureHandler, precondition, channel) I have examined the ajax submit button and it has the following event handler: onclick=var wcall=wicketSubmitFormById('id14', '?wicket:interface=:4:tabs:panel:languageForm:ajaxSubmitButton:1:IActivePageBehaviorListener:0:amp;wicket:ignoreIfNotActive=true', 'ajaxSubmitButton' ,null,null, function() {return Wicket.$$(this)amp;amp;Wicket.$$('id14')}.bind(this));;; return false; How is it possible to get formId, url from my custom function? Have an outstanding day
Re: urls with localization
There is another thread where I have posted a link with implementation (which is currently in production)... so, you can just reuse it: http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330 Alex Objelean Gatos wrote: Hello, How is it possible to use such urls in wicket? If users clicks that link then appropriate page with defined locale will be shown. www.domain.com/uk/home www.domain.com/nl/home Thank you -- View this message in context: http://www.nabble.com/urls-with-localization-tp24676709p24677616.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: [OT] Continue to support Wicket 1.2 in WicketForge
We only use wicket 1.4.* Regards, Maarten On Sat, Jul 25, 2009 at 2:16 PM, Erik van Oosten e.vanoos...@grons.nlwrote: Mostly Wicket 1.4 at my company, just 1 Wicket 1.3 project left. Regards, Erik. Nick Heudecker wrote: Hi, For those of you that don't know, I maintain WicketForge, the Wicket plugin for IDEA (http://plugins.intellij.net/plugin/?id=1545 or http://code.google.com/p/wicketforge). Currently, WicketForge supports Wicket 1.2 in addition to 1.3 and 1.4, but I'd like to remove support for 1.2 to clean a few things up. First, I want to see if people are still using 1.2 with WF. My question to you is: are you still using WicketForge with Wicket 1.2? Thanks for your time and feedback. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
Sorry to keep on buggin over this, I try to understand what is the best option to plugin the unauthorized type of exceptions into the wicket framework. It seems (maybe because of lack of understanding) that the UnAuthorizedException handling can't work as it is now. Now to move on: I've read the RFE Alex sent. As you create a more specific extension of the runtime exception, it will be wrapped by the WebRequestCycleProcessor to an InvalidURLException. How do you make sure that it will show the 404 ? (or is that default for the InvalidURLException ?) It might be an idea to have some kind of exception resolvement at the spot where this decision is made. (I don't know where that is, I have seen hints that this is already done somehow and you are able to override it. ) and throw runtime exceptions as is to that level. By registering exception handler pages you have the option to customize the behaviour. If I like to do that in the current situation, I need to handle the InvalidUrlException, check the cause and do something only in the case I'd like to process (Unauthorized) What to do with the other causes of the InvalidUrl then ? Kind Regards, Olger On 27 jul 2009, at 11:41, Alex Objelean wrote: This is the link of the RFE: https://issues.apache.org/jira/browse/WICKET-2307 Olger Warnier-2 wrote: On 26 jul 2009, at 22:59, Alex Objelean wrote: If you think this would help, then you could remove InvalidUrlException and invalidate the jira RFE created by me... I don't think this would heart anyone... Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? At any time, somehing was a WicketRuntimeException and only a PageExpired (original or as cause) is now rethrown. All others are wrapped. Is there a case that in the AbstractRequestCycleProcessor the following works then ? else if (e instanceof AuthorizationException) { // are authorization exceptions always thrown Kind Regards, Olger Alex igor.vaynberg wrote: my point is that this case is on the fence. it is an invalid url, and it is a security violation. so which one should take precendence? my other concern is that we would have to maintain a long list of exceptions that should be passed through, which becomes a pita. -igor On Sun, Jul 26, 2009 at 1:32 PM, Alex Objeleanalex_objel...@yahoo.com wrote: I just want to remind the reason why the InvalidUrlException was introduced: to avoid situations when user would tweak somehow the url and get the InternalError Page... I introduced a request for enhancement for InvalidUrlException feature and if there are any problems related to it, you can blame me..:( Alex Objelean igor.vaynberg wrote: then we are getting in a debate of what use an invalidurlexception really is. if we forward page expired and a bunch of other exceptions, why do we even need an invalidurlexception... the point is the user has submitted a form that they should not have been able to, it is an invalid url... i dont know off the top of my head what the best approach is. -igor On Sun, Jul 26, 2009 at 12:46 PM, Olger Warnierol...@xs4all.nl wrote: Hi Igor, if the form is disabled why is it allowed to be submitted? In a test you can ;) When you know what to submit, it is possible to submit those values without a page, although I can imagine that it is quite hard to achieve due to the way wicket handles form variables and stuff (via the session). Even with that in mind, I wonder if it is possible to have the UnauthorizedException thrown directly (without the InvalidUrlException). Kind Regards, Olger -igor On Sun, Jul 26, 2009 at 10:58 AM, Olger Warnierol...@xs4all.nl wrote: Hi Developers, Slowly but surely I move through the tests of the wicket security framework. In one test, the SecureFormTest, i ran into some strange behaviour. It starts with an exception like this: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.authorization.UnauthorizedActionException: Component [MarkupContainer [Component id = form]] does not permit action ENABLE (note, the test is commented in order to prevent build failures) There is a secureform that has no rights to be filled an submitted. Normal behaviour till now was the return of a login page. In some cases I found the return of the UnauthorizedActionException - all fine till now. (running 1.4-rc7) In this test though, I there is no redirection to a Login Page and I can't catch the UnauthorizedActionException. This started my quest into the originating throws, this happens to be the throw of an InvalidUrlException in WebRequestCycleProcessor (line 248 and on) catch (WicketRuntimeException e) { // we need to let page expired exception sift through instead of covering it up if (e instanceof PageExpiredException)
Re: [OT] Continue to support Wicket 1.2 in WicketForge
I've only ever seen questions on this list about 1.3 and 1.4 (in the few months I've been on it, that is), so I'm guessing that if there are users of 1.2 they are either knowledgable enough not to have questions, or they're simply not on this list. Regards, Linda Maarten Bosteels wrote: We only use wicket 1.4.* Regards, Maarten On Sat, Jul 25, 2009 at 2:16 PM, Erik van Oosten e.vanoos...@grons.nlwrote: Mostly Wicket 1.4 at my company, just 1 Wicket 1.3 project left. Regards, Erik. Nick Heudecker wrote: Hi, For those of you that don't know, I maintain WicketForge, the Wicket plugin for IDEA (http://plugins.intellij.net/plugin/?id=1545 or http://code.google.com/p/wicketforge). Currently, WicketForge supports Wicket 1.2 in addition to 1.3 and 1.4, but I'd like to remove support for 1.2 to clean a few things up. First, I want to see if people are still using 1.2 with WF. My question to you is: are you still using WicketForge with Wicket 1.2? Thanks for your time and feedback. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.32/2266 - Release Date: 07/27/09 05:58:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
You can treat runtime exceptions by overriding newRequestCycle method of your Application class... @Override public Page onRuntimeException(final Page page, final RuntimeException e) { if (e instanceof InvalidUrlException) { //redirect to 404 } else { return super.onRuntimeException(page, e); } } Olger Warnier-2 wrote: Sorry to keep on buggin over this, I try to understand what is the best option to plugin the unauthorized type of exceptions into the wicket framework. It seems (maybe because of lack of understanding) that the UnAuthorizedException handling can't work as it is now. Now to move on: I've read the RFE Alex sent. As you create a more specific extension of the runtime exception, it will be wrapped by the WebRequestCycleProcessor to an InvalidURLException. How do you make sure that it will show the 404 ? (or is that default for the InvalidURLException ?) It might be an idea to have some kind of exception resolvement at the spot where this decision is made. (I don't know where that is, I have seen hints that this is already done somehow and you are able to override it. ) and throw runtime exceptions as is to that level. By registering exception handler pages you have the option to customize the behaviour. If I like to do that in the current situation, I need to handle the InvalidUrlException, check the cause and do something only in the case I'd like to process (Unauthorized) What to do with the other causes of the InvalidUrl then ? Kind Regards, Olger On 27 jul 2009, at 11:41, Alex Objelean wrote: This is the link of the RFE: https://issues.apache.org/jira/browse/WICKET-2307 Olger Warnier-2 wrote: On 26 jul 2009, at 22:59, Alex Objelean wrote: If you think this would help, then you could remove InvalidUrlException and invalidate the jira RFE created by me... I don't think this would heart anyone... Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? At any time, somehing was a WicketRuntimeException and only a PageExpired (original or as cause) is now rethrown. All others are wrapped. Is there a case that in the AbstractRequestCycleProcessor the following works then ? else if (e instanceof AuthorizationException) { // are authorization exceptions always thrown Kind Regards, Olger Alex igor.vaynberg wrote: my point is that this case is on the fence. it is an invalid url, and it is a security violation. so which one should take precendence? my other concern is that we would have to maintain a long list of exceptions that should be passed through, which becomes a pita. -igor On Sun, Jul 26, 2009 at 1:32 PM, Alex Objeleanalex_objel...@yahoo.com wrote: I just want to remind the reason why the InvalidUrlException was introduced: to avoid situations when user would tweak somehow the url and get the InternalError Page... I introduced a request for enhancement for InvalidUrlException feature and if there are any problems related to it, you can blame me..:( Alex Objelean igor.vaynberg wrote: then we are getting in a debate of what use an invalidurlexception really is. if we forward page expired and a bunch of other exceptions, why do we even need an invalidurlexception... the point is the user has submitted a form that they should not have been able to, it is an invalid url... i dont know off the top of my head what the best approach is. -igor On Sun, Jul 26, 2009 at 12:46 PM, Olger Warnierol...@xs4all.nl wrote: Hi Igor, if the form is disabled why is it allowed to be submitted? In a test you can ;) When you know what to submit, it is possible to submit those values without a page, although I can imagine that it is quite hard to achieve due to the way wicket handles form variables and stuff (via the session). Even with that in mind, I wonder if it is possible to have the UnauthorizedException thrown directly (without the InvalidUrlException). Kind Regards, Olger -igor On Sun, Jul 26, 2009 at 10:58 AM, Olger Warnierol...@xs4all.nl wrote: Hi Developers, Slowly but surely I move through the tests of the wicket security framework. In one test, the SecureFormTest, i ran into some strange behaviour. It starts with an exception like this: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.authorization.UnauthorizedActionException: Component [MarkupContainer [Component id = form]] does not permit action ENABLE (note, the test is commented in order to prevent build failures) There is a secureform that has no rights to be filled an submitted. Normal behaviour till now was the return of a login page. In some cases I found the return of the UnauthorizedActionException - all fine till now. (running 1.4-rc7) In this test though, I
Re: Disabled Auto link bookmarkable page
Ok, Thanks! 2009/7/27 Iain Reddick iain.redd...@beatsystems.com I guess the view is that using a span gives safe markup in any situation. The disableLink() method can be overriden it if you need cleaner markup in a particular situation. Cassio wrote: But it would change only the em and /em default markups and not the span that replace the a tag at org.apache.wicket.markup.html.link.AbstractLink.disableLink(final ComponentTag tag) method. code: // Change anchor link to span tag tag.setName(span); 2009/7/24 Iain Reddick iain.redd...@beatsystems.com The wrapping markup used can be set via methods in AbstractLink: setAfterDisabledLink() setBeforeDisabledLink() or, you can set a default at application level: setDefaultAfterDisabledLink() setDefaultBeforeDisabledLink() Cassio wrote: Hello everybody! Does anyone know for what reason an disabled auto link gets nested inside a span tag? It's messing the page layout... Thanks... Cássio Landim Ribeiro - 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: Questions about Wicket sessions
Not only multiple tabs, but also resources can access the session, and will attach and detach the session during request processing. So session.onAttach() can be called twice before session.onDetach() is called. Martijn On Sun, Jul 26, 2009 at 10:23 PM, Igor Vaynbergigor.vaynb...@gmail.com wrote: no, incorrect. multiple browser tabs can be used to access the same session instance simultaneously. -igor On Sun, Jul 26, 2009 at 1:17 PM, David Changdavid_q_zh...@yahoo.com wrote: Erik, thanks for your input. Please note Sessions are not thread-safe in Wicket context means that the Session /object/ is not thread-safe. Note that requests that fall within a session (except for resources) are handled serially. Only when you use session clustering this guarantee can not be made. So if I dont use clustered web servers, custom methods on a custom session object do not need be synchronized. Put it another way, Wicket session is thread-safe in case of a single web server. Correct? Cheers. --- On Sun, 7/26/09, Erik van Oosten e.vanoos...@grons.nl wrote: From: Erik van Oosten e.vanoos...@grons.nl Subject: Re: Questions about Wicket sessions To: users@wicket.apache.org Date: Sunday, July 26, 2009, 2:08 PM David, Please note Sessions are not thread-safe in Wicket context means that the Session /object/ is not thread-safe. Note that requests that fall within a session (except for resources) are handled serially. Only when you use session clustering this guarantee can not be made. 1. It depends on the browser. All modern browsers will make it one session. 2. Same answer. 3. No. Wicket does this for you. Regarding your question on session storage: you'll be hard pressed to find a more performant solution to Wicket's http session disk store. Perhaps that memory solutions would work better. Regards, Erik. David Chang wrote: Reading Wicket in Action to learn Wicket, I understand that sessions are not thread-safe. I have the following questions about a Wicket app: 1. If I open another tab on the same browser (IE or FF), visitor activities on the same Wicket app are considered in the same session? 2. If I start IE or FF in another window, visitor activities on the same Wicket app are considered in the same or different session? 3. If dirty() is called within a method of custom session object, then it is the developer's responsibility to implement dirty() to synchronize with other clustered web servers, correct? Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: AW: SSL - ajax login
I'll try to find out more. Here is the output from wicket debug console: --- SSL-Link clicked: INFO: focus set on link34 INFO: Using XMLHttpRequest transport INFO: INFO: Initiating Ajax POST request on https://localhost:8443/projectname/;jsessionid=039EAC776571BA623EA885F798AC6A10?wicket:interface=:0:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IBehaviorListener:0:random=0.30097839823986994 INFO: Invoking pre-call handler(s)... (-- no answer/response) INFO: focus removed from link76 INFO: focus set on link7b INFO: Channel busy - postponing... (-- shown when a different link is clicked) Usual Link clicked: INFO: focus set on link7b INFO: Using XMLHttpRequest transport INFO: INFO: Initiating Ajax GET request on ?wicket:interface=:2:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:random=0.39846398226416335 INFO: Invoking pre-call handler(s)... INFO: Received ajax response (20795 characters) INFO: ?xml version=1.0 encoding=UTF-8?ajax-response.../ajax-response INFO: Response parsed. Now invoking steps... INFO: setHistoryItem: 1 INFO: setHistoryItem: 2 INFO: Response processed successfully. INFO: Invoking post-call handler(s)... INFO: Couldn't set focus on not on the page anymore --- btw: I'm using an own made ssl certificate for testing purposes, so it's not trustable. Could it be because of that? For example: When using a non ajax ssl link the browser (IE) ask me if I'd like to proceed. Only if I proceed, the website is loaded/shown. If it's an ajax ssl call, maybe there is no way to ask the user whether he want to proceed or not. Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Sonntag, den 26. Juli 2009, 22:22:22 Uhr Betreff: Re: AW: SSL - ajax login the href is not a problem; you seeing # appended to the end of the url is the correct behavior. what should have happened was the ajax call to that https url in the background. so what you should be looking into is why the ajax call with that https url was never made or response from it not processed, since we know the url itself works - because you pasted it into the browser and it worked. maybe wicket ajax console can give you a clue, firebug also has facilities that let you monitor requests being made. you should see a call to that https url when you click the link. -igor On Sun, Jul 26, 2009 at 1:15 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi Igor, I used Firebug to have a look at the onClick event. I've inspected two links, one usual ajax link and one for the ssl login. Regarding the first link: href=?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::ILinkListener:: onClick=var wcall=wicketAjaxGet('?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:',null,null, function() {return Wicket.$('link141') != null;}.bind(this));return !wcall; Regarding the ssl login link: href=# onClick=var wcall=wicketSubmitFormById('loginForm13b', 'https://localhost:8443/projectname/?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true', 'buttonLogin:container:link' ,null,null, function() {return Wicket.$$(this)Wicket.$$('loginForm13b')}.bind(this));;; return false; I clicked on the ssl login link and the page jumped to the anchor # but the form is not submitted. The symbol # was appended to the address bar of the browser. I copied the url in the onClick event and entered it manually in the address bar of my browser. The xml code for the ajax response was shown in the browser - as known from wicket ajax debug. I guess the problem is the href attribute. I would expect to see an url like https://localhost:8443/projectname/wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link:: [etc.] Do you have any idea how I can solve the problem? Thx, Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 24. Juli 2009, 21:51:48 Uhr Betreff: Re: AW: SSL - ajax login whatever url you see when hovering over the link is not the url used for ajax - not necessarily. you should inspect the onclick handlers. -igor On Fri, Jul 24, 2009 at 12:20 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: no, sorry... the url is not changing to http://locahost:8080/projectname/# but when I hold the mouse pointer over the link, I see the url in the status bar. When I hold the mouse pointer over other links, I see very long urls a la http://localhost:8080/projectname/;jsessionid=wicket:interface. But as you suggested, I'll
Re: executing wicketSubmitFormById
I have temporary solved problem calling onclick function: document.getElementById('ajaxSubmitButton').onclick() Does anyone know any better solution? On Mon, Jul 27, 2009 at 1:02 PM, Gatos ega...@gmail.com wrote: Hello, Wicket lovers! I'm trying to execute wicketSubmitFormById from my custom function. Function itselft looks like this: function wicketSubmitFormById(formId, url, submitButton, successHandler, failureHandler, precondition, channel) I have examined the ajax submit button and it has the following event handler: onclick=var wcall=wicketSubmitFormById('id14', '?wicket:interface=:4:tabs:panel:languageForm:ajaxSubmitButton:1:IActivePageBehaviorListener:0:amp;wicket:ignoreIfNotActive=true', 'ajaxSubmitButton' ,null,null, function() {return Wicket.$$(this)amp;amp;Wicket.$$('id14')}.bind(this));;; return false; How is it possible to get formId, url from my custom function? Have an outstanding day
AW: AW: SSL - ajax login
Hi again Igor, I did the following now: I called the website directly with https://localhost:8443/projectname and then I performed a login and it worked. Any idea? Thx Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Sonntag, den 26. Juli 2009, 22:22:22 Uhr Betreff: Re: AW: SSL - ajax login the href is not a problem; you seeing # appended to the end of the url is the correct behavior. what should have happened was the ajax call to that https url in the background. so what you should be looking into is why the ajax call with that https url was never made or response from it not processed, since we know the url itself works - because you pasted it into the browser and it worked. maybe wicket ajax console can give you a clue, firebug also has facilities that let you monitor requests being made. you should see a call to that https url when you click the link. -igor On Sun, Jul 26, 2009 at 1:15 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi Igor, I used Firebug to have a look at the onClick event. I've inspected two links, one usual ajax link and one for the ssl login. Regarding the first link: href=?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::ILinkListener:: onClick=var wcall=wicketAjaxGet('?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:',null,null, function() {return Wicket.$('link141') != null;}.bind(this));return !wcall; Regarding the ssl login link: href=# onClick=var wcall=wicketSubmitFormById('loginForm13b', 'https://localhost:8443/projectname/?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true', 'buttonLogin:container:link' ,null,null, function() {return Wicket.$$(this)Wicket.$$('loginForm13b')}.bind(this));;; return false; I clicked on the ssl login link and the page jumped to the anchor # but the form is not submitted. The symbol # was appended to the address bar of the browser. I copied the url in the onClick event and entered it manually in the address bar of my browser. The xml code for the ajax response was shown in the browser - as known from wicket ajax debug. I guess the problem is the href attribute. I would expect to see an url like https://localhost:8443/projectname/wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link:: [etc.] Do you have any idea how I can solve the problem? Thx, Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 24. Juli 2009, 21:51:48 Uhr Betreff: Re: AW: SSL - ajax login whatever url you see when hovering over the link is not the url used for ajax - not necessarily. you should inspect the onclick handlers. -igor On Fri, Jul 24, 2009 at 12:20 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: no, sorry... the url is not changing to http://locahost:8080/projectname/# but when I hold the mouse pointer over the link, I see the url in the status bar. When I hold the mouse pointer over other links, I see very long urls a la http://localhost:8080/projectname/;jsessionid=wicket:interface. But as you suggested, I'll debug the javascript to see the url modifications. Thank you for your support Igor! Have a nice weekend. Greetz, Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 24. Juli 2009, 17:30:27 Uhr Betreff: Re: AW: SSL - ajax login no, i havent tried it myself. i never had to do an ajax login. the url in the browser changes to http://locahost:8080/projectname/# ? thats fine. the main part is what the actual ajax url is used - you wont see that in the browser's bar. i suggest you use firebug or something similar to walk the javascript and see why your *ajax* url is being mangled. obviously if you return just https://localhost:8443/projectname; that will not work because that doesnt have the listener interface target that will hit the behavior in your button. -igor On Fri, Jul 24, 2009 at 2:19 AM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi Igor, I tried to do it as simple as possible so I returned https://localhost:8443/projectname in the overridden method getCallbackUrl of AjaxFormSubmitBehavior. The result was the same. The link pointed to the url http://locahost:8080/projectname/#. It seems to me that only relative pathes can be returned, else the standard url will be used. I wanted to understand how the given url is used in wicket. I found the method wicketAjaxGet in wicket-ajax.js. There the url is passed to Wicket.Ajax.Call(...). I couldn't
the effective ways of wicket models to access database
Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } @Override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } @Override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } @Override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: the effective ways of wicket models to access database
You can use spring to inject the service, using @SpringBean and calling in the constructor InjectorHolder.getInjector().inject(this); (or use salve) Service locator is also a possibility. That is why we left it open :) Martijn On Mon, Jul 27, 2009 at 2:20 PM, David Changdavid_q_zh...@yahoo.com wrote: Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } �...@override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } �...@override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } �...@override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
AW: the effective ways of wicket models to access database
what about the LoadableDetachableModel? IModel model = new LoadableDetachableModel() { protected Object load() { return dao.getX(); } }; Von: David Chang david_q_zh...@yahoo.com An: users@wicket.apache.org Gesendet: Montag, den 27. Juli 2009, 14:20:14 Uhr Betreff: the effective ways of wicket models to access database Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } @Override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } @Override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } @Override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: the effective ways of wicket models to access database
Well the reason the book leaves it open is that it really is up to you how you get your DAOs. That has nothing to do with Wicket anymore and depends wholly on your own preferences. Regards, Linda David Chang wrote: Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } @Override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } @Override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } @Override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.32/2266 - Release Date: 07/27/09 05:58:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to determine which behavior corresponds to the currently handled request target
Could anyone shed light on that? -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24680015.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: urls with localization
I'm using wicket 1.3.5 and RequestDecorator could not be found. On Mon, Jul 27, 2009 at 1:05 PM, Alex Objelean alex_objel...@yahoo.comwrote: There is another thread where I have posted a link with implementation (which is currently in production)... so, you can just reuse it: http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330 Alex Objelean Gatos wrote: Hello, How is it possible to use such urls in wicket? If users clicks that link then appropriate page with defined locale will be shown. www.domain.com/uk/home www.domain.com/nl/home Thank you -- View this message in context: http://www.nabble.com/urls-with-localization-tp24676709p24677616.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: the effective ways of wicket models to access database
Martin and all, thanks for your input. You can use spring to inject the service, using @SpringBean and calling in the constructor InjectorHolder.getInjector().inject(this); (or use salve) You mean add a member to this CheeseModel class and use @SpringBean to inject it? From reading this book, I know it works. How about creating a super custom model (implements IModel) which has DAO ready and other classes such as CheeseModel simply extends it? What do you mean by salve? Thanks. --- On Mon, 7/27/09, Martijn Dashorst martijn.dasho...@gmail.com wrote: From: Martijn Dashorst martijn.dasho...@gmail.com Subject: Re: the effective ways of wicket models to access database To: users@wicket.apache.org Date: Monday, July 27, 2009, 8:29 AM You can use spring to inject the service, using @SpringBean and calling in the constructor InjectorHolder.getInjector().inject(this); (or use salve) Service locator is also a possibility. That is why we left it open :) Martijn On Mon, Jul 27, 2009 at 2:20 PM, David Changdavid_q_zh...@yahoo.com wrote: Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } �...@override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } �...@override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } �...@override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - 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
wicket-archetype-quickstart is not enough
I recently did some ranting about wicket-archetype-quickstart on my blog: http://paulszulc.wordpress.com/2009/07/26/wicket-archetype-quickstart-is-not-enough. To be person who not only complains, but also acts, I decided to create my own, more enhanced wicket archetype, that would aim the issues described on my blog. The archetype I'm creating is getting closer to 1.0.0 stable version, but I got this feeling that I might still missing something. There might be still some repetitive configurations, some typical patterns, that any developer would like to see after running mvn archetype:generate -DarchetypeArtifactId=wctemplate-archetype Thus if you have any suggestions or maybe you believe the whole idea is simply stupid, please let me know. I would love to hear from other Wicket users, what they think of creating extended wicket archetype. -- Best regards, Paul Szulc
RE: Questions about Wicket sessions
Question #2 can be muddy depending on how the new window was launched. In my experience (Using IE 6) if you click on a link (i.e target=_blank) that launches an application and log in, then go back and click that link again to open a new window to the same application, you will be using the same wicket session - and http-session. In the above scenerio, multi-window support does not work. If you were to launch a new window or new tab from the WICKET app browser itself, then multi-window does work and you get different sessions. So, a link opening a new window i.e. target=_blank and physically opening a new window using the browser can get different results. -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Sunday, July 26, 2009 2:50 PM To: users@wicket.apache.org Subject: Re: Questions about Wicket sessions On Sun, Jul 26, 2009 at 8:53 AM, David Changdavid_q_zh...@yahoo.com wrote: 1. If I open another tab on the same browser (IE or FF), visitor activities on the same Wicket app are considered in the same session? same session, this is why we provide browser auto-multiwindow support, so we can detect a new tab/window being open and the app still works fine. 2. If I start IE or FF in another window, visitor activities on the same Wicket app are considered in the same or different session? always a different sessions, browsers do not share sessions. 3. If dirty() is called within a method of custom session object, then it is the developer's responsibility to implement dirty() to synchronize with other clustered web servers, correct? no, your responsibility is only to call dirty() when you change your custom state in session. the servlet container will take care of replicating session across the cluster. -igor Thanks! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ EMAIL CONFIDENTIALITY NOTICE This Email message, and any attachments, may contain confidential patient health information that is legally protected. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party unless required to do so by law or regulation and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or action taken in reliance on the contents of this message is strictly prohibited. If you have received this information in error, please notify the sender immediately by replying to this message and delete the message from your system. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: the effective ways of wicket models to access database
On Mon, Jul 27, 2009 at 2:58 PM, David Chang david_q_zh...@yahoo.comwrote: Martin and all, thanks for your input. You can use spring to inject the service, using @SpringBean and calling in the constructor InjectorHolder.getInjector().inject(this); (or use salve) You mean add a member to this CheeseModel class and use @SpringBean to inject it? From reading this book, I know it works. How about creating a super custom model (implements IModel) which has DAO ready and other classes such as CheeseModel simply extends it? What do you mean by salve? http://code.google.com/p/salve/ Maarten Thanks. --- On Mon, 7/27/09, Martijn Dashorst martijn.dasho...@gmail.com wrote: From: Martijn Dashorst martijn.dasho...@gmail.com Subject: Re: the effective ways of wicket models to access database To: users@wicket.apache.org Date: Monday, July 27, 2009, 8:29 AM You can use spring to inject the service, using @SpringBean and calling in the constructor InjectorHolder.getInjector().inject(this); (or use salve) Service locator is also a possibility. That is why we left it open :) Martijn On Mon, Jul 27, 2009 at 2:20 PM, David Changdavid_q_zh...@yahoo.com wrote: Hello, I am reading Wicket in Action to learn Wicket. The example on Page 99 is about teaching detachable models. Here it goes: --- public class CheeseModel extends Model { private Long id; private transient Cheese cheese; public CheeseModel() { } public CheeseModel(Cheese cheese) { setObject(cheese); } public CheeseModel(Long id) { this.id = id; } @Override public Object getObject() { if(cheese != null) return cheese; if(id == null ) { cheese = new Cheese(); } else { CheeseDao dao = ... cheese = dao.getCheese(id); } return cheese; } @Override public void setObject(Object object) { this. cheese = (Cheese)object; id = (cheese == null) ? null : cheese.getId(); } @Override public void detach() { this. cheese = null; } } --- I would like to know how dao is obtained as indicated as follows: CheeseDao dao = ... Use a locator pattern? Or should I let CheeseModel extend a custom model in which dao is set via Spring? Does the latter way create more memory footprint? What are the effective ways of getting DAO avaiable to wicket models? Thanks for your input! Cheers! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Become a Wicket expert, learn from the best: http://wicketinaction.com Apache Wicket 1.3.5 is released Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. - 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: urls with localization
I'm using wicket 1.3.5 and RequestDecorator could not be found. You have to read the posts more carefully - there were two references to pastebin! --- Jan. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: use a lable in several palces in a page
Instead of having one text field with the same text, you can have several text fields pointed to the same model attribute. On Fri, Jul 24, 2009 at 2:34 PM, Jeremy Thomerson jer...@wickettraining.com wrote: That comes from the component use checker - which is only enabled by default in development. You can turn it off and use the label multiple places in a page, but you must do so at your own risk - if you add behaviors and such to it, you will end up breaking things (since the components will be given the same HTML ID). -- Jeremy Thomerson http://www.wickettraining.com On Fri, Jul 24, 2009 at 3:47 PM, tubin genfachh...@gmail.com wrote: I created a label and I wabnt to use this label in seeral places in page , is it allowed , right now I getting exception [Component id = documentType] has the same wicket:id as another component already added at the same level so If want to show the same text at 5 different places in markup do I have to create 5 label objects with the same model ? - 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 -- Fernando Wermus. www.linkedin.com/in/fernandowermus
Tree and TabbedPanel components
I am using a wicket tree component in the left column of a table and a panel (here in details are replaced as you select the nodes of the tree) in the right column. One of the displayed panels is the TabbedPanel. In one TabPanel, I have a DropDownChoice box that makes a Form visible on selecting a choice. The problem arises when you select another node of the tree; the Right hand side panel is replaced by the desired panel but some components of the TabPanel (of the previously selected node) remain visible down under, like DropDownChoice box and Form. The undesired components belong to the last selected tab of the TabbedPanel How can I ensure that no components from the previous selected node remain visible pertaining to the last selected Tab of the TabbedPanel. Any suggestions will be highly appreciated. Raj Kaushik rajv...@yahoo.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: urls with localization
RequestDecorator is nothing but a decorator implementation of Request class... [CODE] public class RequestDecorator extends Request { /** * Decorated request. */ private final Request request; /** * Constructor. * * @param request to decorate. */ public RequestDecorator(final Request request) { if (request == null) { throw new IllegalArgumentException(Decorated Request cannot be NULL!); } this.request = request; } /** * {...@inheritdoc} */ @Override public Locale getLocale() { return request.getLocale(); } /** * {...@inheritdoc} */ @Override public String getParameter(final String key) { return request.getParameter(key); } /** * {...@inheritdoc} */ @Override public MapString, String[] getParameterMap() { return request.getParameterMap(); } /** * {...@inheritdoc} */ @Override public String[] getParameters(final String key) { return request.getParameters(key); } /** * {...@inheritdoc} */ @Override public String getPath() { return request.getPath(); } /** * {...@inheritdoc} */ @Override public String getQueryString() { return request.getQueryString(); } /** * {...@inheritdoc} */ @Override public String getRelativePathPrefixToContextRoot() { return request.getRelativePathPrefixToContextRoot(); } /** * {...@inheritdoc} */ @Override public String getRelativePathPrefixToWicketHandler() { return request.getRelativePathPrefixToWicketHandler(); } /** * {...@inheritdoc} */ @Override public String getURL() { return request.getURL(); } } [/CODE] Gatos wrote: I'm using wicket 1.3.5 and RequestDecorator could not be found. On Mon, Jul 27, 2009 at 1:05 PM, Alex Objelean alex_objel...@yahoo.comwrote: There is another thread where I have posted a link with implementation (which is currently in production)... so, you can just reuse it: http://www.nabble.com/Is-IRequestTargetUrlCodingStrategy-needed-for-mapping-bookmarkable--URLs--td24407411.html#a24409330 Alex Objelean Gatos wrote: Hello, How is it possible to use such urls in wicket? If users clicks that link then appropriate page with defined locale will be shown. www.domain.com/uk/home www.domain.com/nl/home Thank you -- View this message in context: http://www.nabble.com/urls-with-localization-tp24676709p24677616.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/urls-with-localization-tp24676709p24681795.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
WicketSessionFilter and empty HttpSession
Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ.
Re: log4j question with wicket
I am sure something is broken in tomcat. This is not a dependency issue as the build runs file and manually logging info with log4j also works (see below). The problem seems when wicket logs using slf4j and this only goes to catalina.log (I cannot get this redirected to my own log file). If I understand this correctly, wicket uses slf4j to log its own internals. With tomcat6, I am supposed to then configure log4j (or any adapter that I want to) to get that information to the location I would like to (a local text log file). I am trying to enable wicket's requestlog debugging and directing the output to my application log file for later inspection. If I run the following code, I get a message in catalina.out (I also get all the debug information from wicket requestlogger on catalina.out) Logger logger=LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); logger.info(AUTH PAGE ACCESSED); When I run the code under a debugger, I can see that logger points to catalina.out, so clearly I failed to point rootLogger to another file with either of my log4j.properties settings. Note however, that if I use org.apache.log4j.Logger then I can correctly dump logging infor to my target file Logger.getRootLogger().info(AUTHPAGE Logged with Logger.getRootLogger()); Here is my question: 1. What is the correct procedure to enable request logging with wicket and tomcat so that each of my applications dumps its request data to a specific text file? Thanks for all the feedback so far. Pieter here is my log4j.properties in my tomcat lib directory log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.logger.org.apache.catalina=INFO, R log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, R log4j.logger.org.apache.catalina.core=INFO, R log4j.logger.org.apache.catalina.session=INFO, R Here is my application log4j.properties file. log4j.rootLogger=INFO,R log4j.category.org.apache.wicket.protocol.http.RequestLogger=INFO log4j.logger.org.apache.wicket=INFO log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO log4j.logger.org.apache.wicket.version=INFO log4j.logger.org.apache.wicket.RequestCycle=INFO log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=/var/log/${application.name}/application.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - log file%m%n On Mon, Jul 27, 2009 at 12:00 PM, Maarten Bosteels mbosteels@gmail.comwrote: On Fri, Jul 24, 2009 at 3:47 PM, pieter claassen pie...@claassen.co.uk wrote: I think that slf4j is not working in my setup and it might have nothing to do with Tomcat. As a matter of fact, I assume I don't even have to have log4j or slf4j working with tomcat, but that as long as my POM references the correct dependencies, my application should log correctly? To overcome the following error, I had to upgrade by slf4j and log4j deps to the latest version. Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory These are my maven deps. dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.6/version /dependency dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.5.6/version /dependency You still need log4j itself. add this dependency: dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.14/version /dependency Maarten I see the same behaviour in Glassfish and tomcat. Does anybody have slf4j-1.5.6 working with log4j-1.2.14? I am stumped?! P On Fri, Jul 24, 2009 at 9:22 AM, pieter claassen pie...@claassen.co.uk wrote: I am trying to get my application to log to a separate file with the following log4j.properties (server is tomcat6 in netbeans). I enabled the following in my wicketapplication. getRequestLoggerSettings().setRequestLoggerEnabled(true); What I find is that catalina.{date}.out logs the requests correctly, but I get tomcat startup info in my logfile and then nothing else. Any ideas? Thanks, Pieter /var/log/webapp/application.log 2009-07-24 09:21:28,052 INFO - ContextLoader - Root WebApplicationContext: initialization started 2009-07-24 09:21:28,082 INFO - XmlWebApplicationContext - Refreshing
Re: WicketSessionFilter and empty HttpSession
that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Tree and TabbedPanel components
are you using ajax? cause this sounds very strange. -igor On Mon, Jul 27, 2009 at 7:02 AM, Raj Kaushikraj.kaus...@route1.com wrote: I am using a wicket tree component in the left column of a table and a panel (here in details are replaced as you select the nodes of the tree) in the right column. One of the displayed panels is the TabbedPanel. In one TabPanel, I have a DropDownChoice box that makes a Form visible on selecting a choice. The problem arises when you select another node of the tree; the Right hand side panel is replaced by the desired panel but some components of the TabPanel (of the previously selected node) remain visible down under, like DropDownChoice box and Form. The undesired components belong to the last selected tab of the TabbedPanel How can I ensure that no components from the previous selected node remain visible pertaining to the last selected Tab of the TabbedPanel. Any suggestions will be highly appreciated. Raj Kaushik rajv...@yahoo.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: AW: SSL - ajax login
hmm, it might be like you said - ajax request with an untrusted cert might be failing. it looks from the console like wicket is trying to hit that url, what you can do is set a breakpoint in wicketfilter and see if that request ever reaches the server. -igor On Mon, Jul 27, 2009 at 4:56 AM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi again Igor, I did the following now: I called the website directly with https://localhost:8443/projectname and then I performed a login and it worked. Any idea? Thx Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Sonntag, den 26. Juli 2009, 22:22:22 Uhr Betreff: Re: AW: SSL - ajax login the href is not a problem; you seeing # appended to the end of the url is the correct behavior. what should have happened was the ajax call to that https url in the background. so what you should be looking into is why the ajax call with that https url was never made or response from it not processed, since we know the url itself works - because you pasted it into the browser and it worked. maybe wicket ajax console can give you a clue, firebug also has facilities that let you monitor requests being made. you should see a call to that https url when you click the link. -igor On Sun, Jul 26, 2009 at 1:15 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi Igor, I used Firebug to have a look at the onClick event. I've inspected two links, one usual ajax link and one for the ssl login. Regarding the first link: href=?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::ILinkListener:: onClick=var wcall=wicketAjaxGet('?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:linkForgotLogin:container:link::IBehaviorListener:0:',null,null, function() {return Wicket.$('link141') != null;}.bind(this));return !wcall; Regarding the ssl login link: href=# onClick=var wcall=wicketSubmitFormById('loginForm13b', 'https://localhost:8443/projectname/?wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link::IActivePageBehaviorListener:0:wicket:ignoreIfNotActive=true', 'buttonLogin:container:link' ,null,null, function() {return Wicket.$$(this)Wicket.$$('loginForm13b')}.bind(this));;; return false; I clicked on the ssl login link and the page jumped to the anchor # but the form is not submitted. The symbol # was appended to the address bar of the browser. I copied the url in the onClick event and entered it manually in the address bar of my browser. The xml code for the ajax response was shown in the browser - as known from wicket ajax debug. I guess the problem is the href attribute. I would expect to see an url like https://localhost:8443/projectname/wicket:interface=:6:content:container:areaTop:2:panelTop:container:loginForm:buttonLogin:container:link:: [etc.] Do you have any idea how I can solve the problem? Thx, Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 24. Juli 2009, 21:51:48 Uhr Betreff: Re: AW: SSL - ajax login whatever url you see when hovering over the link is not the url used for ajax - not necessarily. you should inspect the onclick handlers. -igor On Fri, Jul 24, 2009 at 12:20 PM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: no, sorry... the url is not changing to http://locahost:8080/projectname/# but when I hold the mouse pointer over the link, I see the url in the status bar. When I hold the mouse pointer over other links, I see very long urls a la http://localhost:8080/projectname/;jsessionid=wicket:interface. But as you suggested, I'll debug the javascript to see the url modifications. Thank you for your support Igor! Have a nice weekend. Greetz, Arthur Von: Igor Vaynberg igor.vaynb...@gmail.com An: users@wicket.apache.org Gesendet: Freitag, den 24. Juli 2009, 17:30:27 Uhr Betreff: Re: AW: SSL - ajax login no, i havent tried it myself. i never had to do an ajax login. the url in the browser changes to http://locahost:8080/projectname/# ? thats fine. the main part is what the actual ajax url is used - you wont see that in the browser's bar. i suggest you use firebug or something similar to walk the javascript and see why your *ajax* url is being mangled. obviously if you return just https://localhost:8443/projectname; that will not work because that doesnt have the listener interface target that will hit the behavior in your button. -igor On Fri, Jul 24, 2009 at 2:19 AM, Arthur Leigh Allenarthurleigh.al...@yahoo.de wrote: Hi Igor, I tried to do it as simple as possible so I returned https://localhost:8443/projectname in the overridden method getCallbackUrl of
DZone Refcard - Getting Started with Apache Wicket
DZone launched a Refcard about Apache Wicket here - http://dzone.it/yml A quick description from the website: Among the dizzying number of Web frameworks available today, Wicket’s simple and intuitive approach to Web development has led it to become a favorite among many Java developers. This Refcard brings you quickly up to speed on some of the key features of Apache Wicket 1.3, showing you how to configure the framework, define your domain model, create standard Wicket components and add internationalization options. Enjoy! To our success! Mystic Coders, LLC | Code Magic | www.mysticcoders.com ANDREW LOMBARDI | and...@mysticcoders.com 2321 E 4th St. Ste C-128, Santa Ana CA 92705 ofc: 949-528-6480 fax: 714-782-6024 cell: 714-697-8046 linked-in: http://www.linkedin.com/in/andrewlombardi twitter: http://www.twitter.com/kinabalu Eco-Tip: Printing e-mails is usually a waste. This message is for the named person's use only. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient.
Re: WicketSessionFilter and empty HttpSession
It is impossible, I can get Session Id but then when I call servlet ' s doPost() method , WicketSessionFilter can not find the HttpSession. I mean : HttpSession httpSession = httpServletRequest.getSession(false); // WicketSessionFilter.java in wicket.1.3.6.jar returns NULL. so that my servlet throws Exception because Session wicketSession = Session.get(); throws java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ.
Re: WicketSessionFilter and empty HttpSession
thats why i said use Session.exists() to check first, and only call Session.get() if Session.exists() returned true. -igor On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: It is impossible, I can get Session Id but then when I call servlet ' s doPost() method , WicketSessionFilter can not find the HttpSession. I mean : HttpSession httpSession = httpServletRequest.getSession(false); // WicketSessionFilter.java in wicket.1.3.6.jar returns NULL. so that my servlet throws Exception because Session wicketSession = Session.get(); throws java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to determine which behavior corresponds to the currently handled request target
you can use AjaxRequestTarget.get() to see if an ajax request is being processed. -igor On Mon, Jul 27, 2009 at 5:41 AM, Vladimir Kkoval...@gmail.com wrote: Could anyone shed light on that? -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24680015.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
Re: executing wicketSubmitFormById
not really sure what you are trying to do -igor On Mon, Jul 27, 2009 at 3:02 AM, Gatosega...@gmail.com wrote: Hello, Wicket lovers! I'm trying to execute wicketSubmitFormById from my custom function. Function itselft looks like this: function wicketSubmitFormById(formId, url, submitButton, successHandler, failureHandler, precondition, channel) I have examined the ajax submit button and it has the following event handler: onclick=var wcall=wicketSubmitFormById('id14', '?wicket:interface=:4:tabs:panel:languageForm:ajaxSubmitButton:1:IActivePageBehaviorListener:0:amp;wicket:ignoreIfNotActive=true', 'ajaxSubmitButton' ,null,null, function() {return Wicket.$$(this)amp;amp;Wicket.$$('id14')}.bind(this));;; return false; How is it possible to get formId, url from my custom function? Have an outstanding day - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Problem with SortableDataProvider
Hi there, this is my first post on this list, so please be gentle :) I have a wicket application that uses SortableDataProvider (org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider). The source compiles nicely on my machine but when i try to deploy it I get the following error: 16:51:47,546 INFO [STDOUT] 16:51:47,545 INFO [AutoDeployDir:183] Processing PmcLocations-war.war 16:51:47,549 INFO [STDOUT] 16:51:47,548 INFO [PortletAutoDeployListener:77] Copying portlets for /opt/deploy/PmcLocations-war.war 16:51:47,563 INFO [STDOUT] Expanding: /opt/deploy/PmcLocations-war.war into /tmp/20090727165147563 16:51:47,582 INFO [warupdater] PSPL_CSPPCWU0014 : Updating the Portlet Application PmcLocations-war with Portlet Container specific artifacts 16:51:47,673 INFO [STDOUT] Copying 1 file to /tmp/20090727165147563/WEB-INF/classes 16:51:47,695 INFO [STDOUT] Copying 1 file to /tmp/20090727165147563/WEB-INF/classes 16:51:47,862 INFO [STDOUT] Copying 19 files to /opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war 16:51:47,896 INFO [STDOUT] Copying 1 file to /opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war 16:51:47,897 INFO [STDOUT] Deleting directory /tmp/20090727165147563 16:51:47,902 INFO [STDOUT] 16:51:47,901 INFO [PortletAutoDeployListener:87] Portlets for /opt/deploy/PmcLocations-war.war copied successfully. Deployment will start in a few seconds. 16:51:53,649 ERROR [AbstractKernelController] Error installing to PostClassLoader: name=vfsfile:/opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/ state=ClassLoader mode=Manual requiredState=PostClassLoader org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/opt/jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/ at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702) at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org/apache/wicket/extensions/markup/html/repeater/util/SortableDataProvider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.classloader.spi.base.BaseClassLoader.loadClassLocally(BaseClassLoader.java:530) at
Re: log4j question with wicket
a) Where does the log4j.properties file for your webapp reside ? b) Do you have a log4j.jar in WEB-INF/lib/ ? M. On Mon, Jul 27, 2009 at 4:45 PM, pieter claassen pieter.claas...@gmail.comwrote: I am sure something is broken in tomcat. This is not a dependency issue as the build runs file and manually logging info with log4j also works (see below). The problem seems when wicket logs using slf4j and this only goes to catalina.log (I cannot get this redirected to my own log file). If I understand this correctly, wicket uses slf4j to log its own internals. With tomcat6, I am supposed to then configure log4j (or any adapter that I want to) to get that information to the location I would like to (a local text log file). I am trying to enable wicket's requestlog debugging and directing the output to my application log file for later inspection. If I run the following code, I get a message in catalina.out (I also get all the debug information from wicket requestlogger on catalina.out) Logger logger=LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); logger.info(AUTH PAGE ACCESSED); When I run the code under a debugger, I can see that logger points to catalina.out, so clearly I failed to point rootLogger to another file with either of my log4j.properties settings. Note however, that if I use org.apache.log4j.Logger then I can correctly dump logging infor to my target file Logger.getRootLogger().info(AUTHPAGE Logged with Logger.getRootLogger()); Here is my question: 1. What is the correct procedure to enable request logging with wicket and tomcat so that each of my applications dumps its request data to a specific text file? Thanks for all the feedback so far. Pieter here is my log4j.properties in my tomcat lib directory log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=${catalina.home}/logs/tomcat.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n log4j.logger.org.apache.catalina=INFO, R log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO, R log4j.logger.org.apache.catalina.core=INFO, R log4j.logger.org.apache.catalina.session=INFO, R Here is my application log4j.properties file. log4j.rootLogger=INFO,R log4j.category.org.apache.wicket.protocol.http.RequestLogger=INFO log4j.logger.org.apache.wicket=INFO log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO log4j.logger.org.apache.wicket.version=INFO log4j.logger.org.apache.wicket.RequestCycle=INFO log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=/var/log/${application.name}/application.log log4j.appender.R.MaxFileSize=10MB log4j.appender.R.MaxBackupIndex=10 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%p %t %c - log file%m%n On Mon, Jul 27, 2009 at 12:00 PM, Maarten Bosteels mbosteels@gmail.comwrote: On Fri, Jul 24, 2009 at 3:47 PM, pieter claassen pie...@claassen.co.uk wrote: I think that slf4j is not working in my setup and it might have nothing to do with Tomcat. As a matter of fact, I assume I don't even have to have log4j or slf4j working with tomcat, but that as long as my POM references the correct dependencies, my application should log correctly? To overcome the following error, I had to upgrade by slf4j and log4j deps to the latest version. Caused by: java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory These are my maven deps. dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.5.6/version /dependency dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.5.6/version /dependency You still need log4j itself. add this dependency: dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.14/version /dependency Maarten I see the same behaviour in Glassfish and tomcat. Does anybody have slf4j-1.5.6 working with log4j-1.2.14? I am stumped?! P On Fri, Jul 24, 2009 at 9:22 AM, pieter claassen pie...@claassen.co.uk wrote: I am trying to get my application to log to a separate file with the following log4j.properties (server is tomcat6 in netbeans). I enabled the following in my wicketapplication. getRequestLoggerSettings().setRequestLoggerEnabled(true); What I find is that catalina.{date}.out logs the requests correctly, but I get tomcat startup info in my logfile and then nothing else. Any ideas? Thanks, Pieter
Re: Problem with SortableDataProvider
make sure you packaged wicket-extensions.jar in your ear or war -igor On Mon, Jul 27, 2009 at 10:18 AM, Elad Katze...@xtify.com wrote: Hi there, this is my first post on this list, so please be gentle :) I have a wicket application that uses SortableDataProvider (org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider). The source compiles nicely on my machine but when i try to deploy it I get the following error: 16:51:47,546 INFO [STDOUT] 16:51:47,545 INFO [AutoDeployDir:183] Processing PmcLocations-war.war 16:51:47,549 INFO [STDOUT] 16:51:47,548 INFO [PortletAutoDeployListener:77] Copying portlets for /opt/deploy/PmcLocations-war.war 16:51:47,563 INFO [STDOUT] Expanding: /opt/deploy/PmcLocations-war.war into /tmp/20090727165147563 16:51:47,582 INFO [warupdater] PSPL_CSPPCWU0014 : Updating the Portlet Application PmcLocations-war with Portlet Container specific artifacts 16:51:47,673 INFO [STDOUT] Copying 1 file to /tmp/20090727165147563/WEB-INF/classes 16:51:47,695 INFO [STDOUT] Copying 1 file to /tmp/20090727165147563/WEB-INF/classes 16:51:47,862 INFO [STDOUT] Copying 19 files to /opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war 16:51:47,896 INFO [STDOUT] Copying 1 file to /opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war 16:51:47,897 INFO [STDOUT] Deleting directory /tmp/20090727165147563 16:51:47,902 INFO [STDOUT] 16:51:47,901 INFO [PortletAutoDeployListener:87] Portlets for /opt/deploy/PmcLocations-war.war copied successfully. Deployment will start in a few seconds. 16:51:53,649 ERROR [AbstractKernelController] Error installing to PostClassLoader: name=vfsfile:/opt/ jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/ state=ClassLoader mode=Manual requiredState=PostClassLoader org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/opt/jboss-5.1.0.GA/server/default/deploy/PmcLocations-war.war/ at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:177) at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702) at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362) at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317) at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.lang.NoClassDefFoundError: org/apache/wicket/extensions/markup/html/repeater/util/SortableDataProvider at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at org.jboss.classloader.spi.base.BaseClassLoader.access$200(BaseClassLoader.java:63) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:572) at org.jboss.classloader.spi.base.BaseClassLoader$2.run(BaseClassLoader.java:532) at
Re: WicketSessionFilter and empty HttpSession
OK. Problem occurs because of swfupload - swfupload.org/ swfupload is a flash based file upload tool and it doesn't send cookie information in the http header so i can't access Wicket Session. I am sending Session Id in URL when posting via swfupload; Is there any way to access Session object assume that you know session Id ? Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com thats why i said use Session.exists() to check first, and only call Session.get() if Session.exists() returned true. -igor On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: It is impossible, I can get Session Id but then when I call servlet ' s doPost() method , WicketSessionFilter can not find the HttpSession. I mean : HttpSession httpSession = httpServletRequest.getSession(false); // WicketSessionFilter.java in wicket.1.3.6.jar returns NULL. so that my servlet throws Exception because Session wicketSession = Session.get(); throws java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ.
Re: WicketSessionFilter and empty HttpSession
no, there is not afaik. what you need to do is pass it in the url just like the servlet container would /context;JSESSIONID=x?foo=bar -igor On Mon, Jul 27, 2009 at 11:09 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: OK. Problem occurs because of swfupload - swfupload.org/ swfupload is a flash based file upload tool and it doesn't send cookie information in the http header so i can't access Wicket Session. I am sending Session Id in URL when posting via swfupload; Is there any way to access Session object assume that you know session Id ? Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com thats why i said use Session.exists() to check first, and only call Session.get() if Session.exists() returned true. -igor On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: It is impossible, I can get Session Id but then when I call servlet ' s doPost() method , WicketSessionFilter can not find the HttpSession. I mean : HttpSession httpSession = httpServletRequest.getSession(false); // WicketSessionFilter.java in wicket.1.3.6.jar returns NULL. so that my servlet throws Exception because Session wicketSession = Session.get(); throws java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: UnauthorizedActionException wrapped in an InvalidUrlException - how to deal with it ?
Well, I'll add that to the WaspWebApplication and check if that will do. Thanks. I'll check On 27 jul 2009, at 12:37, Alex Objelean wrote: You can treat runtime exceptions by overriding newRequestCycle method of your Application class... @Override public Page onRuntimeException(final Page page, final RuntimeException e) { if (e instanceof InvalidUrlException) { //redirect to 404 } else { return super.onRuntimeException(page, e); } } Olger Warnier-2 wrote: Sorry to keep on buggin over this, I try to understand what is the best option to plugin the unauthorized type of exceptions into the wicket framework. It seems (maybe because of lack of understanding) that the UnAuthorizedException handling can't work as it is now. Now to move on: I've read the RFE Alex sent. As you create a more specific extension of the runtime exception, it will be wrapped by the WebRequestCycleProcessor to an InvalidURLException. How do you make sure that it will show the 404 ? (or is that default for the InvalidURLException ?) It might be an idea to have some kind of exception resolvement at the spot where this decision is made. (I don't know where that is, I have seen hints that this is already done somehow and you are able to override it. ) and throw runtime exceptions as is to that level. By registering exception handler pages you have the option to customize the behaviour. If I like to do that in the current situation, I need to handle the InvalidUrlException, check the cause and do something only in the case I'd like to process (Unauthorized) What to do with the other causes of the InvalidUrl then ? Kind Regards, Olger On 27 jul 2009, at 11:41, Alex Objelean wrote: This is the link of the RFE: https://issues.apache.org/jira/browse/WICKET-2307 Olger Warnier-2 wrote: On 26 jul 2009, at 22:59, Alex Objelean wrote: If you think this would help, then you could remove InvalidUrlException and invalidate the jira RFE created by me... I don't think this would heart anyone... Intresting, I assume that it is of value to have this construction, could you give me the link to the RFE ? At any time, somehing was a WicketRuntimeException and only a PageExpired (original or as cause) is now rethrown. All others are wrapped. Is there a case that in the AbstractRequestCycleProcessor the following works then ? else if (e instanceof AuthorizationException) { // are authorization exceptions always thrown Kind Regards, Olger Alex igor.vaynberg wrote: my point is that this case is on the fence. it is an invalid url, and it is a security violation. so which one should take precendence? my other concern is that we would have to maintain a long list of exceptions that should be passed through, which becomes a pita. -igor On Sun, Jul 26, 2009 at 1:32 PM, Alex Objeleanalex_objel...@yahoo.com wrote: I just want to remind the reason why the InvalidUrlException was introduced: to avoid situations when user would tweak somehow the url and get the InternalError Page... I introduced a request for enhancement for InvalidUrlException feature and if there are any problems related to it, you can blame me..:( Alex Objelean igor.vaynberg wrote: then we are getting in a debate of what use an invalidurlexception really is. if we forward page expired and a bunch of other exceptions, why do we even need an invalidurlexception... the point is the user has submitted a form that they should not have been able to, it is an invalid url... i dont know off the top of my head what the best approach is. -igor On Sun, Jul 26, 2009 at 12:46 PM, Olger Warnierol...@xs4all.nl wrote: Hi Igor, if the form is disabled why is it allowed to be submitted? In a test you can ;) When you know what to submit, it is possible to submit those values without a page, although I can imagine that it is quite hard to achieve due to the way wicket handles form variables and stuff (via the session). Even with that in mind, I wonder if it is possible to have the UnauthorizedException thrown directly (without the InvalidUrlException). Kind Regards, Olger -igor On Sun, Jul 26, 2009 at 10:58 AM, Olger Warnierol...@xs4all.nl wrote: Hi Developers, Slowly but surely I move through the tests of the wicket security framework. In one test, the SecureFormTest, i ran into some strange behaviour. It starts with an exception like this: org.apache.wicket.protocol.http.request.InvalidUrlException: org.apache.wicket.authorization.UnauthorizedActionException: Component [MarkupContainer [Component id = form]] does not permit action ENABLE (note, the test is commented in order to prevent build failures) There is a secureform that has no rights to be filled an submitted. Normal behaviour till now was the return of a login page. In some cases I found the return of the UnauthorizedActionException - all fine till now. (running 1.4-rc7) In this
Re: WicketSessionFilter and empty HttpSession
Thanks Igor. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com no, there is not afaik. what you need to do is pass it in the url just like the servlet container would /context;JSESSIONID=x?foo=bar -igor On Mon, Jul 27, 2009 at 11:09 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: OK. Problem occurs because of swfupload - swfupload.org/ swfupload is a flash based file upload tool and it doesn't send cookie information in the http header so i can't access Wicket Session. I am sending Session Id in URL when posting via swfupload; Is there any way to access Session object assume that you know session Id ? Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com thats why i said use Session.exists() to check first, and only call Session.get() if Session.exists() returned true. -igor On Mon, Jul 27, 2009 at 9:45 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: It is impossible, I can get Session Id but then when I call servlet ' s doPost() method , WicketSessionFilter can not find the HttpSession. I mean : HttpSession httpSession = httpServletRequest.getSession(false); // WicketSessionFilter.java in wicket.1.3.6.jar returns NULL. so that my servlet throws Exception because Session wicketSession = Session.get(); throws java.lang.IllegalStateException: you can only locate or create sessions in the context of a request cycle Thanks. 2009/7/27 Igor Vaynberg igor.vaynb...@gmail.com that means session has not yet been created. you should use Session.exists() to test for this. -igor On Mon, Jul 27, 2009 at 7:38 AM, Altuğ B. Altıntaşalt...@gmail.com wrote: Hi all ; I am working on WicketSessionFilter for a while and i have problem about accessing Wicket Session in my Servlet. My question is : In WicketSessionFilter.java (core class in wicket.1.3.6.jar) at doFilter() method HttpSession httpSession = httpServletRequest.getSession(false); above code returns the session. But when my servlet post a request then above code returns NULL . It can not get the standard session object when a simple servlet post a request. Any idea why a servlet http post cause null http session in WicketSessionFilter.java ? Thanks. Altug. -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Altuğ.
DropDownChoice with ID and Value
Newbie question: I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi I will present to my user the select field with the choices abc, def and ghi. I want that my model updates with 1, 2 and 3. I did not find a way to achieve this (must me a simple thing). best regards, carlson - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with ID and Value
Look at ChoiceRenderer. It's pretty easy to write one that takes a map in it's constructor if your needs are that simple. Scott 2009/7/27 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Newbie question: I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi I will present to my user the select field with the choices abc, def and ghi. I want that my model updates with 1, 2 and 3. I did not find a way to achieve this (must me a simple thing). best regards, carlson - 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: DropDownChoice with ID and Value
Will try it, thanks a lot Scott Swank escreveu: Look at ChoiceRenderer. It's pretty easy to write one that takes a map in it's constructor if your needs are that simple. Scott 2009/7/27 carlson weber filho - Master CIM Informática cwe...@mastercim.com.br: Newbie question: I have a list of 3 options, let's supose it's 1=abc, 2=def, 3=ghi I will present to my user the select field with the choices abc, def and ghi. I want that my model updates with 1, 2 and 3. I did not find a way to achieve this (must me a simple thing). best regards, carlson - 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: How to determine which behavior corresponds to the currently handled request target
I'm trying to add AjaxFormComponentUpdating behavior to FormComponentPanel. The latter is inherintly not suited for Ajax requests. So I have to use some workarounds to update model of FormComponentPanel by ajax update on onblur js event on inner input, see code posted here. It works for now but I'm afraid I should bypass updating of model when whole form is submitted via ajax. So I'm trying to figure out what particular behavior is in progress. From the other hand you probably know different way how to add AjaxFormComponentUpdatingBehaviour to DateField component. Any thoughts are welcome. igor.vaynberg wrote: you can use AjaxRequestTarget.get() to see if an ajax request is being processed. -igor On Mon, Jul 27, 2009 at 5:41 AM, Vladimir Kkoval...@gmail.com wrote: Could anyone shed light on that? -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24680015.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24686879.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with ID and Value
class Choice{ private int id; private Stringvalue; // getters and setters } ListChoice choices = new LinkedListChoice(); Choice c = new Choice(); c.setId( 1 ); c.setValue( abc ); choices.add( c ); // add the other values // The choice with id 1 will be selected. DropDownChoice drop = new DropDownChoice( drop , new Model( c ) , choices, new ChoiceRenderer( value , id ) ); -- View this message in context: http://www.nabble.com/DropDownChoice-with-ID-and-Value-tp24686742p24686931.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: How to determine which behavior corresponds to the currently handled request target
you can always override getcallbackurl() and append a marker parameter you can use to differentiate between the different modes. -igor On Mon, Jul 27, 2009 at 12:31 PM, Vladimir Kkoval...@gmail.com wrote: I'm trying to add AjaxFormComponentUpdating behavior to FormComponentPanel. The latter is inherintly not suited for Ajax requests. So I have to use some workarounds to update model of FormComponentPanel by ajax update on onblur js event on inner input, see code posted here. It works for now but I'm afraid I should bypass updating of model when whole form is submitted via ajax. So I'm trying to figure out what particular behavior is in progress. From the other hand you probably know different way how to add AjaxFormComponentUpdatingBehaviour to DateField component. Any thoughts are welcome. igor.vaynberg wrote: you can use AjaxRequestTarget.get() to see if an ajax request is being processed. -igor On Mon, Jul 27, 2009 at 5:41 AM, Vladimir Kkoval...@gmail.com wrote: Could anyone shed light on that? -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24680015.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/How-to-determine-which-behavior-corresponds-to-the-currently-handled--request-target-tp24635282p24686879.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
Re: DropDownChoice with ID and Value
This is an awkward way to do it, and still doesn't set the selected value back into his model. The golden rule of DropDownChoice is: objects in the list must be of the same type as the model object. If you want your model to be updated with an int, you have to give DDC a list of Integer. The second rule is that you use a ChoiceRenderer to convert this value (the int) to a display value: class MyDomainClass { private int selection; } MyDomainClass myobj; add(new DropDownChoice(ddc, new PropertyModel(myobj, selection), Arrays.asList(1, 2, 3), new ChoiceRenderer() { public Object getDisplayValue(Object value) { // value is one of the objects from the list, // the one that the user selected Integer i = (Integer) value; // This function maps 1 to abc and so on... return getName(i); }) ); jk On Mon, Jul 27, 2009 at 12:36:39PM -0700, Mathias Nilsson wrote: class Choice{ private int id; private Stringvalue; // getters and setters } ListChoice choices = new LinkedListChoice(); Choice c = new Choice(); c.setId( 1 ); c.setValue( abc ); choices.add( c ); // add the other values // The choice with id 1 will be selected. DropDownChoice drop = new DropDownChoice( drop , new Model( c ) , choices, new ChoiceRenderer( value , id ) ); -- View this message in context: http://www.nabble.com/DropDownChoice-with-ID-and-Value-tp24686742p24686931.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
Re: Reg next line character in the passed String
HI Igor I have tried with you suggestions..now it is displaying the whole content but it is not displaying in the next line wherever i need to display.. Here is the code in HTML: div class=marginLeft20 wicket:id=mfg a class=bottomCellLinks href=# wicket:id=mfgLink pre wicket:id=mfgName !-- span wicket:id=mfgName[Manufacturer Name]/span -- /pre/a /div Here is the Java Code: RepeatingView rv = new RepeatingView(mfg); WebMarkupContainer wmc = new WebMarkupContainer(rv.newChildId()); BookmarkablePageLink mfgLink = null; String finalString=; String AMfgNames = \n\n+ A +\n\n; String BMfgNames = \n\n+ B +\n\n; String CMfgNames = \n\n+ C +\n\n; String DMfgNames = \n\n+ D +\n\n; String EMfgNames = \n\n+ E +\n\n; String FMfgNames = \n\n+ F +\n\n; String GMfgNames = \n\n+ G +\n\n; String HMfgNames = \n\n+ H +\n\n; for(Manufacturer mfg: mfgs) { String mfgName = mfg.getName(); //if(Pattern.matches([aA][a-zA-Z_0-9]*,mfgName )) if(Pattern.matches([aA][\\w\\W\\s\\S\\d\\D.]*,mfgName )) AMfgNames = AMfgNames + mfgName + | ; if(Pattern.matches([bB][\\w\\W\\s\\S\\d\\D.]*,mfgName )) BMfgNames = BMfgNames + mfgName + | ; if(Pattern.matches([cC][\\w\\W\\s\\S\\d\\D.]*,mfgName )) CMfgNames = CMfgNames + mfgName + | ; if(Pattern.matches([dD][\\w\\W\\s\\S\\d\\D.]*,mfgName )) DMfgNames = DMfgNames + mfgName + | ; if(Pattern.matches([eE][\\w\\W\\s\\S\\d\\D.]*,mfgName )) EMfgNames = EMfgNames + mfgName + | ; if(Pattern.matches([fF][\\w\\W\\s\\S\\d\\D.]*,mfgName )) FMfgNames = FMfgNames + mfgName + | ; if(Pattern.matches([gG][\\w\\W\\s\\S\\d\\D.]*,mfgName )) GMfgNames = GMfgNames + mfgName + | ; if(Pattern.matches([hH][\\w\\W\\s\\S\\d\\D.]*,mfgName )) HMfgNames = HMfgNames + mfgName + | ; // s = s + mfg.getName()+ | ; s = s + mfgName + | ; mfgLink = ManufacturerDetailPage.getBookmarkableLink(mfgLink, mfg); mfgLinkA = ManufacturerDetailPage.getBookmarkableLink(mfgLinkA, mfg); mfgLinkB = ManufacturerDetailPage.getBookmarkableLink(mfgLinkB, mfg); mfgLinkC = ManufacturerDetailPage.getBookmarkableLink(mfgLinkC, mfg); mfgLinkD = ManufacturerDetailPage.getBookmarkableLink(mfgLinkD, mfg); mfgLinkE = ManufacturerDetailPage.getBookmarkableLink(mfgLinkE, mfg); mfgLinkF = ManufacturerDetailPage.getBookmarkableLink(mfgLinkF, mfg); //mfgLink.add(new Label(index, new Model(index++))); } finalString = finalString + AMfgNames + BMfgNames + CMfgNames + DMfgNames + EMfgNames + FMfgNames + GMfgNames + HMfgNames ; mfgLink.add(new Label(mfgName, finalString).setRenderBodyOnly(true)); wmc.add(mfgLink); rv.add(wmc); add(rv); } On Fri, Jul 24, 2009 at 8:55 PM, Jeremy Thomerson jer...@wickettraining.com wrote: You said in your email that you are using span tags. What is the generated HTML? Do you have span tags inside pre tags? Have you tried setRenderBodyOnly(true)? Or just attach the wicket:id to the pre tags directly? -- Jeremy Thomerson http://www.wickettraining.com On Fri, Jul 24, 2009 at 6:38 PM, Swapna Rachamallaswapna.rachama...@gmail.com wrote: Hi Igor I am using pre tag. It is displaying A A2B TRACKING SOLUTIONS | Aastra | Aastra Phones | ABBYY | ABO Gear | ABT | AC Delco | ACCESS but the actual String value is the following: A A2B TRACKING SOLUTIONS | Aastra | Aastra Phones | ABBYY | ABO Gear | ABT | AC Delco | ACCESS HD | ACCUSCREEN | ACD SYSTEMS LICENSING | ACP - MEMORY UPGRADES | Accell | Accell Corp | Acer | Acme Hitch | Acomdata | Acoustic Research | Actiontec Electronics | Active Thermal Management | Activision Blizzard | Activision Blizzard Inc | ADAPTEC - RAID | ADAPTEC SW | ADDONICS | ADIC (ADVANCED DIGITAL INFO. CORP.) | ADMINISTAFF | ADS | ADTRAN INTERNATIONAL | ADTRAN TOTAL ACCESS 1500 PRODUCT | ADVANCED MATRIX TECH. INC. | Adcom | Addlogix | Adesso Inc. | Adobe Licensing | Adobe Software | Adobe Software | Adrians | Adtran | Advance Clocks | AEC SOFTWARE | Aethra SpA | AGFA | AGT | AIC | AIMETIS | AIPTEK | AIRDRIVES | AIRMAGNET ENTERPRISE | AIRVAC/MS SYSTEMS | AIS (American Industrial System) | AITECH | Air-Trekkers | Airhead | Airsoft | Airway | AKG | Akadema | ALACRITECH INC. | ALCOHAWK | ALLIED - NET.COVER | ALLIED TELESIS | Alcatel | Aleen | Aleratec | All Components | Alliance Systems | Allsop | Allworx | Alpen | Alpha Telecom | Altec Lansing | Altronix | Aluratek | AMBICOM | AMBIR TECHNOLOGY | AMC | AMD | AMERICAN BATTERY | AMERICAN HARVEST | AMERICAN TERMINAL | AMERIPHONE | AML | Ambico | American Digital Accessories |
Caching a resource on the browser side
hi We need to provide a flash application (www.amcharts.com if anyone is interested) with some content through some files. As the files are users specific (and determined with data from the session), we went for some page delivering the content like this : public AMChartDataProviderPage(final PageParameters parameters) { Object object = parameters.get(DATA_KEY); if ((object == null) || !(object instanceof String) || .equals(object)) { throw new IllegalStateException(Expected parameter + DATA_KEY + not provided or empty); } String dataId = (String) object; ByteArrayResource resourceStream; try { resourceStream = new ByteArrayResource(text/csv, IOHelper.getResourceAsByteArray(dataId + .csv)); } catch (IOException e) { throw ExceptionHelper.wrap(e); } getRequestCycle().setRequestTarget(new ResourceStreamRequestTarget(resourceStream.getResourceStream())); } However, I don't manage to get this resource to be cached on the user browser side, despite the resource being cacheable. From what I've seen, setHeaders() in WebResource is never called... Neither did I manage to set them myself (on the page they're never called neither... and the request cycle has no webresponse on which to define the header). Any clue ? thanks in advance zedros - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
will there be a performance gain to use singleton to remove references to the service object in models?
Hi all, Although I am using spring-wicket to prevent the whole spring being serialized, It still brothers me to see the references in the model object, for example: Instead of using this: public class MyViewObjectProvider extends SortableDataProvider{ @SpringBean(daoService) private DAOServices daoService; private String objectID; public Iterator iterator(final int first, final int count){ . return daoService.load(objectId).subList(first, first+count).iterator(); } } I always write a singleton helper class for the service to be used, so I can have the model this way: public class MyViewObjectProvider extends SortableDataProvider{ //so no reference to the dao service object private String objectID; public Iterator iterator(final int first, final int count){ . //here the DAOServiceHelper.get() returns a instance that managed by spring(with the actual service object injected.) return DAOServiceHelper.get().load(objectId).subList(first, first+count).iterator(); } } So my question is, will there be a noticeable performance gain to do it the 2nd way? The reason to ask is that the static kind of singleton usage is indeed anti-spring, and makes my eyes bleed If no one has done a performance comparison, I might have to do one myself. Just being lazy... Thanks, Jason Wang - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: DropDownChoice with ID and Value
Wasn't this more awkward? -- View this message in context: http://www.nabble.com/DropDownChoice-with-ID-and-Value-tp24686742p24690478.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
WicketTester and org.slf4j.LoggerFactory and org.slf4j.Logger not serializable
Hello, I have a Wicket 1.4rc4 application with a homegrown set of JDBC DAO classes: basic JDBC Connection and various methods for SQL queries and transactions. And Connection pooling is imported into the same JDBC DAO class and works well against the JUnit TestCases. The JUnit TestCases for the JDBC DAO implementation is comprehensive and complete with no failed testcases (17 in all). Now, I want to start testing the Pages that use my JDBC DAO class using WicketTester but the TestCases so far are failing with errors. I have scoured this topic with Google and have re-read Dashorst/Hillenius, Kent Tong and the Wicket Wiki and other articles covering WicketTester including the JavaDocs. My TestCases are having trouble with my JDBC DAOs as they not seriablizable because of heavy use of the logging packages: org.slf4j.LoggerFactory and org.slf4j.Logger I don't to remove all of the logging from my JDBC DAOs to implement WicketTester. Is there some way around this type of issue with serialization? Please advise, David. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: WicketTester and org.slf4j.LoggerFactory and org.slf4j.Logger not serializable
Your logger instances should either be transient or static - so that they are not serialized. -- Jeremy Thomerson http://www.wickettraining.com On Mon, Jul 27, 2009 at 8:01 PM, David Browndbr...@sexingtechnologies.com wrote: Hello, I have a Wicket 1.4rc4 application with a homegrown set of JDBC DAO classes: basic JDBC Connection and various methods for SQL queries and transactions. And Connection pooling is imported into the same JDBC DAO class and works well against the JUnit TestCases. The JUnit TestCases for the JDBC DAO implementation is comprehensive and complete with no failed testcases (17 in all). Now, I want to start testing the Pages that use my JDBC DAO class using WicketTester but the TestCases so far are failing with errors. I have scoured this topic with Google and have re-read Dashorst/Hillenius, Kent Tong and the Wicket Wiki and other articles covering WicketTester including the JavaDocs. My TestCases are having trouble with my JDBC DAOs as they not seriablizable because of heavy use of the logging packages: org.slf4j.LoggerFactory and org.slf4j.Logger I don't to remove all of the logging from my JDBC DAOs to implement WicketTester. Is there some way around this type of issue with serialization? Please advise, David. - 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: [OT] Continue to support Wicket 1.2 in WicketForge
Thanks for the feedback. Looks like I can safely remove Wicket 1.2 support. On Mon, Jul 27, 2009 at 3:33 AM, Linda van der Pal lvd...@heritageagenturen.nl wrote: I've only ever seen questions on this list about 1.3 and 1.4 (in the few months I've been on it, that is), so I'm guessing that if there are users of 1.2 they are either knowledgable enough not to have questions, or they're simply not on this list. Regards, Linda Maarten Bosteels wrote: We only use wicket 1.4.* Regards, Maarten On Sat, Jul 25, 2009 at 2:16 PM, Erik van Oosten e.vanoos...@grons.nl wrote: Mostly Wicket 1.4 at my company, just 1 Wicket 1.3 project left. Regards, Erik. Nick Heudecker wrote: Hi, For those of you that don't know, I maintain WicketForge, the Wicket plugin for IDEA (http://plugins.intellij.net/plugin/?id=1545 or http://code.google.com/p/wicketforge). Currently, WicketForge supports Wicket 1.2 in addition to 1.3 and 1.4, but I'd like to remove support for 1.2 to clean a few things up. First, I want to see if people are still using 1.2 with WF. My question to you is: are you still using WicketForge with Wicket 1.2? Thanks for your time and feedback. -- Erik van Oosten http://www.day-to-day-stuff.blogspot.com/ - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.32/2266 - Release Date: 07/27/09 05:58:00 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Nick Heudecker Professional Wicket Training Consulting http://www.systemmobile.com