jsp文件中的非法字符:'\ u200c'[重复]

问题描述 投票:0回答:1

我正在大学上为我的班级做一个Web应用程序项目,它包含一个表,我必须从该表中读取Java Derby DB的数据,但是在向jsp中添加一些Java代码后,它总是会遇到很多错误。文件。我尝试了另一种方法,但是当我感到非常沮丧时,所有这些最终都导致了内部服务器错误,希望有人可以帮助我。

项目尚未完成,缺少一些代码,我没有添加代码来显示结果。

而且我也真的找不到对错误消息有帮助的东西:“非法字符:'\ u200c'”

我正在将Netbeans与derbyDB和JaveEE一起使用

出现错误的那一行是我上课的那一行

<%!public class Customer{

错误:HTTP状态500-内部服务器错误键入例外报告

messageInternal服务器错误

说明服务器遇到内部错误,导致服务器无法满足此请求。

例外

org.apache.jasper.JasperException:PWC6033:用于JSP的Javac编译中的错误

PWC6199:生成的servlet错误:源值1.5已过时,将在以后的版本中删除

PWC6199:生成的servlet错误:目标值1.5已过时,将在以后的版本中删除

PWC6199:生成的servlet错误:要禁止显示有关过时选项的警告,请使用-Xlint:-options。

PWC6197:jsp文件:/index.jsp中的第22行出现错误PWC6199:生成的servlet错误:非法字符:“ \ u200c”

PWC6197:jsp文件:/index.jsp中的第22行出现错误PWC6199:生成的servlet错误:不是声明

PWC6197:jsp文件:/index.jsp中的第22行出现错误PWC6199:生成的servlet错误:非法字符:“ \ u200c”

PWC6197:jsp文件:/index.jsp中的第22行出现错误PWC6199:生成的servlet错误:非法字符:“ \ u200c”

PWC6197:jsp文件:/index.jsp中的第22行出现错误PWC6199:生成的servlet错误:不是声明

我的代码:



<%@ page import="java.sql.*" %> 
<%@page import="org.apache.derby.jdbc.*" %>
<%Class.forName("org.apache.derby.jdbc.ClientDriver"); %>
<%@ page import="java.util.Date"%>  
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Shop</title>
    </head>
    <body>
        <h1>Shopdatenbank</h1>
        <h2>Kunden</h2>‌ ‌
        <%!public class Customer{
                String URL ="jdbc:derby://localhost:1527/shop";
                String USERNAME="";
                String PASSWORD="";

                Connection connection =null;
                PreparedStatement selectKunde = null;
                ResultSet resultSet = null;

             public Customer(){
                try{
                    connection‌ ‌=‌ ‌DriverManager.getConnection(URL, USERNAME, PASSWORD);

                    selectKunde = connection.prepareStatement(
                            "SELECT* FROM customer");
                    }
                    catch (SQLException e){
                        e.printStackTrace();
                        }
                }
                public ResultSet getCustomer(){
                    try{
                        resultSet = selectCustomer.executeQuery();
                        } catch (SQLException e){
                                e-printStackTrace();
                                }
                         return resultSet;
                    }
            }
            %>
            <%
              Customer customer = new Customer();
              resultSet customer = customer.getKunde();
            %>
 ‌ ‌
<table border="1">
            <thead> 
            <tr>
                            <th> Name </th>
                            <th> Street </th>
                            <th> Code </th>
                            <th> City </th>
            </tr>
            </thead>
 ‌

            ‌<tbody>‌ ‌ ‌

                ‌<tr>‌ ‌ ‌

                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                ‌</tr>‌ ‌
                    ‌
            ‌</tbody>‌ ‌
        ‌</table>‌ ‌


    ‌</body>‌ ‌

    ‌<script>‌ ‌
        ‌function‌ ‌delete(){‌ ‌
            ‌document.eingabeFeld.feldName.value‌ ‌="";‌ ‌
        ‌}‌ ‌‌
    ‌</script>‌ ‌ ‌
</html>‌  

java jsp servlets netbeans java-ee-7
1个回答
0
投票

看起来您输入了非法字符。删除并重写jsp文件中的第22行。

检查此链接,有人遇到类似的问题:Illegal Character error: '\u200b'

© www.soinside.com 2019 - 2024. All rights reserved.