?
Solved

JSP scriptlets in javascript

Posted on 2006-07-15
8
Medium Priority
?
12,012 Views
Last Modified: 2008-01-09
Hi,
can I have JSP scriplets in a javascript code ?
Thank you.
0
Comment
Question by:matthew016
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 8

Assisted Solution

by:kaliyugkaarjun
kaliyugkaarjun earned 800 total points
ID: 17114120
0
 
LVL 4

Expert Comment

by:Meritor
ID: 17114422
It depands on the situation.
Will you describe what excetly you want to do?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Expert Comment

by:koppcha
ID: 17114749
Usually we end up using expressions in the javascript. But again you need to let us know the situation ,what you are trying to achieve.
0
 
LVL 9

Author Comment

by:matthew016
ID: 17117118
I wanted to affect a jsp variable to a javascript variable.
It is better to avoid this ?
0
 
LVL 8

Expert Comment

by:koppcha
ID: 17117227
You can use expressions. you want to assign a Java script variable to a JSP value right ?
0
 
LVL 9

Author Comment

by:matthew016
ID: 17117270
expressions ?
well js to jsp and jsp to js, i wondered how I could do this.
0
 
LVL 8

Accepted Solution

by:
koppcha earned 1200 total points
ID: 17117355
This is an example

<script>

  var arry = new Array();
 //This is a scriptlet
  <%
  String[] strArray = new String[] {"A", "B", "C"};

  for (int i = 0; i < strArray.length; i++) { %>

//This is how the expression are used
  arry[<%=i%>] = "<%=strArray[i]%>";
  <% } %>
  alert(arry.length);

</script>


Relate this to what you are doing and let me know the specific questions that you have
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

New style of hardware planning for Microsoft Exchange server.
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question