提交 845b8961 编写于 作者: W wizardforcel

2020-06-12 20:56:30

上级 44fd7594
......@@ -8,7 +8,7 @@ Web 应用的性能对于任何公司和任何客户的项目成功都是至关
## 性能技巧
你们中的许多人都认为绩效本身是一个相对术语。 性能卓越的应用可能会让其他人或您的客户感到失望。 因此,与任何其他相对测量一样,您也必须在此处遵循基本要求。
你们中的许多人都认为性能本身是一个相对术语。 性能卓越的应用可能会让其他人或您的客户感到失望。 因此,与任何其他相对测量一样,您也必须在此处遵循基本要求。
1. #### 定义(出色的)性能基准:
......
# 使用 Maven 的 vaadin Hello World Web 应用
# 使用 Maven 的 vaadin HelloWorld Web 应用
> 原文: [https://howtodoinjava.com/vaadin/hello-world-web-application-maven/](https://howtodoinjava.com/vaadin/hello-world-web-application-maven/)
......@@ -26,7 +26,7 @@ $ mvn archetype:generate
现在,将生成的项目作为现有的 maven 项目导入到您的 IDE(在我的情况下为 eclipse)中。
![Vaadin Hello World Application Project Structure](img/e0943201c08237d2f437e759267f7835.png)
![Vaadin HelloWorld Application Project Structure](img/e0943201c08237d2f437e759267f7835.png)
Vaadin HelloWorld 应用项目结构
......@@ -311,7 +311,7 @@ $mvn jetty:run
这将启动内置的 Jetty 服务器,您可以通过`http://localhost:8080/`访问该应用。
![Vaadin Hello World Screen](img/4cf50fc728bf4b7a2220a9723e1b7a8c.png)
![Vaadin HelloWorld Screen](img/4cf50fc728bf4b7a2220a9723e1b7a8c.png)
Vaadin 你好世界屏幕
......@@ -319,7 +319,7 @@ Vaadin 你好世界屏幕
现在在文本框中填写您的姓名或任何字符串,然后单击按钮。 它将在按钮下方打印消息。
![Vaadin Hello World Screen -2](img/70583a72d03f095779814e609023a423.png)
![Vaadin HelloWorld Screen -2](img/70583a72d03f095779814e609023a423.png)
Vaadin 你好世界屏幕 - 2
......
# SQL – 删除没有临时表的重复行
# SQL – 不使用临时表删除的重复行
> 原文: [https://howtodoinjava.com/sql/how-to-remove-duplicate-rows-in-mysql-without-using-temporary-table/](https://howtodoinjava.com/sql/how-to-remove-duplicate-rows-in-mysql-without-using-temporary-table/)
作为开发人员,我们经常遇到必须处理数据库相关内容的情况。 通常,当客户端以 excel 工作表的形式向您发送其数据,并且在经过一些 excel 操作后将数据推送到数据库表时,便完成了该操作。 我也做了很多次。
这种方法面临的一个非常普遍的问题是,有时可能会导致重复行,因为发送的数据主要来自人力资源和财务等部门,而人们对这些数据标准化技术的了解并不充分[:-)]
这种方法面临的一个非常普遍的问题是,有时可能会导致重复行,因为发送的数据主要来自人力资源和财务等部门,而人们对这些数据标准化技术的了解并不充分 :-)
我将使用 Employee 表,其中的列名称为 id,名称,部门和电子邮件。
我将使用`Employee`表,其中的列名称为 ID,名称,部门和电子邮件。
以下是用于生成测试数据的 SQL 脚本。
......@@ -42,13 +42,13 @@ DELETE e1 FROM EMPLOYEE e1, EMPLOYEE e2 WHERE e1.name = e2.name AND e1.id > e2.i
![delete-duplicate-rows-in-mysql](img/47ddfb39186adc25818486adfab58c83.png)
*如果要保留具有最新生成的 ID 值的行,则将 where 子句中的条件反转为 e1.id < e2.id,如下所示:*
*如果要保留具有最新生成的 ID 值的行,则将`where`子句中的条件反转为`e1.id < e2.id`,如下所示:*
```java
DELETE e1 FROM EMPLOYEE e1, EMPLOYEE e2 WHERE e1.name = e2.name AND e1.id > e2.id;
```
如果要比较多个字段并添加适当的 where 子句。
如果要比较多个字段并添加适当的`where`子句。
***注意**:请始终首先对测试数据执行以上(或修改)查询,以确保其产生预期的输出。*
......
# SQL 查询以查找员工的第 N 高薪
# 查找员工的第 N 高薪的 SQL 查询
> 原文: [https://howtodoinjava.com/sql/sql-query-find-nth-highest-salary/](https://howtodoinjava.com/sql/sql-query-find-nth-highest-salary/)
如果您想担任初级职位,要找到**的第 N 个最高薪水**是一个非常常见的面试问题。 大多数人逐个字符地学习它,但是很少有人了解此查询的工作方式。 它的性能好坏是多少? 在这篇文章中,我们将学习这些东西。 我正在使用 MySQL 数据库进行演示。
如果您想担任初级职位,要找到**的第 n 高薪水**是一个非常常见的面试问题。 大多数人逐个字符地学习它,但是很少有人了解此查询的工作方式。 它的性能好坏是多少? 在这篇文章中,我们将学习这些东西。 我正在使用 MySQL 数据库进行演示。
```java
Table of Contents
......@@ -15,7 +15,7 @@ Table of Contents
## 1.创建数据库架构并填充表
让我们创建一个`Employee`表的简单示例。 我们将用 id 和雇员的工资填充此表。 我们将编写查询以在此表上找到第 n 个最高薪水。
让我们创建一个`Employee`表的简单示例。 我们将用 ID 和雇员的工资填充此表。 我们将编写查询以在此表上找到第 n 高薪水。
创建一个新的数据库架构。
......@@ -52,9 +52,9 @@ INSERT INTO Employee_Test VALUES (11,'Sudhir',800);
```
## 2\. SQL 查询找到第 n 个最高薪水
## 2\. 找到第 n 高薪水的SQL 查询
因此,正如我们大多数人所知,查询是这样写的,以查找**位最高薪水**。 在下面的查询中,我们看到如何在不使用 max 函数的情况下在 sql 中找到最高薪水。
因此,正如我们大多数人所知,查询是这样写的,以查找**第 N 高薪水**。 在下面的查询中,我们看到如何在不使用`max`函数的情况下在 sql 中找到最高薪水。
```java
SELECT *
......@@ -67,7 +67,7 @@ WHERE ( n ) = (
```
在此,将`'n'`替换为任何数字。 例如,如果您必须找到第六高的薪水,则将 n 替换为 6。
在此,将`n`替换为任何数字。 例如,如果您必须找到第六高的薪水,则将 n 替换为 6。
```java
SELECT *
......@@ -86,17 +86,17 @@ WHERE Emp2.Employee_Salary >= Emp1.Employee_Salary
## 3.查询的工作方式
如我们所见,该查询涉及内部查询的使用。 内部查询可以有两种类型。 [**相关的**](https://en.wikipedia.org/wiki/Correlated_subquery "Correlated_subquery") **不相关的**查询。 不相关查询是内部查询可以独立于外部查询运行的地方,而相关查询是内部查询与外部查询一起运行的地方。 *我们的第 n 高薪是相关查询*的示例。
如我们所见,该查询涉及内部查询的使用。 内部查询可以有两种类型。 [**相关的**](https://en.wikipedia.org/wiki/Correlated_subquery "Correlated_subquery")**不相关的**查询。 不相关查询是内部查询可以独立于外部查询运行的地方,而相关查询是内部查询与外部查询一起运行的地方。 *我们的第 n 高薪是相关查询*的示例。
最好先了解一下内部查询每次都会执行,处理外部查询中的一行。 内部查询基本上不会做任何非常秘密的工作,它只会返回比当前处理行的薪水列高的不同薪水的计数。 任何时候,它都会发现外部查询中当前行的薪水列的值等于内部查询中较高薪水的计数,并返回结果。
## 4.绩效分析
## 4.性能分析
正如我们从上面了解到的那样,每次执行内部查询都会处理一行外部查询,这会带来很多性能开销,特别是在行数太大的情况下。
为了避免这种情况,应该使用特定于数据库的关键字来更快地获得结果。 例如在 SQL Server 中,可以这样使用关键字 TOP
为了避免这种情况,应该使用特定于数据库的关键字来更快地获得结果。 例如在 SQL Server 中,可以这样使用关键字`TOP`
如何在 SQL Server 中找到第 n 个最高薪水。
如何在 SQL Server 中找到第 n 高薪水。
```java
SELECT TOP 1 EMPLOYEE_SALARY
......
# SQLException:用户“ root” @“ localhost”的访问被拒绝
# `SQLException`:用户`root@localhost`的访问被拒绝
> 原文: [https://howtodoinjava.com/sql/sqlexception-access-denied-for-user-rootlocalhost-after-re-installation-of-mysql-server/](https://howtodoinjava.com/sql/sqlexception-access-denied-for-user-rootlocalhost-after-re-installation-of-mysql-server/)
......@@ -6,7 +6,7 @@
## 访问原因被拒绝错误
用户“ root”问题的访问被拒绝错误通常发生在您卸载并安装新版本甚至旧版本时。 问题在于由 mysql 卸载程序向导完成的不完整清理。 因此,解决方案也很简单,手动清除剩余的垃圾。
用户“`root`”问题的访问被拒绝错误通常发生在您卸载并安装新版本甚至旧版本时。 问题在于由 mysql 卸载程序向导完成的不完整清理。 因此,解决方案也很简单,手动清除剩余的垃圾。
您的异常将如下所示:
......@@ -42,7 +42,7 @@ Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (usi
解决访问被拒绝错误的方法是从以下位置删除旧数据文件夹。
> `C:/Documents and Settings/All Users/Application Data/MySQL` [[参见此处](https://dev.mysql.com/doc/refman/5.1/en/windows-installation-layout.html "windows-installation-layout")]
> `C:/Documents and Settings/All Users/Application Data/MySQL`[(参见此处)](https://dev.mysql.com/doc/refman/5.1/en/windows-installation-layout.html "windows-installation-layout")
该目录包含临时文件和**旧 DB 数据,包括您在先前安装中使用的最新登录凭据**。 因此,要解决此问题:
......@@ -50,6 +50,6 @@ Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (usi
2. 从上方文件夹中删除所有内容
3. 安装新的 MySQL 服务器
您应该可以在 Server 实例中登录。
您应该可以在服务器实例中登录。
学习愉快!
\ No newline at end of file
# Struts 2 教程
\ No newline at end of file
# Struts2 教程
\ No newline at end of file
# Struts 2 Hello World 示例
# Struts2 Hello World 示例
> 原文: [https://howtodoinjava.com/struts2/struts-2-hello-world-example-application/](https://howtodoinjava.com/struts2/struts-2-hello-world-example-application/)
在我以前的文章中,我写了许多关于 [**JAX-RS RESTEasy**](//howtodoinjava.com/restful-web-service/ "resteasy tutorials")[**Spring3**](//howtodoinjava.com "Spring3 tutorials")[**的示例和教程 ] Hibernate**](//howtodoinjava.com/hibernate-tutorials/ "hibernate tutorials") 和其他 Java 框架,例如 [**Maven**](//howtodoinjava.com/maven/ "maven tutorials")[**junit**](//howtodoinjava.com/junit/ "junit tutorials") 。 我也有很多要求在 **struts 2** 上写一些东西。 好吧,这里我从世界示例开始。 在下一篇文章中,我将尝试涵盖涉及 Struts 2 的最大领域和概念。因此,请继续关注。
在我以前的文章中,我写了许多关于 [**JAX-RS RESTEasy**](//howtodoinjava.com/restful-web-service/ "resteasy tutorials")[**Spring3**](//howtodoinjava.com "Spring3 tutorials")[**的示例和教程 ] Hibernate**](//howtodoinjava.com/hibernate-tutorials/ "hibernate tutorials") 和其他 Java 框架,例如 [**Maven**](//howtodoinjava.com/maven/ "maven tutorials")[**junit**](//howtodoinjava.com/junit/ "junit tutorials") 。 我也有很多要求在 **Struts2** 上写一些东西。 好吧,这里我从世界示例开始。 在下一篇文章中,我将尝试涵盖涉及 Struts2 的最大领域和概念。因此,请继续关注。
```java
Sections in this post:
Create maven web project
Struts 2 dependencies
Struts2 dependencies
web.xml changes
Know struts.xml configuration file
Using struts.properties file
......@@ -31,9 +31,9 @@ mvn eclipse:eclipse -Dwtpversion=2.0
```
## Struts 2 依赖项
## Struts2 依赖项
我正在使用 maven 导入 struts 2 运行时依赖项。 这样做的好处是,您无需手动记住和寻找必需的依赖项,一举就能掌握所有内容。
我正在使用 maven 导入 Struts2 运行时依赖项。 这样做的好处是,您无需手动记住和寻找必需的依赖项,一举就能掌握所有内容。
```java
<dependency>
......@@ -46,9 +46,9 @@ mvn eclipse:eclipse -Dwtpversion=2.0
如果您想查看所有包含的内容,请查看下图:(获取最新版本的 jar 文件)
![Struts 2 jar files](img/4e306a9c4559a0413080ca658adc5234.png)
![Struts2 jar files](img/4e306a9c4559a0413080ca658adc5234.png)
Struts 2 jar files
Struts2 jar files
......@@ -117,7 +117,7 @@ struts.custom.i18n.resources=global
## 编写第一个动作类
这很重要,因为您将在此处编写实际的应用逻辑。 Struts 2 动作通常扩展 [**ActionSupport**](https://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html "ActionSupport") 类,这些类提供了一些方法来覆盖和更改应用流,并在两者之间注入业务逻辑。
这很重要,因为您将在此处编写实际的应用逻辑。 Struts2 动作通常扩展 [**ActionSupport**](https://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html "ActionSupport") 类,这些类提供了一些方法来覆盖和更改应用流,并在两者之间注入业务逻辑。
```java
package com.howtodoinjava.struts2.example.web;
......@@ -155,7 +155,7 @@ public class TestAction extends ActionSupport
```
**注意:** Struts 2 动作看起来像 POJO 类,因为它们必须充当动作形式,它们也是 Struts 1 中的单独实体。
**注意:** Struts2 动作看起来像 POJO 类,因为它们必须充当动作形式,它们也是 Struts 1 中的单独实体。
## 组成视图文件
......@@ -170,7 +170,7 @@ public class TestAction extends ActionSupport
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Struts 2 hello world example</title>
<title>Struts2 hello world example</title>
<s:head/>
</head>
......@@ -219,7 +219,7 @@ public class TestAction extends ActionSupport
```java
submit=Submit
your.message-label=Your Name
welcome=Welcome to Struts 2!
welcome=Welcome to Struts2!
error.enter.message=Please enter your name !!
```
......@@ -240,7 +240,7 @@ error.enter.message=Please enter your name !!
![struts2-hello-world-3](img/d0130d03643abb28625695765e4c3db3.png)
这就是 struts 2 hello world 应用的全部朋友。 如果要下载本教程的源代码,请遵循以下给定的下载链接。
这就是 Struts2 hello world 应用的全部朋友。 如果要下载本教程的源代码,请遵循以下给定的下载链接。
[**源码下载**](https://docs.google.com/file/d/0B7yo2HclmjI4d2sxRGtSS1pONEE/edit?usp=sharing "struts 2 hello world 源码下载")
[**源码下载**](https://docs.google.com/file/d/0B7yo2HclmjI4d2sxRGtSS1pONEE/edit?usp=sharing "Struts2 hello world 源码下载")
**Happy Learning !!**
\ No newline at end of file
# Struts 2 Hello World 注释示例
# Struts2 Hello World 注释示例
> 原文: [https://howtodoinjava.com/struts2/struts-2-hello-world-with-annotations/](https://howtodoinjava.com/struts2/struts-2-hello-world-with-annotations/)
在我以前的文章中,我写了许多关于 [**JAX-RS RESTEasy**](//howtodoinjava.com/restful-web-service/ "RESTful Web services Tutorials")[**Spring3**](//howtodoinjava.com "Spring3 Tutorials")[**的示例和教程 ] Hibernate**](//howtodoinjava.com/hibernate-tutorials/ "Hibernate Tutorials") 和其他 Java 框架,例如 [**Maven**](//howtodoinjava.com/maven/ "Maven Tutorials")[**junit** **4**](//howtodoinjava.com/junit/ "JUnit Tutorials") 。 我还在与 [**Struts 2 hello world 和 xml 配置**](//howtodoinjava.com/struts-2/struts-2-hello-world-example-application/ "Struts 2 hello world example application") 相关的帖子中写道。 在本文中,我将更新先前的示例,以使用注释来配置 struts 2 应用。
在我以前的文章中,我写了许多关于 [**JAX-RS RESTEasy**](//howtodoinjava.com/restful-web-service/ "RESTful Web services Tutorials")[**Spring3**](//howtodoinjava.com "Spring3 Tutorials")[**的示例和教程 ] Hibernate**](//howtodoinjava.com/hibernate-tutorials/ "Hibernate Tutorials") 和其他 Java 框架,例如 [**Maven**](//howtodoinjava.com/maven/ "Maven Tutorials")[**junit** **4**](//howtodoinjava.com/junit/ "JUnit Tutorials") 。 我还在与 [**Struts2 hello world 和 xml 配置**](//howtodoinjava.com/struts-2/struts-2-hello-world-example-application/ "Struts2 hello world example application") 相关的帖子中写道。 在本文中,我将更新先前的示例,以使用注释来配置 Struts2 应用。
有关信息,struts 注解是 [**struts 常规插件**](https://struts.apache.org/docs/convention-plugin.html "struts 2 convention plugin") 的一部分。
有关信息,struts 注解是 [**struts 常规插件**](https://struts.apache.org/docs/convention-plugin.html "Struts2 convention plugin") 的一部分。
```java
Sections in this post:
Create maven web project
Struts 2 dependencies
Struts2 dependencies
web.xml changes
Writing first action class
Composing view files
......@@ -31,9 +31,9 @@ mvn eclipse:eclipse -Dwtpversion=2.0
```
## Struts 2 依赖项
## Struts2 依赖项
我正在使用 maven 导入 struts 2 运行时依赖项。 这样做的好处是,您无需手动记住和寻找必需的依赖项,一举就能掌握所有内容。
我正在使用 maven 导入 Struts2 运行时依赖项。 这样做的好处是,您无需手动记住和寻找必需的依赖项,一举就能掌握所有内容。
```java
<dependency>
......@@ -82,7 +82,7 @@ mvn eclipse:eclipse -Dwtpversion=2.0
## 编写第一个类
这很重要,因为您将在此处编写实际的应用逻辑。 Struts 2 操作通常扩展 **ActionSupport** 类,该类提供了一些方法来覆盖和更改应用流,并在两者之间注入业务逻辑。
这很重要,因为您将在此处编写实际的应用逻辑。 Struts2 操作通常扩展 **ActionSupport** 类,该类提供了一些方法来覆盖和更改应用流,并在两者之间注入业务逻辑。
```java
@Namespace("/default")
......@@ -130,7 +130,7 @@ public class TestAction extends ActionSupport
```
注意:Struts 2 动作看起来像 POJO 类,因为它们也必须充当动作形式,它们也是 Struts 1 中的单独实体。
注意:Struts2 动作看起来像 POJO 类,因为它们也必须充当动作形式,它们也是 Struts 1 中的单独实体。
## 构成视图文件
......@@ -145,7 +145,7 @@ public class TestAction extends ActionSupport
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Struts 2 hello world example</title>
<title>Struts2 hello world example</title>
<s:head/>
</head>
......@@ -194,7 +194,7 @@ public class TestAction extends ActionSupport
```java
submit=Submit
your.message-label=Your Name
welcome=Welcome to Struts 2!
welcome=Welcome to Struts2!
error.enter.message=Please enter your name !!
```
......@@ -219,7 +219,7 @@ error.enter.message=Please enter your name !!
![struts-folder-tree](img/ab6f074ff3a7767b519c8852fb057c90.png)
就是这个带有注解的 struts 2 hello world 应用的朋友。 如果要**下载本教程的源代码**,请按照以下给定的下载链接进行操作。
就是这个带有注解的 Struts2 hello world 应用的朋友。 如果要**下载本教程的源代码**,请按照以下给定的下载链接进行操作。
[**源码下载**](https://docs.google.com/file/d/0B7yo2HclmjI4Q0NZUlgxbm90Vk0/edit?usp=sharing "struts 2 annotations hello world source code")
[**源码下载**](https://docs.google.com/file/d/0B7yo2HclmjI4Q0NZUlgxbm90Vk0/edit?usp=sharing "Struts2 annotations hello world source code")
**Happy Learning !!**
\ No newline at end of file
# 使用@InterceptorRef 示例的 Struts 2 自定义拦截器
# 使用@InterceptorRef 示例的 Struts2 自定义拦截器
> 原文: [https://howtodoinjava.com/struts2/struts-2-custom-interceptor-with-interceptorref-example/](https://howtodoinjava.com/struts2/struts-2-custom-interceptor-with-interceptorref-example/)
在以前的帖子中,我们了解了 [hello world 应用](//howtodoinjava.com/struts-2/struts-2-hello-world-with-annotations/ "Struts 2 hello world with annotations")[设置 struts 2 应用](//howtodoinjava.com/struts-2/how-to-correctly-set-result-path-in-struts-2/ "How to correctly set result path in struts 2")的结果路径。 现在,在这篇文章中,我将举一个使用注释的自定义或用户定义的拦截器配置示例。
在以前的帖子中,我们了解了 [hello world 应用](//howtodoinjava.com/struts-2/struts-2-hello-world-with-annotations/ "Struts2 hello world with annotations")[设置 Struts2 应用](//howtodoinjava.com/struts-2/how-to-correctly-set-result-path-in-struts-2/ "How to correctly set result path in Struts2")的结果路径。 现在,在这篇文章中,我将举一个使用注释的自定义或用户定义的拦截器配置示例。
拦截器是一个类,其每次访问已配置的服务器资源时都会调用其预定义方法。 这可以在资源访问之前或之后访问。 请注意,此处的资源访问也意味着 HTTP 请求处理。
......@@ -14,7 +14,7 @@ Steps summary:
4) Apply on any Action class
```
**Important**: Please note that Struts 2 comes with many ready-made interceptor implementations, So make sure you really need to create your own interceptor or something can work for you.
**Important**: Please note that Struts2 comes with many ready-made interceptor implementations, So make sure you really need to create your own interceptor or something can work for you.
## 1)& 2)创建自定义拦截器类并实现重写的方法
......
# Struts 2 – 如何正确设置结果路径
# Struts2 – 如何正确设置结果路径
> 原文: [https://howtodoinjava.com/struts2/how-to-correctly-set-result-path-in-struts-2/](https://howtodoinjava.com/struts2/how-to-correctly-set-result-path-in-struts-2/)
在这里,结果路径表示 Struts 2 在执行 Action 类中的代码后将解析的 JSP 文件或其他视图文件的位置。 这些**结果路径在 Action 类顶部的@Result 注解**的“位置”中提到。
在这里,结果路径表示 Struts2 在执行 Action 类中的代码后将解析的 JSP 文件或其他视图文件的位置。 这些**结果路径在 Action 类顶部的@Result 注解**的“位置”中提到。
一旦动作类完成执行,它将把控件传递给视图解析器。 视图解析器尝试查找需要渲染的视图文件的位置。 该解决方案主要可以通过两种方式提及:
......
# Spring 4 + Struts 2 + Hibernate 集成教程
# Spring 4 + Struts2 + Hibernate 集成教程
> 原文: [https://howtodoinjava.com/struts2/spring-4-struts-2-hibernate-integration-tutorial/](https://howtodoinjava.com/struts2/spring-4-struts-2-hibernate-integration-tutorial/)
以前,我已经介绍了 [**Spring3 +Hibernate 集成**](//howtodoinjava.com/spring/spring-orm/spring-3-and-hibernate-integration-tutorial-with-example/ "Spring3 and hibernate integration tutorial with example") 示例和 [**struts 2 hello world**](//howtodoinjava.com/struts-2/struts-2-hello-world-example-application/ "Struts 2 hello world example application") 示例。 在本教程中,我将讨论将 spring 框架与 Struts 和 Hibernate 结合使用时要记住的所有重要点。 另外,请注意,本教程使用了其他次要但很重要的概念,例如日志记录,TLD 的使用和事​​务以及已集成到本教程中。 因此,请记住还要检查其详细信息。
以前,我已经介绍了 [**Spring3 +Hibernate 集成**](//howtodoinjava.com/spring/spring-orm/spring-3-and-hibernate-integration-tutorial-with-example/ "Spring3 and hibernate integration tutorial with example") 示例和 [**Struts2 hello world**](//howtodoinjava.com/struts-2/struts-2-hello-world-example-application/ "Struts2 hello world example application") 示例。 在本教程中,我将讨论将 spring 框架与 Struts 和 Hibernate 结合使用时要记住的所有重要点。 另外,请注意,本教程使用了其他次要但很重要的概念,例如日志记录,TLD 的使用和事​​务以及已集成到本教程中。 因此,请记住还要检查其详细信息。
在本教程中,我将使用简单的功能(例如全部获取,添加和删除)来构建员工管理屏幕。 它看起来像这样:
......@@ -849,6 +849,6 @@ Directory structure for spring struts hibernate integration
[Download .war File](https://drive.google.com/file/d/0B7yo2HclmjI4T2NrS19iRU5Hb3c/edit?usp=sharing "spring + struts + hibernate tutorial .war file link")
这是 **spring 4 + struts 2 + hibernate 集成**教程的全部内容。 让我知道您的想法和疑问。
这是 **spring 4 + Struts2 + hibernate 集成**教程的全部内容。 让我知道您的想法和疑问。
**祝您学习愉快!**
\ No newline at end of file
......@@ -2,7 +2,7 @@
> 原文: [https://howtodoinjava.com/struts2/solved-unable-to-find-interceptor-class-referenced-by-ref-name/](https://howtodoinjava.com/struts2/solved-unable-to-find-interceptor-class-referenced-by-ref-name/)
在为 [**@InterceptorRef 示例**](//howtodoinjava.com/struts-2/struts-2-custom-interceptor-with-interceptorref-example/ "Struts 2 custom interceptor with @InterceptorRef example") 编写代码时,我才知道此功能。 我必须在 struts.xml 文件中声明拦截器定义,而我想通过注释使用拦截器。 第一次尝试时,失败并显示以下错误:
在为 [**@InterceptorRef 示例**](//howtodoinjava.com/struts-2/struts-2-custom-interceptor-with-interceptorref-example/ "Struts2 custom interceptor with @InterceptorRef example") 编写代码时,我才知道此功能。 我必须在 struts.xml 文件中声明拦截器定义,而我想通过注释使用拦截器。 第一次尝试时,失败并显示以下错误:
```java
Unable to load configuration. - [unknown location]
......
......@@ -2,7 +2,7 @@
> 原文: [https://howtodoinjava.com/struts2/solved-unable-to-find-a-result-type-for-extension-properties-or-xml/](https://howtodoinjava.com/struts2/solved-unable-to-find-a-result-type-for-extension-properties-or-xml/)
如果您刚刚开始编写 struts 2 应用,并且正在配置它,那么您可能会遇到此异常。 完整的堆栈跟踪如下所示:
如果您刚刚开始编写 Struts2 应用,并且正在配置它,那么您可能会遇到此异常。 完整的堆栈跟踪如下所示:
```java
SEVERE: Dispatcher initialization failed
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册