Re: Wicket 1.5 shared image resource and modal windows.
Thanks! I'll try those options. A On Tue, Jul 5, 2011 at 11:45 AM, Martin Grigorov wrote: > You can use ContextImage and put the image itself next to WEB-INF folder. > > the anti-cache parameter is added to Image components so that they are > re-rendered when added to AjaxRequestTarget > with Wicket 1.5-RC5.1 there is > org.apache.wicket.markup.html.image.Image.shouldAddAntiCacheParameter() > which you can override and say to not add this parameter for images > which you think should not be updated > > On Tue, Jul 5, 2011 at 11:35 AM, Anders Smestad > wrote: >> I see. >> >> So how do you usually include common images in your application? Say >> for instance you have a form button functionality, but you want it >> displayed as an image instead of the standard html button. Here we >> have used a button with an image, but the image gets rendered with the >> wicket:antiCache appended to the img src, but since this is a static >> image, it doesn't make much sense to have it anti-cached. >> >> Thanks again. >> >> A >> >> On Tue, Jul 5, 2011 at 10:22 AM, Martin Grigorov >> wrote: >>> We should revise this code. >>> At least this shouldn't be a warning. I see it as debug. But as I said >>> I need to look in this code first before I can comment. >>> I personally don't use SharedResourceReferences in my app and thus >>> never faced this issue. >>> >>> On Tue, Jul 5, 2011 at 10:13 AM, Anders Smestad >>> wrote: But even when I follow the guidelines from the wicketstuff images examples, I get the WARN - ResourceReferenceRegistry - Resource reference not added to registry. reference.canBeRegistered() == false Why cannot a shared reference be registered? A On Mon, Jul 4, 2011 at 10:41 PM, Anders Smestad wrote: > Done: https://issues.apache.org/jira/browse/WICKET-3869 > > A > > On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov > wrote: >> See how http://wicketstuff.org/wicket/images/ creates the images. >> If you can create a quickstart application that shows the problem then >> attach it to a ticket. >> >> On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad >> wrote: >>> Hi. I have a simple (test) page with an ajax link that displays a >>> modal window when clicked. >>> >>> The modal window contains some text and an image-link. The image is >>> added to a link as >>> >>> link.add(new Image("image", sharedResourceReference); >>> >>> When displaying the modal window, everything displays correctly, but >>> firstly, there is a warning in the log that says: >>> >>> WARN - ResourceReferenceRegistry - Resource reference not added to >>> registry. reference.canBeRegistered() == false >>> >>> Then, not every time, but often, the stacktrace included at the bottom >>> of this message appears in the log when using Internet Explorer. Using >>> the network inspector tool (F12) in internet explorer shows that the >>> image is first requested once, then the request is aborted (result: >>> "(Aborted)"), then the same image is requested another time, this time >>> it receives a 200 and the image is downloaded. >>> >>> None of these problems materialize when using other browsers than >>> internet explorer. >>> >>> The image is a symbol for a link, and is a static image that will not >>> change between redeployments of the application. >>> >>> What is the proper way to use such images. I have tried different >>> approaches, >>> * Using the in markup >>> * Using PackageResourceReference from java code >>> * Using SharedResourceReference as described above >>> * Registring the Image to the >>> Application.get().getSharedResources().add("name", ...); and >>> dereferencing it using new SharedResourceReference("name"), then >>> adding it to the link. >>> >>> It seems that either the image link gets rendered with the >>> -ts00.ext (timestamp) extension, or the ?wicket:antiCache is >>> appended, both seems unnecessary since it is a static image which >>> could very well be cached on the browser. >>> >>> The SharedResourceReference seems like it would be the right class to >>> use, but when adding the image to the page, the .canBeRegistered() == >>> false is displayed. >>> >>> So finally, this is the question: What is the correct way to include >>> static images, css and javascript resources in wicket, it seems there >>> are multiple ways to do this, but none seems to do what I want. I also >>> the resources to be contained with the component it is used with. >>> >>> Thanks in advance! >>> >>> A >>> >>> Stacktrace from log when using Internet Explorer. >>> >>> ERROR - DefaultExceptionMapper - Connection lost, give up >>> responding. >>> org.apache.wicket.protocol.http.servlet.ResponseIOException:
Re: Wicket 1.5 shared image resource and modal windows.
You can use ContextImage and put the image itself next to WEB-INF folder. the anti-cache parameter is added to Image components so that they are re-rendered when added to AjaxRequestTarget with Wicket 1.5-RC5.1 there is org.apache.wicket.markup.html.image.Image.shouldAddAntiCacheParameter() which you can override and say to not add this parameter for images which you think should not be updated On Tue, Jul 5, 2011 at 11:35 AM, Anders Smestad wrote: > I see. > > So how do you usually include common images in your application? Say > for instance you have a form button functionality, but you want it > displayed as an image instead of the standard html button. Here we > have used a button with an image, but the image gets rendered with the > wicket:antiCache appended to the img src, but since this is a static > image, it doesn't make much sense to have it anti-cached. > > Thanks again. > > A > > On Tue, Jul 5, 2011 at 10:22 AM, Martin Grigorov wrote: >> We should revise this code. >> At least this shouldn't be a warning. I see it as debug. But as I said >> I need to look in this code first before I can comment. >> I personally don't use SharedResourceReferences in my app and thus >> never faced this issue. >> >> On Tue, Jul 5, 2011 at 10:13 AM, Anders Smestad >> wrote: >>> But even when I follow the guidelines from the wicketstuff images >>> examples, I get the WARN - ResourceReferenceRegistry - Resource >>> reference not added to registry. reference.canBeRegistered() == false >>> >>> Why cannot a shared reference be registered? >>> >>> A >>> >>> On Mon, Jul 4, 2011 at 10:41 PM, Anders Smestad >>> wrote: Done: https://issues.apache.org/jira/browse/WICKET-3869 A On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov wrote: > See how http://wicketstuff.org/wicket/images/ creates the images. > If you can create a quickstart application that shows the problem then > attach it to a ticket. > > On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad > wrote: >> Hi. I have a simple (test) page with an ajax link that displays a >> modal window when clicked. >> >> The modal window contains some text and an image-link. The image is >> added to a link as >> >> link.add(new Image("image", sharedResourceReference); >> >> When displaying the modal window, everything displays correctly, but >> firstly, there is a warning in the log that says: >> >> WARN - ResourceReferenceRegistry - Resource reference not added to >> registry. reference.canBeRegistered() == false >> >> Then, not every time, but often, the stacktrace included at the bottom >> of this message appears in the log when using Internet Explorer. Using >> the network inspector tool (F12) in internet explorer shows that the >> image is first requested once, then the request is aborted (result: >> "(Aborted)"), then the same image is requested another time, this time >> it receives a 200 and the image is downloaded. >> >> None of these problems materialize when using other browsers than >> internet explorer. >> >> The image is a symbol for a link, and is a static image that will not >> change between redeployments of the application. >> >> What is the proper way to use such images. I have tried different >> approaches, >> * Using the in markup >> * Using PackageResourceReference from java code >> * Using SharedResourceReference as described above >> * Registring the Image to the >> Application.get().getSharedResources().add("name", ...); and >> dereferencing it using new SharedResourceReference("name"), then >> adding it to the link. >> >> It seems that either the image link gets rendered with the >> -ts00.ext (timestamp) extension, or the ?wicket:antiCache is >> appended, both seems unnecessary since it is a static image which >> could very well be cached on the browser. >> >> The SharedResourceReference seems like it would be the right class to >> use, but when adding the image to the page, the .canBeRegistered() == >> false is displayed. >> >> So finally, this is the question: What is the correct way to include >> static images, css and javascript resources in wicket, it seems there >> are multiple ways to do this, but none seems to do what I want. I also >> the resources to be contained with the component it is used with. >> >> Thanks in advance! >> >> A >> >> Stacktrace from log when using Internet Explorer. >> >> ERROR - DefaultExceptionMapper - Connection lost, give up responding. >> org.apache.wicket.protocol.http.servlet.ResponseIOException: >> org.mortbay.jetty.EofException >> at >> org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) >> at >> org.apache.wicket.protocol.http.HeaderBuffering
Re: Wicket 1.5 shared image resource and modal windows.
I see. So how do you usually include common images in your application? Say for instance you have a form button functionality, but you want it displayed as an image instead of the standard html button. Here we have used a button with an image, but the image gets rendered with the wicket:antiCache appended to the img src, but since this is a static image, it doesn't make much sense to have it anti-cached. Thanks again. A On Tue, Jul 5, 2011 at 10:22 AM, Martin Grigorov wrote: > We should revise this code. > At least this shouldn't be a warning. I see it as debug. But as I said > I need to look in this code first before I can comment. > I personally don't use SharedResourceReferences in my app and thus > never faced this issue. > > On Tue, Jul 5, 2011 at 10:13 AM, Anders Smestad > wrote: >> But even when I follow the guidelines from the wicketstuff images >> examples, I get the WARN - ResourceReferenceRegistry - Resource >> reference not added to registry. reference.canBeRegistered() == false >> >> Why cannot a shared reference be registered? >> >> A >> >> On Mon, Jul 4, 2011 at 10:41 PM, Anders Smestad >> wrote: >>> Done: https://issues.apache.org/jira/browse/WICKET-3869 >>> >>> A >>> >>> On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov >>> wrote: See how http://wicketstuff.org/wicket/images/ creates the images. If you can create a quickstart application that shows the problem then attach it to a ticket. On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad wrote: > Hi. I have a simple (test) page with an ajax link that displays a > modal window when clicked. > > The modal window contains some text and an image-link. The image is > added to a link as > > link.add(new Image("image", sharedResourceReference); > > When displaying the modal window, everything displays correctly, but > firstly, there is a warning in the log that says: > > WARN - ResourceReferenceRegistry - Resource reference not added to > registry. reference.canBeRegistered() == false > > Then, not every time, but often, the stacktrace included at the bottom > of this message appears in the log when using Internet Explorer. Using > the network inspector tool (F12) in internet explorer shows that the > image is first requested once, then the request is aborted (result: > "(Aborted)"), then the same image is requested another time, this time > it receives a 200 and the image is downloaded. > > None of these problems materialize when using other browsers than > internet explorer. > > The image is a symbol for a link, and is a static image that will not > change between redeployments of the application. > > What is the proper way to use such images. I have tried different > approaches, > * Using the in markup > * Using PackageResourceReference from java code > * Using SharedResourceReference as described above > * Registring the Image to the > Application.get().getSharedResources().add("name", ...); and > dereferencing it using new SharedResourceReference("name"), then > adding it to the link. > > It seems that either the image link gets rendered with the > -ts00.ext (timestamp) extension, or the ?wicket:antiCache is > appended, both seems unnecessary since it is a static image which > could very well be cached on the browser. > > The SharedResourceReference seems like it would be the right class to > use, but when adding the image to the page, the .canBeRegistered() == > false is displayed. > > So finally, this is the question: What is the correct way to include > static images, css and javascript resources in wicket, it seems there > are multiple ways to do this, but none seems to do what I want. I also > the resources to be contained with the component it is used with. > > Thanks in advance! > > A > > Stacktrace from log when using Internet Explorer. > > ERROR - DefaultExceptionMapper - Connection lost, give up responding. > org.apache.wicket.protocol.http.servlet.ResponseIOException: > org.mortbay.jetty.EofException > at > org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) > at > org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) > at > org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) > at > org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) > at > org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) > at > org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) > at
Re: Wicket 1.5 shared image resource and modal windows.
We should revise this code. At least this shouldn't be a warning. I see it as debug. But as I said I need to look in this code first before I can comment. I personally don't use SharedResourceReferences in my app and thus never faced this issue. On Tue, Jul 5, 2011 at 10:13 AM, Anders Smestad wrote: > But even when I follow the guidelines from the wicketstuff images > examples, I get the WARN - ResourceReferenceRegistry - Resource > reference not added to registry. reference.canBeRegistered() == false > > Why cannot a shared reference be registered? > > A > > On Mon, Jul 4, 2011 at 10:41 PM, Anders Smestad > wrote: >> Done: https://issues.apache.org/jira/browse/WICKET-3869 >> >> A >> >> On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov wrote: >>> See how http://wicketstuff.org/wicket/images/ creates the images. >>> If you can create a quickstart application that shows the problem then >>> attach it to a ticket. >>> >>> On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad >>> wrote: Hi. I have a simple (test) page with an ajax link that displays a modal window when clicked. The modal window contains some text and an image-link. The image is added to a link as link.add(new Image("image", sharedResourceReference); When displaying the modal window, everything displays correctly, but firstly, there is a warning in the log that says: WARN - ResourceReferenceRegistry - Resource reference not added to registry. reference.canBeRegistered() == false Then, not every time, but often, the stacktrace included at the bottom of this message appears in the log when using Internet Explorer. Using the network inspector tool (F12) in internet explorer shows that the image is first requested once, then the request is aborted (result: "(Aborted)"), then the same image is requested another time, this time it receives a 200 and the image is downloaded. None of these problems materialize when using other browsers than internet explorer. The image is a symbol for a link, and is a static image that will not change between redeployments of the application. What is the proper way to use such images. I have tried different approaches, * Using the in markup * Using PackageResourceReference from java code * Using SharedResourceReference as described above * Registring the Image to the Application.get().getSharedResources().add("name", ...); and dereferencing it using new SharedResourceReference("name"), then adding it to the link. It seems that either the image link gets rendered with the -ts00.ext (timestamp) extension, or the ?wicket:antiCache is appended, both seems unnecessary since it is a static image which could very well be cached on the browser. The SharedResourceReference seems like it would be the right class to use, but when adding the image to the page, the .canBeRegistered() == false is displayed. So finally, this is the question: What is the correct way to include static images, css and javascript resources in wicket, it seems there are multiple ways to do this, but none seems to do what I want. I also the resources to be contained with the component it is used with. Thanks in advance! A Stacktrace from log when using Internet Explorer. ERROR - DefaultExceptionMapper - Connection lost, give up responding. org.apache.wicket.protocol.http.servlet.ResponseIOException: org.mortbay.jetty.EofException at org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) at org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) at org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) at org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) at org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) at org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) at org.apache.wicket.protocol.http.WicketFilter.doFilter(Wicket
Re: Wicket 1.5 shared image resource and modal windows.
But even when I follow the guidelines from the wicketstuff images examples, I get the WARN - ResourceReferenceRegistry - Resource reference not added to registry. reference.canBeRegistered() == false Why cannot a shared reference be registered? A On Mon, Jul 4, 2011 at 10:41 PM, Anders Smestad wrote: > Done: https://issues.apache.org/jira/browse/WICKET-3869 > > A > > On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov wrote: >> See how http://wicketstuff.org/wicket/images/ creates the images. >> If you can create a quickstart application that shows the problem then >> attach it to a ticket. >> >> On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad >> wrote: >>> Hi. I have a simple (test) page with an ajax link that displays a >>> modal window when clicked. >>> >>> The modal window contains some text and an image-link. The image is >>> added to a link as >>> >>> link.add(new Image("image", sharedResourceReference); >>> >>> When displaying the modal window, everything displays correctly, but >>> firstly, there is a warning in the log that says: >>> >>> WARN - ResourceReferenceRegistry - Resource reference not added to >>> registry. reference.canBeRegistered() == false >>> >>> Then, not every time, but often, the stacktrace included at the bottom >>> of this message appears in the log when using Internet Explorer. Using >>> the network inspector tool (F12) in internet explorer shows that the >>> image is first requested once, then the request is aborted (result: >>> "(Aborted)"), then the same image is requested another time, this time >>> it receives a 200 and the image is downloaded. >>> >>> None of these problems materialize when using other browsers than >>> internet explorer. >>> >>> The image is a symbol for a link, and is a static image that will not >>> change between redeployments of the application. >>> >>> What is the proper way to use such images. I have tried different >>> approaches, >>> * Using the in markup >>> * Using PackageResourceReference from java code >>> * Using SharedResourceReference as described above >>> * Registring the Image to the >>> Application.get().getSharedResources().add("name", ...); and >>> dereferencing it using new SharedResourceReference("name"), then >>> adding it to the link. >>> >>> It seems that either the image link gets rendered with the >>> -ts00.ext (timestamp) extension, or the ?wicket:antiCache is >>> appended, both seems unnecessary since it is a static image which >>> could very well be cached on the browser. >>> >>> The SharedResourceReference seems like it would be the right class to >>> use, but when adding the image to the page, the .canBeRegistered() == >>> false is displayed. >>> >>> So finally, this is the question: What is the correct way to include >>> static images, css and javascript resources in wicket, it seems there >>> are multiple ways to do this, but none seems to do what I want. I also >>> the resources to be contained with the component it is used with. >>> >>> Thanks in advance! >>> >>> A >>> >>> Stacktrace from log when using Internet Explorer. >>> >>> ERROR - DefaultExceptionMapper - Connection lost, give up responding. >>> org.apache.wicket.protocol.http.servlet.ResponseIOException: >>> org.mortbay.jetty.EofException >>> at >>> org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) >>> at >>> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) >>> at >>> org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) >>> at >>> org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) >>> at >>> org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) >>> at >>> org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) >>> at >>> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) >>> at >>> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) >>> at >>> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) >>> at >>> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) >>> at >>> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) >>> at >>> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216) >>> at >>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) >>> at >>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) >>> at >>> org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220) >>> at >>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.
Re: Wicket 1.5 shared image resource and modal windows.
Done: https://issues.apache.org/jira/browse/WICKET-3869 A On Mon, Jul 4, 2011 at 7:46 PM, Martin Grigorov wrote: > See how http://wicketstuff.org/wicket/images/ creates the images. > If you can create a quickstart application that shows the problem then > attach it to a ticket. > > On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad > wrote: >> Hi. I have a simple (test) page with an ajax link that displays a >> modal window when clicked. >> >> The modal window contains some text and an image-link. The image is >> added to a link as >> >> link.add(new Image("image", sharedResourceReference); >> >> When displaying the modal window, everything displays correctly, but >> firstly, there is a warning in the log that says: >> >> WARN - ResourceReferenceRegistry - Resource reference not added to >> registry. reference.canBeRegistered() == false >> >> Then, not every time, but often, the stacktrace included at the bottom >> of this message appears in the log when using Internet Explorer. Using >> the network inspector tool (F12) in internet explorer shows that the >> image is first requested once, then the request is aborted (result: >> "(Aborted)"), then the same image is requested another time, this time >> it receives a 200 and the image is downloaded. >> >> None of these problems materialize when using other browsers than >> internet explorer. >> >> The image is a symbol for a link, and is a static image that will not >> change between redeployments of the application. >> >> What is the proper way to use such images. I have tried different approaches, >> * Using the in markup >> * Using PackageResourceReference from java code >> * Using SharedResourceReference as described above >> * Registring the Image to the >> Application.get().getSharedResources().add("name", ...); and >> dereferencing it using new SharedResourceReference("name"), then >> adding it to the link. >> >> It seems that either the image link gets rendered with the >> -ts00.ext (timestamp) extension, or the ?wicket:antiCache is >> appended, both seems unnecessary since it is a static image which >> could very well be cached on the browser. >> >> The SharedResourceReference seems like it would be the right class to >> use, but when adding the image to the page, the .canBeRegistered() == >> false is displayed. >> >> So finally, this is the question: What is the correct way to include >> static images, css and javascript resources in wicket, it seems there >> are multiple ways to do this, but none seems to do what I want. I also >> the resources to be contained with the component it is used with. >> >> Thanks in advance! >> >> A >> >> Stacktrace from log when using Internet Explorer. >> >> ERROR - DefaultExceptionMapper - Connection lost, give up responding. >> org.apache.wicket.protocol.http.servlet.ResponseIOException: >> org.mortbay.jetty.EofException >> at >> org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) >> at >> org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) >> at >> org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) >> at >> org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) >> at >> org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) >> at >> org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) >> at >> org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) >> at >> org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) >> at >> org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) >> at >> org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) >> at >> org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) >> at >> org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216) >> at >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) >> at >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) >> at >> org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220) >> at >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) >> at >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822) >> at >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:305) >> at >> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:229) >> at >> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113) >> at >> org.mort
Re: Wicket 1.5 shared image resource and modal windows.
See how http://wicketstuff.org/wicket/images/ creates the images. If you can create a quickstart application that shows the problem then attach it to a ticket. On Mon, Jul 4, 2011 at 6:42 PM, Anders Smestad wrote: > Hi. I have a simple (test) page with an ajax link that displays a > modal window when clicked. > > The modal window contains some text and an image-link. The image is > added to a link as > > link.add(new Image("image", sharedResourceReference); > > When displaying the modal window, everything displays correctly, but > firstly, there is a warning in the log that says: > > WARN - ResourceReferenceRegistry - Resource reference not added to > registry. reference.canBeRegistered() == false > > Then, not every time, but often, the stacktrace included at the bottom > of this message appears in the log when using Internet Explorer. Using > the network inspector tool (F12) in internet explorer shows that the > image is first requested once, then the request is aborted (result: > "(Aborted)"), then the same image is requested another time, this time > it receives a 200 and the image is downloaded. > > None of these problems materialize when using other browsers than > internet explorer. > > The image is a symbol for a link, and is a static image that will not > change between redeployments of the application. > > What is the proper way to use such images. I have tried different approaches, > * Using the in markup > * Using PackageResourceReference from java code > * Using SharedResourceReference as described above > * Registring the Image to the > Application.get().getSharedResources().add("name", ...); and > dereferencing it using new SharedResourceReference("name"), then > adding it to the link. > > It seems that either the image link gets rendered with the > -ts00.ext (timestamp) extension, or the ?wicket:antiCache is > appended, both seems unnecessary since it is a static image which > could very well be cached on the browser. > > The SharedResourceReference seems like it would be the right class to > use, but when adding the image to the page, the .canBeRegistered() == > false is displayed. > > So finally, this is the question: What is the correct way to include > static images, css and javascript resources in wicket, it seems there > are multiple ways to do this, but none seems to do what I want. I also > the resources to be contained with the component it is used with. > > Thanks in advance! > > A > > Stacktrace from log when using Internet Explorer. > > ERROR - DefaultExceptionMapper - Connection lost, give up responding. > org.apache.wicket.protocol.http.servlet.ResponseIOException: > org.mortbay.jetty.EofException > at > org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) > at > org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) > at > org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) > at > org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) > at > org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) > at > org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) > at > org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) > at > org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) > at > org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) > at > org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) > at > org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) > at > org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216) > at > org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) > at > org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) > at > org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220) > at > org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) > at > org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822) > at > org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:305) > at > org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:229) > at > org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113) > at > org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) > at org.mortbay.jetty.Server.handle(Server.java:324) > at > org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550) > at > o
Wicket 1.5 shared image resource and modal windows.
Hi. I have a simple (test) page with an ajax link that displays a modal window when clicked. The modal window contains some text and an image-link. The image is added to a link as link.add(new Image("image", sharedResourceReference); When displaying the modal window, everything displays correctly, but firstly, there is a warning in the log that says: WARN - ResourceReferenceRegistry - Resource reference not added to registry. reference.canBeRegistered() == false Then, not every time, but often, the stacktrace included at the bottom of this message appears in the log when using Internet Explorer. Using the network inspector tool (F12) in internet explorer shows that the image is first requested once, then the request is aborted (result: "(Aborted)"), then the same image is requested another time, this time it receives a 200 and the image is downloaded. None of these problems materialize when using other browsers than internet explorer. The image is a symbol for a link, and is a static image that will not change between redeployments of the application. What is the proper way to use such images. I have tried different approaches, * Using the in markup * Using PackageResourceReference from java code * Using SharedResourceReference as described above * Registring the Image to the Application.get().getSharedResources().add("name", ...); and dereferencing it using new SharedResourceReference("name"), then adding it to the link. It seems that either the image link gets rendered with the -ts00.ext (timestamp) extension, or the ?wicket:antiCache is appended, both seems unnecessary since it is a static image which could very well be cached on the browser. The SharedResourceReference seems like it would be the right class to use, but when adding the image to the page, the .canBeRegistered() == false is displayed. So finally, this is the question: What is the correct way to include static images, css and javascript resources in wicket, it seems there are multiple ways to do this, but none seems to do what I want. I also the resources to be contained with the component it is used with. Thanks in advance! A Stacktrace from log when using Internet Explorer. ERROR - DefaultExceptionMapper - Connection lost, give up responding. org.apache.wicket.protocol.http.servlet.ResponseIOException: org.mortbay.jetty.EofException at org.apache.wicket.protocol.http.servlet.ServletWebResponse.write(ServletWebResponse.java:120) at org.apache.wicket.protocol.http.HeaderBufferingWebResponse.write(HeaderBufferingWebResponse.java:168) at org.apache.wicket.request.resource.PackageResource$1.writeData(PackageResource.java:239) at org.apache.wicket.request.resource.AbstractResource.respond(AbstractResource.java:448) at org.apache.wicket.request.handler.resource.ResourceRequestHandler.respond(ResourceRequestHandler.java:77) at org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler.respond(ResourceReferenceRequestHandler.java:92) at org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:717) at org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63) at org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:212) at org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:253) at org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:160) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:216) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1112) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363) at org.mortbay.jetty.security.ConstraintsSecurityHandler.handle(ConstraintsSecurityHandler.java:220) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:822) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:305) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:229) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:113) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:550) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:876) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:535) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:407) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.j
Re: Shared Image Resource
> In my application I've added a shared resource. This resource is in a > seperate resource package (com.test.resources). In that package there's also > a 'dummy' class ResourceGetter, just to get access to the package. So in the > init of my application i've putted : > > getSharedResources().add("imgStar", > PackageResource.get(ResourceGetter.class, "star.gif")); > > In different pages i need this image multiple times. These pages are in > different packages. I know I can put the wicket:id on all of my images, but > I find it a little bit too much trouble to give all those images a different > id and add them in my java code as well. > I've tried with the -tag, but that only works with package > resources and not with application shared resources (i guess.. correct me if > i'm wrong). Is there a way i can pass the ResourceGetter-class with the > wicket:link or img tag, so wicket will look for my resource in > com.test.resources and not in the package my page is in? And can i also use > the shared name "imgStar" instead of "star.gif"? > I want something like : > < img src="imgStar" > The paths of shared resources are predictable, meaning that you can hard code them. They follow the form: resources//, for instance: src="resources/org.apache.wicket.examples.debug.InspectorBug/bug.png" You can register class aliases if you want to make this shorter. Also note that you don't have to explicitly register packaged resources. Eelco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Shared Image Resource
In my application I've added a shared resource. This resource is in a seperate resource package (com.test.resources). In that package there's also a 'dummy' class ResourceGetter, just to get access to the package. So in the init of my application i've putted : getSharedResources().add("imgStar", PackageResource.get(ResourceGetter.class, "star.gif")); In different pages i need this image multiple times. These pages are in different packages. I know I can put the wicket:id on all of my images, but I find it a little bit too much trouble to give all those images a different id and add them in my java code as well. I've tried with the -tag, but that only works with package resources and not with application shared resources (i guess.. correct me if i'm wrong). Is there a way i can pass the ResourceGetter-class with the wicket:link or img tag, so wicket will look for my resource in com.test.resources and not in the package my page is in? And can i also use the shared name "imgStar" instead of "star.gif"? I want something like : < img src="imgStar" > Thanks for the help ! -- View this message in context: http://www.nabble.com/Shared-Image-Resource-tf4514067.html#a12875089 Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]