<script> 
function searchperson(style)
{<%String mysql="select * from user_info where style='"+request.getParameter("style") +"'" %>   }

解决方案 »

  1.   

    JSP在服务端执行,不能直接接收JAVASCRIPT(客户端)的内容,只能通过提交或用IE的XMLHTTP接口访问服务器,
      

  2.   

    应该可是吧:用searchperson('<%=style%>');可以调用;
    也能打印出mysql值;但是mysql应该做这样的修改:
    mysql="select * from user_info where style='+style+'";
    虽然这样修改后style参数是可以传进来,但是执行数据库查询时,一条符合要求的记录也没有,需要在style加上双引号;
    即:mysql="select * from user_info where style='"+style+"'";
    但是这样修改之后,style又得不到传进来的参数;
    不知道怎样解决;
    谢谢