我想从数据库中获取employee name
对应的 an employee code
,使用vxml
. 在浏览器中运行时出现以下错误。
此页面包含以下错误:
第 3 行第 2 列的错误:StartTag:无效元素名称
下面是第一个错误之前的页面渲染。
<?xml version="1.0" encoding = "UTF-8"?>
<vxml version="2.1" xml:lang="en-IN" xmlns="http://www.w3.org/2001/vxml" application="lang_select.vxml">
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<form id="welcome_user">
<var name="user_name">
<block name="hello_user">
<%
Connection connection = DriverManager.getConnection(
"jdbc:odbc:data", "userName", "password");
Statement statement = connection.createStatement();
String id = request.getParameter("employee");
ResultSet resultset =
statement.executeQuery("SELECT Ename from Database where Ecode=' "
+ req.getParameter("Employee") + "'") ;
if(!resultset.next()) {
out.println("<prompt cond=\"lang=='2'\">Sorry, No employee of such employee code.Please try again </prompt>
<prompt xml:lang=\"hi-IN\" cond=\"lang=='1'\">क्षमा करे, इश्स तरह के करंचारी कोड का कोई करंचारी यहा काम नही करता </prompt>" +
"<throw event=\"Invalid\" />.");
}
else {
%>
<prompt cond="lang=='2'"> Welcome </prompt>
<prompt cond="lang=='1'" xml:lang="hi-IN">आपका स्वागत है </prompt>
<assign name="user_name" expr="'<%= resultset.getString(1) %>'"/>
<prompt> <value expr= "user_name"/> </prompt>
<%
}
%>
</block>
</form>
</vxml>