Re: i18n for html header elements

2011-08-05 Thread Martin Makundi
Hi!

I am not sure, but you might need to use  tag.. (1.4 thouhg)

**
Martin

2011/8/6 heikki :
> Hello,
>
> I've used Wicket's i18n functionality to provide users of my site the choice
> to view it in various languages, and this works well.
>
> Except for things that go in the html header. My aim is that all html header
> elements containg text, are localized too -- but it doesn't happen.
>
> For example, putting this in my html page:
>
> 
> 
>     
>          welcome to my
> site
>     
> ...
>
> doesn't display the translated string -- just the  itself
> appears as the title of the page in the browser.
>
> Doing exactly the same thing for strings in the html body of the same page
> works perfect.
>
>
> Is it possible to use the i18n mechanism for html header elements too?
>
> Thanks in advance for your answers,
> kind regards
> Heikki Doeleman
>
>
>
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/i18n-for-html-header-elements-tp3722490p3722490.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



i18n for more than attribute

2011-08-05 Thread heikki
Hello,

I'm trying to make my site available in several languages, and mostly things
work fine. But I'm wondering how to apply translations to more than one
attribute in an element.

For example:



this works fine to have the 'title' attribute properly translated. But I
want the 'alt' attribute also properly translated; I can't put in a second
'wicket:message' attribute for that, because it causes a runtime exception
complaining that the same attribute appears twice.

How can I have i18n translations for more than one attribute in the same
element?

thanks in advance for your help,
kind regards
Heikki Doeleman

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/i18n-for-more-than-attribute-tp3722544p3722544.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Wicket Problems On Ubuntu

2011-08-05 Thread mmaredia
I had a similar problem where I was trying to access an custom application on
Linux. I converted the Login.html to UTF-8 encoding and was able to access
the application. 

Thanks to everyone on this page - Your suggestions worked me!

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Wicket-Problems-On-Ubuntu-tp1880998p3722422.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: CSS, JS resource file handle issues?

2011-08-05 Thread rush66
As per your suggestion I grabbed the project from SVN and compiled the
snapshot. Sadly there was no change in my results.  Is there a bug that is
already filed for this?   



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/CSS-JS-resource-file-handle-issues-tp3701938p3722413.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: error during deployment

2011-08-05 Thread srinash
i think i answered my own question, thank you for your help, the package was
wrong

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722389.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: Issues with HeaderResponseContainerFilteringHeaderResponse

2011-08-05 Thread Loren Cole
Ah, sweet.  Thanks for digging that up Jeremy.

Alec, since we were pressed for time, I piggybacked off your code to get
something working

@Override
protected void init() {
super.init();
/*
 * Adds custom skin at the end of the header
 */
setHeaderResponseDecorator(new IHeaderResponseDecorator() {
public IHeaderResponse decorate(IHeaderResponse response) {
return new DecoratingHeaderResponse(response) {
@Override
public void close() {
String css = null;
if(MyWebSession.get() != null) css =
MyWebSession.get().getCssStyle();

if(css != null && !wasRendered(css)) {
renderString("" + css + "");
}
super.close();
}
};
}
});
}

I chose not to override renderString(), because I didn't want to break
anything that might use it.  Also, we don't know what css we want to add
when the application gets initialized; we have to wait till the user has
authenticated.  So, I stuck our css in the session after authentication and
had the decorator pull it from there.

When we get a chance I will swap this out for the bucket method for it's
added flexibility, but this does work for now.

Thanks again guys,
Loren


On Wed, Aug 3, 2011 at 9:58 PM, Jeremy Thomerson
wrote:

> That thread is here: http://tinyurl.com/3fnery2
>
> In it there's a link to a tar of a project that's still hosted on my site.
>
> --
> Jeremy Thomerson
> http://wickettraining.com
> *Need a CMS for Wicket?  Use Brix! http://brixcms.org*
>
> On Wed, Aug 3, 2011 at 1:21 PM, Martin Grigorov  >wrote:
>
> > Hi Loren,
> >
> > See whether you can find the mail mentioned in
> > https://cwiki.apache.org/confluence/display/WICKET/Resource+decoration
> > in the mail archives.
> > Jeremy attached the raw application in this mail thread and I
> > transformed it to proper wicket-example for 1.5
> >
> > On Wed, Aug 3, 2011 at 6:36 PM, Loren Cole  wrote:
> > > Hey guys, thanks for your responses. We're still using 1.4, it looks
> like
> > it
> > > will be a few months till we get to upgrade and use all the
> improvements
> > > that have been made to resource handling in 1.5.  In 1.4 it appears
> that
> > you
> > > cannot put a bucket in the header without things getting confused and
> > > failing to close.  Does anyone know why this is the case, or if there
> is
> > a
> > > way around it while still getting things in a  tag?
> > >
> > > Martin, since we're using an older version I'm having trouble taking
> > > advantage of your excellent advise, but I see elsewhere on the list,
> you
> > > mention that this aggregation example should work in 1.4 also.  Do you
> > > perhaps have an example of that I could look at?  The 1.4 equivalent of
> > > MergedResourcesResource in particular is eluding me.
> > >
> > > Am I right in thinking that aggregation will be required to order my
> css
> > > contributions in 1.4?  At this point in development, the performance
> > boost
> > > doesn't necessarily offset the extra trouble of tracking down what
> > > stylesheet or js library a problem is in, so I'd rather avoid it if
> > > possible.
> > >
> > >
> > > Thanks, Loren
> > >
> >
> >
> >
> > --
> > Martin Grigorov
> > jWeekend
> > Training, Consulting, Development
> > http://jWeekend.com
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
>


Re: error during deployment

2011-08-05 Thread srinash
at
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:82)
at
org.apache.wicket.protocol.http.ContextParamWebApplicationFactory.createApplication(ContextParamWebApplicationFactory.java:49)
at
org.apache.wicket.protocol.http.WicketFilter.init(WicketFilter.java:677)
at
org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at
org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at
org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at
org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3720)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4365)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
at
org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
at
org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
at
org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
at org.jboss.web.WebModule.startModule(WebModule.java:83)
at org.jboss.web.WebModule.startService(WebModule.java:61)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
at $Proxy0.start(Unknown Source)
at
org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown
Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at
org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at
org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at
org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at
org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy45.start(Unknown Source)
at
org.jboss.web.AbstractWebContainer.start(

Re: error during deployment

2011-08-05 Thread srinash
It is very straneg it says. I am surely missing something

Caused by: java.lang.ClassNotFoundException:
com.dev.wicket.apps.helloworld.HelloWorldApplication

That class is there in that package above...





--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722274.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: error during deployment

2011-08-05 Thread Dan Retzlaff
Getting warmer... What's the cause of that exception? It will be included in
the stack trace.

On Fri, Aug 5, 2011 at 1:52 PM, srinash  wrote:

> thank you for the reply
>
> the previous error is
>
> 2011-08-05 13:11:47,313 ERROR
> [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]]
> Exception starting filter HelloWorldApplication
> org.apache.wicket.WicketRuntimeException: Unable to create application of
> class com.dev.wicket.apps.helloworld.HelloWorldApplication
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722247.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: error during deployment

2011-08-05 Thread srinash
thank you for the reply 

the previous error is 

2011-08-05 13:11:47,313 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]]
Exception starting filter HelloWorldApplication 
org.apache.wicket.WicketRuntimeException: Unable to create application of
class com.dev.wicket.apps.helloworld.HelloWorldApplication  

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722247.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: error during deployment

2011-08-05 Thread srinash
it is not com.softcoin.wicket.sites.webapp.HelloWorldApplication 
but
com.dev.wicket.apps.helloworld.HelloWorldApplication

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722243.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: error during deployment

2011-08-05 Thread srinash
thank you for the reply

the previous error is 

