-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi all,
I am studying the code from 'ZK Spring Boot' from ZK demo and have question about the URL used to load image using <image>.
To be exact, the file resources.zul has code for loading image and I don't understand how it works.
* The uri "/" used in <image> seems to be hard coded to load image from /src/main/resources/static/ in ZK framework.
Example:
<image src="/img/zklogo1.png" width="100px"/>
* The uri "~./" used in <image> seems to be hard coded to load image from /src/main/resources/web/ in ZK framework.
Example:
<image src="~./img/zklogo3.png" width="100px"/>
Am I right in the above assumptions or am I missing some config somewhere?
Thanks, Sam
I wouldn't say hard coded, but it's the default resource folders in both frameworks.
spring boot uses the static
package ( and files/folders below )
zk uses the a different the web
package ( and files/folders below ) in ZK called: class-web-resource (CWR)
This example is targetting developers experienced with both ZK and Spring Boot. The resource.zul case simply shows how both springs and zk's default mechanism still work side-by-side.
Since a spring boot application doesn't need/have a classical WebContent folder you need a place to put your resources. So I gave 2 options ... the Spring guys maybe prefer the spring way, ZK experienced developers might like to keep their existing class-web-resource structure.
So yes your observation is right, there are 2 parallel ways to serve resources. 2 Frameworks, 2 Ways.
Asked: 2018-03-15 07:20:35 +0800
Seen: 18 times
Last updated: Mar 15 '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
webapp folder of ZK spring boot?
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