Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9004203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:50:59+00:00 2026-06-16T00:50:59+00:00

I added a name space binding on IBM WebSphere 7.0 using the following info:

  • 0

I added a name space binding on IBM WebSphere 7.0 using the following info:

  • Binding type = String
  • Binding identifier = test
  • Name in name space relative to lookup name prefix ‘cell/nodes/DummyNode01/servers/server1/’: = url1
  • String value = <some string>

I was able to access the String value on my web application’s code using the code below:

Context initial_ctx;
initial_ctx = new InitialContext();
String value = (String) initial_ctx.lookup("url1");

Now I want to put the String value in XML instead of accessing it via code. How do I do I access the name space bindings of WebSphere in XML? Can I declare it inside the context-param tag?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:51:00+00:00Added an answer on June 16, 2026 at 12:51 am

    A couple of notes.

    First, the string name of the NSB (JNDI string) will vary on WebSphere depending on the scope you set. “server” scope as you identified in your post lets you reference this string value by its friendly name (“url1” in your example) as-is. However, watch out in a clustered environment – you’ll have to define this NSB on every server instance where you probably want the same value for all cluster member appservers. In this case, define the NSB at cell level and in your code (or in a moment, your Spring xml) use jndi name “cell/persistent/url1.”

    Since NSBs in WebSphere are just strings in the naming service (JNDI), you can use the Spring JndiFactoryBean:

    <bean id="myUrl1NameSpaceBinding" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="url1"/> <!-- cell/persistent/url1 in a cluster-wide shared namespace binding -->
        <property name="cache" value="true"/>
        <property name="resourceRef" value="false"/>
        <property name="lookupOnStartup" value="false"/>
        <property name="expectedType" value="java.lang.String"/>
    </bean>
    

    There is a shorthand flavor too:

    <jee:jndi-lookup />
    

    See also: Spring XML docs

    Hope this helps,

    ScottH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any need for code with author's name added in every function or
Question 1: When i try to get the name of every added mc i
I just added PrimeFaces 3.0 to a JSF project: <repository> <id>prime-repo</id> <name>PrimeFaces Maven Repository</name>
I added to my system-wide /etc/security/limits.conf the following two rows: * soft rtprio 55
I added Jquery toggle/show hide in my site (click the plus sign) http://pligg.marsgibson.info if
friends . i am debugging WPF data binding according to this . i added
I have a weird situation here, i have the following grid: @(Html.Telerik().Grid(this.Model). Name(grdEscolas). Groupable().
I want to remove the default xmlns (namespace) added to my service's response (see
Is there a way to specify which namespace includes should be automatically added any
Just a general curiosity question. Why is this namespace System.Collections.Generic added by default in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.