2011-08-05 13:11:47,313 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]]
Exception starting filter HelloWorldApplication
org.apache.wicket.WicketRuntimeException: Unable to create application of
class com.softcoin.wicket.sites.webapp.HelloWorldApplication


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3722239.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: Repeating form on a page

2011-08-05 Thread heikki
OK ! Indeed, this solves it, and now all's perfect.

Thank you so much !

Kind regards
Heikki Doeleman

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Repeating-form-on-a-page-tp2002098p378.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: error during deployment

2011-08-05 Thread Dan Retzlaff
I think we'll need to see the previous errors.

12:06:46,590 ERROR [StandardContext] Error filterStart
> 12:06:46,590 ERROR [StandardContext] Context [] startup failed due to
> previous errors


On Fri, Aug 5, 2011 at 12:28 PM, srinash  wrote:

> Thanky ou for the reply. The snippet that was ssent was part of the
> web.xml.
> Please take a look at the complete log.
>
> 12:06:46,590 ERROR [StandardContext] Error filterStart
> 12:06:46,590 ERROR [StandardContext] Context [] startup failed due to
> previous errors
> 12:06:52,869 WARN  [TomcatDeployer] Failed to setup clustering, clustering
> disabled. NoClassDefFoundError: org/jgroups/blocks/MethodCall
> 12:06:52,869 WARN  [ServiceController] Problem starting service
> jboss.web.deployment:war=web.war,id=1217810086
> org.jboss.deployment.DeploymentException: URL
> file:/home/akal/
> jboss-4.2.1.GA/server/default/deploy/invocation-system.ear/web.war/
> deployment failed
>at
>
> org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:379)
>at
>
> org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
>at
> org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
>at org.jboss.web.WebModule.startModule(WebModule.java:83)
>at org.jboss.web.WebModule.startService(WebModule.java:61)
>at
>
> org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
>at
>
> org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
>at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
>at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>at java.lang.reflect.Method.invoke(Method.java:597)
>at
>
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>at
>
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>at
>
> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
>at $Proxy0.start(Unknown Source)
>at
> org.jboss.system.ServiceController.start(ServiceController.java:417)
>at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
>at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>at java.lang.reflect.Method.invoke(Method.java:597)
>at
>
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>at
>
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>at $Proxy45.start(Unknown Source)
>at
> org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>at java.lang.reflect.Method.invoke(Method.java:597)
>at
>
> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>at
>
> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>at
>
> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>at
>
> org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
>at
>
> org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
>at
>
> org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
>at
>
> org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
>at
>
> org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
>at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>at
>
> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>at
> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>at $Proxy46.start(Unknown Source)
>  

Re: tomcat eats memory

2011-08-05 Thread Dan Retzlaff
Construct a ResourceLink with the same ResourceReference as your Image.

On Fri, Aug 5, 2011 at 11:06 AM, Miroslav F.  wrote:

