javascript « JSTL « JSP-Servlet Q&A

[ August 02, 2006: Message edited by: Merrill Higginson ]

<% } } %> Here the number of labels and textboxes are generated dynamically. How do I ...

1. JSTL and Javascript

Is having tags inside a jstl tag considered bad form? So for example I know the following will work but is it considered bad form to have the script tags ...

2. problem using jstl in Javascript

in my jsp page I have:

<form:select path="index" id="sIndex" onchange="showDetails()">
    <form:options items="${smth}" itemLabel="name" itemValue="index"/>
And in my javascript function:
 *function showDetails() {
        var ...

3. Is it possible to use JSP/JSTL to generate dynamic css/javascript files?

If so how do you do this? (jboss/tomact embedded/jdk 1.5) not embedded js/css but an actual file...

4. how to identify the radio button in javascript

I am creating a dynamic table in which each row has a group of radio buttons placed in different columns. I want to change the cell background color when a radio button ...

5. File path on JSP and javascript

trying to put a file path in javascript. it is a pain \ is an escape character and it always kill the character after the backslash what i am doing is this ...

6. Output JSTL escaped?

I am retrieving a value from our DB using JSTL. I am inserting it right into some javascript to use it as a variable. I need the output of the value ...

7. Passing rendered html to a javascript function

I have some html code rendered on the server side. This is passed to a jsp which renders a javascript-call with this html:

<script type="text/javascript">
    window.parent.${param.popup_return}("${helpId}", "${content}");
content is like
This ...

8. jstl inside javascript

Is it possible to use jstl inside javascript? I'm tying to set <c:set var="abc" value="yes"/> and then later access this value in html and execute some code. My problem is the c:set ...

9. How to prevent JavaScript injection (XSS) when JSTL escapeXml is false

I have a form that people can add their stuff. However, in that form, if they enter JavaScript instead of only text, they can easily inject whatever they want to do. ...

10. How to access web application context in JAVASCRIPT file?

I have a javascript file (Util.js) which i am using in a JSP. How to access the application context EL '${pageContext.request.contextPath}' in the javascript file? This EL is working if the ...

11. JavaScript onLoad function + IE = problems

I'm working on a school project which should give students the ability to search institutes and extra information about them. After the search the results are displayed like this: can't ...

12. JavaScript function arg into JSTL

  1. is there a way to move a javascript function-arg into JSTL tag?
    function loadList(listName) 
     {  <c:forEach var="item" items="${listName}">  ....  }
  2. Why did this code"
    x = '${item.category}'; 
    work all ...

13. if...else within JSP or JSTL

I have a kind of open-ended question.. I want to have a HTML code based on condition (desktop/ipad)..say Condition 1/Condition 2 I want to have separate HTML snippets for each of these conditions...

if ...

14. how to add el code or jstl code through javascript

how to add el code and jstl code to the textbox generated dyanmically like ${fn:escapeXml(} as value of textbox.

15. send data to a new jsp page when user click on a row

<form action="" method="get" enctype="application/x-www-form-urlencoded">

        <h3>Current Users</h3>
         <c:if test="${!empty userList}">

16. send data to a new jsp when user click on a div

<form action="" method="get" enctype="application/x-www-form-urlencoded">
    <h3>Current Users</h3>
    <c:if test="${!empty pagedListHolder}">
        <div class="data">

17. How to get textbox values

 <form:form method="get" action="" onsubmit="return matchPassword();" id="myform" commandName="users">

            <form:label path="password" id="newPwd"><spring:message ...

18. Dont allow password field to copy

I have this field:

<form:label path="password"><spring:message code="label.password"/></form:label>
 <form:password path="password" id="password"/>
Now what can I do to make sure this password field value cannot be copied?

19. How to hide an element in jsp file using javascript

<li><label>Email:</label> <input type='text' name='username'

20. Javascript method that receives a value from a servlet not working

I have a JavaScript method that on the document body onload() event should show an alert. It has one string parameter that the servlet provides. The method does get the value ...

21. How to pass values between JSP - JSTL - Javascript ?

It doesn't look like you're talking about JavaScript, but about Java scripting elements in your JSP pages. The answer is to create a scoped attribute, as you've discovered: <% pageContext.setAttribute("x", x); %> There is no way for JSP tags to read scripting variables; there's no way around that because of the way JSP is designed. See chapter 3 of JSTL in ...

22. JSTL & JavaScript

23. Javascript and JSTL

24. Passing jstl to javascript function

You can fix this by using the Struts-el version of the tags. To do this, change your taglib declaration to: <%@ taglib uri="" prefix="html" %> and make sure that struts-el.jar is in your WEB-INF/lib directory. You can then write:

25. JSTL tag with javascript

26. JSTL and simple javascript

Hello Folks, A simple problem which I have been breaking my head on....There is a simple javascript function that I have: function errorAlert(){ var temp = "dialog.close"; var x1 = ""; var x2 = ""; alert(x1); alert(x2); } While alert(x1) always returns the internationalized message from the alert(x2) gives the message ???dialog.close??? which seems to indicate that the ...

27. Mixing JSTL and JavaScript

28. JavaScript and JSTL

29. Using javaScript Inside JSTL Give Error

You should start by reading the error message. (You do get error messages, don't you? I assume that was what "gives error" means in your post.) Then take note of when the error occurs. Does it occur when the JSP is running on the server, or is it a Javascript error in the generated page? All of those things are useful ...

30. using jstl tags in javascript

31. calling javascript function from jstl

33. pass jstl value to javascript

Whenever I click the checkbox I need to pass the corresponding name from jstl to the javascript function. Here is the code. function showInactive() { //var chkBoxName = document.getElementsByName('chk'); var chkBoxName = document.getElementsByName('checkToInActive'); var statusConfirmation = false; countRemovedElements = 0; for( var i = 0; i < chkBoxName.length; i++ ) { if (chkBoxName[i].checked) { countRemovedElements ++; statusConfirmation= true; var names ='${names}'; ...

34. Pass JSTL data via Javascript

36. invoking javascript on in jsp

38. create Instance of class in Javascript

39. 'Permission denied' java script error

40. The lasted java script

44. javascript + java

function getCpuANDMemoryList(sel){ getCPUList(sel); } var ajax = new Array(); function getCPUList(sel) { var category = sel.options[sel.selectedIndex].value; document.getElementById('conf_cpu').options.length = 0; // Empty city select box if(category.length>0) { var index = ajax.length; ajax[index] = new sack(); ajax[index].requestFile = 'scripts/returnCPU.jsp?mb='+category; // Specifying which file to get ajax[index].onCompletion = function(){ createCPUList(index) }; // Specify function that will be executed after file has been found ajax[index].runAJAX(); ...

45. JSP and javascript binding???

Hi, I have a problem which I hope someone can help me with. I have an jsp page which also has some javascript in. The idea is that when a user presses a button on the page a busy cursor appears(java script) and some text appears to show the progress or status. I have the javascript to do this and I ...

49. logout using java script

50. JavaScript after page loads

52. Not Empty check of texboxes using javascript

Hello, I have a jsp code which goes like this <% ArrayListlst1 = new ArrayList(); lst1 = (ArrayList)session.getAttribute("reportParam"); if(lst1!=null) { for(int i=0;i


53. JSP and javascript - assignment problem

54. Jsp and javascript