I am new to this JSTL and JSP. I have a JSP page on which I have a Java code(a method) in which I want to place an alert.For that I have written a Javascript function(for alert) and trying to call it from Java code,but I cant ... can anyone suggest me any other option to call an alert from JAVA code.
<%// Your JSP code here String alertText = "This is a text for alert!"; %> <script type="text/javascript"> alert('<%= alertText%>'); </script> <%// Your JSP code can continue.. %>
If I go with this way for the line alert('<%= alertText%>'); it says "No variable or field found at this location.