• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IE + relative URLs + js file = HTTP404

 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a really strange problem that appears only when testing in IE.

I have set up an error handler for HTTP404s which prints data to the system.out
I have a relative url in a jsp (which is served through a struts 1 action)

The url is
the jsp containing this is within webcontent/pages/myPage.jsp
the js file is within webcontent/pages/scripts/helpPopups/myscript.js

In FF all is good. In IE I get the HTTP404 report below, but yet the scripts do work.

PAGE NOT FOUND: ***************************************

Time : 2010-08-18 13:20:05:870
Referrer : http://localhost:8080/MyApp/someAction.do <- serves up the jsp
URL that doesnt exist: /MyApp/scripts/helpPopups/myscript.js <- note that the pages folder is missing

*********************************************************

anyone know why?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use relative paths.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
See the JSP FAQ for information on forming proper server-relative URLs that start with the context path.
 
Mark Wa
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys, but the problem is not with the context path, but the next directory after the context path. Also the app tends to be run on different servers and protocols (HTTP/S) so using absolute paths would be a major pain.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No one said anything about absolute paths. You can start using proper URLs, that start with the context path, or you can continue to have issues. The choice is yours.
reply
    Bookmark Topic Watch Topic
  • New Topic