| Author |
multiple JS files with Struts Tiles
|
Quince bise
Greenhorn
Joined: Jan 22, 2008
Posts: 8
|
|
Hi anybody please help... I am using struts - tiles with my application. currently when using only one js file has no problem. but when i add new js file same method as what i did on my first js file, it cannot read the function from the second js file. Bold Font is my 2nd(added) js file, i placed it above the first. On my Tiles-Defs.xml <definition name="defaultLayout" path="/layout/defaultTemplate.jsp"> <put name="jsfile" value="/js/Prototype.js"/> <put name="jsfile" value="/js/functions.js"/> <put name="header" value="/layout/header.jsp"/> <put name="body" value="/layout/body.jsp"/> <put name="menuBar" value="/layout/menuBar.jsp"/> <put name="footer" content="/layout/footer.jsp" /> </definition> My defaultTemplate.jsp is <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <link rel="stylesheet" href="<html:rewrite page='/css/style.css' />" type="text/css"> <script src="<%=request.getContextPath()%><tiles:getAsString name='jsprototype' ignore="true"/>"></script> <script src="<%=request.getContextPath()%><tiles:getAsString name='jsfile' ignore="true"/>"></script> <tiles:insert attribute="title" ignore="true" /> </head> <body> <tiles:insert attribute="header" ignore="true"/> <tiles:insert attribute="menuBar" ignore="true"/> <tiles:insert attribute="environmentMenu" ignore="true" /> <%-- include body --%> <tiles:insert attribute="body" ignore="true" /> <%-- include footer --%> <tiles:insert attribute="footer" ignore="true"/> </body> </html> Thank you.
|
 |
Robert Siqueira
Ranch Hand
Joined: Jan 21, 2008
Posts: 37
|
|
you can't use the same name to the two parameter... try to change the second parameter to something like this:
|
 |
 |
|
|
subject: multiple JS files with Struts Tiles
|
|
|