aspose file tools*
The moose likes Struts and the fly likes Unable to call java script function in JSP (Struts 2) 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 "Unable to call java script function in JSP (Struts 2)" Watch "Unable to call java script function in JSP (Struts 2)" New topic
Author

Unable to call java script function in JSP (Struts 2)

hildich kilal
Ranch Hand

Joined: Aug 25, 2008
Posts: 44
Resolved Please ignore
Hans Egger
Greenhorn

Joined: Jan 30, 2009
Posts: 3
You are talking about the function showMessage(), right?

You need to provide the relevant .js-files, otherwise it's hard to say why it doesn't work.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use Firebug to debug your JavaScript code, or just put some alert(...) statements in the selectAll(...) function to help track down what you've done wrong.

I'd strongly recommend using a JavaScript library like jQuery, Prototype, etc. to help clean up the JavaScript.

I really hope you clean up the JSP, too--that's extremely difficult to read and hard to maintain. Mixing Java and JSP like this, in this quantity, is a recipe for disaster.

There's no reason to use <s:a...> tags if you're not using them for the Ajax theme. If you're not using the Ajax theme, there's no reason to use <s:head theme="ajax"/>, and it will add a *significant* amount of overhead to your page loading since it loads Dojo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to call java script function in JSP (Struts 2)