Re: Running a TestNG test suite from a wicket page
On Mon, December 02, 2013, Paul Bors wrote: Have you considered Mockito to mock your POJOs for the test data and methods? I use that in conjunction with TestNG and then start the wicket app providing it mocked DAOs and POJOs. I've got pretty strong feelings about such frameworks, bluntly speaking, I consider them harmful. They look like a cool thing on first glance, but if you've got complex test cases in your business logic you end up recording complex sequences of mocked service responses and end up with write-only test code. People who use them for their code may have different experience, but since I usually work on large projects in teams of 2-5 people I've far too often had to understand and repair broken tests that were made unnecessarily complex due to the use of Eazymock or Mockito. Just for completeness I'm repeating once again what I already wrote about it a little before in this thread: I really don't like mocking services and DAOs at all, because in complex application this sooner or later leads you to testing against your particular implementation rather than your code's contract. In particular when mocking frameworks are used, this very easily leads to write-only test code. I've seen this on too many occasions and no longer believe that this is a wise approach. Also one needs to consider that many applications are pretty much data-driven (e.g. my system uses a document-based data model with nearly 100 different object variants), and loading and interpreting both schema and data is a crucial piece of the application and needs thorough testing, and you really want to do this on the real thing rather than on mocked services. But actually I wanted to report my progress on this issue here, since this might be of interest for others, too. I succeded with my approach and implemented my first tests yesterday. My setup is like this: 1. For testing, I deploy my test librariees into WEB-INF/lib, so that they can be used within the running webapp. Also I create a JAR file from all my integration tests and deploy it into the same location. 2. I create a wicket page and mount it somewhere (e.g. /test), make sure that it cannot be accessed in production environments :) 3. In that page, I locate the JAR with my tests: | @Nonnull | public static File getJarForClassName( String packageAndClassName ) { | URL url = ReflectionUtil.class.getClassLoader().getResource( packageAndClassName ); | if ( url == null ) { | throw new IllegalStateException( Unable to resolve resource + packageAndClassName ); | } | if ( !jar.equals( url.getProtocol() ) ) { | throw new IllegalStateException( Wrong protocol for + packageAndClassName + : + url.getProtocol() ); | } | String path = url.getPath(); | if ( path == null ) { | throw new IllegalStateException( No path for + packageAndClassName ); | } | int delimPos = path.indexOf( '!' ); | if ( delimPos = 0 ) { | throw new IllegalStateException( Cannot extract JAR path for + packageAndClassName + : + path ); | } | String jarPath = path.substring( file:.length(), delimPos ); | File result = new File( jarPath ); | if ( !result.isFile() ) { | throw new IllegalStateException( Something's wrong, no valid file for + packageAndClassName + : + jarPath ); | } | return result; | } 4. Then I set up TestNG in onConfigure(): | TestNG testNG = new TestNG(); | testNG.setTestJar( jarFile.getAbsolutePath() ); | testNG.setExcludedGroups( EXCLUDED_TEST_GROUPS ); | testNG.setGroups( INCLUDED_TEST_GROUPS ); | testNG.setOutputDirectory( outputDir.getAbsolutePath() ); | @SuppressWarnings( rawtypes ) | ListClass reporterList = Collections.Class singletonList( HTMLReporter.class ); | testNG.setListenerClasses( reporterList ); | int result = 0; | try { | testNG.run(); | result = testNG.getStatus(); | } catch ( TestNGException ex ) { | LOG.error( Exception caught, ex ); | error( ex.getMessage() ); | result = 1; | } 5. If the result is not 0, I throw an IllegalStateException, so that my ANT build fails: | if ( result != 0 ) { | throw new IllegalStateException( tests failed ); | } 6. Since my tests may run for a while i increase the timeout before wicket throws a pagemap-locked exception in the constructor: | if ( !TIMEOUT_FOR_TEST_PAGE.equals( VrmsApplication.get().getRequestCycleSettings().getTimeout() ) ) { | VrmsApplication.get().getRequestCycleSettings().setTimeout( TIMEOUT_FOR_TEST_PAGE ); | } 7. In ANT I create a test target like this: | target name=test-integration depends=check-wget,compile-tests,glassfish-start-if-necessary,glassfish-test-deploy | antcall target=run-test-integration/antcall | /target | | target name=run-test-integration | exec executable=wget failonerror=true | arg line=-O /dev/null --quiet http://localhost:8080/test; / | /exec | /target Now testing the business logic has
Referencing CSS resources
Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Referencing CSS resources
Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Referencing CSS resources
Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.bundle.Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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: Referencing CSS resources
On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.bundle.Bootstrap3Reference/dist /fonts/glyphicons-halflings-regular.eot?#iefix Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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: Referencing CSS resources
Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.bundle.Bootstrap3Reference/dist /fonts/glyphicons-halflings-regular.eot?#iefix Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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: Referencing CSS resources
Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.bundle.Bootstrap3Reference/dist /fonts/glyphicons-halflings-regular.eot?#iefix Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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: Referencing CSS resources
Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist /fonts/glyphicons-halflings-regular.eot?#iefix Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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: Referencing CSS resources
Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/java/com/profitbricks/wicket/bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist /fonts/glyphicons-halflings-regular.eot?#iefix Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. I know that the problem that the fonts referenced directly from the CSS files. But how can I handle that? Viele Grüße Oliver Am 04.12.13 12:03, schrieb Martin Grigorov: Hi, Just make sure the font/ folder is next to the css/ folder in your file structure. On Wed, Dec 4, 2013 at 11:59 AM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi, I would like to include all Bootstrap 3 resources via resources references. I managed to in include all CSS files by extending CssResourceReference and specifying a list of dependencies (getDependencies()). But how can I include the fonts provided by Bootstrap? The fonts are referenced directly in the CSS files via src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), How can I reference these fonts? Bye, Oliver - 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
Re: Referencing CSS resources
Hi Oliver, The problem is at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/java/com/profitbricks/wicket/bootstrap/resources/example/ExampleApplication.java?at=master#cl-44 Earlier I asked: Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. Here you set ExampleApplication.class as scope for the bundle. The effect from this is that Wicket will create url like: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.ExampleApplication/css/bootstrap(-HASH).css and since the combined url contains the url(../font/...) code the browser will make a request to: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.ExampleApplication/font/glyphfont-css A simple solution is to use Bootstrap3Reference.class as a scope: getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, bootstrap.css, new Bootstrap3Reference()); No need to override getMinifiedName() ( https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/java/com/profitbricks/wicket/bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master#cl-26 ) Wicket does the same for you. On Wed, Dec 4, 2013 at 3:28 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/ obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b 49fced00c0/example/src/main/java/com/profitbricks/wicket/ bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via http://localhost:8080/bs3test/wicket/resource/fonts/ glyphicons-halflings-regular.woff There is something wrong here. A relative url like ../fonts/glyphicons-halflings-regular.eot?#iefix should be calculated to http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle.
Wicket CDI Status
Hello guys.. I'm setting up a Glassfish4 environment with wicket 6.12.0 and I previously started using cdi to inject entity managers. On Tomee, cdi was working but I decided that this particular application will need a more robust JavaEE server (specially because of OpenJPA slow pace). Anyway.. I'm getting warnings everywhere and specially this exception that just broke the app: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class comLoginPage$1 cannot be a non-static inner class The offending class is basically a anonymous Form.. I conclude that any anonymous class would cause this. Found this ticket: https://issues.apache.org/jira/browse/WICKET-5264 I guess it happened before and was fixed in v6.9.0 but I'm still facing this issue with v6.12.0. So basically.. what's the best option: - Apply some fix to this situation; - Stick with a JavaEE6 with Glassfish3 while using v6.x + cdi and in near future go for JavaEE7 Glassfish4 + Wicket v7.x cdi 1.1 (when ready) - Should I forget cdi =\ I appreciate guidance. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket CDI Status
Hi, I am not very into CDI business but here are some solutions: - upgrade Weld to 2.1.0 in Glassfish 4, if this is possible. The exception is caused by a bug in Weld 2.0.x - use Wicket 6.9.0. This will work unless you use @Inject in anonymous Wicket components. I personally never thought about this pattern before Wicket 6.9.1. I guess you don't use it too - Wicket 6.13.0 will bring wicket-cdi-1.1 module. But again it will work only if you use it with Weld 2.1.x On Wed, Dec 4, 2013 at 5:01 PM, Diogo Casado diogocas...@gmail.com wrote: Hello guys.. I'm setting up a Glassfish4 environment with wicket 6.12.0 and I previously started using cdi to inject entity managers. On Tomee, cdi was working but I decided that this particular application will need a more robust JavaEE server (specially because of OpenJPA slow pace). Anyway.. I'm getting warnings everywhere and specially this exception that just broke the app: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class comLoginPage$1 cannot be a non-static inner class The offending class is basically a anonymous Form.. I conclude that any anonymous class would cause this. Found this ticket: https://issues.apache.org/jira/browse/WICKET-5264 I guess it happened before and was fixed in v6.9.0 but I'm still facing this issue with v6.12.0. So basically.. what's the best option: - Apply some fix to this situation; - Stick with a JavaEE6 with Glassfish3 while using v6.x + cdi and in near future go for JavaEE7 Glassfish4 + Wicket v7.x cdi 1.1 (when ready) - Should I forget cdi =\ I appreciate guidance. Thanks. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Referencing CSS resources
Hi Martin, I updated it and changed it as you suggested. But the problem remains. bootstrap.css is fetched via /bs3test/wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.bundle.Bootstrap3Reference/bootstrap-ver-1386173958000.css But the fonts are fetched via /bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff Oliver Am 04.12.13 15:41, schrieb Martin Grigorov: Hi Oliver, The problem is at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/java/com/profitbricks/wicket/bootstrap/resources/example/ExampleApplication.java?at=master#cl-44 Earlier I asked: Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. Here you set ExampleApplication.class as scope for the bundle. The effect from this is that Wicket will create url like: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.ExampleApplication/css/bootstrap(-HASH).css and since the combined url contains the url(../font/...) code the browser will make a request to: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example.ExampleApplication/font/glyphfont-css A simple solution is to use Bootstrap3Reference.class as a scope: getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, bootstrap.css, new Bootstrap3Reference()); No need to override getMinifiedName() ( https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/java/com/profitbricks/wicket/bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master#cl-26 ) Wicket does the same for you. On Wed, Dec 4, 2013 at 3:28 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/ obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b 49fced00c0/example/src/main/java/com/profitbricks/wicket/ bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package resource... BYe, Oliver Am 04.12.13 13:23, schrieb Martin Grigorov: On Wed, Dec 4, 2013 at 12:11 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi, it is there. The CSS as bundle is referenced via http://localhost:8080/bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/dist/css/bootstrap-theme-ver-1386155341000.css But the fonts via
Re: Referencing CSS resources
right. you need to use css/ in getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, *css/*bootstrap.css, new Bootstrap3Reference()); it is all about tuning :-) On Wed, Dec 4, 2013 at 5:26 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, I updated it and changed it as you suggested. But the problem remains. bootstrap.css is fetched via /bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/bootstrap-ver-1386173958000.css But the fonts are fetched via /bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff Oliver Am 04.12.13 15:41, schrieb Martin Grigorov: Hi Oliver, The problem is at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ ExampleApplication.java?at=master#cl-44 Earlier I asked: Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. Here you set ExampleApplication.class as scope for the bundle. The effect from this is that Wicket will create url like: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/css/bootstrap(-HASH).css and since the combined url contains the url(../font/...) code the browser will make a request to: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/font/glyphfont-css A simple solution is to use Bootstrap3Reference.class as a scope: getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, bootstrap.css, new Bootstrap3Reference()); No need to override getMinifiedName() ( https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ bundle/Bootstrap3Reference.java?at=master#cl-26 ) Wicket does the same for you. On Wed, Dec 4, 2013 at 3:28 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/ obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b 49fced00c0/example/src/main/java/com/profitbricks/wicket/ bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated you are confronted with a lot of classes and you must understand all the details. And this does not pay off unless you will build many different applications... Am 04.12.13 13:45, schrieb Oliver B. Fischer: Hi Martin, I think I will try to write a custom package
Re: Referencing CSS resources
Now it works as I expected. ;-) Am 04.12.13 17:32, schrieb Martin Grigorov: right. you need to use css/ in getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, *css/*bootstrap.css, new Bootstrap3Reference()); it is all about tuning :-) On Wed, Dec 4, 2013 at 5:26 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, I updated it and changed it as you suggested. But the problem remains. bootstrap.css is fetched via /bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/bootstrap-ver-1386173958000.css But the fonts are fetched via /bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff Oliver Am 04.12.13 15:41, schrieb Martin Grigorov: - 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: Referencing CSS resources
Now I got it. The name in addCssBundle(...) can be any string and can be used to 'hide' the internal name. Since the fonts paths are calcuated relative to the CSS file my browser will calculate and wrong path. Thank you very much! Without you I wouldn't have been able to figure this out. Bye Oliver Am 04.12.13 17:32, schrieb Martin Grigorov: right. you need to use css/ in getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, *css/*bootstrap.css, new Bootstrap3Reference()); it is all about tuning :-) On Wed, Dec 4, 2013 at 5:26 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Hi Martin, I updated it and changed it as you suggested. But the problem remains. bootstrap.css is fetched via /bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/bootstrap-ver-1386173958000.css But the fonts are fetched via /bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff Oliver Am 04.12.13 15:41, schrieb Martin Grigorov: Hi Oliver, The problem is at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ ExampleApplication.java?at=master#cl-44 Earlier I asked: Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. Here you set ExampleApplication.class as scope for the bundle. The effect from this is that Wicket will create url like: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/css/bootstrap(-HASH).css and since the combined url contains the url(../font/...) code the browser will make a request to: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/font/glyphfont-css A simple solution is to use Bootstrap3Reference.class as a scope: getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, bootstrap.css, new Bootstrap3Reference()); No need to override getMinifiedName() ( https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ bundle/Bootstrap3Reference.java?at=master#cl-26 ) Wicket does the same for you. On Wed, Dec 4, 2013 at 3:28 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/ obfischer/wicket-bootstrap-resources/src/6e1642e4990e92a228a91bb5b8147b 49fced00c0/example/src/main/java/com/profitbricks/wicket/ bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already too much time. Putting all file in the WEB-INF folder would take me 10 minutes... BTW, Wicket is great and powerfull and you can build some simple pages quite fast. But if you need something more complicated
Re: Referencing CSS resources
On Wed, Dec 4, 2013 at 5:52 PM, Oliver B. Fischer mails...@swe-blog.netwrote: Now I got it. The name in addCssBundle(...) can be any string and can be used to 'hide' the internal name. Since the fonts paths are calcuated relative to the CSS file my browser will calculate and wrong path. Thank you very much! Without you I wouldn't have been able to figure this out. Welcome! Bye Oliver Am 04.12.13 17:32, schrieb Martin Grigorov: right. you need to use css/ in getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, *css/*bootstrap.css, new Bootstrap3Reference()); it is all about tuning :-) On Wed, Dec 4, 2013 at 5:26 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, I updated it and changed it as you suggested. But the problem remains. bootstrap.css is fetched via /bs3test/wicket/resource/com. profitbricks.wicket.bootstrap.resources.example.bundle. Bootstrap3Reference/bootstrap-ver-1386173958000.css But the fonts are fetched via /bs3test/wicket/resource/fonts/glyphicons-halflings-regular.woff Oliver Am 04.12.13 15:41, schrieb Martin Grigorov: Hi Oliver, The problem is at https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ ExampleApplication.java?at=master#cl-44 Earlier I asked: Do you use Wicket bundle (several CSS files combined into one) by chance ? It would break if the bundle doesn't use Bootstrap3Reference.class (or another class in the same package) as a scope. Here you set ExampleApplication.class as scope for the bundle. The effect from this is that Wicket will create url like: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/css/bootstrap(-HASH).css and since the combined url contains the url(../font/...) code the browser will make a request to: /wicket/resource/com.profitbricks.wicket.bootstrap.resources.example. ExampleApplication/font/glyphfont-css A simple solution is to use Bootstrap3Reference.class as a scope: getResourceBundles().addCssBundle(*Bootstrap3Reference*.class, bootstrap.css, new Bootstrap3Reference()); No need to override getMinifiedName() ( https://bitbucket.org/obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b49fced00c0/example/src/main/ java/com/profitbricks/wicket/bootstrap/resources/example/ bundle/Bootstrap3Reference.java?at=master#cl-26 ) Wicket does the same for you. On Wed, Dec 4, 2013 at 3:28 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, I think the problem is how I specify the bootstrap-theme.css theme as a dependency of bootstrap.css. I put my example online at https://bitbucket.org/ obfischer/wicket-bootstrap-resources/src/ 6e1642e4990e92a228a91bb5b8147b 49fced00c0/example/src/main/java/com/profitbricks/wicket/ bootstrap/resources/example/bundle/Bootstrap3Reference.java?at=master May you can have a look at it? Bye, Oliver Am 04.12.13 14:51, schrieb Martin Grigorov: Hi Oliver, There is no such central class that maps all resources. You can use any class as a scope for resources. Just make sure the resources are in the same folder as the scope class. Example: - if the scope class is com.example.package.MyClass - if the resource path is: css/some.css - then Wicket will try to load some.css from /wicket/resource/com.example.package.MyClass/css/some.css - if some.css contains: url (../font/some.woff) - then the browser will calculate its absolute url to: /wicket/resource/com.example.package.MyClass/font/some.woff - so you have to make sure that font/ folder resides next to css/ in the classpath This is how it works. You can still use the web folder, i.e. create css/ and font/ folders next to WEB-INF. This works as with any other Servlet based application. In your .html you can use link href=css/some.css/ to load it in a page. The benefit of using Wicket resource references is that: - you can load different resources depending on the user agent's locale, or session style/variation - you can use dependency management - one resource may depend on several other. You do response.render(headerItem) and wicket makes sure that all its dependencies are rendered too - resource bundles - i.e. to combine several CSS files into one to save network requests ... For more consult with http://wicket.apache.org/guide/guide/single.html#chapter14_4 I'll need more information/code to be able to help you more. On Wed, Dec 4, 2013 at 2:34 PM, Oliver B. Fischer mails...@swe-blog.net wrote: Hi Martin, is there any ready resource class that simply maps all resource requests to a package including relative paths? Such a simple task takes already
Re: Wicket CDI Status
It looks like it is running with glassfish4 snapshot 4.1 b4m1. They use the latest version of weld on it. Well.. I will continue this way.. Do you have an idea on when we will have v6.13 with cdi1.1? Thank you very much. On Wed, Dec 4, 2013 at 2:07 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, I am not very into CDI business but here are some solutions: - upgrade Weld to 2.1.0 in Glassfish 4, if this is possible. The exception is caused by a bug in Weld 2.0.x - use Wicket 6.9.0. This will work unless you use @Inject in anonymous Wicket components. I personally never thought about this pattern before Wicket 6.9.1. I guess you don't use it too - Wicket 6.13.0 will bring wicket-cdi-1.1 module. But again it will work only if you use it with Weld 2.1.x On Wed, Dec 4, 2013 at 5:01 PM, Diogo Casado diogocas...@gmail.com wrote: Hello guys.. I'm setting up a Glassfish4 environment with wicket 6.12.0 and I previously started using cdi to inject entity managers. On Tomee, cdi was working but I decided that this particular application will need a more robust JavaEE server (specially because of OpenJPA slow pace). Anyway.. I'm getting warnings everywhere and specially this exception that just broke the app: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class comLoginPage$1 cannot be a non-static inner class The offending class is basically a anonymous Form.. I conclude that any anonymous class would cause this. Found this ticket: https://issues.apache.org/jira/browse/WICKET-5264 I guess it happened before and was fixed in v6.9.0 but I'm still facing this issue with v6.12.0. So basically.. what's the best option: - Apply some fix to this situation; - Stick with a JavaEE6 with Glassfish3 while using v6.x + cdi and in near future go for JavaEE7 Glassfish4 + Wicket v7.x cdi 1.1 (when ready) - Should I forget cdi =\ I appreciate guidance. 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: Wicket CDI Status
On Wed, Dec 4, 2013 at 7:02 PM, Diogo Casado diogocas...@gmail.com wrote: It looks like it is running with glassfish4 snapshot 4.1 b4m1. They use the latest version of weld on it. Well.. I will continue this way.. Do you have an idea on when we will have v6.13 with cdi1.1? In a week or two. Thank you very much. On Wed, Dec 4, 2013 at 2:07 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, I am not very into CDI business but here are some solutions: - upgrade Weld to 2.1.0 in Glassfish 4, if this is possible. The exception is caused by a bug in Weld 2.0.x - use Wicket 6.9.0. This will work unless you use @Inject in anonymous Wicket components. I personally never thought about this pattern before Wicket 6.9.1. I guess you don't use it too - Wicket 6.13.0 will bring wicket-cdi-1.1 module. But again it will work only if you use it with Weld 2.1.x On Wed, Dec 4, 2013 at 5:01 PM, Diogo Casado diogocas...@gmail.com wrote: Hello guys.. I'm setting up a Glassfish4 environment with wicket 6.12.0 and I previously started using cdi to inject entity managers. On Tomee, cdi was working but I decided that this particular application will need a more robust JavaEE server (specially because of OpenJPA slow pace). Anyway.. I'm getting warnings everywhere and specially this exception that just broke the app: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class comLoginPage$1 cannot be a non-static inner class The offending class is basically a anonymous Form.. I conclude that any anonymous class would cause this. Found this ticket: https://issues.apache.org/jira/browse/WICKET-5264 I guess it happened before and was fixed in v6.9.0 but I'm still facing this issue with v6.12.0. So basically.. what's the best option: - Apply some fix to this situation; - Stick with a JavaEE6 with Glassfish3 while using v6.x + cdi and in near future go for JavaEE7 Glassfish4 + Wicket v7.x cdi 1.1 (when ready) - Should I forget cdi =\ I appreciate guidance. 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: Wicket CDI Status
Hi Diogo, Please note that wicket-cdi-1.1 is still experimental. I do have high confidence it will work fine, but it has not been tested extensively. The API is mostly compatible with the current wicket-cdi module. One of the changes is that the constructor of the CdiConfiguration no longer takes a BeanManager. CDI 1.1 has several portable ways of looking up this BeanManager. A fallback is added (see CdiConfiguration), in case your environment does not provide any of the portable lookup methods, but Glassfish should. Also, it is no longer possible to disable injection of various Wicket classes. Components, behaviors, sessions and the application are always injected. A major difference in behavior is the way conversations are propagated. The current cdi module uses non-portable code (which only works with Weld) to propagate the conversation. wicket-cdi-1.1 always propagates the conversation via the url (with the cid query-parameter), which is portable across all CDI 1.1 providers. As Martin mentioned, wicket-cdi-1.1 requires a recent version of Weld (if used with Weld). Weld 2.1.1 (which has not yet been released) has some fixes regarding warning floods (https://issues.jboss.org/browse/WELD-1547). Until then, you either have to ignore the warnings or lower the logging level. To use wicket-cdi-1.1, once wicket 6.13 is released, add the following dependency: dependency groupIdorg.apache.wicket/groupId artifactIdwicket-cdi-1.1/artifactId version0.2/version /dependency Until then, you can test with 0.2-SNAPSHOT. You can find the details for the snapshot repository on our download page. If you find any issues with wicket-cdi-1.1, please file JIRA issues and assign them to me. Best regards, Emond Papegaaij On Wed, Dec 4, 2013 at 7:02 PM, Diogo Casado diogocas...@gmail.com wrote: It looks like it is running with glassfish4 snapshot 4.1 b4m1. They use the latest version of weld on it. Well.. I will continue this way.. Do you have an idea on when we will have v6.13 with cdi1.1? Thank you very much. On Wed, Dec 4, 2013 at 2:07 PM, Martin Grigorov mgrigo...@apache.org wrote: Hi, I am not very into CDI business but here are some solutions: - upgrade Weld to 2.1.0 in Glassfish 4, if this is possible. The exception is caused by a bug in Weld 2.0.x - use Wicket 6.9.0. This will work unless you use @Inject in anonymous Wicket components. I personally never thought about this pattern before Wicket 6.9.1. I guess you don't use it too - Wicket 6.13.0 will bring wicket-cdi-1.1 module. But again it will work only if you use it with Weld 2.1.x On Wed, Dec 4, 2013 at 5:01 PM, Diogo Casado diogocas...@gmail.com wrote: Hello guys.. I'm setting up a Glassfish4 environment with wicket 6.12.0 and I previously started using cdi to inject entity managers. On Tomee, cdi was working but I decided that this particular application will need a more robust JavaEE server (specially because of OpenJPA slow pace). Anyway.. I'm getting warnings everywhere and specially this exception that just broke the app: WELD-70 Simple bean [EnhancedAnnotatedTypeImpl] class comLoginPage$1 cannot be a non-static inner class The offending class is basically a anonymous Form.. I conclude that any anonymous class would cause this. Found this ticket: https://issues.apache.org/jira/browse/WICKET-5264 I guess it happened before and was fixed in v6.9.0 but I'm still facing this issue with v6.12.0. So basically.. what's the best option: - Apply some fix to this situation; - Stick with a JavaEE6 with Glassfish3 while using v6.x + cdi and in near future go for JavaEE7 Glassfish4 + Wicket v7.x cdi 1.1 (when ready) - Should I forget cdi =\ I appreciate guidance. 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
Generic busy indicator - override for AjaxSelfUpdatingTimerBehavior
Dear wicket users, We are using the Generic busy indicator found on the wiki to have a busy indicator for every ajax event. https://cwiki.apache.org/confluence/display/WICKET/Generic+Busy+Indicator+%28for+both+Ajax+and+non-Ajax+submits%29# In that article on the wiki, it's also described how to override that functionality for a specific ajax event. /var clickedElement = (window.event) ? event.srcElement : eventData.target;/ Afterwards the clickedElement can be checked to see if the indicator needs to be shown or not. This is all working fine, but now we have a case where we want to use AjaxSelfUpdatingTimerBehavior. Then we have no clickedElement. Would somebody have an idea on how it's possible to retrieve the element that needs to be updated in the javascript functions for busy indicator? Thanks !! Kind regards, Marieke -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generic-busy-indicator-override-for-AjaxSelfUpdatingTimerBehavior-tp4662800.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