0

ZK SpringBoot 2.5.3, zkspringboot-demo-jar project, zhtml extension is not working.

asked 2021-08-26 22:40:04 +0800

franferri gravatar image franferri
48 2

updated 2021-08-26 22:59:50 +0800

Hello

ZK SpringBoot 2.5.3, zkspringboot-demo-jar project, zhtml extension is not working.

I have placed my .zhtml in the resources/web/zul website where the .zul files are. I have created the following mapping (in the DemoApplication.java file):

@GetMapping("/html")
public String htmlExample() {
    return "html";
}

Why is not picking it?

the demo application.properties files shows:

zk.zul-view-resolver-prefix=/zul

How do we use in Springboot demo project zhtml files?

thanks!

Update with more data: I run the server with:

./mvnw clean package -DskipTests;
./mvnw spring-boot:run

Maybe this is a limitation due the current implementation, and only will work using a .war in a webserver instead of running the .jar (with embedded tomcat):

Can anybody help me? Thanks!

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2021-08-27 11:20:39 +0800

cor3000 gravatar image cor3000
6280 2 7

short answer: The DHtmlLayoutServlet which handles both .zul and .zhtml pages is not available in a jar deployment. The DHtmlUpdateServlet can only handle .zul files .zhtml files cannot be processed right now. For now you have to use the war-deployment method for full backwards compatiblity with existing zk applications, include .zhtml support.

Long answer:

Why is not picking it? The view resolver can be configured to pick up zhtml files by specifying a different view resolver suffix, the prefix is irrelevant there and can be anything that matches your folder structure.

zk.zul-view-resolver-suffix=.zhtml

Then the view resolver will zhtml files. However there's a shorter way to verify this by just using the explicit URL to the servlet directly, no need to go through spring-mvc's dispatcher servlet.

e.g. http://myserver:8080/zkau/web/zul/html.zhtml

The problem now is what I described above... the zhtml file is not parsed/processed and returned as plain text instead ... which is of course useless.

Further it's possible to also configure the ZumlExtendlet (handling zul files, via /zkau/web/*/.zul) also for zhtml files. But that isn't supported/working right now (possibly never considered a use case) and leads to an exception. ---> That means back to war-deployment.

I posted a new Feature Request: ZK-5007 to enable handling .zhtml files through the DHtmlUpdateServlet to allow this configuration in a jar deployment as well.

Once that's available, I can also implement an auto-config option for ZK Spring Boot (I am the maintainer of zkspringboot).

link publish delete flag offensive edit

Comments

cor3000 many thanks for all the details. Delightful. I'm using 100% spring boot auto-config, quite nice. I think if is possible to enable all the options for the .jar too will be amazing, so, for developers is a no brainer.

franferri ( 2021-08-27 21:56:41 +0800 )edit

yes I agree that would be great, I don't think this FR will get the highest priority since (most zhtml scenarios can be also represented as zul files). Anyway you can watch/vote for the ticket in JIRA and I'll keep you updated here.

cor3000 ( 2021-08-30 11:45:12 +0800 )edit
0

answered 2022-02-05 21:35:03 +0800

franferri gravatar image franferri
48 2

I have seen no traction in the issue so far ZK-5007,

Just to add some more data, having zhtml support for my current organization will make ZK more sellable, despite a few demos I did, the fact the frontenders see the .zul based as in android ui's in xul, makes them be quite annoyed. This is a very subjective matter. But having a zhtml will let me start with the xhtml namespace without the <zk> tag by default required in the .zuls and will allow me to make direct examples from html to java events.

From .html to java events for us, back people, makes this really sellable.

Please consider it, I hope we get this simple upgrade if possible as cor3000 describes.

Manythanks

link publish delete flag offensive edit

Comments

Thank you for your additional input, we will take it into consideration when reviewing the feature. Schedule-wise, based on the current release plan, if a new feature is decided, it will most likely go to the next major version ZK 10 (scheduled for later this year).

jeanher ( 2022-02-09 09:55:49 +0800 )edit

If it is an urgent request, please contact us at [email protected] for a custom arrangement.

jeanher ( 2022-02-09 09:57:00 +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: 2021-08-26 22:40:04 +0800

Seen: 7 times

Last updated: Feb 05

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