我是Java EE的新手,并尝试使用ServletContextListener,并且侦听器作业是连接到数据库bla bla.当我尝试启动服务器(Tomcat 9)时,它仍然停留在:
"信息:至少有一个JAR被扫描用于尚未包含TLD的TLD.启用此记录器的调试日志记录,以获取已扫描但未找到TLD的完整JAR列表.在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间."
所以我改变了"Logging properties file"中的一些属性,如下所示:
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# …Run Code Online (Sandbox Code Playgroud) 我正在开发一个 Servlet/JSP 项目,我想将其托管在 aws.amazon.com 上。我已经注册了 Amazon Web Services,登录后打开此页面,但我不知道该做什么或选择哪个选项。
我认为 AWS 提供了很多定制功能以及很多高级技术选项可供选择,但这对于只想让自己的网站运行的初学者来说很困难。
我的项目将使用这些:-
JSP/Servlet
CSS
MySQL
Struts2
Tomcat网络服务器
我有一个场景,我想通过进行 Http REST 调用来获取匹配的字符串,将每次击键时输入框中存在的字符串发送到服务器。但它并没有像我预期的那样工作,例如假设输入框中的当前值是“模块”,如果我在“模块”之后输入字符“e”,我希望传递给searchDepartmentsWithName
方法的值将是“模块” ' 但它给出了当前值 'modul' 而不是修改后的值 'module',后者发送到服务器并返回错误的匹配字符串。简而言之,传递给searchDepartmentsWithName方法的值始终是修改前的值。我们如何解决这个问题,或者这是否是正确的做法?
searchnox.component.html
<body>
<input type="text" placeholder="enter department name here.." (keypress)="searchDepartmentsWithName($event.target.value)" class="ticketinginput" />
<div *ngFor="let department of searchResults; let i = index">
<p id="result" href="#" (click)="onClick(department)">{{ department.departmentName }}</p>
</div>
</body>
Run Code Online (Sandbox Code Playgroud)
searchbox.component.ts
searchDepartmentsWithName(departmentName: string) {
this.serverService.searchDepartment(departmentName).subscribe( (response) => {
console.log(response);
},
(error) => console.log(error)
);
this.prepareSearchResults();
}
Run Code Online (Sandbox Code Playgroud)
server.service.ts
searchDepartment(name: string) {
this.departmentList = new Array();
const url = `http://localhost:8082/request/searchDepartmentsByName/${name}`;
return this.http.get(url).map(
(response: Response) => {
const data = response.json();
for …Run Code Online (Sandbox Code Playgroud)