首页 > 解决方案 > 实体是否需要一个特殊的库才能在 Netbeans 中编译?

问题描述

我正在开发 JEE 应用程序,每当我运行该应用程序时,都会收到此错误:

Unable to compile class for JSP: only a type can be imported.

这是源代码

    ProjetAppFormLocal paf = null;
    String mgs = null;

<%
    try {
        Context c = new InitialContext();
        paf = (ProjetAppFormLocal) c.lookup("ProjectApp/ProjectAppForm/Local");
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
%>
<%
    String customerid = request.getParameter("customerid");
    String firstname = request.getParameter("firstname");
    String lastname = request.getParameter("lastname");
    String gender = request.getParameter("gender");
    String phoneno = request.getParameter("phoneno");
    String address = request.getParameter("address");
    String nextofkin = request.getParameter("nextofkin");
    String nextofkinphone = request.getParameter("nextofkinphone");
    if (request.getParameter("ok") != null) {
        mgs = "Record Saved Successfully";
        try {
            paf.createcustomer(new Customer(customerid, firstname, lastname, gender, phoneno, address, nextofkin, nextofkinphone));
           paf.CreateCustomerLogin(new Login(customerid, customerid "customer"));
        } catch (Exception e) {
            e.printStackTrace();
        }
    } else {
        System.out.println("Empty Fields not Allowed");
    }
%>

标签: performanceimportdeploymentcompilationentitylisteners

解决方案


推荐阅读