call javascript library in jsp

A

albert kao

How to call the tablekit javascript library in jsp?
I downloaded the tablekit javascript library and put it in the js
directory which is in the jsp directory.
i.e. the directory is
C:\workspace\com.mycomp.data.war\WEB-INF\jsp\js
The jsp page is as follows and display correctly with FF and chrome on
Windows Vista.
However, the column of the page is not sorted by clicking on the
column.
i.e. the tablekit javascript library sorting function does not work
on the web page generated by jsp.

<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table border="1" class="sortable resizable"
style="width:100%;background-color:#FFA69C;border-collapse:
collapse">
<thead>
<tr>
<td colspan="2">
<h3 style="text-align:center">Data</h3>
</td>
</tr>
<tr>
<th class="sortfirstdesc" id="data">Data</th>
<th id="message">Message</th>
</tr>
</thead>
<tbody>
<c:forEach items="${model.datas}" var="data">
<tr>
<td> <style="font-family:monospace">${data.id}
</td>
<td> <style="font-family:monospace">${data.message}
</td>
</tr>
</c:forEach>
</tbody>
</table>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/fabtabulous.js"></script>
<script type="text/javascript" src="js/tablekit.js"></script>
</body>
</html>
 
S

Stevo

albert said:
How to call the tablekit javascript library in jsp?
i.e. the tablekit javascript library sorting function does not work

You'll be wanting a tablekit forum.
 
T

Thomas 'PointedEars' Lahn

albert said:
How to call the tablekit javascript library in jsp?

*Please* get yourself informed what JSP is and what it does before you
continue.

Besides, libraries are _not_ called; functions in libraries are.
<script type="text/javascript"
src="js/prototype.js"> said:
<script type="text/javascript"
src="js/fabtabulous.js"> said:
<script type="text/javascript"

OMG.

And *please* stop crossposting until you got that minimum clue. TIA.


PointedEars
 
S

Scott Sauyet

How to call the tablekit  javascript library in jsp?
I downloaded the tablekit  javascript library and put it in the js
directory which is in the jsp directory.
i.e. the directory is
C:\workspace\com.mycomp.data.war\WEB-INF\jsp\js

This might be your problem. In my experience, resources like scripts
or images should be placed relative to the web application's root
directory, in your case, the JS should probably be in,

C:\workspace\com.mycomp.data.war\js

HTH,

-- Scott
 
L

Lew

*Please* get yourself informed what JSP is and what it does before you
continue.

There's no problem with the OP in that regard. One can, and often does embed
Javascript in a JSP, wherein it becomes part of the generated HTML. You have
no basis to your objection there.

One calls Javascript libraries from JSP in exactly the way one does from HTML.

Well, there are component frameworks like JSF that automagically generate
Javascript for some of their functionality, but here we're talking about the
application-specific JS that would be present regardless.
Besides, libraries are _not_ called; functions in libraries are.

Yeesh. And people call me picky. To say that one "calls a library" is to say
colloquially that one calls methods from that library. Take a chill pill.

albert said:
src="js/tablekit.js"></script>

Yes? You rang?
And *please* stop crossposting until you got [sic] that minimum clue.

There was a good reason why the OP cross-posted. It's not like they
multi-posted.

You should stop whining until you get that minimum clue.
 
A

albert kao

This might be your problem.  In my experience, resources like scripts
or images should be placed relative to the web application's root
directory, in your case, the JS should probably be in,

    C:\workspace\com.mycomp.data.war\js

HTH,

  -- Scott

You are right.
JS should probably be in C:\workspace\com.mycomp.data.war\js.
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top