How to call a specific JSP script?

hi.. i am just starting to learn JSP

how can i call a specific jsp script <% %> on mouse button click?

[119 byte] By [jayson17a] at [2007-11-27 11:18:56]
# 1

You mean like this:

<% String getTheVal = (String)session.getAttribute("sessionVal"); %>

function callMe() {

var val = '<%= getTheVal %>';

alert(val);

}

<input type="button" value="button" onclick="javascript:callMe()">

skp71a at 2007-7-29 14:33:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Warning:

Any java scriptlet inside a javascript function is called and executed when the JSP page is created (the JSP file is compiled and instansiated into a java servlet). It is not executed when you click an onclick button that calls the javascript function. Clicking the onclick button does not rebuild the JSP file. Therefore you can only use java scriptlet in a javascript function to initially set some value when the JSP page is first created.

Example:

document.textField1.value=<%=myBean.getFirstName()%>

George123a at 2007-7-29 14:33:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...