you might be right and I can change that. But first I would like to solve my problem. Im sorry, you might have realized that Im a newbie, but I really need help, because Im stuck.
Here is my mappingfile. I thought there must be everything right with the configuration, because saving new users works without problem
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="package.backend.hibernate.Users" table="users">
<id column="username" name="username" type="java.lang.String"/>
<property name="password" type="java.lang.String"/>
<property name="enabled" type="boolean"/>
</class>
<class name="package.backend.hibernate.Authorities" table="authorities">
<composite-id access="field" class="package.backend.hibernate.AuthoritiesPK" name="authoritiesPK">
<key-property access="field" column="username" name="username" type="java.lang.String"/>
<key-property access="field" column="authority" name="authority" type="java.lang.String"/>
</composite-id>
</class>
<class name="package.backend.hibernate.Userinformation" table="userinformation">
<id column="email" name="email" type="java.lang.String"/>
<property name="username" type="java.lang.String"/>
<property name="gender" type="java.lang.String"/>
<property name="birthday" type="java.lang.String"/>
<property name="city" type="java.lang.String"/>
<property name="country" type="int"/>
<property name="foto" type="java.lang.String"/>
</class>
<class name="package.backend.hibernate.Securitysalt" table="securitysalt">
<id column="username" name="username" type="java.lang.String"/>
<property name="salt" type="java.lang.String"/>
</class>
</hibernate-mapping>
my web.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Project</display-name>
<description>Project</description>
<!-- URL Rewrite Filter -->
<!-- called for every Page - /* -->
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>UrlRewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Dispatcher Servlet - resolves view names and scans the packages for annotations -->
<servlet>
<servlet-name>jspDispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/dispatcher/*
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jspDispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- thats for static files -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/static/*</url-pattern>
</servlet-mapping>
<!-- Configuration Files to be loaded -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/applicationContext.xml
</param-value>
</context-param>
<!-- Security Configurations -->
<!-- get the Security Configuration File -->
<!-- All requests are going through the springSecurityFilterChain -->
<!-- The DelegatingFilterProxy -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
</web-app>
<!-- with this annotations didnt work so I commented it out
<filter>
<filter-name>HibernateSession</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>HibernateSession</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
-->