我有一个在head的脚本标签内定义的函数.(在JSP中) 我想在JSP中声明一个字符串变量,并将其作为参数传递给此函数 % String uname ="multiple"; %form action="ExampleServlet" method="post" onclick="pagetype(${
          我想在JSP中声明一个字符串变量,并将其作为参数传递给此函数
<%  String uname ="multiple"; %>
<form action="ExampleServlet" method="post" onclick="pagetype(${uname});"><br>
    <input type="submit" name="Log in" value="Login" />
</form> 
 但这不起作用.
需要帮忙
<% String uname ="multiple"; %>
<form action="ExampleServlet" method="post" onclick="pagetype('<%=uname%>');"><br>
    <input type="submit" name="Log in" value="Login" />
</form>
        
             