Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java textarea在加载值为的文档时不起作用_Java_Html_Spring_Spring Mvc_Jsp - Fatal编程技术网

Java textarea在加载值为的文档时不起作用

Java textarea在加载值为的文档时不起作用,java,html,spring,spring-mvc,jsp,Java,Html,Spring,Spring Mvc,Jsp,下面的代码显示了我尝试过的代码 <textarea name="description" id="description" cols="30" rows="5" wrap="soft" value="${event.description}"></textarea> 如果我们尝试输入type=text,则会给出输出 <input id="description" type="text" class="datepicker" value="${ev

下面的代码显示了我尝试过的代码

<textarea name="description" id="description"  cols="30" rows="5" wrap="soft"     value="${event.description}"></textarea>  

如果我们尝试输入type=text,则会给出输出

<input id="description" type="text" class="datepicker" value="${event.description}">


请告诉任何人为什么会这样,以及如何解决

您可以尝试此操作,textarea的值必须包含在标记中:

<textarea name="description" id="description" cols="30" rows="5" wrap="soft">${event.description}</textarea>
${event.description}
没有
属性。它有
textContent
,因此您应该执行以下操作:

<textarea>${event.description}</textarea>
${event.description}

HTML
textarea
不会提供值属性
。相反,如果我们想访问HTML区域内的值,那么我们需要将值放在
开始和结束标记之间,即

<textarea name="description" id="description" cols="30" rows="5" wrap="soft">
     ${event.description}
</textarea>

${event.description}

非常感谢您的回复。行得通。我不知道那个问题。