From 1177762340ebc0e7bee444ae2d7c119f697cbdbb Mon Sep 17 00:00:00 2001
From: ulrich@undisclosed
Date: Sat, 02 May 2020 15:54:14 +0000
Subject: [PATCH] Kleinere Anpassungen

---
 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..9f0a7a3 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 pWert : pWerte) {
+              parameterListe.add(pWert);
+            } 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