[英]Error while importing class in JSP
I am getting the error on importing a class located in a subpackage in JSP. 我在导入位于JSP的子包中的类时遇到错误。
Effective code of index.jsp: index.jsp的有效代码:
<%@ page import="a.b.TestDetails" contentType="text/html"
pageEncoding="UTF-8" errorPage="Error/error-page.jsp"%>
Error i am recieving: 我收到错误:
HTTP Status 404 - Not Found
type Status report
messageNot Found
descriptionThe requested resource is not available.
GlassFish Server Open Source Edition 4.0
When i remove the import
page loads correctly but when i use it to import class, it gives me above error. 当我正确删除
import
页面时加载,但是当我使用它导入类时,它给了我上面的错误。
try : 尝试:
<%@ page import="abTestDetails" %>
// here ab is package & sub-package name & TestDetails llbe name of Class which you want to import. //这里的ab是要导入的类的包和子包名称以及TestDetails llbe的名称。
remove contentType="text/html"
& other code. 删除
contentType="text/html"
和其他代码。
Then test it again, if still problem post me. 然后再次测试,如果仍然有问题,请发给我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.