<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.net.HttpURLConnection" %>
<%@ page import="java.net.URL" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="java.io.BufferedReader" %>
<%@ page import="java.io.InputStreamReader" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.OutputStream" %>
<%@ page import="java.util.Scanner" %>
<%
// 1. 配置接口参数(可根据实际需求从前端获取,此处为固定示例)
String idCard = "330327200001010002";
String apiKey = ""; // 替换为你实际配置的API密钥
String nextcloudApiUrl = "http://172.17.0.1:10081/index.php/apps/idcardquery/api/get_user_by_idcard";
// 拼接GET请求参数并做URL编码,避免特殊字符导致请求异常
String queryParams = "?idCard=" + URLEncoder.encode(idCard, "UTF-8")
+ "&apiKey=" + URLEncoder.encode(apiKey, "UTF-8");
String fullApiUrl = nextcloudApiUrl + queryParams;
// 2. 初始化变量
HttpURLConnection connection = null;
BufferedReader reader = null;
String responseJsonStr = "";
String errorMsg = "";
try {
// 创建URL对象
URL url = new URL(fullApiUrl);
connection = (HttpURLConnection) url.openConnection();
// 设置请求配置
connection.setRequestMethod("GET");
connection.setRequestProperty("User-Agent", "Mozilla/5.0");
connection.setConnectTimeout(10000); // 连接超时5秒
connection.setReadTimeout(10000); // 读取超时5秒
connection.setDoInput(true);
// 3. 获取响应码并处理响应
int responseCode = connection.getResponseCode();
InputStream inputStream = null;
if (responseCode == HttpURLConnection.HTTP_OK) {
// 请求成功,获取正常响应流
inputStream = connection.getInputStream();
} else {
// 请求失败,获取错误响应流
inputStream = connection.getErrorStream();
errorMsg = "接口请求失败,响应码:" + responseCode;
}
// 读取响应数据(兼容各种编码格式)
reader = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"));
StringBuilder sb = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
sb.append(line);
}
responseJsonStr = sb.toString();
// 若请求失败,直接输出错误信息并终止
if (!errorMsg.isEmpty()) {
out.print(errorMsg + ",错误详情:" + responseJsonStr);
return;
}
// 4. 手动解析JSON(避免依赖org.json包,使用字符串截取简化解析,若需完整JSON解析可使用JDK自带的JsonReader)
// 简化版:假设接口返回格式固定,直接截取关键参数(若需要更严谨的JSON解析,可参考JDK 11+的javax.json API)
// 实际生产环境中,若JDK版本≥11,可使用javax.json(自带,无需额外JAR)
String status = "";
String cookieName = "";
String cookieid = "";
long expires = System.currentTimeMillis() + 3600 * 1000;
String path = "/";
String domain = "";
boolean secure = false;
boolean httponly = true;
// 简单截取(仅适用于固定格式的JSON响应,若响应格式复杂,建议使用JDK自带JSON API)
if (json.contains("\"status\":\"success\"")) {
// 使用正则表达式提取值(改进版,更健壮)
String sessionName = extractValue(json, "session", "name");
String sessionId = extractValue(json, "session", "id");
String expires = extractValue(json, "session", "expires");
String path = extractValue(json, "session", "path");
String domain = extractValue(json, "session", "domain");
String secure = extractValue(json, "session", "secure");
String httponly = extractValue(json, "session", "httponly");
String samesite = extractValue(json, "session", "samesite");
// 计算最大生存时间(秒)
long currentTime = System.currentTimeMillis() / 1000;
long expireTime = Long.parseLong(expires);
int maxAge = (int) (expireTime - currentTime);
if (maxAge < 0) maxAge = 0;
// 创建会话Cookie
createCookie(response, sessionName, sessionId, domain, path,
maxAge, "true".equals(secure), "true".equals(httponly), samesite);
// 创建其他必要Cookie - 注意:这些值应该从API响应中获取,这里示例使用固定值
createCookie(response, "nc_username", "nextcloud", domain, "/",
maxAge, true, true, "None");
// 注意:oc_sessionPassphrase的值应该从API响应中获取,这里示例使用固定值(实际中需要替换)
createCookie(response, "oc_sessionPassphrase", "%2Fo9aCFa3pSMEUr8DJvF%2BAooySI3mrG44bVDTknPyCsuZIOUFWqA%2F498ocjSj5YCfZWCersauEkq3QUKNLSwcvsqAE%2F%2BMuC%2BOxA3dTNXb7JgJ4L%2Bu1CNZzTUmykTWuqBm",
domain, "/", maxAge, true, true, "None");
// 重定向到Nextcloud(使用绝对URL,HTTPS)
response.sendRedirect(nextcloudRedirectUrl);
} else {
// 登录失败,输出错误信息
out.print("登录失败:" + (errorMsg.isEmpty() ? "未知错误" : errorMsg));
}
} catch (Exception e) {
// 异常处理
out.print("接口调用异常:" + e.getMessage());
e.printStackTrace();
} finally {
// 关闭资源,避免内存泄漏
if (reader != null) {
try {
reader.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (connection != null) {
connection.disconnect();
}
}
%>
<%!
// 创建Cookie的辅助方法
private void createCookie(jakarta.servlet.http.HttpServletResponse response,
String name, String value, String domain, String path,
int maxAge, boolean secure, boolean httpOnly, String sameSite) {
Cookie cookie = new Cookie(name, value);
if (path != null && !path.isEmpty()) {
cookie.setPath(path);
} else {
cookie.setPath("/");
}
cookie.setMaxAge(maxAge);
cookie.setSecure(secure);
cookie.setHttpOnly(httpOnly);
// 设置SameSite属性(Servlet 4.0+)
if (sameSite != null) {
cookie.setAttribute("SameSite", sameSite);
}
// 如果指定了域名,则设置
if (domain != null && !domain.isEmpty()) {
cookie.setDomain(domain);
}
response.addCookie(cookie);
}
// JSON解析辅助方法(改进版,处理带引号和不带引号的值)
private String extractValue(String json, String parent, String key) {
// 尝试匹配: "parent": { ... "key": "value" ... }
Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
Matcher matcher = pattern.matcher(json);
if (matcher.find()) {
return matcher.group(1);
}
// 尝试匹配: "parent": { ... "key": value ... } (值没有引号)
pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*([^,}]+)[^}]*\\}");
matcher = pattern.matcher(json);
if (matcher.find()) {
return matcher.group(1);
}
return null;
}
// 提取错误消息
private String extractValue(String json, String key) {
Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
Matcher matcher = pattern.matcher(json);
if (matcher.find()) {
return matcher.group(1);
}
return null;
}
%>运行后抛出异常HTTP状态 500 - 内部服务器错误
类型 异常报告
消息 org.apache.jasper.JasperException: Unable to compile class for JSP:
描述 服务器遇到一个意外的情况,阻止它完成请求。
例外情况
org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [166] in the jsp file: [/index.jsp]
Pattern cannot be resolved to a type
163: // JSON解析辅助方法(改进版,处理带引号和不带引号的值)
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
An error occurred at line: [166] in the jsp file: [/index.jsp]
Pattern cannot be resolved
163: // JSON解析辅助方法(改进版,处理带引号和不带引号的值)
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
An error occurred at line: [167] in the jsp file: [/index.jsp]
Matcher cannot be resolved to a type
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
170: }
An error occurred at line: [172] in the jsp file: [/index.jsp]
Pattern cannot be resolved
169: return matcher.group(1);
170: }
171: // 尝试匹配: "parent": { ... "key": value ... } (值没有引号)
172: pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*([^,}]+)[^}]*\\}");
173: matcher = pattern.matcher(json);
174: if (matcher.find()) {
175: return matcher.group(1);
An error occurred at line: [182] in the jsp file: [/index.jsp]
Pattern cannot be resolved to a type
179:
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
An error occurred at line: [182] in the jsp file: [/index.jsp]
Pattern cannot be resolved
179:
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
An error occurred at line: [183] in the jsp file: [/index.jsp]
Matcher cannot be resolved to a type
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
186: }
An error occurred at line: [81] in the jsp file: [/index.jsp]
json cannot be resolved
78: boolean httponly = true;
79:
80: // 简单截取(仅适用于固定格式的JSON响应,若响应格式复杂,建议使用JDK自带JSON API)
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
An error occurred at line: [83] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
80: // 简单截取(仅适用于固定格式的JSON响应,若响应格式复杂,建议使用JDK自带JSON API)
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
An error occurred at line: [84] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
An error occurred at line: [85] in the jsp file: [/index.jsp]
Duplicate local variable expires
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
An error occurred at line: [85] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
An error occurred at line: [86] in the jsp file: [/index.jsp]
Duplicate local variable path
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
An error occurred at line: [86] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
An error occurred at line: [87] in the jsp file: [/index.jsp]
Duplicate local variable domain
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
An error occurred at line: [87] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
An error occurred at line: [88] in the jsp file: [/index.jsp]
Duplicate local variable secure
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
An error occurred at line: [88] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
An error occurred at line: [89] in the jsp file: [/index.jsp]
Duplicate local variable httponly
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
An error occurred at line: [89] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
An error occurred at line: [90] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
93: long currentTime = System.currentTimeMillis() / 1000;
An error occurred at line: [110] in the jsp file: [/index.jsp]
nextcloudRedirectUrl cannot be resolved to a variable
107: domain, "/", maxAge, true, true, "None");
108:
109: // 重定向到Nextcloud(使用绝对URL,HTTPS)
110: response.sendRedirect(nextcloudRedirectUrl);
111: } else {
112: // 登录失败,输出错误信息
113: out.print("登录失败:" + (errorMsg.isEmpty() ? "未知错误" : errorMsg));
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:547)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:394)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:330)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:281)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
根本原因。
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [166] in the jsp file: [/index.jsp]
Pattern cannot be resolved to a type
163: // JSON解析辅助方法(改进版,处理带引号和不带引号的值)
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
An error occurred at line: [166] in the jsp file: [/index.jsp]
Pattern cannot be resolved
163: // JSON解析辅助方法(改进版,处理带引号和不带引号的值)
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
An error occurred at line: [167] in the jsp file: [/index.jsp]
Matcher cannot be resolved to a type
164: private String extractValue(String json, String parent, String key) {
165: // 尝试匹配: "parent": { ... "key": "value" ... }
166: Pattern pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*\"([^\"]*)\"[^}]*\\}");
167: Matcher matcher = pattern.matcher(json);
168: if (matcher.find()) {
169: return matcher.group(1);
170: }
An error occurred at line: [172] in the jsp file: [/index.jsp]
Pattern cannot be resolved
169: return matcher.group(1);
170: }
171: // 尝试匹配: "parent": { ... "key": value ... } (值没有引号)
172: pattern = Pattern.compile("\""+parent+"\":\\s*\\{[^}]*\""+key+"\"\\s*:\\s*([^,}]+)[^}]*\\}");
173: matcher = pattern.matcher(json);
174: if (matcher.find()) {
175: return matcher.group(1);
An error occurred at line: [182] in the jsp file: [/index.jsp]
Pattern cannot be resolved to a type
179:
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
An error occurred at line: [182] in the jsp file: [/index.jsp]
Pattern cannot be resolved
179:
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
An error occurred at line: [183] in the jsp file: [/index.jsp]
Matcher cannot be resolved to a type
180: // 提取错误消息
181: private String extractValue(String json, String key) {
182: Pattern pattern = Pattern.compile("\""+key+"\"\\s*:\\s*\"([^\"]*)\"");
183: Matcher matcher = pattern.matcher(json);
184: if (matcher.find()) {
185: return matcher.group(1);
186: }
An error occurred at line: [81] in the jsp file: [/index.jsp]
json cannot be resolved
78: boolean httponly = true;
79:
80: // 简单截取(仅适用于固定格式的JSON响应,若响应格式复杂,建议使用JDK自带JSON API)
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
An error occurred at line: [83] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
80: // 简单截取(仅适用于固定格式的JSON响应,若响应格式复杂,建议使用JDK自带JSON API)
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
An error occurred at line: [84] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
81: if (json.contains("\"status\":\"success\"")) {
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
An error occurred at line: [85] in the jsp file: [/index.jsp]
Duplicate local variable expires
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
An error occurred at line: [85] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
82: // 使用正则表达式提取值(改进版,更健壮)
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
An error occurred at line: [86] in the jsp file: [/index.jsp]
Duplicate local variable path
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
An error occurred at line: [86] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
83: String sessionName = extractValue(json, "session", "name");
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
An error occurred at line: [87] in the jsp file: [/index.jsp]
Duplicate local variable domain
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
An error occurred at line: [87] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
84: String sessionId = extractValue(json, "session", "id");
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
An error occurred at line: [88] in the jsp file: [/index.jsp]
Duplicate local variable secure
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
An error occurred at line: [88] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
85: String expires = extractValue(json, "session", "expires");
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
An error occurred at line: [89] in the jsp file: [/index.jsp]
Duplicate local variable httponly
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
An error occurred at line: [89] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
86: String path = extractValue(json, "session", "path");
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
An error occurred at line: [90] in the jsp file: [/index.jsp]
json cannot be resolved to a variable
87: String domain = extractValue(json, "session", "domain");
88: String secure = extractValue(json, "session", "secure");
89: String httponly = extractValue(json, "session", "httponly");
90: String samesite = extractValue(json, "session", "samesite");
91:
92: // 计算最大生存时间(秒)
93: long currentTime = System.currentTimeMillis() / 1000;
An error occurred at line: [110] in the jsp file: [/index.jsp]
nextcloudRedirectUrl cannot be resolved to a variable
107: domain, "/", maxAge, true, true, "None");
108:
109: // 重定向到Nextcloud(使用绝对URL,HTTPS)
110: response.sendRedirect(nextcloudRedirectUrl);
111: } else {
112: // 登录失败,输出错误信息
113: out.print("登录失败:" + (errorMsg.isEmpty() ? "未知错误" : errorMsg));
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:70)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:189)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:523)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:367)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:325)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:368)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:330)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:281)
jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
):注意 主要问题的全部 stack 信息可以在 server logs 里查看
Apache Tomcat/11.0.15