?
Solved

JSP scriptlets in javascript

Posted on 2006-07-15
8
Medium Priority
?
12,020 Views
Last Modified: 2008-01-09
Hi,
can I have JSP scriplets in a javascript code ?
Thank you.
0
Comment
Question by:matthew016
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes MS breaks things just for fun... In Access 2003, only the maximum allowable SQL string length could cause problems as you built a recordset. Now, when using string data in a WHERE clause, the 'identifier' maximum is 128 characters. So, …
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

839 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