Solved

JSP scriptlets in javascript

Posted on 2006-07-15
8
12,009 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 200 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
Independent Software Vendors: 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 300 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

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!

Question has a verified solution.

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

Popular third-party chat platforms like Slack, Discord, and Telegram are just a few of the many new productivity applications that are being hijacked by cybercriminals to create command-and-control (C&C) communications infrastructures for their malw…
In this blog we highlight approaches to managed security as a service.  We also look into ConnectWise’s value in aiding MSPs’ security management and indicate why critical alerting is a necessary integration.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

726 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