0

ZKSprintBoot Project For Both SpringBoot jar and war file deployment

asked 2023-01-05 23:16:21 +0800

mjrother gravatar image mjrother
1 1

updated 2023-01-06 22:02:10 +0800

From the documentation from the zpspringboot project, it appears that the only differences between a war file and a springboot jar file deployments are the <packaging> tag in the pom.xml and the property "zk.springboot-packaging" in the application.properties.

According to the documentation : General resource folders are: src/main/resources/static Spring Boot's resource folder src/main/resources/web ZK's class-web-resource folder

This appears to work for for the spring jar file deployment. However, when I try the war file deployment it appears to look in the main/webapp dir instead. So it appears I am not understand the view resolvers. I am also not totally clear on the need for the @GetMapping methods.

for example, I took the file "minimal.zul" from the example program. I added a mapping

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

I placed the file in the /src/main/webapps it works file. If I place in the /src/main/resources/web the browser displays /minimal.zul

So I guess the question is : Is there a configuration that would allow war file deployments to load zul files from /src/main/resource/web (instead of /src/main/webapp) like spring boot jar file deployments?

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-09 21:43:07 +0800

hawk gravatar image hawk
3073 1 5
http://hawkphoenix.blogsp... ZK Team

updated 2023-01-10 09:17:51 +0800

If the packaging is jar, there is no context folder, so you need to put zul under src/main/resources/web. We follow spring boot's way.

But if the package is war, then you should put zul files under src/main/webapp (Java EE specification). To load a file in src/main/resources/web with this packaging, please refer to Classpath Web Resource Path. By default, there is no way to directly visit a zul under Classpath Web Resource Path with a browser.

link publish delete flag offensive 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

RSS

Stats

Asked: 2023-01-05 23:16:21 +0800

Seen: 11 times

Last updated: Jan 10

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