0

Page of included template not found when try to forward from index

asked 2019-09-23 15:32:57 +0800

BrickWithGlasses gravatar image BrickWithGlasses
103 2

I use Spring for getting access to my zul files in WEB-INF directory.

And all worked until I used template on my pages.

Now when forward from index.zul using <?forward uri = "console/clients"?> exception occure:

org.zkoss.zk.ui.UiException: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.zkoss.zk.ui.UiException: Page not found: /template.zul

index.zul

<zk><?forward uri = "console/clients"?></zk>

template.zul

<div>
    <include hflex="1" src="include-menu.zul"/>
</div>

<div self="@{insert(pageContent)}"/>

Actually if I add template.zul to index using <?init class="org.zkoss.zk.ui.util.Composition" arg0="/WEB-INF/zul/template.zul/>" than I have exception

org.zkoss.zk.ui.UiException: Page not found: /include-menu.zul

and arg0="/WEB-INF/zul/include-menu.zul" in index.zul does not help with this exception

include-menu.zul

<div apply="org.zkoss.bind.BindComposer" viewModel="@id('vm') @init('dynamicdemoadmin.viewmodel.MenuModel')">
    <menubar id="mainMenu" orient="horizontal">
        <menuitem label="profiles" ...
    </menubar>
</div>

client-profiles.zul

<?init class="org.zkoss.zk.ui.util.Composition" arg0="template.zul"?>
<zk>
<div self="@{define(pageContent)}">
    <div apply="org.zkoss.bind.BindComposer"...
delete flag offensive retag edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-09-24 10:38:29 +0800

cor3000 gravatar image cor3000
4791 2 7
ZK Team

I can't really follow your descriptions, somehow it sounds like a very complicated way to achieve something simple. Distracting from the actual problem (relative vs absolute paths and how/where they are resolved)

1) do you really need an index.zul file just to do a forward? If you are using spring (MVC?) you can just configure entry points directly. No need to go through ZK servlet -> forwarding to spring dispatcher servlet -> forwarding again to a zul page ... I am sure there's a simpler more direct way.

2) Can you reproduce this without involving Spring? (Might help to reproduce this on our side to test the scenario)

3) also please provide some information where all your files are located in you webapplication. Right now it's hard to visualize your case.

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: 2019-09-23 15:32:57 +0800

Seen: 5 times

Last updated: Sep 24

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