Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.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
<;c:out>;在jsp中查找隐藏类型_Jsp_Jstl - Fatal编程技术网

<;c:out>;在jsp中查找隐藏类型

<;c:out>;在jsp中查找隐藏类型,jsp,jstl,Jsp,Jstl,以下哪种语法正确 <input type="hidden" name="outagetkt" value="<c:out value='${ppshOutageAttrib.attributeHM['OutageType']}'></c:out>"/> <input type="hidden" name="outagetkt" value="<c:out value="${ppshOutageAttrib.attributeHM['Outag

以下哪种语法正确

<input type="hidden"  name="outagetkt" value="<c:out value='${ppshOutageAttrib.attributeHM['OutageType']}'></c:out>"/>

<input type="hidden"  name="outagetkt" value="<c:out value="${ppshOutageAttrib.attributeHM['OutageType']}"></c:out>"/>

当我在“$”之前使用带转义字符的“双引号”时,如下所示:

<input type="hidden"  name="outagetkt" value="<c:out value=\"${ppshOutageAttrib.attributeHM['OutageType']}\"></c:out>"/>


这不起作用。有人能告诉我正确的语法吗?

作为
的替代方法,您可以使用
fn:escapeXml()
函数:

<input type="hidden" name="outagetkt" value="${fn:escapeXml(ppshOutageAttrib.attributeHM['OutageType'])}" />

这将消除对嵌套的
的需要,并减少引号的数量

为此,如果尚未指定函数标记库指令,则需要在JSP中指定该指令

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


当您尝试它们时会发生什么?。。。。。。。。这是两个语法中哪一个的输出?