tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Watts <...@cliftonfarm.org>
Subject Re: "/" getting added to action path
Date Wed, 06 Jun 2012 02:57:48 GMT
See Christopher's reply.

IE 6 is pretty ancient.  IIRC, earlier versions of IE cached all js
files in one folder per host or something weird like that.  That would
explain why it works in IE6 but not IE8.  I'll bet dollars to donuts
that it won't work in FireFox 12 either.  You're probably going to have
to fix your app so that all references to resources are relative to the
host not the page url.

So if the page url is something like http://somehost/uom/foo/bar.jsp
then the jsp, or whatever you're using to generate content, will need to
generate that reference as something like

	<script src="${pageContext.request.contextPath}/foo/include/somescript.js">

See HttpServletRequest.getContextPath().


On Tue, 2012-06-05 at 21:37 -0400, Dharamshila Khandelwal wrote:
> Tim,
> 
> It worked fine with IE 6.
> Tomcat logs clearly say that the path is invalid.
> Wierd this is that when the screen is loaded for the first time, it works
> fine. If I click on save (which makes a call to servlet) , it starts giving
> invalid path error.
> I know that its not a tomcat issue, but is there any configuration I need
> to change to make sure that the paths are always taken relative to base
> context?
> 
> Thanks,
> DS.
> 
> 
> On Tue, Jun 5, 2012 at 8:43 PM, Tim Watts <tim@cliftonfarm.org> wrote:
> 
> > Does it work ok with other non-IE browsers?
> >
> > After my 1st reply it occurred to me that that path in the TomCat log
> > may possibly be relative to /uom.  Are you using Struts in the webapp?
> > That RequestProcessor I think is a Struts component?  Just a possibility
> > to eliminate before deciding it's a browser issue.  So far, however,
> > nothing seems to indicate a problem in your TomCat set up.
> >
> >
> > On Tue, 2012-06-05 at 20:19 -0400, Dharamshila Khandelwal wrote:
> > > Tim,
> > >
> > > Yes you are right. I don't see any base tag in the offending page. This
> > > started happening in IE 8. With IE 6, it works fine.
> > >
> > > Thanks,
> > > DS.
> > >
> > > On Tue, Jun 5, 2012 at 6:21 PM, Tim Watts <tim@cliftonfarm.org> wrote:
> > >
> > > > On Tue, 2012-06-05 at 17:37 -0400, Dharamshila Khandelwal wrote:
> > > > > Hi,
> > > > >
> > > > > I am doing testing of a web application on IE 8.
> > > > > I am not able to load any images, css, etc. because "/" is getting
> > added
> > > > in
> > > > > front of action path.
> > > > >
> > > > > For example, when trying to load the following script,
> > > > > <script language="JavaScript" src="include/mm_menu.js"></script>
> > > > > It gives me the following error  in tomcat logs:
> > > > > [ERROR] RequestProcessor - -Invalid path /include/mm_menu.js was
> > > > requested
> > > > >
> > > > > The document base is /uom. Instead of finding this script under
> > /uom, its
> > > > > finding it under /.
> > > > >
> > > > So in IE the HTML shows
> > > >
> > > >        src="include/mm_menu.js"
> > > >
> > > > but TomCat gets a request for
> > > >        /include/mm_menu.js
> > > >
> > > > Is that right?
> > > >
> > > > Does the offending page use a <base> tag?
> > > >
> > > >
> > > > > I am not sure how to fix this problem, can someone please help?
> > > > >
> > > > > Thanks,
> > > > > DS.
> > > >
> > > >
> >
> >


Mime
View raw message