=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java 2014-08-15 07:40:20 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppListAction.java 2015-01-16 17:29:56 +0000 @@ -61,9 +61,6 @@ return appList; } - //TODO create settings to set for external server like Apache2/nginx - //TODO Should be a per-app setting - private String appBaseUrl; public String getAppBaseUrl() === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java 2014-07-08 16:54:08 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-appmanager/src/main/java/org/hisp/dhis/appmanager/action/AppSettingsAction.java 2015-01-16 17:29:56 +0000 @@ -67,9 +67,10 @@ { appFolderPath = appManager.getAppFolderPath(); - if ( null == appFolderPath || appFolderPath.isEmpty() ) + if ( appFolderPath == null || appFolderPath.isEmpty() ) { String realPath = ServletActionContext.getServletContext().getRealPath( "/" ); + if ( realPath.endsWith( "/" ) || realPath.endsWith( "\\" ) ) { appFolderPath = realPath + "apps"; @@ -97,7 +98,7 @@ { appBaseUrl = appManager.getAppBaseUrl(); - if ( null == appBaseUrl || appBaseUrl.isEmpty() ) + if ( appBaseUrl == null || appBaseUrl.isEmpty() ) { HttpServletRequest request = ServletActionContext.getRequest(); String realPath = ServletActionContext.getServletContext().getRealPath( "/" ); @@ -108,12 +109,12 @@ if ( !contextPath.isEmpty() ) { appBaseUrl = baseUrl.substring( 0, baseUrl.length() - 1 ) + request.getContextPath() + "/" - + ((appsPath.replace( "//", "/" )).replace( realPath, "" )).replace( '\\', '/' ); + + ( ( appsPath.replace( "//", "/" ) ).replace( realPath, "" ) ).replace( '\\', '/' ); } else { appBaseUrl = baseUrl.substring( 0, baseUrl.length() - 1 ) - + ((appsPath.replace( "//", "/" )).replace( realPath, "" )).replace( '\\', '/' ); + + ( ( appsPath.replace( "//", "/" ) ).replace( realPath, "" ) ).replace( '\\', '/' ); } appManager.setAppBaseUrl( appBaseUrl );