Solved

JSP scriptlets in javascript

Posted on 2006-07-15
8
11,970 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 200 total points
ID: 17114120
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
ID: 17114169
0
 
LVL 4

Expert Comment

by:Meritor
ID: 17114422
It depands on the situation.
Will you describe what excetly you want to do?
0
 
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now