Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZKSpringBoot HomePage Isnt Being Used #36

Open
mrother-stoneriver opened this issue Oct 3, 2023 · 4 comments
Open

ZKSpringBoot HomePage Isnt Being Used #36

mrother-stoneriver opened this issue Oct 3, 2023 · 4 comments

Comments

@mrother-stoneriver
Copy link

I have a web application based on ZKSpringBoot. I am deploying as a war file in tomcat. If I hit the login page directly, I see the login and the application works fine. However I am having problems when I try the root URL "/". I look at the tomcat access logs and see the access for URL "/". If I set a breakpoint in the FilterChainProxy, the request URL is "index.zul". So somewhere the request is being converted from "/" to "index.zul" I looked at the ZKSpringBoot code and cant find where that is happening.

When I specify the zk homepage the property to zk.homepage=login and hit the root URL in the browser, I see in the filter chain that it is mapping it to /index.zul.

I tried setting the property to zk.homepage= and add a mapping to the Controller but see no difference.

@RequestMapping("/") public String home() { return "login"; }

I tried disabling both zk.homepage and request mapping and added a welcomepage but again no difference.

Has anyone else observed this issue or have a possible solution?

@cor3000
Copy link
Contributor

cor3000 commented Oct 3, 2023

To be sure it's not the default zk spring boot view resolver you can disable it via

zk.zul-view-resolver-enabled=false

Next it sounds like a spring security redirect taking effect before reaching your application. RequestMapping. Since you didn't mention that, I can only guess.

Maybe it's just the default redirect mentioned here https://stackoverflow.com/questions/68082468/spring-security-change-login-default-path

@mrother-stoneriver
Copy link
Author

mrother-stoneriver commented Oct 3, 2023

I changed the view-resolver to false and still see same behavior (forwarding to /index.zul). I have checked our code everywhere for /index.zul and cant find anywhere. I even disabled spring security (made all the URL's permitAll()) and see same behavior. But I agree, something is intercepting and changing the request URL. The access log does not show any additional requests from the browser side.

@cor3000
Copy link
Contributor

cor3000 commented Oct 5, 2023

then the only thing I offer is too run and look into your application configuration directly... can you share a zip file or github repo I can unzip/checkout locally to see where the internal forward/redirect happens?

@cor3000
Copy link
Contributor

cor3000 commented Oct 5, 2023

another idea coming to mind is ... since you're using a war file deployment, could it be you have a <welcome-file-list> configured in your web.xml?

In case you are using the zkwebfragment dependency for automatic zk-servlet/listener configuration you might unknowingly inherit the default from there:

https://github.com/zkoss/zk/blob/011040eb4c33cf90cedde08f641fbc4ee29a5247/zkwebfragment/src/main/resources/META-INF/web-fragment.xml#L68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants