aboutsummaryrefslogtreecommitdiff
path: root/id/server/idserverlib/src/main
diff options
context:
space:
mode:
authorThomas Lenz <tlenz@iaik.tugraz.at>2014-06-11 13:26:08 +0200
committerThomas Lenz <tlenz@iaik.tugraz.at>2014-06-11 13:26:08 +0200
commit64ef43d992ffd7cfd5f571b1922ad0d32ef668ad (patch)
treebc8e99d58d4a5f869973f47dbe13660424a23e07 /id/server/idserverlib/src/main
parent1fcd3257660917fef95498f36300330afe8a00ed (diff)
downloadmoa-id-spss-64ef43d992ffd7cfd5f571b1922ad0d32ef668ad.tar.gz
moa-id-spss-64ef43d992ffd7cfd5f571b1922ad0d32ef668ad.tar.bz2
moa-id-spss-64ef43d992ffd7cfd5f571b1922ad0d32ef668ad.zip
solve problem with Velocity EngineMOA-ID-2.1-RC2
Diffstat (limited to 'id/server/idserverlib/src/main')
-rw-r--r--id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
index a46b11c6e..cb12bc5bd 100644
--- a/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
+++ b/id/server/idserverlib/src/main/java/at/gv/egovernment/moa/id/moduls/SSOManager.java
@@ -288,21 +288,22 @@ public class SSOManager {
public void printSingleLogOutInfo(VelocityContext context, HttpServletResponse httpResp) throws MOAIDException {
try {
Logger.trace("Initialize VelocityEngine...");
- VelocityEngine velocityEngine = VelocityProvider.getClassPathVelocityEngine();
InputStream is = null;
+ String pathLocation = null;
try {
String rootconfigdir = AuthConfigurationProvider.getInstance().getRootConfigFileDir();
- String pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL;
+ pathLocation = rootconfigdir + HTMLTEMPLATESDIR + HTMLTEMPLATEFULL;
File file = new File(new URI(pathLocation));
is = new FileInputStream(file);
evaluateSLOTemplate(context, httpResp, is);
} catch (Exception e) {
- Logger.warn("SLO Template is not found in configuration directory. Load template from project library ... ");
+ Logger.warn("SLO Template is not found in configuration directory (" +
+ pathLocation + "). Load template from project library ... ");
try {
- String pathLocation = "resources/templates/" + HTMLTEMPLATEFULL;
+ pathLocation = "resources/templates/" + HTMLTEMPLATEFULL;
is = Thread.currentThread()
.getContextClassLoader()
.getResourceAsStream(pathLocation);
@@ -326,7 +327,10 @@ public class SSOManager {
}
- private void evaluateSLOTemplate(VelocityContext context, HttpServletResponse httpResp, InputStream is) throws ConfigurationException, IOException {
+ private void evaluateSLOTemplate(VelocityContext context, HttpServletResponse httpResp, InputStream is) throws Exception {
+
+ VelocityEngine engine = VelocityProvider.getClassPathVelocityEngine();
+
BufferedReader reader = new BufferedReader(new InputStreamReader(is ));
//set default elements to velocity context
@@ -334,7 +338,7 @@ public class SSOManager {
StringWriter writer = new StringWriter();
//velocityEngine.evaluate(context, writer, "SLO_Template", reader);
- Velocity.evaluate(context, writer, "SLO Template", reader);
+ engine.evaluate(context, writer, "SLO Template", reader);
httpResp.setContentType("text/html;charset=UTF-8");