• 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

static content (css and EXT-JS JavaScript) not found 404 (SOLVED)

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Sorry if this is in the wrong forum - I'm not sure what this should fall under. I have a Maven-based WTP web app using struts 2 / Sitemesh / EXT-JS.

When I run the project using a Tomcat 6 embedded server in Eclipse (3.4) and inspect using Firebug, I am being told that various decorator-related css files and EXT-JS JavaScript could not be found (404). I can also see that files are not loaded as my Sitemesh decorator is not applied and the EXT-JS Javascript is not executed (see below). In fact, my Struts 2 internationalisation is not being applied from my package_<country_code>.properties files, so I suspect something is very wrong with the project structure:



I have triple-checked the URLs - they appear fine to me. The web app is deployed in it's entirety on to the Eclipse-based local Tomcat server and I can see all the files including the 'missing' ones within the <ContextPath>/static/css and <ContextPath>/static/ext directories. I have also tried deleting and adding a new Tomcat server in Eclipse.

Here is my project structure.



This is what my project looked like prior to the EXT-JS - in fact, I had some EXT-JS functioning so something has broken since:



Tomcat server context.xml:


Tomcat server server.xml:


extTest.jsp:


Does anyone have any ideas or pointers at all? I noticed I had a context element with a docRoot parameter in one of the deployment descriptors once but now it has gone...

 
James Gadbury
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My colleagues and I have found the solution so here it is in case someone else comes across this...

We realised that changing the versions of our Struts2 libraries...

struts2-core-2.0.12.jar to struts2-core-2.1.6.jar
xwork-2.0.6.jar to xwork-2.1.2.jar

...was causing the problem with the static content not loading.

By changing the struts2 filter mapping in the web app deployment descriptor (web.xml) from...


to...



...one can use the struts2-core.2.1.6.jar and xwork.2.1.2.jar

If a moderator reads this, could this post please be moved to the struts2 forum - when I posted, I had no idea what the problem was related to!
 
reply
    Bookmark Topic Watch Topic
  • New Topic