-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi ZK,
The zk-spring-boot example at https: //github.com/zkoss-demo/zk-spring-boot doesn't have webapp folder, which is the de-facto folder for containing front end files, i.e. css, images, zul, ...
Is that really the intention of best practice or an oversight, or work in progress?
Am I right to assume /src/main/resources/web plays the role as webapp folder from now on for ZK spring boot?
If I am going to start a new ZK project using spring boot, is it a good ZK practice to use zk-spring-boot as a starter template?
How to configure web app domain name?
In old way, nothing under webapp/web-inf/ folder can be accessed directly hence secured automatically. What's the equivalent in the zk-spring-boot example?
Thanks,
Sam
Spring boot comes in different deployment modes.
War file or jar file (maybe more but those are the 2 basic ones). If you are creating a war-file you can keep putting your resources into the webapp folder which is as you say the de-facto standard web-applications following the servlet standard. Then you can deploy your war file in a tomcat/jetty/wildfly as before. Also the default way to configure your ZK application will work as before.
However when building a self contained, executable jar file (which contains an embedded jetty/tomcat), you are somewhat leaving the "de-facto" standard and enter the spring boot world. Inside the jar file (as far as I figured out - corrections are welcome) you cannot use an old fashioned webapp and WEB-INF folder and configuration is mostly done in Java. Additional ZK configuration can be loaded from multiple sources and WEB-INF/zk.xml is not the only location ZK looks for (metainfo/zk/zk.xml will do as well).
In a similar way ZK has a mechanism to load resources from the classpath below the web folder (e.g. used with ZK's themes and js files). So you can put resources you need for your ZK application there.
Spring boot has its own convention also shown in the example project - the static/ folder which (IMO) serves the purpose of the classic webapp folder.
I haven't found direct documentation on what the exact equivalent of WEB-INF is in a spring boot application.
Basically everything in your classpath (src/main/resources) will be hidden unless it is exposed otherwise by either spring convention "static/"-folder or ZK convention "web/"-folder.
Before using Spring boot you should have a clear understanding of what Spring boot is doing "under the hood". The example merely explains how ZK can be used on top of the default Spring boot web app auto-configuration.
Asked: 2018-04-13 06:21:59 +0800
Seen: 36 times
Last updated: Apr 22 '18
[Announcement] ZK 8.5.1 is now available!
Highlight new release changes/new features in demo app
How can I make a button change its image by clicking on the same button?
Problems calling function 'sec:isAnyGranted' with zkspring 3.2 and Spring Security 4
Can I set in runtime a new value to library property: org.zkoss.zk.ui.processMask.enabled:
Package ZK Eclipse Tomcat Project For Deployment
AImage org.zkoss.zk.ui.UiException: java.io.FileNotFoundException
There is nothing wrong with spring boot. The example is a jar, but you can still make a project the old way with spring boot, meaning a war and default folders. Like this you can deployment it on other servers to
chillworld ( 2018-04-13 12:15:59 +0800 )edit