[Laszlo-user] relative path in dynamic dataset

Markus Reinhardt markus.reinhardt at stud-mail.uni-wuerzburg.de
Wed Mar 8 03:17:29 EST 2006


ankit rastogi schrieb:
> Here is the coede through which I currently access this servlet.
> This has hardcoded URL and I want to give relative stuff.
>
> <library>
> <dataset name="currentroleds"
> src="http://localhost:8080/gui/FetchRoleServlet" request="true"/>
> <datapointer name="currentroledp" xpath="currentroleds:/*"/>
> </library>
>
> when I try something like http://../../../FetchRoleServlet
> The debugger gives error that
> http://localhost:8080/Contextroot/resources/lzx/common/../../../FetchRoleServlet
> not found.
The easiest way would be something like that:

--------------- global functions.js ---------------
function getBaseUrl() {
  var url = new LzUrl();
  url = LzBrowser.getLoadURLAsLzURL();

  //return whatever you like... i.e. omit path
  return url.protocol + "://"
    + url.host + ":" + url.port + url.path;
}


--------------- Laszlo App ---------------
<datasource name="ds">
  <method event="oninit">
    this.currentroleds.setSrc(getBaseUrl() + 'FetchRoleServlet');
    this.mapserverData.doRequest();
  </method>
  <dataset type="http" name="currentroleds"/>
</datasource>
<script src="global_functions.js"/>


Markus

-- 
My GnuPG public key:
http://pgpkeys.pca.dfn.de:11371/pks/lookup?op=get&search=0x4CFAB28FFB576443
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060308/55f6ea66/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://www.openlaszlo.org/pipermail/laszlo-user/attachments/20060308/55f6ea66/signature-0001.bin


More information about the Laszlo-user mailing list