Re: Interpolate response with IResponseFilter
Because I didn't know AbstractTransformerBehavior ! :) Many thanks ! I put it on my Page instance so it fullfills the last case of post + redirect (but the filter is still necessary for components refreshed by Ajax, otherwise I should add AbstractTransformerBehavior to all components of my Page) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Interpolate-response-with-IResponseFilter-tp4651476p4651486.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Interpolate response with IResponseFilter
my {myVar}s comes from HTML, or even model of components If these placeholders are in your HTML, why don't you just use an AbstractTransformerBehavior to fill them? Sven On 08/24/2012 04:51 PM, guillaume.mary wrote: Thanks Martin, it's easier to find the actual page with PageRequestHandlerTracker. Nevertheless, the redirecting case is still not filled because as I debugged, PageRequestHandlerTracker returns null for both first and last handler when my filter is called (am i wrong ??). That's almost the same problem as wicket 1.5.7: there's no more IRequestHandler during call of IResponseFilter.filter(..) on the second request. It's handle by a BufferedResponseRequestHandler at the beggining but it disappears ! @Sven: my {myVar}s comes from HTML, or even model of components -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Interpolate-response-with-IResponseFilter-tp4651476p4651480.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Interpolate response with IResponseFilter
Thanks Martin, it's easier to find the actual page with PageRequestHandlerTracker. Nevertheless, the redirecting case is still not filled because as I debugged, PageRequestHandlerTracker returns null for both first and last handler when my filter is called (am i wrong ??). That's almost the same problem as wicket 1.5.7: there's no more IRequestHandler during call of IResponseFilter.filter(..) on the second request. It's handle by a BufferedResponseRequestHandler at the beggining but it disappears ! @Sven: my {myVar}s comes from HTML, or even model of components -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Interpolate-response-with-IResponseFilter-tp4651476p4651480.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Apache Wicket 1.5.8 is released
This is the eighth maintenance release of the Wicket 1.5.x series. This release brings over 45 bug fixes and improvements. Git tag: release/wicket-1.5.8 Changelog: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310561&version=12321662 Maven: org.apache.wicket wicket-core 1.5.8 Download the full distribution (including source): http://www.apache.org/dyn/closer.cgi/wicket/1.5.8 The Wicket team - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Interpolate response with IResponseFilter
Where do these {myVar}s come from? Sven On 08/24/2012 03:32 PM, Guillaume Mary wrote: Hi all, Here is my use case: I need to fill variables, like {myVar}, that are rendered into the page. My approach is to use a specialized IResponseFilter for that. The important point is the filter should be applied to a certain Page of my application, and more of that, the variable values are picked up in this particular page (they are stored in a specific attribute of the page instance). All was right in Wicket 1.4, I was able to check the targeted page in the IResponseFilter thanks to the code: Page page = RequestCycle.get().getResponsePage(); Since Wicket 1.5, the getResponsePage() method disappeared, so I'm facing trouble to check (and get) my page. I tried to replace the so simple getResponsePage() by some combination of overriden MountedMapper, WebPageRendered, BufferedResponseRequestHandler, or RequestCycle, etc, but I didn't manage to fill all the traps to ensure that all requests made by the user on the page are interpolated. Here is what I found: - the first time the user opens the page seems to be treated by overriding WebPageRenderer.respond() and testing his renderPageRequestHandler.getPageClass() - the Ajax case (user clicks on an ajax link on my page, I should interpolate the result response) seems to be treated by checking the result of PageInstanceMapper.mapRequest(..) to see if it's a IPageRequestHandler, then getting the page thru pageProvider - the worst case is the redirecting one: the user click on a link that makes a setResponsePage(MyPage) then Wicket uses a temporary buffered response stored in WebApplication.storedResponse, then sends redirect to client, which recalls Wicket thats serves the cached response ! The second request doesn't contain the targeted Page because a BufferedResponseRequestHandler takes priority Done all of that, the result is not always good, there are still unterpolated variables in my HTML. It seems to be so complicated that I'm asking myself if i'm on the good way. Does anyone can help me accomplish my use case ? (a good knowledge of wicket 1.5 request handling seems to be necessary !) Thanks - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Interpolate response with IResponseFilter
Hi, In Wicket 1.5.8 there is org.apache.wicket.request.cycle.PageRequestHandlerTracker which you can use to get the requested page and the response page. In your case you need the latter. PageRequestHandlerTracker.getLastHandler(cycle), then check whether it is IPageRequestHandler and call #getPage() on it. On Fri, Aug 24, 2012 at 4:32 PM, Guillaume Mary wrote: > Hi all, > > Here is my use case: I need to fill variables, like {myVar}, that are > rendered into the page. My approach is to use a specialized IResponseFilter > for that. The important point is the filter should be applied to a certain > Page of my application, and more of that, the variable values are picked up > in this particular page (they are stored in a specific attribute of the page > instance). > > All was right in Wicket 1.4, I was able to check the targeted page in the > IResponseFilter thanks to the code: > Page page = RequestCycle.get().getResponsePage(); > > Since Wicket 1.5, the getResponsePage() method disappeared, so I'm facing > trouble to check (and get) my page. > I tried to replace the so simple getResponsePage() by some combination of > overriden MountedMapper, WebPageRendered, BufferedResponseRequestHandler, or > RequestCycle, etc, but I didn't manage to fill all the traps to ensure that > all requests made by the user on the page are interpolated. Here is what I > found: > - the first time the user opens the page seems to be treated by overriding > WebPageRenderer.respond() and testing his > renderPageRequestHandler.getPageClass() > - the Ajax case (user clicks on an ajax link on my page, I should interpolate > the result response) seems to be treated by checking the result of > PageInstanceMapper.mapRequest(..) to see if it's a IPageRequestHandler, then > getting the page thru pageProvider > - the worst case is the redirecting one: the user click on a link that makes > a setResponsePage(MyPage) then Wicket uses a temporary buffered response > stored in WebApplication.storedResponse, then sends redirect to client, which > recalls Wicket thats serves the cached response ! The second request doesn't > contain the targeted Page because a BufferedResponseRequestHandler takes > priority > > Done all of that, the result is not always good, there are still unterpolated > variables in my HTML. > > It seems to be so complicated that I'm asking myself if i'm on the good way. > Does anyone can help me accomplish my use case ? (a good knowledge of wicket > 1.5 request handling seems to be necessary !) > > Thanks -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Interpolate response with IResponseFilter
Hi all, Here is my use case: I need to fill variables, like {myVar}, that are rendered into the page. My approach is to use a specialized IResponseFilter for that. The important point is the filter should be applied to a certain Page of my application, and more of that, the variable values are picked up in this particular page (they are stored in a specific attribute of the page instance). All was right in Wicket 1.4, I was able to check the targeted page in the IResponseFilter thanks to the code: Page page = RequestCycle.get().getResponsePage(); Since Wicket 1.5, the getResponsePage() method disappeared, so I'm facing trouble to check (and get) my page. I tried to replace the so simple getResponsePage() by some combination of overriden MountedMapper, WebPageRendered, BufferedResponseRequestHandler, or RequestCycle, etc, but I didn't manage to fill all the traps to ensure that all requests made by the user on the page are interpolated. Here is what I found: - the first time the user opens the page seems to be treated by overriding WebPageRenderer.respond() and testing his renderPageRequestHandler.getPageClass() - the Ajax case (user clicks on an ajax link on my page, I should interpolate the result response) seems to be treated by checking the result of PageInstanceMapper.mapRequest(..) to see if it's a IPageRequestHandler, then getting the page thru pageProvider - the worst case is the redirecting one: the user click on a link that makes a setResponsePage(MyPage) then Wicket uses a temporary buffered response stored in WebApplication.storedResponse, then sends redirect to client, which recalls Wicket thats serves the cached response ! The second request doesn't contain the targeted Page because a BufferedResponseRequestHandler takes priority Done all of that, the result is not always good, there are still unterpolated variables in my HTML. It seems to be so complicated that I'm asking myself if i'm on the good way. Does anyone can help me accomplish my use case ? (a good knowledge of wicket 1.5 request handling seems to be necessary !) Thanks
Re: after migration to 1.5 I get "java.lang.IllegalStateException: Header was already written to response!"
We also have this problem after migrating to 1.5. Everything seems to work ok, but the logs get full with this error. We did not find a solution to this. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/after-migration-to-1-5-I-get-java-lang-IllegalStateException-Header-was-already-written-to-response-tp4651455p4651475.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: i18n/l10n XML file not recognized in Wicket 6.0.0-beta3?
Oh boy.. I somehow assumed that .properties is the file-extension for the normal properties files, and .xml for XML files. So I overlooked the proper naming-conventions.. sigh. Thanks, woking now! 2012/8/24 Sven Meier > Do your files have the correct suffix? > > *.properties.xml > > Sven > > Michael M schrieb: > > >Hi, need to use an XML file for localization in my application. However, > >Wicket is just not recognizing an XML file for this. > > > >I did the XML structure exactly like in the examples, proper UTF-8 > >encoding, proper doctype for Java properties. I copied the examples into a > >newly created UTF-8 text file and saved it as an XML, I tried to do it > from > >scratch in a text-editor as well as in my IDE. I escaped the {} brackets > >with a backslash, tried without any text or just one letter in the > >-tags... nothing, Wicket is not recognizing or not reading the file. > > > >XML validators tell me the file is valid. As soon as I change the XML into > >a .properties file, Wicket reads it. But I need UTF-8 for German Umlauts. > > > >Is the beta3 having a problem maybe, anyone else experiencing that? > >*_de.html files are recognized as well, but not my XML. >
Re: i18n/l10n XML file not recognized in Wicket 6.0.0-beta3?
Do your files have the correct suffix? *.properties.xml Sven Michael M schrieb: >Hi, need to use an XML file for localization in my application. However, >Wicket is just not recognizing an XML file for this. > >I did the XML structure exactly like in the examples, proper UTF-8 >encoding, proper doctype for Java properties. I copied the examples into a >newly created UTF-8 text file and saved it as an XML, I tried to do it from >scratch in a text-editor as well as in my IDE. I escaped the {} brackets >with a backslash, tried without any text or just one letter in the >-tags... nothing, Wicket is not recognizing or not reading the file. > >XML validators tell me the file is valid. As soon as I change the XML into >a .properties file, Wicket reads it. But I need UTF-8 for German Umlauts. > >Is the beta3 having a problem maybe, anyone else experiencing that? >*_de.html files are recognized as well, but not my XML.
i18n/l10n XML file not recognized in Wicket 6.0.0-beta3?
Hi, need to use an XML file for localization in my application. However, Wicket is just not recognizing an XML file for this. I did the XML structure exactly like in the examples, proper UTF-8 encoding, proper doctype for Java properties. I copied the examples into a newly created UTF-8 text file and saved it as an XML, I tried to do it from scratch in a text-editor as well as in my IDE. I escaped the {} brackets with a backslash, tried without any text or just one letter in the -tags... nothing, Wicket is not recognizing or not reading the file. XML validators tell me the file is valid. As soon as I change the XML into a .properties file, Wicket reads it. But I need UTF-8 for German Umlauts. Is the beta3 having a problem maybe, anyone else experiencing that? *_de.html files are recognized as well, but not my XML.