为jsp中的String变量赋值

时间:2021-12-27 23:30:15

Is the any way to assign a value from the text field to a jsp/java String variable with out submitting the form ?

是否可以通过提交表单将文本字段中的值分配给jsp / java字符串变量?

i.,e

i need to assign <%String s="";%>//that means it must hold xyz value with out submitting the button.

我需要指定<%String s =“”;%> //这意味着它必须保持xyz值而不提交按钮。

1 个解决方案

#1


0  

Without submitting the form? Well, not possible. The text field value is on the client side while the JSP scriptlet is on the server side. In order for you to set a value in the JSP scriptlet using the text field value, you will need to submit the form.

没有提交表格?好吧,不可能。文本字段值位于客户端,而JSP scriptlet位于服务器端。为了使用文本字段值在JSP scriptlet中设置值,您需要提交表单。

#1


0  

Without submitting the form? Well, not possible. The text field value is on the client side while the JSP scriptlet is on the server side. In order for you to set a value in the JSP scriptlet using the text field value, you will need to submit the form.

没有提交表格?好吧,不可能。文本字段值位于客户端,而JSP scriptlet位于服务器端。为了使用文本字段值在JSP scriptlet中设置值,您需要提交表单。