Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bug in Struts or in Tomcat ??

R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat4.1 and Struts 1.0.
I tried to get the ServletContext name.
I tried to find out some easy way provided by Struts , but could not find any method which can give me the name of Context.
So I tried in my jsp..
1) request.getSession().getServletContext().getServletContextName()
But it returns "null"
2) application.getServletContextName()
But it returns "null"
I need to know the context name so finally I used
and then parse it to get the Context name.
I wonder what I was doing wrong in first two cases .. why I was not getting theh context name ??
Is it the bug in Tomcat or in Struts ?? or I was worng somewhere ??
Is there any other way to get Context name OR ServletContext object ??
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic