on 04-06-2011 10:20 AM
hi experts,
Can you please explain how to use "substitution variable" in webdynpro java. I am using CE7.2 NWDS. I shall appreciate if you can share some code sample. Thanks
Hi Pramod,
First of all go to Resource->WEB-INF-Web.xml folder of your DC.
In web.xml create env-entry. To create env-entry use following tag in the source code of the xml.
<env-entry>
<description><DECRIPTION></description>
<env-entry-name><ENV_NAME></env-entry-name>
<env-entry-type><ENV_TYPE></env-entry-type>
<env-entry-value><${<SUBTITUTION_VARIABLE_NAME>}></env-entry-value>
</env-entry>
ENV-TYPE should same as type of substitution variable. Ex: java.lang.String
Now you can get value of Subtitution Variable using following code in your java code.
String VARIABLE_NAME= "java:comp/env/ENV_NAME";
InitialContext ctx = new InitialContext();
String SUBTITUTION_VARIABLE_VALUE= (String) ctx.lookup(VARIABLE_NAME);
I hope it helps.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
fyi, I have moved this thread to wd4java forum
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello pramod
I see that you have not recieved any replies to your question.
Can you provide anymore information about the problem that you are experiencing which may help get some replies?
Thanks
Kenny
Moderator
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.