[英]HTML to JSP conversion issues
I want an HTML textbox value to be converted in a variable.我希望将 HTML 文本框值转换为变量。
I have the following:我有以下几点:
<input type="text" name="abc" value="0">
<br>
<%
String contb = request.getParameter("abc");
out.print("The result is: "+contb);
%>
Why do I receive a "NULL" result?为什么我会收到“NULL”结果?
You want你要
<%
String contb = request.getParameter("abc");
out.print("The result is: " + contb);
%>
Note the spaces.注意空格。 If you leave no space between the string, "+" operator and contb then JavaScript cannot parse it as an operation
如果字符串、“+”运算符和 contb 之间没有空格,则 JavaScript 无法将其解析为操作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.