File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 5371
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 ??