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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:08:20+00:00 2026-06-01T12:08:20+00:00

C# is the language I am most comfortable with but do Java when at

  • 0

C# is the language I am most comfortable with but do Java when at work. I guess you can say I am very comfortable with using the Visual Studio IDE. One of the things I enjoyed about its debugger is that I can put watch variables (“Expressions” in Eclipse) for any expression. So I could take a peek at values of specific fields public or non-public, call methods, etc. with no problem as I am debugging.

It doesn’t seem like I can do the same in Eclipse. I have to resort to calling the associated getter method for the field (assuming it has one). If it doesn’t have one, I either have to temporarily add one so I can view it and remember to remove it when I’m done or I’m just SOL.

How can I put a watch expression for an object on one of its private fields? Or am I just doing it wrong and I have to craft special expressions to view them?
(Or is there a better way for me to get the information that I want?)

e.g.,

I have an HttpServletRequest and want to keep an eye on the requestURI. If I just watch the request variable, it lists a lot of its fields and it’s just too much information. I’m only interested in one thing in the object so to minimize this, I want to add a watch expression for that one thing.

The field name is apparently requestURI so I added the expression: request.requestURI. Eclipse throws an error saying it’s not a field (it is, it’s just not public). Instead of going directly to the field, I had to go to the getter: request.getRequestURI() and that works fine. But I can’t always count on the getter being available.

the variables view
The Variables view

the expressions view
The Expressions view

  • 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-01T12:08:21+00:00Added an answer on June 1, 2026 at 12:08 pm

    The Eclipse evaluates expression considering the private/protected fields of Declared Type, not of Actual Type.

    Example:

    Number n1 = new Integer(1000);
    Integer n2 = new Integer(1000);
    

    Expressions:

    n1.value  can't be evaluate
    n2.value  returns 1000, perfectly
    

    An alternative is use DetailFormatter (right-click in variable > New Detail Formatter).

    The Eclipse will use this expression instead of toString() method when the textual representation of a object of type is displayed (in Variables View, for example).

    Your DetailFormatter (for ApplicationHttpRequest) can be:

    requestURI 
    

    or

    "URI: " + requestURI + "\n" +
    "Path: " + servletPath
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since its possibly one of the most widely used methods of the Java language,
I have some ideas but C# is language I'm comfortable the most and I
C++ is probably the most popular language for static metaprogramming and Java doesn't support
What is the proper or most appropriate language agnostic name for C#'s using and
I'm trying to find a programming language I feel really comfortable learning and using
As we know c++ is also an Object Oriented Programming language where most the
Python is the language I know the most, and strangely I still don't know
What is the most concise programming language? in case a criteria is needed for
What algorithm taught you the most about programming or a specific language feature? We
Now I've heard the expression maths is the language if the universe; and most

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.