0

initArgs / ServletContext

asked 2007-01-18 08:52:37 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4109152

By: oniseijin

I can't seem to manage to get the variables I have set with initArgs.

The documenation points me to use applicationScope, but the variable I set in web.xml or servlets.properties does not show up.

So, basically, how do I go end to end from a variable in web.xml or servlets.properties and retrieve it within a zscript?

I can see in the zkdemo-all that there is a i3-label_ja.properties that set's the username, but how is this loaded or accessed in the application later on?

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2007-01-18 15:13:30 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4109674

By: henrichen

I don't quite catch what you ask. Can you provide a "minimum", "working" example code so we can test it here?

/henri

link publish delete flag offensive edit

answered 2007-01-19 00:11:38 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4110710

By: oniseijin

Ok, I'll be a bit more specific, and I'm sure there are more than one way to do this, but I can't get any to work

In the web.xml, I have the following:

<init-param>
<param-name>proxy</param-name>
<param-value>null</param-name>
</init-param>

And then I try an access this in a <zscript>

proxy = applicationScope.get("proxy")

That is what I thought I should do by reading the documents, but it didn't work.

Basically, what I want to know is how to pass servlet level configurations to zscript or other ZK components.

link publish delete flag offensive edit

answered 2007-01-19 01:15:42 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4110763

By: henrichen

proxy = desktop.webApp.getInitParameter("proxy");


/henri

link publish delete flag offensive edit

answered 2009-03-06 23:48:29 +0800

InfoSec812 gravatar image InfoSec812
96

Just to clarify, this only allows access to <context-param> elements. I made the mistake of trying to specify an <init-param> element for the zkLoader servlet and that will not work for this purpose.

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: 2007-01-18 08:52:37 +0800

Seen: 199 times

Last updated: Mar 06 '09

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