0

Executing jsp from within a ZK JS widget

asked 2012-10-05 02:39:37 +0800

Fujitsu gravatar image Fujitsu
117 2

updated 2012-10-05 04:52:55 +0800

Hi All,

We have been working on an OpenLayers ZK widget component and we have nearly got it to work.

But our client has complained about the mixed content with https and http, due to our site is https and we are accessing the map tiles from a http. I have found this solution:

http://gunnicom.wordpress.com/2010/10/14/redirect-from-https-to-http-works-for-tiles-from-openlayers/

Which I am trying to convert to jsp:

<%
  String x = request.getParameter("x");
  String y = request.getParameter("y");
  String z = request.getParameter("z");

  String[] server = new String[3];
  String url = "";
  
  server[0] = "a.tile.openstreetmap.org";
  server[1] = "b.tile.openstreetmap.org";
  server[2] = "c.tile.openstreetmap.org";
    
  url = "http://"+server[0];
  url += "/" + z + "/"  + x + "/" + y + ".png";

  response.setStatus(response.SC_MOVED_PERMANENTLY);
  response.setHeader("Location", url);
%>

But I need to run this jsp from within the ZK widget:

      var redirectURI = zk.ajaxURI("web/js/openstreetmap/tileRedirect.jsp?z=${z}&x=${x}&y=${y}", { au : true });
      var osmLayer = new OpenLayers.Layer.OSM("Mapnik", redirectURI);

I have to use zk.ajaxURI and the client finds tileRedirect.jsp but it doesnt execute, when I go directly to the jsp (http://127.0.0.1:8080/openstreetmap/zkau/web/js/openstreetmap/tileRedirect.jsp?z=4&x=0&y=10) it out puts the jsp code instead of running the jsp!!!

Any ideas on how to fix this?

Thanks!

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2012-10-08 09:42:24 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

I don't completely understand your implementation but looking at ajaxURI API I think since it is a jsp then it should go through servlet lifecycle rather than zk update engine so instead of { au : true } I would use { au : false }. Did you try that?

link publish delete flag offensive edit
Your reply
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: 2012-10-05 02:39:37 +0800

Seen: 89 times

Last updated: Oct 08 '12

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