1

Here is my function:

var boxName = document.getElementById('searchBox').value;

How can I put the value of boxName inside the scriplet like this?

<%BoxList.getInstance().getBoxListNames().contains(boxName);%>
pmark019
  • 1,199
  • 5
  • 15
  • 24
  • What are you trying to do with this? Note that JavaScript and Java code run at different time. Also, you should not use scriptlets anymore: http://stackoverflow.com/q/3177733/1065197 – Luiggi Mendoza Jul 08 '13 at 07:07

1 Answers1

0

--Not Possible

You might misunderstand that jsp and javascript existed on same document.Yes but JSP part compiles on server side itself comes to client.

Java script Plays on client side and JSP plays on server side.

What you need is you have to make a server request.And send that string a query parameter.

And please prefer to read How to avoid Java code in JSP files?

Community
  • 1
  • 1
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307