This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes bug in Struts or in Tomcat ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bug in Struts or in Tomcat ??" Watch "bug in Struts or in Tomcat ??" New topic
Author

bug in Struts or in Tomcat ??

R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5370
Hi
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
request.getContextPath()
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 ??


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: bug in Struts or in Tomcat ??
 
Similar Threads
ServletContext and ServletContextAttribute listener query
RequestDispatcher null? is this possible outcome.
Struts 1.2- Retrieve Client Information.
How to get ServletContext in struts 2 action class
ServletConfig & Context ?