Anti Cross-Site Scripting (XSS) For Java Web Application

In this tutorial, I am showing how to protect cross site scripting (xss) attacks for a java web application.

Cross-site scripting (XSS) happens, when an attacker injects malicious client sides scripts in the application.

How can we prevent Cross-site scripting (XSS)?

We can prevent xss attacks through hibernate validator’s @safehtml, which prevents HTML tags for XSS protection. @safehtml ensure that it contains no malicious code, such as embedded <script> elements.

Hibernate JPA With H2 Database

Hibernate JPA With H2 Database explains step by step details of setting / configuring Java Persistence JPA With Hibernate And H2

How To Configure Hibernate JPA With H2?

Java Persistence API, is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc.

ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

On this standalone JPA Example, we are using Java Persistence With H2 Database

Hibernate is popular open source ORM (Object Relation Mapping) tool for Java platform, for mapping an entity to a traditional relational like Oracle, MySQL, SQL Server, PostgreSQL, DB2, Derby, Sybase, H2 etc

I am going to reuse JPA Tutorial With Hibernate

Hibernate Many To Many Relation Mapping Example

Hibernate Many To Many Relation Mapping Example explains about how to implement a Many to Many relationship by using Hibernate

many-to-many entity relationship, each record of an entity have multiple records in other associated entity and vice versa

On this standalone Hibernate Many To Many Mapping Example, we are using Hibernate With MySQL Database.

Hibernate Many To One Relation Mapping Example

Hibernate Many To One Relation Mapping Example explains about how to implement a Many To One relationship by using Hibernate

many-to-one entity relationship, multiple records of an entity have single record in other associated entity

On this standalone Hibernate Many To One Mapping Example, we are using Hibernate With MySQL Database.

Hibernate One To Many Relation Mapping Example

Hibernate One To Many Relation Mapping Example explains about how to implement a One To Many relationship by using Hibernate

one-to-many entity relationship, each record of an entity have multiple records in other associated entity

On this standalone Hibernate One To Many Relation Mapping Example, we are using Hibernate With MySQL Database.

Hibernate One To One Relation Mapping Example

Hibernate One To One Relation Mapping Example explains about how to implement a One To One relationship by using Hibernate

one-to-one entity relationship, each record of an entity have single records in other associated entity

On this standalone Hibernate One To One Relation Mapping Example, we are using Hibernate With MySQL Database.

Hibernate JPA One To One Relation Mapping Example

Hibernate JPA One To One Relation Mapping Example explains about how to implement a One To One relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

one-to-one entity relationship, each record of an entity have single records in other associated entity

On this standalone One To One Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table

Hibernate JPA One To Many Relation Mapping Example

Hibernate JPA One To Many Relation Mapping Example explains about how to implement a One To Many relationship by using Hibernate JPA

Java Persistence API (JPA) is a standard interface which wraps different ORM tools such as  Hibernate, EclipseLink, OpenJPA etc. ie; you can able to change Hibernate implementation to EclipseLink implementation without changing the code base.

one-to-many entity relationship, each record of an entity have multiple records in other associated entity

On this standalone One To Many Mapping Example, we are using Java Persistence (JPA) With MySQL Database. If you want to configure Hibernate JPA With other Databases, you can check below table