@@ -54,27 +54,26 @@ public String post(PageModel model, @ModelAttribute(value = "appId") @BindParams
5454 @ RequestParam ("action" ) String action ,
5555 @ SpringBean ("appFrameworkService" ) AppFrameworkService service , HttpSession session , UiUtils ui ) {
5656
57- String htmlSafeAppId = StringEscapeUtils .escapeHtml (userApp .getAppId ());
5857 try {
5958 AppDescriptor descriptor = mapper .readValue (userApp .getJson (), AppDescriptor .class );
60- if (!htmlSafeAppId .equals (descriptor .getId ())) {
59+ if (!userApp . getAppId () .equals (descriptor .getId ())) {
6160 session .setAttribute (UiCommonsConstants .SESSION_ATTRIBUTE_ERROR_MESSAGE ,
6261 ui .message ("referenceapplication.app.errors.IdsShouldMatch" ));
63- } else if ("add" .equals (action ) && service .getUserApp (htmlSafeAppId ) != null ) {
62+ } else if ("add" .equals (action ) && service .getUserApp (userApp . getAppId () ) != null ) {
6463 session .setAttribute (UiCommonsConstants .SESSION_ATTRIBUTE_ERROR_MESSAGE ,
6564 ui .message ("referenceapplication.app.errors.duplicateAppId" ));
6665 } else {
6766 service .saveUserApp (userApp );
6867
6968 InfoErrorMessageUtil .flashInfoMessage (session ,
70- ui .message ("referenceapplication.app.userApp.save.success" , htmlSafeAppId ));
69+ ui .message ("referenceapplication.app.userApp.save.success" , StringEscapeUtils . escapeHtml ( userApp . getAppId ()) ));
7170
7271 return "redirect:/referenceapplication/manageApps.page" ;
7372 }
7473 }
7574 catch (Exception e ) {
7675 session .setAttribute (UiCommonsConstants .SESSION_ATTRIBUTE_ERROR_MESSAGE ,
77- ui .message ("referenceapplication.app.userApp.save.fail" , htmlSafeAppId ));
76+ ui .message ("referenceapplication.app.userApp.save.fail" , StringEscapeUtils . escapeHtml ( userApp . getAppId ()) ));
7877 }
7978
8079 model .addAttribute ("userApp" , userApp );
0 commit comments