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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:12:38+00:00 2026-05-25T10:12:38+00:00

We run Apache infront of Tomcat and use mod_jk. Our single sign on Apache

  • 0

We run Apache infront of Tomcat and use mod_jk. Our single sign on Apache module sets information about the user which we can retrieve in Java with a getAttribute() call.

String mobileNumber = request.getAttribute("WEBAUTH_LDAP_MOBILE");

This works fine. Now I wanted to retrieve all attributes and look for ones named with a prefix “WEBAUTH_LDAP_”. I used getAttributeNames() for this.

Enumeration<String> enumeration = request.getAttributeNames();

to get the attribute names. To my surprise there is no attribute named “WEBAUTH_LDAP_MOBILE”.
Is this expected? Is there a way to get all attributes? The JavaDoc makes it sound like something in getAttribute() should also be in getAttributeNames().

We are using Tomcat 6.0.28.

  • 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-05-25T10:12:39+00:00Added an answer on May 25, 2026 at 10:12 am

    This is because any attributes set with mod_jk are available with getAttribute() but not through getAttributeNames(). According to the documentation

    You can retrieve the variables on Tomcat as request attributes via
    request.getAttribute(attributeName). Note that the variables send via
    JkEnvVar will not be listed in request.getAttributeNames().

    I debugged through all the RequestWrappers (per BalusC’s suggestion) and the underlying request has an internal map of attributes which are used for getAttributeNames(). However, getAttribute() has a fall through to another object when the internal map’s value is null. From the javadoc and documentation, this is working as designed.

    This behavior has previously been reported as a bug, but the fix fails the TCK test:

    I looked at just including all the Tomcat internal attributes in the return
    from getAttributeNames() but this causes problems with the Servlet 2.5 TCK
    tests which expect that getAttributeNames() return only those attributes that
    have been set via setAttribute().

    So in short, getAttributeNames() will return attributes set with setAttribute() while getAttribute() can return attributes set through various other (internal) means.

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

Sidebar

Related Questions

I want to run multiple instances of apache on one single machine? How to
Hey, I'm trying to run Apache Tomcat 6.0.26 on Mac OS X - Snow
I want to run apache benchmark the which is listed after userid logged in.
I have a web-application built with GWT (2.0.3) and run on Apache Tomcat 6.
I have 2 applications hosted on a single apache tomcat on port 8080 >
I run Apache Tomcat 6 using NetBeans. When there is a failure in my
I have a server running Gentoo 2.6.12 r6 and I want to run Apache
I want to run an Apache on my local machine since I can only
I need to run Linux-Apache-PHP-MySQL application (Moodle e-learning platform) for a large number of
I run Jetty6 yet gladly place Apache in the front if needs be. I

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.