在我的Jsp页面(name.jsp)
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/xml" %><%@ page isELIgnored="false" %>
<?xml version="2.5" encoding="UTF-8" standalone="no"?>
<document type="freeswitch/xml">
<section name="configuration">
<configuration name="sofia.conf" description="sofia Endpoint">
<global_settings>
<param name="log-level" value="0"/>
<param name="debug-presence" value="0"/>
<param name="bind-params" value="transport=udp"/>
</global_settings>
<profiles>
<profile name="external">
<gateways>
</gateways>
<aliases/>
<domains>
<domain name="all" alias="false" parse="true"/>
</domains>
<settings>
</settings>
</profile>
<profile name="internal">
<settings>
</settings>
</profile>
</profiles>
</configuration>
<configuration name="ivr.conf" description="IVR menus">
<menus>
<menu name="ivr-test" greet-long="say:welcome to neron. press 1 for sales . press 2 for support. press 3 for accounts. press 4 for me " greet-short="" invalid-sound="say:it was an invalid sound" exit-sound="say:thankyou for contacting us" confirm-macro="" confirm-key="" tts-engine="flite" tts-voice="slt" confirm-attempts="" timeout="10000" inter-digits-timeout="2000" max-failures="3" max-timeouts="" digit-len="4">
<entry action="menu-exec-app" digits="1" param="bridge sofia/internal/2001@192.168.1.105"/>
<entry action="menu-exec-app" digits="2" param="bridge sofia/internal/2002@192.168.1.105"/>
<entry action="menu-exec-app" digits="3" param="bridge sofia/internal/2003@192.168.1.105"/>
</menu>
</menus>
</configuration>
它给了我
此页面包含以下错误: 第7行第1行的错误:仅在开始时允许XML声明 该文件 下面是第一个错误的页面呈现。
当我删除<?xml version="2.5" encoding="UTF-8" standalone="no"?>
时,它可以正常工作。这个项目完全是基于web.xml文件的注释。你能解决吗?感谢
答案 0 :(得分:0)
我经常避免文本顶部的空行,这样做:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%><%@ page contentType="text/xml" %><%@ page isELIgnored="false"
%><?xml version="2.5" encoding="UTF-8" standalone="no"?>
这是否有助于解决这个问题。虽然你可以这样做:
<c:out value='<?xml version="2.5" encoding="UTF-8" standalone="no"?>'
escapeXml="false"/>