wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes can we use JSTL in Javascrpt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "can we use JSTL in Javascrpt" Watch "can we use JSTL in Javascrpt" New topic

can we use JSTL in Javascrpt

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
Hi the column names of my table are in a container. So in my jsp page when i need them i use JSTL something like this

Now the problem is i am using an open source java script grid to display my data this grid also requires the name of the columns.
Function is

Now can i ue the jstl in javascript function to write own the column names. is that possible if so how would i accomplish that ??
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 60774

Like HTML markup, JavaScript code is just template text in the JSP. So you can use the JSTL anywhere on the page and the values will be substituted prior to sending the HTML to the browser.

What does not happen is that the JSTL be evaluated on the client as the JavaScript is running. Remember that all a JSP is is a template for an HTML page.

If you haven't read it yet, please read this article which may be helpful.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: can we use JSTL in Javascrpt
Similar Threads
A table with 100 columns problem
displaying multiple columns in html table in jsp from mysql database
Display of hashmap values using jstl
[solved] passing 3 times by default through action using struts 2
Looping problem in the display.