This content has been marked as final.
Show 2 replies
-
1. Re: [WF.9.0.2.Final] JNDI issues - accessing simple global binding
jaysensharma Jan 11, 2016 2:20 AM (in response to hr.stoyanov)You need to change it as following: [ type="String" => type="java.lang.String" ]
<subsystem xmlns="urn:jboss:domain:naming:2.0"> <bindings> <simple name="java:global/ga" value="true" type="java.lang.String"/> </bindings> <remote-naming/> </subsystem>
CLI Output:
[standalone@localhost:9990 /] /subsystem=naming/binding=java\:global\/ga:read-attribute(name=type) { "outcome" => "success", "result" => "java.lang.String" } [standalone@localhost:9990 /] /subsystem=naming/binding=java\:global\/ga:read-attribute(name=value) { "outcome" => "success", "result" => "true" } [standalone@localhost:9990 /] /subsystem=naming/binding=java\:global\/ga:read-resource(recursive=true) { "outcome" => "success", "result" => { "binding-type" => "simple", "cache" => undefined, "class" => undefined, "environment" => undefined, "lookup" => undefined, "module" => undefined, "type" => "java.lang.String", "value" => "true" } }
My JSP is as following:
<h1>Hello World!!!</h1> <% //To disable Google Analytics, configure a JNDI property, or use: http://localhost:8080/s4gwebapp/index.jsp?ga=false#StartPage String ga = null; try{ ga = javax.naming.InitialContext.doLookup("java:global/ga"); }catch(javax.naming.NameNotFoundException e){} if ("false".equals(ga)) { out.println("Yahoooo! ga = " + ga); } else { out.println("Wqqqqqq! ga = " + ga); } %>
The Output i received is as following when accessing the application:
Hello World!!!
Wqqqqqq! ga = true
Regards
Jay SenSharma
-
2. Re: [WF.9.0.2.Final] JNDI issues - accessing simple global binding
hr.stoyanov Jan 11, 2016 10:36 AM (in response to jaysensharma)Thank you!