0

zk10FL integration with springboot

asked 2022-04-28 09:19:24 +0800

wastemails gravatar image wastemails
130 1 2

zk10 looks very good, Please share how to integrate with spring boot also

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2022-04-29 18:00:30 +0800

MDuchemin gravatar image MDuchemin
2480 1 6
ZK Team

Hey there,

ZK 10 is currently still in development phase. The two projects provided with the recent articles are technology demonstrations, and I'd recommend waiting for the actual tutorial projects before doing integration.

Which feature do you plan on testing in a spring-boot project?

Client-side MVVM is pretty easy to test, you can start from the zk springboot project demo of your choice, and then just update the ZK version of the graddle / maven build file to the current ZK 10 FL, and the relevant depedencies:

<dependency>
            <groupId>org.zkoss.zephyr</groupId>
            <artifactId>zephyr</artifactId>
            <version>${zk.version}</version>
        </dependency>
        <dependency>
            <groupId>org.zkoss.zephyr</groupId>
            <artifactId>zephyr-ex</artifactId>
            <version>${zk.version}</version>
        </dependency>
        <dependency>
            <groupId>org.zkoss.zk</groupId>
            <artifactId>zkmax</artifactId>
            <version>${zk.version}</version>
        </dependency>

Once your project is configured, it's just a matter of switching the default BindComposer on your ViewModel binding with a org.zkoss.zephyrex.bind.ClientBindComposer

<div apply="org.zkoss.zephyrex.bind.ClientBindComposer" viewModel="@id()@init()" ...

For the cloud-native feature, the setup is slightly more complicated. I'd recommend waiting for the tutorial on that one. Not only because of the setup, but also because these features are still under development, and you may need to redo it once the final version is out.

The steps required to use this feature under current FL are: - Setup a zk spring-boot project. - Add the zephyr dependencies - Add the configuration for the new DispacherRichletFilter (which process the StatelessRichlet). Should look like:

FilterRegistrationBean reg = new FilterRegistrationBean(new DispatcherRichletFilter());
        reg.addInitParameter("basePackages", "foo.bar.your.package.here");
        reg.addUrlPatterns(richletFilterMapping);

Then you'd need to setup the relevant @getMapping in your application to target the Richlets declared in your project.

link publish delete flag offensive edit

answered 2022-04-30 10:45:01 +0800

wastemails gravatar image wastemails
130 1 2

updated 2022-04-30 10:46:52 +0800

Thankyou, is it possible to configure "org.zkoss.zephyrex.bind.ClientBindComposer" for entire project as default composer instead of writing in each viewmodel?

link publish delete flag offensive edit

answered 2022-05-02 18:14:35 +0800

MDuchemin gravatar image MDuchemin
2480 1 6
ZK Team

Oh yes, absolutely. If you want to switch the ClientBindComposer project-wide, there will be a library property to set in zk.xml for that.

If you had a chance to check-out the smalltalks, the performance test project explains how to do so in its readme file: https://github.com/zkoss-demo/zk10-performance-test

Same warning as per previous post: The features are still in development, so I'd recommend waiting for the stable release, as there might be updates to the APIs or configuration from here to release.

There are some limitations on the structures that can be transformed from the default BindComposer to the ClientBindComposer. You can definitely test it out, but if you encounter exceptions while testing, I'd recommend keeping an eye out for the later article explaining how to optimize the MVVM structures for client-side MVVM

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2022-04-28 09:19:24 +0800

Seen: 16 times

Last updated: May 02 '22

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More