0

zk + spring boot + change theme

asked 2018-05-23 16:22:58 +0800

SebastianG gravatar image SebastianG
3 1

Hi all,

i set up a simple zk + spring boot application according to the guide.

Everything works fine. Now i just wanted to change the default 'iceblue' theme to for example silvertail. I followed the zk and theme instructions and copied the silvertail jar into the resources/metainfo/zk/lib folder (not WEB-INF/lib because of spring boot ?!) and added the preferred theme to the zk.xml.

But it does not work. Are there some other changes needed to change the theme in an spring boot application environment?

Thanks Sebastian

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-24 18:08:08 +0800

cor3000 gravatar image cor3000
6280 2 7

When adding a theme you need to make sure the library is added to the classpath at runtime. This is spring-boot specific and spring is not aware of anything you put into metainfo/zk/lib, neither does ZK do anything about this folder.

The natural way with maven/gradle is add the theme jar as a dependency instead of copying jar files manually.

gradle: add to build.gradle

compile "org.zkoss.theme:silvertail:${zkVersion}"

maven: add to pom.xml

<dependency>
    <groupId>org.zkoss.theme</groupId>
    <artifactId>silvertail</artifactId>
    <version>${zk.version}</version>
</dependency>

and set the preferred theme library property to zk.xml

<library-property>
    <name>org.zkoss.theme.preferred</name>
    <value>silvertail</value>
</library-property>
link publish delete flag offensive edit

Comments

what happens, if i have a custom theme that i build, how can i configure that theme in a spring boot project?

jsanti39 ( 2021-11-02 02:52:55 +0800 )edit

in the same way, just add the theme jar to the classpath, and set the library property with the theme name

cor3000 ( 2021-11-04 18:10:32 +0800 )edit
Your answer
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
2 followers

RSS

Stats

Asked: 2018-05-23 16:22:58 +0800

Seen: 23 times

Last updated: May 24 '18

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