> With this I have problem that then I need to take url from Image component
> and put it into Link component:
>  wicket:id="anchor"
>rel="lightbox"
>title="">
> <-and this atribute -->
>wicket:id="image">
>
> 
>
> No problem make Image component as in example (my first attempt was same)
> but not know how then take url from image component and put into Link
> component.
>
>
>
> > -Original Message-
> > From: Dan Retzlaff [mailto:dretzl...@gmail.com]
> > Sent: Friday, 05. August 2011 19:58
> > To: users@wicket.apache.org
> > Subject: Re: tomcat eats memory
> >
> > It sounds like a shared resource is not the right solution
> > for your problem.
> > Just throw a wicket:id on your Lightbox image tag and create
> > a Wicket Image like "image5" of the wicketstuff examples link I sent.
> >
> > On Fri, Aug 5, 2011 at 10:46 AM, Miroslav F.  wrote:
> >
> > > Answer myself: should be solution before
> > > Start.get().getSharedResources().add("image" + random.toString() +
> > > ".jpg", image); do something like "unmount all previosly mounted
> > > images"?
> > >
> > > In Application.init() isn't possible to mount them - I don't know
> > > which page user click. In database is around 1.000 images and there
> > > are on around 100 pages (every page has around 10 images).
> > For me it
> > > looks crazy in Application.init() take all images from DB and mount
> > > them.
> > >
> > >
> > > > -Original Message-
> > > > From: Miroslav F. [mailto:mir...@seznam.cz]
> > > > Sent: Friday, 05. August 2011 18:54
> > > > To: users@wicket.apache.org
> > > > Subject: RE: tomcat eats memory
> > > >
> > > > Using non-shared images? My problem is that I need same
> > url for href
> > > > in  and for src in  for lightbox to work.
> > > >
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: Dan Retzlaff [mailto:dretzl...@gmail.com]
> > > > > Sent: Friday, 05. August 2011 18:45
> > > > > To: users@wicket.apache.org
> > > > > Subject: Re: tomcat eats memory
> > > > >
> > > > > This is your problem:
> > > > >
> > > > > Start.get().getSharedResources().add("image" +
> > > > > > random.toString() + ".jpg", image);
> > > > >
> > > > >
> > > > > Adding shared resources during page construction is
> > very unusual.
> > > > > Consider registering shared resources in
> > > > Application.init(), or using
> > > > > non-shared images. Refer to
> > http://wicketstuff.org/wicket/images/
> > > > >
> > > > > On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.
> > > >  wrote:
> > > > >
> > > > > > Hi folks,
> > > > > >
> > > > > > I have these classes:
> > > > > >
> > > > > > package com.myapp;
> > > > > > public class Minerals extends WebPage{
> > > > > >public Minerals(){
> > > > > >RepeatingView repeater = new
> > > > > RepeatingView("repeater");
> > > > > >//data from database - images and descriptions
> > > > > >ArrayList dataFromDB = (new
> > > > ImagesMinerals()).load();
> > > > > >//descriptions
> > > > > >ArrayList desc = new ArrayList();
> > > > > >desc = (ArrayList) dataFromDB.get(0);
> > > > > >//images
> > > > > >ArrayList images = new ArrayList();
> > > > > >images = (ArrayList) dataFromDB.get(1);
> > > > > >int size = images.size();
> > > > > >for(int i = 0; i < size; i++){
> > > > > >String repeaterID =
> > repeater.newChildId();
> > > > > >ImageRepeater repeaterChild = new
> > > > > > ImageRepeater(repeaterID);
> > > > > >//add description
> > > > > >repeaterChild.add(new
> > > > > > Label("description",
> > > > > > (String) desc.get(i)));
> > > > > >//add image
> > > > > >DBImage image = new DBImage();
> > > > > >image.setImageData((byte[])
> > images.get(i));
> > > > > >//not caching on browser
> > > > > >Double random = Math.random();
> > > > > >//put shared resource (image) on clean
> > > > > > path
> > > > > >
> > > > > Start.get().getSharedResources().add("image" +
> > > > > > random.toString() + ".jpg", image);
> > > > > >ResourceReference imageResource = new
> > > > > > ResourceReference("image" + random.toString() + ".jpg");
> > > > > >String url =
> > > > > > RequestCycle.get().urlFor(imageResource).toString();
> > > > > >//href in  and src in 
> > > > > should have same
> > > > > > path because lightbox won't work...
> > > > > >

Re: tomcat eats memory

2011-08-05 Thread Bas Gooren

Actually, I think mounting a custom resource _is_ the way to go.

To keep things simple, let me suggest two options:

(1) Create a custom resource which serves the correct image based on a 
url parameter (see WebResource)

This will allow you to generate user-friendly urls to your images

(2) Create a custom component which implements IResourceListener; You 
can then generate a session-specific url for this component, which when 
requested by a browser will call onResourceRequested(). You can then 
send the image based on component-specific variables, e.g. a database-id;


(1) has the benefit of non-session-specific (seo-friendly) urls
(2) has the benefit of having all image related functionality in a 
single component (both generating the url and serving the image)


Bas

Op 5-8-2011 19:58, schreef Dan Retzlaff:

It sounds like a shared resource is not the right solution for your problem.
Just throw a wicket:id on your Lightbox image tag and create a Wicket Image
like "image5" of the wicketstuff examples link I sent.

On Fri, Aug 5, 2011 at 10:46 AM, Miroslav F.  wrote:


Answer myself: should be solution before
Start.get().getSharedResources().add("image" + random.toString() + ".jpg",
image);
do something like "unmount all previosly mounted images"?

In Application.init() isn't possible to mount them - I don't know which
page
user click. In database is around 1.000 images
and there are on around 100 pages (every page has around 10 images). For me
it looks crazy in Application.init() take all images
from DB and mount them.



-Original Message-
From: Miroslav F. [mailto:mir...@seznam.cz]
Sent: Friday, 05. August 2011 18:54
To: users@wicket.apache.org
Subject: RE: tomcat eats memory

Using non-shared images? My problem is that I need same url
for href in  and for src in  for lightbox to work.




-Original Message-
From: Dan Retzlaff [mailto:dretzl...@gmail.com]
Sent: Friday, 05. August 2011 18:45
To: users@wicket.apache.org
Subject: Re: tomcat eats memory

This is your problem:

Start.get().getSharedResources().add("image" +

random.toString() + ".jpg", image);


Adding shared resources during page construction is very unusual.
Consider registering shared resources in

Application.init(), or using

non-shared images. Refer to http://wicketstuff.org/wicket/images/

On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.

  wrote:

Hi folks,

I have these classes:

package com.myapp;
public class Minerals extends WebPage{
public Minerals(){
RepeatingView repeater = new

RepeatingView("repeater");

//data from database - images and descriptions
ArrayList dataFromDB = (new

ImagesMinerals()).load();

//descriptions
ArrayList desc = new ArrayList();
desc = (ArrayList) dataFromDB.get(0);
//images
ArrayList images = new ArrayList();
images = (ArrayList) dataFromDB.get(1);
int size = images.size();
for(int i = 0; i<  size; i++){
String repeaterID = repeater.newChildId();
ImageRepeater repeaterChild = new
ImageRepeater(repeaterID);
//add description
repeaterChild.add(new Label("description",
(String) desc.get(i)));
//add image
DBImage image = new DBImage();
image.setImageData((byte[]) images.get(i));
//not caching on browser
Double random = Math.random();
//put shared resource (image) on clean path


Start.get().getSharedResources().add("image" +

random.toString() + ".jpg", image);
ResourceReference imageResource = new
ResourceReference("image" + random.toString() + ".jpg");
String url =
RequestCycle.get().urlFor(imageResource).toString();
//href in  and src in

should have same

path because lightbox won't work...
ExternalLink odkaz = new

ExternalLink("anchor",

url);
WebMarkupContainer imageSrcAttribute = new
WebMarkupContainer("image");
imageSrcAttribute.add(new
AttributeModifier("src", new Model(url)));
odkaz.add(imageSrcAttribute);
odkaz.add(new

SimpleAttributeModifier("title",

(String) desc.get(i)));
repeaterChild.add(odkaz);
repeater.add(repeaterChild);
}
this.add(repeater);
}
}

package com.myapp;
public class ImagesMinerals extends
LoadableDetachableModel>{
@Override
protected ArrayList load(){
DBGetImages databaseMinerals = new DBGetImages();
ArrayList dataMineraly =

databaseMinerals.getData();

return dataMinerals;
}
}

My problem i

Re: I am having trouble mounting shared resources

2011-08-05 Thread Alec Swan
I will have to track down each individual image use from css and mount
it. Is there a way to mount the entire folder?

Thanks!

2011/8/5 Miroslav F. :
> Same way as is mounted .js and .css mount images and then in .css you can
> just use this path.
>
>
>> -Original Message-
>> From: Alec Swan [mailto:alecs...@gmail.com]
>> Sent: Friday, 05. August 2011 19:30
>> To: users@wicket.apache.org
>> Subject: Re: I am having trouble mounting shared resources
>>
>> Thanks, mounting JS worked perfectly.
>>
>> However, mounting CSS was problematic because it references
>> quite a few images and they don't get loaded/mounted
>> correctly. How do I mount the folder that contains all images
>> so that they can be loaded from the CSS?
>>
>> Thanks,
>>
>> Alec
>>
>>
>> On Fri, Aug 5, 2011 at 11:51 AM, Miroslav F.  wrote:
>> > Project dirs:
>> >
>> > . com.myapp
>> > .      MyStartAppPoint.java
>> > . com.myapp.resources
>> > .      MyResources.java
>> > .      fancybox-123.js
>> >
>> > In MyStartAppPoint.init() do:
>> >
>> > mountSharedResource("/js/fancybox.js", new
>> > ResourceReference(MyResources.class,
>> > "fancybox-123.js").getSharedResourceKey());
>> >
>> > MyResources.java is just empty class (for classloader to find your
>> > resource):
>> > package com.myapp.resources;
>> > public class MyResources
>> > {
>> > }
>> >
>> > and then in html markup you can write:
>> > 
>> >
>> > Hope helps,
>> >
>> > Miro
>> >
>> >
>> >
>> >
>> >> -Original Message-
>> >> From: Alec Swan [mailto:alecs...@gmail.com]
>> >> Sent: Friday, 05. August 2011 08:42
>> >> To: users@wicket.apache.org
>> >> Subject: I am having trouble mounting shared resources
>> >>
>> >> Hello,
>> >>
>> >> I am having troubles figuring out how to organize my
>> static resources.
>> >>
>> >> I would like to map a static URL alias, e.g. /js/fancybox,
>> to a file
>> >> such as /js/fancybox/version123/fancybox-123.js. I also want to be
>> >> able to update the file version and after that have it
>> served under
>> >> the same alias. This assumes that I will modify my Java code to
>> >> reference the new file name.
>> >>
>> >> I think I need to create a resource reference class that points to
>> >> /js/fancybox/version123/fancybox-123.js and mount it in my Wicket
>> >> Application. But I can only mount a resource, not a
>> >> JavaScriptResourceReference in Application.init().
>> >>
>> >> Can anybody please explain how to do this right?
>> >>
>> >> 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
>>
>>
>
>
> -
> 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: tomcat eats memory

2011-08-05 Thread Miroslav F.
With this I have problem that then I need to take url from Image component
and put it into Link component:
 wicket:id="anchor"
rel="lightbox"
title="">

wicket:id="image">



No problem make Image component as in example (my first attempt was same)
but not know how then take url from image component and put into Link
component.



> -Original Message-
> From: Dan Retzlaff [mailto:dretzl...@gmail.com] 
> Sent: Friday, 05. August 2011 19:58
> To: users@wicket.apache.org
> Subject: Re: tomcat eats memory
> 
> It sounds like a shared resource is not the right solution 
> for your problem.
> Just throw a wicket:id on your Lightbox image tag and create 
> a Wicket Image like "image5" of the wicketstuff examples link I sent.
> 
> On Fri, Aug 5, 2011 at 10:46 AM, Miroslav F.  wrote:
> 
> > Answer myself: should be solution before 
> > Start.get().getSharedResources().add("image" + random.toString() + 
> > ".jpg", image); do something like "unmount all previosly mounted 
> > images"?
> >
> > In Application.init() isn't possible to mount them - I don't know 
> > which page user click. In database is around 1.000 images and there 
> > are on around 100 pages (every page has around 10 images). 
> For me it 
> > looks crazy in Application.init() take all images from DB and mount 
> > them.
> >
> >
> > > -Original Message-
> > > From: Miroslav F. [mailto:mir...@seznam.cz]
> > > Sent: Friday, 05. August 2011 18:54
> > > To: users@wicket.apache.org
> > > Subject: RE: tomcat eats memory
> > >
> > > Using non-shared images? My problem is that I need same 
> url for href 
> > > in  and for src in  for lightbox to work.
> > >
> > >
> > >
> > > > -Original Message-
> > > > From: Dan Retzlaff [mailto:dretzl...@gmail.com]
> > > > Sent: Friday, 05. August 2011 18:45
> > > > To: users@wicket.apache.org
> > > > Subject: Re: tomcat eats memory
> > > >
> > > > This is your problem:
> > > >
> > > > Start.get().getSharedResources().add("image" +
> > > > > random.toString() + ".jpg", image);
> > > >
> > > >
> > > > Adding shared resources during page construction is 
> very unusual.
> > > > Consider registering shared resources in
> > > Application.init(), or using
> > > > non-shared images. Refer to 
> http://wicketstuff.org/wicket/images/
> > > >
> > > > On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.
> > >  wrote:
> > > >
> > > > > Hi folks,
> > > > >
> > > > > I have these classes:
> > > > >
> > > > > package com.myapp;
> > > > > public class Minerals extends WebPage{
> > > > >public Minerals(){
> > > > >RepeatingView repeater = new
> > > > RepeatingView("repeater");
> > > > >//data from database - images and descriptions
> > > > >ArrayList dataFromDB = (new
> > > ImagesMinerals()).load();
> > > > >//descriptions
> > > > >ArrayList desc = new ArrayList();
> > > > >desc = (ArrayList) dataFromDB.get(0);
> > > > >//images
> > > > >ArrayList images = new ArrayList();
> > > > >images = (ArrayList) dataFromDB.get(1);
> > > > >int size = images.size();
> > > > >for(int i = 0; i < size; i++){
> > > > >String repeaterID = 
> repeater.newChildId();
> > > > >ImageRepeater repeaterChild = new 
> > > > > ImageRepeater(repeaterID);
> > > > >//add description
> > > > >repeaterChild.add(new 
> > > > > Label("description",
> > > > > (String) desc.get(i)));
> > > > >//add image
> > > > >DBImage image = new DBImage();
> > > > >image.setImageData((byte[]) 
> images.get(i));
> > > > >//not caching on browser
> > > > >Double random = Math.random();
> > > > >//put shared resource (image) on clean 
> > > > > path
> > > > >
> > > > Start.get().getSharedResources().add("image" +
> > > > > random.toString() + ".jpg", image);
> > > > >ResourceReference imageResource = new 
> > > > > ResourceReference("image" + random.toString() + ".jpg");
> > > > >String url = 
> > > > > RequestCycle.get().urlFor(imageResource).toString();
> > > > >//href in  and src in 
> > > > should have same
> > > > > path because lightbox won't work...
> > > > >ExternalLink odkaz = new
> > > > ExternalLink("anchor",
> > > > > url);
> > > > >WebMarkupContainer imageSrcAttribute = 
> > > > > new WebMarkupContainer("image");
> > > > >imageSrcAttribute.add(new 
> > > > > AttributeModifier("src", new Model(url)));
> > > > >odkaz.add(imageSrcAttribute);

Re: tomcat eats memory

2011-08-05 Thread Dan Retzlaff
It sounds like a shared resource is not the right solution for your problem.
Just throw a wicket:id on your Lightbox image tag and create a Wicket Image
like "image5" of the wicketstuff examples link I sent.

On Fri, Aug 5, 2011 at 10:46 AM, Miroslav F.  wrote:

> Answer myself: should be solution before
> Start.get().getSharedResources().add("image" + random.toString() + ".jpg",
> image);
> do something like "unmount all previosly mounted images"?
>
> In Application.init() isn't possible to mount them - I don't know which
> page
> user click. In database is around 1.000 images
> and there are on around 100 pages (every page has around 10 images). For me
> it looks crazy in Application.init() take all images
> from DB and mount them.
>
>
> > -Original Message-
> > From: Miroslav F. [mailto:mir...@seznam.cz]
> > Sent: Friday, 05. August 2011 18:54
> > To: users@wicket.apache.org
> > Subject: RE: tomcat eats memory
> >
> > Using non-shared images? My problem is that I need same url
> > for href in  and for src in  for lightbox to work.
> >
> >
> >
> > > -Original Message-
> > > From: Dan Retzlaff [mailto:dretzl...@gmail.com]
> > > Sent: Friday, 05. August 2011 18:45
> > > To: users@wicket.apache.org
> > > Subject: Re: tomcat eats memory
> > >
> > > This is your problem:
> > >
> > > Start.get().getSharedResources().add("image" +
> > > > random.toString() + ".jpg", image);
> > >
> > >
> > > Adding shared resources during page construction is very unusual.
> > > Consider registering shared resources in
> > Application.init(), or using
> > > non-shared images. Refer to http://wicketstuff.org/wicket/images/
> > >
> > > On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.
> >  wrote:
> > >
> > > > Hi folks,
> > > >
> > > > I have these classes:
> > > >
> > > > package com.myapp;
> > > > public class Minerals extends WebPage{
> > > >public Minerals(){
> > > >RepeatingView repeater = new
> > > RepeatingView("repeater");
> > > >//data from database - images and descriptions
> > > >ArrayList dataFromDB = (new
> > ImagesMinerals()).load();
> > > >//descriptions
> > > >ArrayList desc = new ArrayList();
> > > >desc = (ArrayList) dataFromDB.get(0);
> > > >//images
> > > >ArrayList images = new ArrayList();
> > > >images = (ArrayList) dataFromDB.get(1);
> > > >int size = images.size();
> > > >for(int i = 0; i < size; i++){
> > > >String repeaterID = repeater.newChildId();
> > > >ImageRepeater repeaterChild = new
> > > > ImageRepeater(repeaterID);
> > > >//add description
> > > >repeaterChild.add(new Label("description",
> > > > (String) desc.get(i)));
> > > >//add image
> > > >DBImage image = new DBImage();
> > > >image.setImageData((byte[]) images.get(i));
> > > >//not caching on browser
> > > >Double random = Math.random();
> > > >//put shared resource (image) on clean path
> > > >
> > > Start.get().getSharedResources().add("image" +
> > > > random.toString() + ".jpg", image);
> > > >ResourceReference imageResource = new
> > > > ResourceReference("image" + random.toString() + ".jpg");
> > > >String url =
> > > > RequestCycle.get().urlFor(imageResource).toString();
> > > >//href in  and src in 
> > > should have same
> > > > path because lightbox won't work...
> > > >ExternalLink odkaz = new
> > > ExternalLink("anchor",
> > > > url);
> > > >WebMarkupContainer imageSrcAttribute = new
> > > > WebMarkupContainer("image");
> > > >imageSrcAttribute.add(new
> > > > AttributeModifier("src", new Model(url)));
> > > >odkaz.add(imageSrcAttribute);
> > > >odkaz.add(new
> > > SimpleAttributeModifier("title",
> > > > (String) desc.get(i)));
> > > >repeaterChild.add(odkaz);
> > > >repeater.add(repeaterChild);
> > > >}
> > > >this.add(repeater);
> > > >}
> > > > }
> > > >
> > > > package com.myapp;
> > > > public class ImagesMinerals extends
> > > > LoadableDetachableModel>{
> > > >@Override
> > > >protected ArrayList load(){
> > > >DBGetImages databaseMinerals = new DBGetImages();
> > > >ArrayList dataMineraly =
> > databaseMinerals.getData();
> > > >return dataMinerals;
> > > >}
> > > > }
> > > >
> > > > My problem is that when i again and again click on page the
> > > memory in
> > > > tomcat is eaten and I end-up with Java heap space error. Doesn't
> > > > matter i

RE: tomcat eats memory

2011-08-05 Thread Miroslav F.
Answer myself: should be solution before
Start.get().getSharedResources().add("image" + random.toString() + ".jpg",
image);
do something like "unmount all previosly mounted images"?

In Application.init() isn't possible to mount them - I don't know which page
user click. In database is around 1.000 images
and there are on around 100 pages (every page has around 10 images). For me
it looks crazy in Application.init() take all images
from DB and mount them.


> -Original Message-
> From: Miroslav F. [mailto:mir...@seznam.cz] 
> Sent: Friday, 05. August 2011 18:54
> To: users@wicket.apache.org
> Subject: RE: tomcat eats memory
> 
> Using non-shared images? My problem is that I need same url 
> for href in  and for src in  for lightbox to work.
> 
> 
> 
> > -Original Message-
> > From: Dan Retzlaff [mailto:dretzl...@gmail.com]
> > Sent: Friday, 05. August 2011 18:45
> > To: users@wicket.apache.org
> > Subject: Re: tomcat eats memory
> > 
> > This is your problem:
> > 
> > Start.get().getSharedResources().add("image" +
> > > random.toString() + ".jpg", image);
> > 
> > 
> > Adding shared resources during page construction is very unusual. 
> > Consider registering shared resources in 
> Application.init(), or using 
> > non-shared images. Refer to http://wicketstuff.org/wicket/images/
> > 
> > On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F. 
>  wrote:
> > 
> > > Hi folks,
> > >
> > > I have these classes:
> > >
> > > package com.myapp;
> > > public class Minerals extends WebPage{
> > >public Minerals(){
> > >RepeatingView repeater = new
> > RepeatingView("repeater");
> > >//data from database - images and descriptions
> > >ArrayList dataFromDB = (new 
> ImagesMinerals()).load();
> > >//descriptions
> > >ArrayList desc = new ArrayList();
> > >desc = (ArrayList) dataFromDB.get(0);
> > >//images
> > >ArrayList images = new ArrayList();
> > >images = (ArrayList) dataFromDB.get(1);
> > >int size = images.size();
> > >for(int i = 0; i < size; i++){
> > >String repeaterID = repeater.newChildId();
> > >ImageRepeater repeaterChild = new 
> > > ImageRepeater(repeaterID);
> > >//add description
> > >repeaterChild.add(new Label("description",
> > > (String) desc.get(i)));
> > >//add image
> > >DBImage image = new DBImage();
> > >image.setImageData((byte[]) images.get(i));
> > >//not caching on browser
> > >Double random = Math.random();
> > >//put shared resource (image) on clean path
> > >
> > Start.get().getSharedResources().add("image" +
> > > random.toString() + ".jpg", image);
> > >ResourceReference imageResource = new 
> > > ResourceReference("image" + random.toString() + ".jpg");
> > >String url =
> > > RequestCycle.get().urlFor(imageResource).toString();
> > >//href in  and src in 
> > should have same
> > > path because lightbox won't work...
> > >ExternalLink odkaz = new
> > ExternalLink("anchor",
> > > url);
> > >WebMarkupContainer imageSrcAttribute = new 
> > > WebMarkupContainer("image");
> > >imageSrcAttribute.add(new 
> > > AttributeModifier("src", new Model(url)));
> > >odkaz.add(imageSrcAttribute);
> > >odkaz.add(new
> > SimpleAttributeModifier("title",
> > > (String) desc.get(i)));
> > >repeaterChild.add(odkaz);
> > >repeater.add(repeaterChild);
> > >}
> > >this.add(repeater);
> > >}
> > > }
> > >
> > > package com.myapp;
> > > public class ImagesMinerals extends
> > > LoadableDetachableModel>{
> > >@Override
> > >protected ArrayList load(){
> > >DBGetImages databaseMinerals = new DBGetImages();
> > >ArrayList dataMineraly = 
> databaseMinerals.getData();
> > >return dataMinerals;
> > >}
> > > }
> > >
> > > My problem is that when i again and again click on page the
> > memory in
> > > tomcat is eaten and I end-up with Java heap space error. Doesn't 
> > > matter if heap is 64MB or 1GB on start, after some clicks 
> memory is 
> > > eaten.
> > >
> > > Somethink wrong with my LDM?
> > >
> > > Miro
> > >
> > >
> > > 
> > 
> -
> > > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > > For additional commands, e-mail: users-h...@wicket.apache.org
> > >
> > >
> > 
> 
> 
> ---

RE: I am having trouble mounting shared resources

2011-08-05 Thread Miroslav F.
Same way as is mounted .js and .css mount images and then in .css you can
just use this path.
 

> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com] 
> Sent: Friday, 05. August 2011 19:30
> To: users@wicket.apache.org
> Subject: Re: I am having trouble mounting shared resources
> 
> Thanks, mounting JS worked perfectly.
> 
> However, mounting CSS was problematic because it references 
> quite a few images and they don't get loaded/mounted 
> correctly. How do I mount the folder that contains all images 
> so that they can be loaded from the CSS?
> 
> Thanks,
> 
> Alec
> 
> 
> On Fri, Aug 5, 2011 at 11:51 AM, Miroslav F.  wrote:
> > Project dirs:
> >
> > . com.myapp
> > .      MyStartAppPoint.java
> > . com.myapp.resources
> > .      MyResources.java
> > .      fancybox-123.js
> >
> > In MyStartAppPoint.init() do:
> >
> > mountSharedResource("/js/fancybox.js", new 
> > ResourceReference(MyResources.class,
> > "fancybox-123.js").getSharedResourceKey());
> >
> > MyResources.java is just empty class (for classloader to find your
> > resource):
> > package com.myapp.resources;
> > public class MyResources
> > {
> > }
> >
> > and then in html markup you can write:
> > 
> >
> > Hope helps,
> >
> > Miro
> >
> >
> >
> >
> >> -Original Message-
> >> From: Alec Swan [mailto:alecs...@gmail.com]
> >> Sent: Friday, 05. August 2011 08:42
> >> To: users@wicket.apache.org
> >> Subject: I am having trouble mounting shared resources
> >>
> >> Hello,
> >>
> >> I am having troubles figuring out how to organize my 
> static resources.
> >>
> >> I would like to map a static URL alias, e.g. /js/fancybox, 
> to a file 
> >> such as /js/fancybox/version123/fancybox-123.js. I also want to be 
> >> able to update the file version and after that have it 
> served under 
> >> the same alias. This assumes that I will modify my Java code to 
> >> reference the new file name.
> >>
> >> I think I need to create a resource reference class that points to 
> >> /js/fancybox/version123/fancybox-123.js and mount it in my Wicket 
> >> Application. But I can only mount a resource, not a 
> >> JavaScriptResourceReference in Application.init().
> >>
> >> Can anybody please explain how to do this right?
> >>
> >> 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
> 
> 


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



Re: I am having trouble mounting shared resources

2011-08-05 Thread Alec Swan
Thanks, mounting JS worked perfectly.

However, mounting CSS was problematic because it references quite a
few images and they don't get loaded/mounted correctly. How do I mount
the folder that contains all images so that they can be loaded from
the CSS?

Thanks,

Alec


On Fri, Aug 5, 2011 at 11:51 AM, Miroslav F.  wrote:
> Project dirs:
>
> . com.myapp
> .      MyStartAppPoint.java
> . com.myapp.resources
> .      MyResources.java
> .      fancybox-123.js
>
> In MyStartAppPoint.init() do:
>
> mountSharedResource("/js/fancybox.js", new
> ResourceReference(MyResources.class,
> "fancybox-123.js").getSharedResourceKey());
>
> MyResources.java is just empty class (for classloader to find your
> resource):
> package com.myapp.resources;
> public class MyResources
> {
> }
>
> and then in html markup you can write:
> 
>
> Hope helps,
>
> Miro
>
>
>
>
>> -Original Message-
>> From: Alec Swan [mailto:alecs...@gmail.com]
>> Sent: Friday, 05. August 2011 08:42
>> To: users@wicket.apache.org
>> Subject: I am having trouble mounting shared resources
>>
>> Hello,
>>
>> I am having troubles figuring out how to organize my static resources.
>>
>> I would like to map a static URL alias, e.g. /js/fancybox, to
>> a file such as /js/fancybox/version123/fancybox-123.js. I
>> also want to be able to update the file version and after
>> that have it served under the same alias. This assumes that I
>> will modify my Java code to reference the new file name.
>>
>> I think I need to create a resource reference class that
>> points to /js/fancybox/version123/fancybox-123.js and mount
>> it in my Wicket Application. But I can only mount a resource,
>> not a JavaScriptResourceReference in Application.init().
>>
>> Can anybody please explain how to do this right?
>>
>> 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



RE: tomcat eats memory

2011-08-05 Thread Miroslav F.
Using non-shared images? My problem is that I need same url for href in 
and for
src in  for lightbox to work.



> -Original Message-
> From: Dan Retzlaff [mailto:dretzl...@gmail.com] 
> Sent: Friday, 05. August 2011 18:45
> To: users@wicket.apache.org
> Subject: Re: tomcat eats memory
> 
> This is your problem:
> 
> Start.get().getSharedResources().add("image" +
> > random.toString() + ".jpg", image);
> 
> 
> Adding shared resources during page construction is very 
> unusual. Consider registering shared resources in 
> Application.init(), or using non-shared images. Refer to 
> http://wicketstuff.org/wicket/images/
> 
> On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.  wrote:
> 
> > Hi folks,
> >
> > I have these classes:
> >
> > package com.myapp;
> > public class Minerals extends WebPage{
> >public Minerals(){
> >RepeatingView repeater = new 
> RepeatingView("repeater");
> >//data from database - images and descriptions
> >ArrayList dataFromDB = (new ImagesMinerals()).load();
> >//descriptions
> >ArrayList desc = new ArrayList();
> >desc = (ArrayList) dataFromDB.get(0);
> >//images
> >ArrayList images = new ArrayList();
> >images = (ArrayList) dataFromDB.get(1);
> >int size = images.size();
> >for(int i = 0; i < size; i++){
> >String repeaterID = repeater.newChildId();
> >ImageRepeater repeaterChild = new 
> > ImageRepeater(repeaterID);
> >//add description
> >repeaterChild.add(new Label("description", 
> > (String) desc.get(i)));
> >//add image
> >DBImage image = new DBImage();
> >image.setImageData((byte[]) images.get(i));
> >//not caching on browser
> >Double random = Math.random();
> >//put shared resource (image) on clean path
> >
> Start.get().getSharedResources().add("image" +
> > random.toString() + ".jpg", image);
> >ResourceReference imageResource = new 
> > ResourceReference("image" + random.toString() + ".jpg");
> >String url =
> > RequestCycle.get().urlFor(imageResource).toString();
> >//href in  and src in  
> should have same 
> > path because lightbox won't work...
> >ExternalLink odkaz = new 
> ExternalLink("anchor", 
> > url);
> >WebMarkupContainer imageSrcAttribute = new 
> > WebMarkupContainer("image");
> >imageSrcAttribute.add(new 
> > AttributeModifier("src", new Model(url)));
> >odkaz.add(imageSrcAttribute);
> >odkaz.add(new 
> SimpleAttributeModifier("title",
> > (String) desc.get(i)));
> >repeaterChild.add(odkaz);
> >repeater.add(repeaterChild);
> >}
> >this.add(repeater);
> >}
> > }
> >
> > package com.myapp;
> > public class ImagesMinerals extends
> > LoadableDetachableModel>{
> >@Override
> >protected ArrayList load(){
> >DBGetImages databaseMinerals = new DBGetImages();
> >ArrayList dataMineraly = databaseMinerals.getData();
> >return dataMinerals;
> >}
> > }
> >
> > My problem is that when i again and again click on page the 
> memory in 
> > tomcat is eaten and I end-up with Java heap space error. Doesn't 
> > matter if heap is 64MB or 1GB on start, after some clicks memory is 
> > eaten.
> >
> > Somethink wrong with my LDM?
> >
> > Miro
> >
> >
> > 
> -
> > 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: error during deployment

2011-08-05 Thread Dan Retzlaff
"Error in filter start tag" --- this is a web.xml parsing error? The snippet
you included is not complete. web.xml content should be wrapped in
. Refer to the sample at
http://wicket.apache.org/learn/examples/helloworld.html.

If that is not the problem, please post the full, verbatim error output.

On Fri, Aug 5, 2011 at 9:22 AM, srinash  wrote:

> Hi All, Can you please let me know why i get a deployment error when I set
> up
> the filter in the web.xml. The structure of the web.xml is, I had posted
> this earlier - guess in the general forums, please bear with me.
>
> 
>HelloWorldApplication
>
> org.apache.wicket.protocol.http.WicketFilter
>
>  applicationClassName
>
>
> com.dev.wicket.apps.helloworld.HelloWorldApplication
>
> 
>configuration
>deployment
>   
>
>
>HelloWorldApplication
>/apps/HelloWorldApplication/*
>
>
> the error that is got is Error in filter start tag, some direction will be
> really helpful
>
> Thank you
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3721621.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: tomcat eats memory

2011-08-05 Thread Dan Retzlaff
This is your problem:

Start.get().getSharedResources().add("image" +
> random.toString() + ".jpg", image);


Adding shared resources during page construction is very unusual. Consider
registering shared resources in Application.init(), or using non-shared
images. Refer to http://wicketstuff.org/wicket/images/

On Fri, Aug 5, 2011 at 9:20 AM, Miroslav F.  wrote:

> Hi folks,
>
> I have these classes:
>
> package com.myapp;
> public class Minerals extends WebPage{
>public Minerals(){
>RepeatingView repeater = new RepeatingView("repeater");
>//data from database - images and descriptions
>ArrayList dataFromDB = (new ImagesMinerals()).load();
>//descriptions
>ArrayList desc = new ArrayList();
>desc = (ArrayList) dataFromDB.get(0);
>//images
>ArrayList images = new ArrayList();
>images = (ArrayList) dataFromDB.get(1);
>int size = images.size();
>for(int i = 0; i < size; i++){
>String repeaterID = repeater.newChildId();
>ImageRepeater repeaterChild = new
> ImageRepeater(repeaterID);
>//add description
>repeaterChild.add(new Label("description", (String)
> desc.get(i)));
>//add image
>DBImage image = new DBImage();
>image.setImageData((byte[]) images.get(i));
>//not caching on browser
>Double random = Math.random();
>//put shared resource (image) on clean path
>Start.get().getSharedResources().add("image" +
> random.toString() + ".jpg", image);
>ResourceReference imageResource = new
> ResourceReference("image" + random.toString() + ".jpg");
>String url =
> RequestCycle.get().urlFor(imageResource).toString();
>//href in  and src in  should have same path
> because lightbox won't work...
>ExternalLink odkaz = new ExternalLink("anchor",
> url);
>WebMarkupContainer imageSrcAttribute = new
> WebMarkupContainer("image");
>imageSrcAttribute.add(new AttributeModifier("src",
> new Model(url)));
>odkaz.add(imageSrcAttribute);
>odkaz.add(new SimpleAttributeModifier("title",
> (String) desc.get(i)));
>repeaterChild.add(odkaz);
>repeater.add(repeaterChild);
>}
>this.add(repeater);
>}
> }
>
> package com.myapp;
> public class ImagesMinerals extends
> LoadableDetachableModel>{
>@Override
>protected ArrayList load(){
>DBGetImages databaseMinerals = new DBGetImages();
>ArrayList dataMineraly = databaseMinerals.getData();
>return dataMinerals;
>}
> }
>
> My problem is that when i again and again click on page the memory in
> tomcat
> is eaten and I end-up with
> Java heap space error. Doesn't matter if heap is 64MB or 1GB on start,
> after
> some clicks memory is eaten.
>
> Somethink wrong with my LDM?
>
> Miro
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


error during deployment

2011-08-05 Thread srinash
Hi All, Can you please let me know why i get a deployment error when I set up
the filter in the web.xml. The structure of the web.xml is, I had posted
this earlier - guess in the general forums, please bear with me. 


HelloWorldApplication
   
org.apache.wicket.protocol.http.WicketFilter

  applicationClassName
 
com.dev.wicket.apps.helloworld.HelloWorldApplication

 
configuration
deployment
   


HelloWorldApplication
/apps/HelloWorldApplication/*


the error that is got is Error in filter start tag, some direction will be
really helpful

Thank you  



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/error-during-deployment-tp3721621p3721621.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



tomcat eats memory

2011-08-05 Thread Miroslav F.
Hi folks,

I have these classes:

package com.myapp;
public class Minerals extends WebPage{
public Minerals(){
RepeatingView repeater = new RepeatingView("repeater");
//data from database - images and descriptions
ArrayList dataFromDB = (new ImagesMinerals()).load();
//descriptions
ArrayList desc = new ArrayList();
desc = (ArrayList) dataFromDB.get(0);
//images
ArrayList images = new ArrayList();
images = (ArrayList) dataFromDB.get(1);
int size = images.size();
for(int i = 0; i < size; i++){
String repeaterID = repeater.newChildId();
ImageRepeater repeaterChild = new
ImageRepeater(repeaterID);
//add description
repeaterChild.add(new Label("description", (String)
desc.get(i)));
//add image
DBImage image = new DBImage();
image.setImageData((byte[]) images.get(i));
//not caching on browser
Double random = Math.random();
//put shared resource (image) on clean path
Start.get().getSharedResources().add("image" +
random.toString() + ".jpg", image);
ResourceReference imageResource = new
ResourceReference("image" + random.toString() + ".jpg");
String url =
RequestCycle.get().urlFor(imageResource).toString();
//href in  and src in  should have same path
because lightbox won't work...
ExternalLink odkaz = new ExternalLink("anchor",
url);
WebMarkupContainer imageSrcAttribute = new
WebMarkupContainer("image");
imageSrcAttribute.add(new AttributeModifier("src",
new Model(url)));
odkaz.add(imageSrcAttribute);
odkaz.add(new SimpleAttributeModifier("title",
(String) desc.get(i)));
repeaterChild.add(odkaz);
repeater.add(repeaterChild);
}
this.add(repeater);
}
}

package com.myapp;
public class ImagesMinerals extends
LoadableDetachableModel>{
@Override
protected ArrayList load(){
DBGetImages databaseMinerals = new DBGetImages();
ArrayList dataMineraly = databaseMinerals.getData();
return dataMinerals;
}
}

My problem is that when i again and again click on page the memory in tomcat
is eaten and I end-up with 
Java heap space error. Doesn't matter if heap is 64MB or 1GB on start, after
some clicks memory is eaten.

Somethink wrong with my LDM?

Miro


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



RE: I am having trouble mounting shared resources

2011-08-05 Thread Miroslav F.
Project dirs:

. com.myapp
.  MyStartAppPoint.java
. com.myapp.resources
.  MyResources.java
.  fancybox-123.js

In MyStartAppPoint.init() do:

mountSharedResource("/js/fancybox.js", new
ResourceReference(MyResources.class,
"fancybox-123.js").getSharedResourceKey());

MyResources.java is just empty class (for classloader to find your
resource):
package com.myapp.resources;
public class MyResources
{
}

and then in html markup you can write:


Hope helps,

Miro




> -Original Message-
> From: Alec Swan [mailto:alecs...@gmail.com] 
> Sent: Friday, 05. August 2011 08:42
> To: users@wicket.apache.org
> Subject: I am having trouble mounting shared resources
> 
> Hello,
> 
> I am having troubles figuring out how to organize my static resources.
> 
> I would like to map a static URL alias, e.g. /js/fancybox, to 
> a file such as /js/fancybox/version123/fancybox-123.js. I 
> also want to be able to update the file version and after 
> that have it served under the same alias. This assumes that I 
> will modify my Java code to reference the new file name.
> 
> I think I need to create a resource reference class that 
> points to /js/fancybox/version123/fancybox-123.js and mount 
> it in my Wicket Application. But I can only mount a resource, 
> not a JavaScriptResourceReference in Application.init().
> 
> Can anybody please explain how to do this right?
> 
> 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



Re: session closed when adding CSSPackageResource

2011-08-05 Thread Dan Retzlaff
No, sorry, that doesn't make sense to me. But I'm glad to hear you worked
out the problem, and more importantly, understand the usage of detachable
models. :)

On Fri, Aug 5, 2011 at 1:52 AM, Mathilde Pellerin <
mathilde.pelle...@statlife.fr> wrote:

> Wonderful ! it works with "*InjectorHolder.getInjector().inject(this);*".
>
> Thank to you all.
>
> Can someone could explain to me why I need a specific
> LoadableDetachableModel only when I add CSSPackageResource to my modal
> window ?
>


Re: Safari hangs on ajax form submit

2011-08-05 Thread Martin Grigorov
1.4.18 is being voted at the moment.

Branch: http://svn.apache.org/repos/asf/wicket/branches/wicket-1.4.18/
Maven Repository:
https://repository.apache.org/content/repositories/orgapachewicket-001
Non-Maven Build Artifacts:
http://people.apache.org/~jrthomerson/wicket-1.4.18/

This vote ends Monday, August 8th at 5:00am (GMT)

Test it and tell us if you find any regressions.

On Thu, Aug 4, 2011 at 4:36 PM, trodi  wrote:
>
> Peter Miklosko wrote:
>>
>> Where did you see 1.4.18?
>> I do not see it on SVN https://svn.apache.org/repos/asf/wicket/branches/
>>
>
> I figured that from
> 
>
> "Igor Vaynberg added a comment - 21/Jun/11 06:13
> it bit me earlier today. this is something we will need to fix in 1.4.18"
>
> I didn't see anything stating how far 1.4.18 was from release.
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Safari-hangs-on-ajax-form-submit-tp3713539p3718673.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



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

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



Re: session closed when adding CSSPackageResource

2011-08-05 Thread Mathilde Pellerin
Wonderful ! it works with "*InjectorHolder.getInjector().inject(this);*".

Thank to you all.

Can someone could explain to me why I need a specific
LoadableDetachableModel only when I add CSSPackageResource to my modal
window ?


Re: session closed when adding CSSPackageResource

2011-08-05 Thread Martin Grigorov
 public QuestionnaireModel(Long primaryKey) {
   InjectorHolder.getInstance().inject(this); 
   id = primaryKey;
   }


On Fri, Aug 5, 2011 at 11:27 AM, Mathilde Pellerin
 wrote:
> Ok, so I try with your method. This is my model :
>
> public class QuestionnaireModel extends
> LoadableDetachableModel {
>    @SpringBean
>    private ServiceQuestionnaire serviceQuestionnaire;
>    private Long id;
>
>    public QuestionnaireModel(Long primaryKey) {
>        id = primaryKey;
>    }
>
>    @Override
>    protected Questionnaire load() {
>
>        return serviceQuestionnaire.getOne(id);
>    }
> }
>
> But I have a null pointer exception :
> java.lang.NullPointerException
>    at
> fr.statlife.protoE4N.pages.membre.QuestionnaireModel.load(QuestionnaireModel.java:22)
>    at
> fr.statlife.protoE4N.pages.membre.QuestionnaireModel.load(QuestionnaireModel.java:1)
>    at
> org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:120)
>    at
> org.apache.wicket.Component.getDefaultModelObject(Component.java:1724)
>    at
> fr.statlife.protoE4N.pages.membre.QuestionnairesPage$BoutonRemplirQuestionnaire$1.onClick(QuestionnairesPage.java:112)
>    [...]
>
> Questionnaire is also an attribute of my Page and maybe there is a conflict.
> This code calls my new model :
>     item.add(new BoutonRemplirQuestionnaire("boutonQuestionnaire",  new
> QuestionnaireModel(q.getIdQuestionnaire(;
>
> and this is inner class BoutonRemplirQuestionnaire :
>    class BoutonRemplirQuestionnaire extends Panel
>    {
>        public BoutonRemplirQuestionnaire(String id, IModel model) {
>            super(id, model);
>
>            //Ajout du lien qui affichera le questionnaire
>            AjaxLink showQuestionnaire = new AjaxLink("remplir")
> {
>                @Override
>                public void onClick(AjaxRequestTarget target) {
>                    qCourant =
> (Questionnaire)getParent().getDefaultModelObject();
>
>
> target.appendJavascript("Wicket.Window.unloadConfirmation = false;");
>
> questionnaireContentPanel.initialiserQuestionnaire(qCourant);
>                    modalWindow.setContent(questionnaireContentPanel);
>                    modalWindow.setTitle(qCourant.getTitre());
>                    modalWindow.show(target);
>                }
>            };
>            add(showQuestionnaire);
>        }
>    }
>
> the NullPointerException is sent by this line :
>       qCourant = (Questionnaire)getParent().getDefaultModelObject();
>
> Maybe modal window make this problem more complex...
>



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

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



Re: session closed when adding CSSPackageResource

2011-08-05 Thread Mathilde Pellerin
Ok, so I try with your method. This is my model :

public class QuestionnaireModel extends
LoadableDetachableModel {
@SpringBean
private ServiceQuestionnaire serviceQuestionnaire;
private Long id;

public QuestionnaireModel(Long primaryKey) {
id = primaryKey;
}

@Override
protected Questionnaire load() {

return serviceQuestionnaire.getOne(id);
}
}

But I have a null pointer exception :
java.lang.NullPointerException
at
fr.statlife.protoE4N.pages.membre.QuestionnaireModel.load(QuestionnaireModel.java:22)
at
fr.statlife.protoE4N.pages.membre.QuestionnaireModel.load(QuestionnaireModel.java:1)
at
org.apache.wicket.model.LoadableDetachableModel.getObject(LoadableDetachableModel.java:120)
at
org.apache.wicket.Component.getDefaultModelObject(Component.java:1724)
at
fr.statlife.protoE4N.pages.membre.QuestionnairesPage$BoutonRemplirQuestionnaire$1.onClick(QuestionnairesPage.java:112)
[...]

Questionnaire is also an attribute of my Page and maybe there is a conflict.
This code calls my new model :
 item.add(new BoutonRemplirQuestionnaire("boutonQuestionnaire",  new
QuestionnaireModel(q.getIdQuestionnaire(;

and this is inner class BoutonRemplirQuestionnaire :
class BoutonRemplirQuestionnaire extends Panel
{
public BoutonRemplirQuestionnaire(String id, IModel model) {
super(id, model);

//Ajout du lien qui affichera le questionnaire
AjaxLink showQuestionnaire = new AjaxLink("remplir")
{
@Override
public void onClick(AjaxRequestTarget target) {
qCourant =
(Questionnaire)getParent().getDefaultModelObject();


target.appendJavascript("Wicket.Window.unloadConfirmation = false;");

questionnaireContentPanel.initialiserQuestionnaire(qCourant);
modalWindow.setContent(questionnaireContentPanel);
modalWindow.setTitle(qCourant.getTitre());
modalWindow.show(target);
}
};
add(showQuestionnaire);
}
}

the NullPointerException is sent by this line :
   qCourant = (Questionnaire)getParent().getDefaultModelObject();

Maybe modal window make this problem more complex...


Re: I am having trouble mounting shared resources

2011-08-05 Thread Martin Grigorov
Quick solution:

Resource res = new JavaScriptResourceReference().getResource();
mountSharedResource(somePath, res);

On Fri, Aug 5, 2011 at 10:01 AM, Alec Swan  wrote:
> We are using Wicket 1.4.17 but we would like to do something like this
> mountResource("/mount/path", new SomeResourceReference()) as described
> in http://wicketinaction.com/ for Wicket 1.5.
>
> On Fri, Aug 5, 2011 at 12:41 AM, Alec Swan  wrote:
>> Hello,
>>
>> I am having troubles figuring out how to organize my static resources.
>>
>> I would like to map a static URL alias, e.g. /js/fancybox, to a file
>> such as /js/fancybox/version123/fancybox-123.js. I also want to be
>> able to update the file version and after that have it served under
>> the same alias. This assumes that I will modify my Java code to
>> reference the new file name.
>>
>> I think I need to create a resource reference class that points to
>> /js/fancybox/version123/fancybox-123.js and mount it in my Wicket
>> Application. But I can only mount a resource, not a
>> JavaScriptResourceReference in Application.init().
>>
>> Can anybody please explain how to do this right?
>>
>> Thanks
>>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



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

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



RE: session closed when adding CSSPackageResource

2011-08-05 Thread Wilhelmsen Tor Iver
> When I do this :
>  new Model(q)
> it creates an IModel for Questionnaire, doesn't it?

I think he means to make a more dynamic model, e.g.

public class QuestionnaireModel extends LoadableDetachabeModel {

private String theKey;

public QuestionnaireModel(String key) { theKey = key; }

public Questionnaire load() { /* Get Hibernate session and load based 
on key */ }
}

This serializes the minimum amount of state to "recreate" the complex object.

- Tor Iver

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



Re: I am having trouble mounting shared resources

2011-08-05 Thread Alec Swan
We are using Wicket 1.4.17 but we would like to do something like this
mountResource("/mount/path", new SomeResourceReference()) as described
in http://wicketinaction.com/ for Wicket 1.5.

On Fri, Aug 5, 2011 at 12:41 AM, Alec Swan  wrote:
> Hello,
>
> I am having troubles figuring out how to organize my static resources.
>
> I would like to map a static URL alias, e.g. /js/fancybox, to a file
> such as /js/fancybox/version123/fancybox-123.js. I also want to be
> able to update the file version and after that have it served under
> the same alias. This assumes that I will modify my Java code to
> reference the new file name.
>
> I think I need to create a resource reference class that points to
> /js/fancybox/version123/fancybox-123.js and mount it in my Wicket
> Application. But I can only mount a resource, not a
> JavaScriptResourceReference in Application.init().
>
> Can anybody please explain how to do this right?
>
> Thanks
>

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



Re: session closed when adding CSSPackageResource

2011-08-05 Thread Mathilde Pellerin
Hi Dan,

I followed your advise : I change Questionnaire so it is not serializable
and errors appeared in my page for this line :
item.add(new BoutonRemplirQuestionnaire("boutonQuestionnaire",  new
Model(q)));

and it's coherent because it's when I click on this AjaxLink that I have the
first error (method *BoutonRemplirQuestionnaire* creates a Panel with an
AjaxLink inside).

But I don't really understand your solution :

> The best solution is to create an IModel for Questionnaire so that the
> entity itself is not serialized.


When I do this :
 new Model(q)
it creates an IModel for Questionnaire, doesn't it?

and there is something else that I don't understand : why this problem
appears only when I add a HeaderContributor?

thanks for your help
M.


> Hi Mathilde,
>
> The story must be more complicated than your addition of a
> HeaderContributor. Somehow you're serializing a Questionnaire into your
> Wicket session, and when it's used in a subsequent request, the Hibernate
> session associated with its lazy collection of questions has been closed.
> One way to troubleshoot this is to change Questionnaire so it is not
> Serializable; then you will see the problem closer to its source. The best
> solution is to create an IModel for Questionnaire so that the entity itself
> is not serialized.
>
> Hope that helps, Dan
>
>
>