• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Referencing Javascript

 
Phil Haigh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My Struts application has all its JSP pages stored under WEB-INF. I want to reference a javascript file inside a JSP file and I'm struggling to get it to work.

At the moment my javascript is in a 'javascript' directory that is at the same level as WEB-INF (under the top level of the web application structure), the action that results in the JSP being sent to the client is of the format "/forms/goMyForm.do" and the script tag looks like this: <script language="javascript" src="javascript/form-rules.js"></script>

The page loads but the JavaScript doesn't work. If I move the javascript code into the JSP everything works fine.

All suggestions appreciated,

Thanks,
Phil.
 
dnyan ginde
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the problem is that the location of the javascript is not being found. Put tag after <html:html> tag in ur jsp and try. I think this should work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic