简体   繁体   English

如何在jsp函数中使用getparameter

[英]How use of getparameter in jsp function

how use of getParameter in function如何在函数中使用getParameter

<%! public void search(){

String name = request.getParameter("name");
}
%>

error accepted by this code此代码接受的错误

You shouldn't do any business login on jsp.. but to resolve your issue, you can try below code:您不应该在 jsp 上进行任何业务登录。但要解决您的问题,您可以尝试以下代码:

<%!
public void search(HttpServletRequest request) {
       String name = request.getParameter("name");
}

//and while calling this on same jsp
search(request);
%>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM