Giter VIP home page Giter VIP logo

zkspringboot's Introduction

ZK - Spring Boot

License

(Adapted from Dirk's amazing zk-spring-boot-starter - Thanks a lot for the input and ideas!)

Getting started

Configuration options (for Spring Boot style application.properties)

Defaults as in ZkProperties.java

zk.springboot-packaging=jar

zk.homepage=
zk.zul-view-resolver-enabled=true
zk.zul-view-resolver-prefix=
zk.zul-view-resolver-suffix=.zul

zk.richlet-filter-mapping=

zk.websockets-enabled=true
zk.servlet3-push-enabled=true
zk.update-uri=/zkau
property default example(s) description
zk.springboot-packaging jar war/jar package as jar or war file
zk.homepage null home/main when set will setup a @GetMapping for "/" to return the configured view-name
zk.zul-view-resolver-enabled true true/false enable/disable InternalViewResolver for zul files
zk.zul-view-resolver-prefix empty /zul prefix prepended to a view name (i.e. a folder inside the web resource package on the classpath)
zk.zul-view-resolver-suffix .zul .zul/.zhtml usually .zul does what you need
zk.richlet-filter-mapping null /richlets/* filter-mapping string as the basepath for richlets
zk.websockets-enabled=true true true/false enable/disable websockets (available in ZK-EE)
zk.servlet3-push-enabled=true true true/false enable/disable servlet3 CometServerPush (available in ZK-EE)
zk.update-uri /zkau /mypath configure servlet path for ZK's Update Engine (rarely used)
zk.resource-uri null /zkres configure/enable separate servlet path for ZK's Resource Engine (since ZK 9.5.0)

zk.homepage

Shortcut configuration to enable a Spring MVC Controller with a @GetMapping for the root path '/' returning the configured view name. (disabled by default). The default zul-view-resolver config will prepend the the servlet mapping for ZK's update engine (default /zkau) and append the .zul-extension to locate the zul file in your application.

zk.zul-view-resolver-*

Defines a simple InternalViewResolver resolving view names to zul files inside the class-web package (not required but still possible for war packaging)

The defaults above have the following effect, given the get mapping:

	@GetMapping("/demo")
	public String demo() {
		return "views/demo";
	}

Resolves to /zkau/web/views/demo.zul ZK's UpdateServlet will locate the file on the classpath e.g. in src/main/resources/web/views/demo.zul A configured prefix e.g. /myprefix will be inserted before the view name: /zkau/web[/myprefix]/views/demo.zul

zk.richlet-filter-mapping

Enables ZK's RichletFilter. The value has to be a servlet filter mapping such as: /richlet/* Requires additional richlet-mappings configured in zk.xml.

zk.resource-uri

Registers and enables ZK's Resource Engine. When packging as war file this will also set the necessary init-parameter for the ZK Loader Servlet

Using springboot-devtools (restart)

When using the restart feature of spring-boot-devtools make sure to include the ZK jars in the restart process by customizing the Restart Classloader.

Create a file on the classpath:

src/main/resources/META-INF/spring-devtools.properties

restart.include.zklibs=/z[\\w]+-[\\w\\d-\.]+\.jar

This regex will match all jar files matching the expression e.g. zk-9.5.1.jar or zul-9.5.1.jar etc.

zkspringboot's People

Contributors

cor3000 avatar hawkchen avatar klauswr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.