Re: turning off page versioning

2014-09-26 Thread mscoon
Martin, I found you "single-page-instance" sample very interesting. I have the following question if you can spare some time: What happens if you completely remove the local map in SinglePageManager (and the associated) code? I.e. if SinglePageManager#getPage(int id) always delegates to the und

Re: turning off page versioning

2014-09-26 Thread Martin Grigorov
Hi, What you describe is what several users currently do by using NoVersionMapper. NoVersionMapper is the thing that hides the ?pageId from the url in the address bar. The changes you suggest to be done in SinglePageManager (effectively remove SinglePageManager completely) is the current default

Re: turning off page versioning

2014-09-26 Thread mscoon
Okay I see. I imagine this approach breaks if the render strategy is REDIRECT_TO_RENDER and works in ONE_PASS_RENDER and REDIRECT_TO_BUFFER. Also REDIRECT_TO_BUFFER works sort of by chance? What would happen if somehow requests from different tabs for the same page (url) were handled simultaneous

Re: turning off page versioning

2014-09-26 Thread Martin Grigorov
On Fri, Sep 26, 2014 at 12:23 PM, mscoon wrote: > Okay I see. > > I imagine this approach breaks if the render strategy is REDIRECT_TO_RENDER > and works in ONE_PASS_RENDER and REDIRECT_TO_BUFFER. > Wicket will redirect only if the requested url differs with the response url. Since the ?pageId i

Re: turning off page versioning

2014-09-26 Thread mscoon
I just tried your demo, it does seem to redirect (the requested url is ?0 while the current url has no version number)... But I was referring to the use of NoVersionMapper without SinglePageManager. I tried this too, and redirect to render breaks because the redirect is to http://blahblah/a and ha

Re: turning off page versioning

2014-09-26 Thread Martin Grigorov
Thanks for testing! I'm sure there will be problems to be solved. The app is just a proof of concept that it is not that hard to accomplish what Garret wanted. If someone wants to use this in production then (s)he will have to test and optimize it further. Martin Grigorov Wicket Training and Consu

Error page for AJAX requests

2014-09-26 Thread Wayne W
Hi all, we've recently moved to Wicket 6.17 from 1.4 and I'm having trouble with NOT showing the default wicket error page when a runtime exception is thrown from an AjaxLink. I've set the following in the application: getApplicationSettings().setInternalErrorPage(ErrorPage.class); getException

Re: Error page for AJAX requests

2014-09-26 Thread Martin Grigorov
Hi, Check org.apache.wicket.settings.ExceptionSettings#setAjaxErrorHandlingStrategy Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Sep 26, 2014 at 1:25 PM, Wayne W wrote: > Hi all, > > we've recently moved to Wicket 6.17 from 1.4 and I'm having trouble wi

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Thibault Kruse
As a follow-up: How can the Http Error code then be checked using WicketTester? Currently, after your suggested change, the browser shows my 404 page and status is 404, but in WicketTester, I get In MyPage.java: @Override protected void onInitialize() { super.onInitialize();

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Martin Grigorov
Hi, I think it is 200 because this is the status code of the error page - it is rendered successfully. You need org.apache.wicket.util.tester.BaseWicketTester#setFollowRedirects(false) if you want to assert the response for MyPage. Martin Grigorov Wicket Training and Consulting https://twitter.co

[Problem] Attribute not found

2014-09-26 Thread Maxime00
Hello, I have a weird issue in my tests. I have a html file with that line : wich is supposed to add a question circle in my page. When I run my tests, I do : public void testWicketExist() throws Exception { // GIVEN : Page was created // Page creation ModuleCreatePanel

Re: [Problem] Attribute not found

2014-09-26 Thread Martin Grigorov
Hi, WicketHelper is your own class. We cannot know how it works. You can use WicketTester.getTagBy(Wicket)Id() instead. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Sep 26, 2014 at 1:41 PM, Maxime00 wrote: > Hello, I have a weird issue in my tests. I ha

Re: turning off page versioning

2014-09-26 Thread mscoon
One last question: what code is involved in the redirect to buffer strategy? Where to start to search if using the NoVersionMapper without the SinglePageManager will have problems with redirect to buffer? Thanks a lot for your time so far. As always you rock (and so does the list) :) On Fri, Sep

Re: turning off page versioning

2014-09-26 Thread Martin Grigorov
The magic happens in WebPageRenderer#respond() method. But beware that this is one of the most scary (to reason about) code in Wicket. We know about this problem, we simplified it somehow for Wicket 7, but still as the comments there say "it is hairy". Martin Grigorov Wicket Training and Consultin

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Thibault Kruse
Hm, so the Error Page itself is does not render during the test (debugger does not enter constructor at all). My Error Page has: @Override protected void configureResponse(WebResponse response) { super.configureResponse(response); response.setStatus(HttpServletResponse.SC_NO

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Martin Grigorov
OK. Right. ErrorCodeRequestHandler returns a response with code 404 and then the web container uses the definition in web.xml to get the url for 404 ... There is no web.xml with WicketTester and thus no redirect to /404.html. Your code is good! Martin Grigorov Wicket Training and Consulting https:

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Thibault Kruse
Sorry I just realized I pasted something wrong in my last message. My current workaround would be: assertThat(TESTER_SCOPE.getTester().getPreviousResponses().get(0).getStatus()) .isEqualTo(HttpServletResponse.SC_NOT_FOUND); But that is a bit annoying for us when we reuse a tester

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Martin Grigorov
Use getLastResponse(). getRequest() and getResponse() return the ones which will be used for the next interaction. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Sep 26, 2014 at 2:04 PM, Thibault Kruse wrote: > Sorry I just realized I pasted something wro

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Thibault Kruse
duh, sorry, could have seen that myself. It is still a bit confusing that the WicketTester ends up in a state with a new request and response which are undefined. Somehow I think if the web.xml for testing did not define a response for 404, there should not be any new request. But that's not bad e

Re: respond with 404 page while keeping original URL

2014-09-26 Thread Martin Grigorov
I agree that getResponse() is indeed confusing I don't see why someone would use it before making a request but I am not sure how much harm it will cause if we move its initialization to #processRequest() (this is where the request processing starts in WicketTester) changing #getResponse() to retur

Re: [Problem] Attribute not found

2014-09-26 Thread Maxime00
We used : TagTester tagById = this.tester.getTagByWicketId("address-helper"); assertNotNull(tagById); Assert fail -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667721.html Sent from the Users forum mailing list archive

Re: [Problem] Attribute not found

2014-09-26 Thread Martin Grigorov
See IMarkupSettings#setStripWicketTags(). It has to be 'false' to be able to use tester.getTagByWicketId(). Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Fri, Sep 26, 2014 at 2:29 PM, Maxime00 wrote: > We used : > > TagTester tagById = this.tester.getTagByWick

Re: [Problem] Attribute not found

2014-09-26 Thread Maxime00
It is false :( Another idea ? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667723.html Sent from the Users forum mailing list archive at Nabble.com. - To unsu

Re: [Problem] Attribute not found

2014-09-26 Thread Martin Grigorov
Use org.apache.wicket.util.tester.BaseWicketTester#getLastResponseAsString() to print the response. Make sure the element is there. If it is there then fire the debugger and see why getTagByWicketId() doesn't see it. Then file a bug at JIRA. Martin Grigorov Wicket Training and Consulting https://t

Re: [Problem] Attribute not found

2014-09-26 Thread Maxime00
We chose to use java instead, thank you for your help. (we couldn't find where the error is) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Problem-Attribute-not-found-tp4667711p4667728.html Sent from the Users forum mailing list archive at Nabble.com. --