Revision history [back]

click to hide/show revision 1
initial version

asked 2018-04-17 22:43:10 +0800

guiperg gravatar image guiperg

How to get web application attribute in javascript?

Hello, I have a java class that implements WebAppInit and sets an attribute to zk's WebApp object.

I'm able to recover this attribute in a .zul page using EL and if I create a script tag I can use it without problems:

<script>
zk.afterMount(function(){
    alert("${applicationScope.profile}");
});
</script>

But the problem is that I want to put this script in a .js file and when I do this the EL is not processed.

Is there a way to achieve this? I doesn't need to be with EL, it could be using a ZK javascript object or something like that.

Thanks in advance!

How to get web application attribute in javascript?

Hello, I have a java class that implements WebAppInit and sets an attribute to zk's WebApp object.

I'm able to recover this attribute in a .zul page using EL and if I create a script tag I can use it without problems:

<script>
zk.afterMount(function(){
    alert("${applicationScope.profile}");
});
</script>

But the problem is that I want to put this script in a .js file and when I do this the EL is not processed.

Is there a way to achieve this? I It doesn't need to be with EL, it could be using a ZK javascript object or something like that.

Thanks in advance!

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