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 8793903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:10:55+00:00 2026-06-13T23:10:55+00:00

In the application context XML file, how do you set a constructor argument to

  • 0

In the application context XML file, how do you set a constructor argument to a static class member?

For example, I am using Restlet and one of Restlet’s classes called ChallengeAuthenticator receives a challenge scheme member variable.

// Normal Initialization
ChallengeAuthenticator challengeAuthenticator = new ChallengeAuthenticator(
                null, ChallengeScheme.HTTP_BASIC, "WSRealm");

I want to have this in the application context if possible. To something like this:

<bean id="challengeAuthenticator" class="org.restlet.security.ChallengeAuthenticator">
  <!-- Not meant to be String for value just trying to make it easier to reader to interpret my question -->  
  <constructor-arg value="ChallengeScheme.HTTP_BASIC" />
</bean>
  • 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-13T23:10:56+00:00Added an answer on June 13, 2026 at 11:10 pm

    The easiest way is to use Spring Expression Language:

    <constructor-arg value="#{ T(ChallengeScheme).HTTP_BASIC }" />
    

    Note that you need a full class name in T(...).

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

Sidebar

Related Questions

I am using JNDI to read database configuration from my application's context.xml. The way
In my application iam using Log4j for logging.Presently I am placing log4j.xml in WEB-INF/classes.
I have a Silverlight application that reads its content from an XML file. The
Here is part of my web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-config.xml </param-value> </context-param> application-config.xml uses
I need the context to ApplicationContext.xml ,which I provided in web.xml as <listener> <listener-class>
Have a JUNIT test set up as such @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration({ /applicationContext.xml, /applicationContext-security.xml }) @TransactionConfiguration(defaultRollback
I am trying to add some filtering to the application context file, which resides
My war file has 3 properties files: test.properties, dev.properties and prod.properties. My application context
I deploy a application to tomcat with context xml. I want the tomcat work
In my application there are two class one is InternetActivity which only extends Activity

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.