title: jsp variable as javascript function parameters
body: <p>I'm having a trouble with using jsp variables as javascript parameters.</p>
  
  <p>The javascript function:</p>
  
  <pre><code>function user(name, lastname, nick) {
      return name + " " + lastname + " (" + nick + ")";
  }
  </code></pre>
  
  <p>And using it in jsp:</p>
  
  <pre><code>&lt;tbody&gt;
  &lt;c:forEach var="et" items="${eTestsToAdd}"&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;script&gt;document.write(user(${et.author.name}, ${et.author.lastname}, ${et.author.nick}));&lt;/script&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Also it works on another example:</p>
  
  <p>js</p>
  
  <pre><code>function parseToDate(dateInMiliseconds) {
      var d = new Date(dateInMiliseconds);
      var string = d.getDay().toString() + "-" + d.getMonth().toString() + "-" + d.getFullYear().toString();
      return string;
  }
  </code></pre>
  
  <p>jsp</p>
  
  <pre><code>&lt;script&gt;document.write(parseToTime(${uc.startDate.time}));&lt;/script&gt;
  </code></pre>
  
  <p>There are two differences, working example is javascript function with one parameter and the parameter is int, and not working one is javasript function with three string parameters. How can I pass those values to have it working? 
  No scriptlets please :)</p>
  
  <p>//EDIT</p>
  
  <p>ok, I'll try to clarify it a little more:</p>
  
  <p>I have a table in jsp where some data is to be displayed:</p>
  
  <pre><code>&lt;tbody&gt;
      &lt;c:set var="i" value="0" /&gt;
      &lt;c:forEach var="uc" items="${userClasses}"&gt;
          &lt;c:set var="i" value="${i+1}" /&gt;
          &lt;c:url var="usrURL" value="/users/show/${uc.user.nick}" /&gt;
          &lt;tr onclick="location.href = '${usrURL}' "&gt;
              &lt;td&gt;${i}&lt;/td&gt;
              &lt;td&gt;&lt;img class="img-circle img-little" src="&lt;c:url value='/imageView/${uc.user.avatar.id}'/&gt;" /&gt;
                  &lt;script&gt;document.write(user(${uc.user.name}, ${uc.user.lastname}, ${uc.user.nick}));&lt;/script&gt;
              &lt;/td&gt;
              &lt;td&gt;&lt;script&gt;document.write(parseToTime(${uc.startDate.time}));&lt;/script&gt;&lt;/td&gt;
          &lt;/tr&gt;
                                  &lt;/c:forEach&gt;
                              &lt;/tbody&gt;
  </code></pre>
  
  <p>uc.user - is the user entity, I wanted to have it nicely written in the table in pattern - </p>
  
  <p>Name Lastname (userName) </p>
  
  <p>with the javascript I posted here. 
  But when I use this function in jsp, tomcat throws me org.apache.jasper.JasperException: An exception occurred processing JSP page  at the line where I call the js function. So obviously, I'm using it wrong in jsp somehow; I'm fresh with javascripts, though. And my question is how to use this javasript function properly here?</p>