Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need a tool for viewing context objects

 
J. Kevin Robbins
Bartender
Posts: 1728
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a tool that will let me see the values stored in objects in context? Psi-Probe will let me see the class of the objects, but not the properties, or at least I can't figure out how.
 
Paul Clapham
Sheriff
Pie
Posts: 20768
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a "context"?
 
J. Kevin Robbins
Bartender
Posts: 1728
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, too cryptic. I mean ServletContext. I'd like to be able to view the beans/maps/whatever that I've put there as attributes and see if they hold the data that I expect them to hold.

i.e, I have a weather forecast object that is updated twice an hour by a ServletContextListener. It would be helpful for troubleshooting if I could view that object and see it's properties.

It's not a show stopper, just something that occurred to me as "nice to have" thing. I can always use logging to track it's updates.

Psi-Probe will show me that the object is there, but I can't view the properties of it.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're referring to objects stored in Application Scope, probably the easiest thing to do is just write a little servlet or JSP that gets the context attributes and enumerates them. Although I recommend keeping that code secure so that not just anyone can exploit it.

For more general things like startup configuration info (which, of course shouldn't change), you should look at the MBean interface for your appserver (if there is one). Or the appserver may provide a management console app that can be used, depending on which appserver it is.
 
J. Kevin Robbins
Bartender
Posts: 1728
19
Chrome Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:If you're referring to objects stored in Application Scope, probably the easiest thing to do is just write a little servlet or JSP that gets the context attributes and enumerates them.


That's a clever solution. I wish I had thought of that. Thanks.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic