编写jsp代码,在jsp中调用不了src中的类

5819524e0001c89004180328.jpg

5819524e000169ac05000305.jpg

这个是一个上传图片的功能,要获取随机名防止图片名重复,可是测试的时候调用不了getFileName.getName(),

错误代码是这样的:

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 18 in the jsp file: /SmartUpload/Demo2.jsp
GetFileName cannot be resolved
15:   //鍑嗗涓婁紶
16:   smartUpload.upload();
17: 
18:   String name0=GetFileName.getName();
19:   %>
20: <h1><%=name0%></h1>
21: 


Stacktrace:
	org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
	org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
	org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

求解啊

慕标2986111
浏览 4432回答 3
3回答

Caballarii

GetFileName这个类没有import进来
打开App,查看更多内容
随时随地看视频慕课网APP