0

Spring boot, jar, URLs of *zul

asked 2019-10-25 17:01:44 +0800

Evgenic gravatar image Evgenic
14 3

Hello,

zkVersion = 8.6.2; zkspringboot-starter, version: '1.0.4;

I have some files '.zul' in folder 'resources/web'. But URL becomes as 'http://localhost:8080/zkau/web/c931702b/*.zul'.

In application.yml I have

zk:
  homepage: index

then 'http://localhost:8080' is opening 'index.zul'. It is OK. But how to open other *.zul directly? What is 'c931702b'? Can I change this? Maybe I can map 'zkau/web/c931702b' in some way as something more simple?

I have to open 'onepage.zul' directly by direct URL but I do not understand how to create the link for that.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-28 11:14:01 +0800

cor3000 gravatar image cor3000
4887 2 7
ZK Team

updated 2019-10-28 12:32:13 +0800

The zk.homepage property is a convenience parameter for single page applications. For multi page applications you have all the possibilities spring mvc offers.

E.g. you can define multiple entrypoints in your application config, and return a string to your ViewResolvers.

In our demo we specify @GetMappings for the entry points "/mvvm" and "/resources" https://github.com/zkoss/zkspringboot/blob/v1.0.4/zkspringboot-demos/zkspringboot-demo-jar/src/main/java/org/zkoss/zkspringboot/demo/DemoApplication.java

(BTW the homepage config does nothing different)

These returned Strings (view-names) are then handled view resolvers. By default the zk.zul-view-resolver-enabled is enabled. And will resolve view-names into urls like /zkau/web/{optional-prefix}/{view-name}.zul

Please also read the related README.md and Spring-mvc documentation (request-mappings, view-resolvers)

I know that's a lot to read but that's what you get when choosing a sophisticated framework as Spring boot. Even though they try to hide the nasty details, you still have to be aware of them in order to understand your application.

link publish delete flag offensive edit

Comments

How to change {optional-prefix}?

Evgenic ( 2019-10-29 22:20:06 +0800 )edit

please read the README https://github.com/zkoss/zkspringboot/blob/master/README.md -->

you can set the following in your application.properties zk.zul-view-resolver-prefix=/somethingelse

cor3000 ( 2019-10-29 23:36:01 +0800 )edit

i hope this didn't sound rude, just had a tough day... if the current documentation is unclear I'll intend to improve it.

cor3000 ( 2019-10-31 10:50:04 +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
1 follower

RSS

Stats

Asked: 2019-10-25 17:01:44 +0800

Seen: 13 times

Last updated: Oct 28

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