From 09b3fc0cda5b08d6e2dc495e967eaacf23f51d2c Mon Sep 17 00:00:00 2001 From: ulrich <nondisclosed> Date: Sun, 01 Mar 2015 13:17:36 +0000 Subject: [PATCH] kosmetische Aenderungen --- src/de/uhilger/transit/web/TransitServlet.java | 32 +++++++++++++++++++++----------- 1 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/de/uhilger/transit/web/TransitServlet.java b/src/de/uhilger/transit/web/TransitServlet.java index 55f7660..a4d22ff 100644 --- a/src/de/uhilger/transit/web/TransitServlet.java +++ b/src/de/uhilger/transit/web/TransitServlet.java @@ -17,6 +17,12 @@ */ package de.uhilger.transit.web; +import de.uhilger.transit.JavaServer; +import de.uhilger.transit.JsonFlatWandler; +import de.uhilger.transit.JsonNiceWandler; +import de.uhilger.transit.JsonWandler; +import de.uhilger.transit.NutzerKontext; +import de.uhilger.transit.XmlWandler; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; @@ -29,7 +35,6 @@ import java.util.ArrayList; import java.util.List; -import de.uhilger.transit.*; /** * Das TransitServlet macht beliebige Klassen und Methoden ueber HTTP @@ -156,16 +161,20 @@ while (en.hasMoreElements()) { String pName = en.nextElement().toString(); String[] pWerte = req.getParameterValues(pName); - if (pName.equals(CLASS_NAME)) { - klassenName = pWerte[0]; - } else if (pName.equals(METHOD_NAME)) { - methodenName = pWerte[0]; - } else if (pName.equals(FORMAT_NAME)) { - formatName = pWerte[0]; - } else { - for (int i = 0; i < pWerte.length; i++) { - parameterListe.add(pWerte[i]); - } + switch (pName) { + case CLASS_NAME: + klassenName = pWerte[0]; + break; + case METHOD_NAME: + methodenName = pWerte[0]; + break; + case FORMAT_NAME: + formatName = pWerte[0]; + break; + default: + for (String pWerte1 : pWerte) { + parameterListe.add(pWerte1); + } break; } } Object[] parameter = parameterListe.toArray(new Object[0]); @@ -174,6 +183,7 @@ server = new JavaServer(); server.wandlerHinzufuegen(new JsonWandler()); server.wandlerHinzufuegen(new JsonFlatWandler()); + server.wandlerHinzufuegen(new JsonNiceWandler()); server.wandlerHinzufuegen(new XmlWandler()); Class cls = server.klasseFinden(klassenName); if (cls != null) { -- Gitblit v1.9.3