-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am looking for a way to link from an HTTP page to HTTPS page without specifying the absolute path in an href. If anyone has any ideas on this, especially if there are utilities in ZK that would help, I'd appreciate hearing about it.
Thanks,
Scott
You can use the OnClick event and inside this event make the redirection
... public void onClick$yourBtn(Event event) throws Exception { // redirect Executions.sendRedirect("/yourNewPage.zul"); }
Regards
Stephan
sreed,
I think you have to use absolute path cause you change the protocol from http to https of a url...
You're correct, Dennis, but I'd prefer not hard-coding the absolute path in the zuml code so I don't break it if I move the files around. One approach I considered is to obtain the absolute path of the HTTPS page and then construct the absolute path for the link to the HTTP link on the fly and not have to hard-code an absolute path in the zuml code.
Can anyone tell me how to get the absolute path (relative to ROOT) of the current page?
no direct api to do this in servler/zk I think , but you can do it by a simple util api isn't it.
in jsp , you do
String uri = request.getRequestURI(); if (request.getQueryString() != null) { uri += '?' + request.getQueryString(); } URL url = new URL(request.getScheme(), request.getServerName(), request.getServerPort(), uri);
in url , construct this in first request(not ajax request) , keep it in desktop.
Asked: 2009-02-23 16:48:21 +0800
Seen: 554 times
Last updated: Feb 25 '09