0

Using a div selector opens a error page

asked 2023-04-14 17:18:15 +0800

rmalik gravatar image rmalik
31 2

At the moment we have build a webapp with the ZK framework. We have a page that consist about multiple listboxes containing data. Our use case is to select items from left to right and select a provider (top right) and create a shipping label. At the last step of the use case we use a selector to choose delivery mode from the listbox.

Here is how the selector is styled in the .zul overview:

<div sclass="input-group" refFields="CarrierOptionCode,CarrierOptionDescription,CarrierOptionCode|CheckEmptyCarrierDelivery" targetRow="@load(vm.selectedPackedCollo)" carrierNr="@load(vm.selectedPackedCollo.field('CarrierNr'))" use="nl.wics.nextgen.webui.util.components.carrier.CarrierOptionSelector" >
    <textbox value="@load(vm.selectedPackedCollo.field('CarrierOptionDescription').value)" width="100%"/>
    <span class="input-group-btn">
        <h:a class="btn btn-md btn-default" style="height:32px;">
            <n:i class="fas fa-search" />
        </h:a>
    </span>
</div>

When opening the selector it opens the following code:

final HashMap<String, Object> map = new HashMap<String, Object>(); 
map.put( "selector", comp ); 
map.put( "carrierNr", getCarrierNr() ); 
Util.createComponents( Util.getPage("/carrier/carrierOptionLookup.zul"), map );

When it succeeds succesfully, it displays like the following image: image description

The carrierLookup.zul fetches a dataset from the backend and populates a listbox.

However, our end to end users execute the above use case and when opening the selector, sometimes a empty windows appears with the following message: HTTP status 404 not found, and it displays in a style with a tomcat error page, as below:

image description

A work around is to refresh the page (with F5). The downside is that the end user has to open the menu item and do all the previous steps to continue.

These are the technologies that we are using: ZK CE version 9.6.0.2, Spring framework version 5.2.22 and Tomcat version 7.0.76

Is in possible that someone can point us in the right direction?

delete flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
0

answered 2023-04-21 14:59:52 +0800

MDuchemin gravatar image MDuchemin
2560 1 6
ZK Team

updated 2023-04-21 18:56:04 +0800

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

Hey there,

The things I would check in order are:

Is the new window opened as a new browser window? Or does it replace the content of the current window? If it replaces the content of the current window, there is a chance that a navigation event has occured. A navigation event might be triggered by an expired ZK session, an expired security token (if you are using a security layer such as spring security), or by a response sending a navigation command.

Is this new page / URL something you open on purpose? Or is it open automatically, and you currently don't know why? The URL in the new window looks like an authentication / login thing. You may have a security layer in your application that intercepts specific requests.

If you are not opening this URL on purpose, then something must be opening it for you. I recommend using the browser developer tools > network panel. In the network panel, after you were able to reproduce the issue, check for any response which may contain code such as window.open, or containing this URL. If you find which response triggers this window, then it will be easier to identify why it is opened.

Lastly, I'd recommend checking the tomcat logs, to see if you find any error which could have caused a 404 response. I think most tomcat errors should end up causing an error page with something like "internal error" rather than 404, but if something goes wrong early enough, it is possible that no servlet is actually listening to this URL.

link publish delete flag offensive edit
0

answered 2023-05-03 20:02:59 +0800

rmalik gravatar image rmalik
31 2

updated 2023-05-03 20:03:22 +0800

Hi MDuchemin,

Thanks for your response. It should just open a window, like in the example (first image) with a dataset. It now opens a new window with the tomcat error. We really do not know which is triggering this. Thanks for the help, we will try and investigate further. The odd thing is that of all our customers just one experiences this behavior.

Kind regards,

Remie

link publish delete flag offensive edit
0

answered 2023-05-09 20:52:29 +0800

MDuchemin gravatar image MDuchemin
2560 1 6
ZK Team

In that case, I'd recommend you keep the browser dev tools opened while the application is in use. Once you see the window open, check the content of the last /zkau response, to see if there is anything susceptible to open the new window in the server response.

link publish delete flag offensive edit
0

answered 2023-05-25 18:07:01 +0800

rmalik gravatar image rmalik
31 2

Hi MDuchemin,

We are now a little closer.

When this issue appears we get the following message in the browser:

image description

We also have the zkau message:

dtid: zY8VwzjKtILJ8wMy2kkF-XA cmd0: onClick uuid0: cEkRm40 data0: {"pageX":1661,"pageY":204,"which":1,"x":17,"y":12} cmd1: setAttr uuid1: cEkR61 data1: {"":["value",""]} cmd2: onChange uuid2: cEkR61 data2: {"value":"","start":0}

And furthermore our security.xml of spring has the following setting:

image description

Maybe you can help us track down the issue? When i login with a chrome tab and incognito window i log, the other user out in ZK (as expected). It seems that Spring might expire the session from itself?

link publish delete flag offensive edit
0

answered 2023-05-26 18:27:17 +0800

MDuchemin gravatar image MDuchemin
2560 1 6
ZK Team

Hi there,

Thanks for the screenshot, it's a good start. The message is indeed specifically from spring-security.

From ZK's point of view, it looks like it is requesting a page called secure/wics/main.zul, then receives an non-ZK string of text (which looks like a default session expiration message) instead of ZK content.

I cannot tell you why spring-security is expiring the session though. To note, the error message is sent by spring security before the request even reaches ZK's servlet, so ZK itself doesn't have any information that a request was sent.

You could try to setup a spring listener to catch session destroyed events and log them.

https://docs.spring.io/spring-security/site/docs/4.0.1.RELEASE/apidocs/org/springframework/security/core/session/SessionDestroyedEvent.html

https://stackoverflow.com/questions/41685991/login-and-logout-event-doesnt-fireup-in-spring-security/41752556#41752556

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
1 follower

RSS

Stats

Asked: 2023-04-14 17:18:15 +0800

Seen: 21 times

Last updated: May 26 '23

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