请高手帮忙改改JSP异常

来源:百度知道 编辑:UC知道 时间:2024/06/05 01:49:43
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: 32 in the jsp file: /admin/updateProduct.jsp
Locale.US cannot be resolved to a type
29:
30: //取得上传时间
31:
32: SimpleDateFormat formatter2 = new SimpleDateFormat("yyyyMMddhhmmss",Locale.US);
33: String uptime=formatter2.format(currTime);
34:
35:

An error occurred at line: 33 in the jsp file: /admin/updateProduct.jsp
currTime cannot be resolved
30: //取得上传时间
31:
32: SimpleDateFormat formatter2 = new SimpleDateFormat("yyyyMMddhhmmss",Locale.US);
33: String uptim

1、关于以下问题:
Unable to compile class for JSP
Locale.US cannot be resolved to a type
currTime cannot be resolved
这个问题可能是你没有导入相应的包造成的。你仔细检查一下是否导入了相应的包。如:
<%@ page import="java.util.*" %>
如果你还用到了其他的包,也应该导入

2、关于问题:
Duplicate local variable picture
这个问题说明你在该页面中重复定义了一个变量“picture”,你仔细检查一下是否重复定义了。

祝你学习愉快!

java.text.SimpleDateFormat formatter2 = new java.text.SimpleDateFormat("yyyyMMddhhmmss",java.util.Locale.US);
Date currTime = new Date();
String uptime=formatter2.format(currTime);
System.out.println(uptime);

这是没有问题的

不贴代码谁知道你哪错了,更具错误提示找到相应的页面的错误改就对了,看下面的信息是哪个类引起的你就去哪改就行了,多System.out.println()测试

能否把源码贴出来呢?