aspose file tools*
The moose likes Struts and the fly likes Referencing Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Referencing Javascript" Watch "Referencing Javascript" New topic
Author

Referencing Javascript

Phil Haigh
Greenhorn

Joined: Jan 19, 2006
Posts: 26
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.


Phil
SCJP, SCWCD, SCEA
dnyan ginde
Ranch Hand

Joined: Jan 17, 2006
Posts: 68
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Referencing Javascript