This commit is contained in:
Nikolaos Laskaris 2017-11-16 19:24:05 +02:00
parent 48ed8ac469
commit e981d9c92e
3 changed files with 41 additions and 23 deletions

View File

@ -263,19 +263,19 @@ public class Projects {
Project newproj = projectDao.create(project); Project newproj = projectDao.create(project);
DMP newdmp = new DMP(); // DMP newdmp = new DMP();
newdmp.setId(null); // newdmp.setId(null);
newdmp.setLabel("Auto-Generated"); // newdmp.setLabel("Auto-Generated");
newdmp.setCreated(new Date()); // newdmp.setCreated(new Date());
newdmp.setVersion(1); // newdmp.setVersion(1);
newdmp.setStatus(new Short("0")); // newdmp.setStatus(new Short("0"));
newdmp.setProject(newproj); // newdmp.setProject(newproj);
//
Set<UserInfo> users = new HashSet<UserInfo>(); // Set<UserInfo> users = new HashSet<UserInfo>();
users.add(userInfo); // users.add(userInfo);
newdmp.setUsers(users); // newdmp.setUsers(users);
//
newdmp = dMPDao.create(newdmp); // newdmp = dMPDao.create(newdmp);
return ResponseEntity.status(HttpStatus.OK).body(SerializerProvider.toJson(newproj)); return ResponseEntity.status(HttpStatus.OK).body(SerializerProvider.toJson(newproj));
} }

View File

@ -75,7 +75,7 @@ public class Users {
@RequestMapping(method = RequestMethod.GET, value = { "/user/whoami" }, produces="application/json") @RequestMapping(method = RequestMethod.GET, value = { "/user/whoami" }, produces="application/json;charset=UTF-8")
public @ResponseBody ResponseEntity<Object> whoami(){ public @ResponseBody ResponseEntity<Object> whoami(){
@ -88,6 +88,7 @@ public class Users {
UserInfo userInfo = userInfoDao.getUserInfo(userID); UserInfo userInfo = userInfoDao.getUserInfo(userID);
System.out.println(userInfo.getName());
if(userInfo==null) //this should normally never happer if(userInfo==null) //this should normally never happer
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("There's no such a user on the system. You shouldn't be here"); return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body("There's no such a user on the system. You shouldn't be here");

View File

@ -65,16 +65,16 @@
</listener> </listener>
<context-param> <!-- THIS FILTER IS FOR SPRING SECURITY -->
<param-name>contextConfigLocation</param-name> <context-param>
<param-value>/WEB-INF/applicationContext.xml,/WEB-INF/spring-security.xml</param-value> <param-name>contextConfigLocation</param-name>
<!-- <param-value>/WEB-INF/applicationContext.xml</param-value> --> <param-value>/WEB-INF/applicationContext.xml,/WEB-INF/spring-security.xml</param-value>
</context-param> <!-- <param-value>/WEB-INF/applicationContext.xml</param-value> -->
<session-config> </context-param>
<session-timeout>30</session-timeout> <session-config>
</session-config> <session-timeout>30</session-timeout>
</session-config>
<!-- THIS FILTER IS FOR SPRING SECURITY -->
<filter> <filter>
<filter-name>springSecurityFilterChain</filter-name> <filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
@ -85,6 +85,23 @@
</filter-mapping> </filter-mapping>
<!-- THIS FILTER IS FOR SUPPORTING UNICODE CHARACTERS -->
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app> </web-app>