public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println( this.getServletContext().getRealPath("uri")); response.setContentType("application/x-java-serialized-object"); String st = ""; System.out.println(1); try { ObjectInputStream stream = new ObjectInputStream(request.getInputStream()); SendObject so = (SendObject)stream.readObject(); stream.close(); Integer Right; System.out.println(2); if(so.getType()==pennenews.SendObject.LOGIN) { int auth = acces((String)so.getItem(0),(String)so.getItem(1)); Vector Content = new Vector(); pennenews.SendObject back = new pennenews.SendObject(pennenews.SendObject.LOGIN); back.addItem((String)so.getItem(0)); back.addItem(new Integer(auth)); System.out.println(3); if(auth > -1) { Right = new Integer(1); Vector[] main = new Vector[folders.length]; Vector[] kind = new Vector[folders.length]; for(int i=0; i<folders.length; i++) { main[i] = InputOutput.getInfos(InputOutput.TXT_PATH + folders[i].substring(0,4) + "/main.txt"); kind[i] = InputOutput.getArticlesOfFolder(folders[i].substring(0,4)); } Content.add(InputOutput.getInfos(InputOutput.TXT_PATH + "main.txt")); Content.add(main); Content.add(kind); Content.add(InputOutput.getDates()); Content.add(InputOutput.getArchive()); } System.out.println(4); back.addItem(Content); ObjectOutputStream Ostream = new ObjectOutputStream(response.getOutputStream()); Ostream.writeObject(back); Ostream.close(); } else if(so.getType()==SendObject.RELOAD) { Vector[] main = new Vector[folders.length]; Vector[] kind = new Vector[folders.length]; for(int i=0; i<folders.length; i++) { main[i] = InputOutput.getInfos(InputOutput.TXT_PATH + folders[i].substring(0,4) + "/main.txt"); kind[i] = InputOutput.getArticlesOfFolder(folders[i].substring(0,4)); } Vector Content = new Vector(); Content.add(InputOutput.getInfos(InputOutput.TXT_PATH + "main.txt")); Content.add(main); Content.add(kind); Content.add(InputOutput.getDates()); Content.add(InputOutput.getArchive()); pennenews.SendObject back = new pennenews.SendObject(pennenews.SendObject.RELOAD); back.addItem(""); back.addItem("0"); back.addItem(Content); ObjectOutputStream Ostream = new ObjectOutputStream(response.getOutputStream()); Ostream.writeObject(back); Ostream.close(); } if(so.getType()==pennenews.SendObject.SAVE) { Vector help = new Vector(so.getSize()-3); help.add(so.getItem(3)); help.add(so.getItem(4)); help.add(so.getItem(5)); help.add(so.getItem(6)); help.add(so.getItem(7)); String[] names = (String[])so.getItem(2); InputOutput.saveChanges(help,names); } } catch (IOException e) { st += e; System.out.println("IOException-Fehler: " + e); // Hier kommt immer die Fehlermeldung } catch (ClassNotFoundException e) { st += e; System.out.println("ClassNotFoundException-Fehler: " + e); } try { BufferedWriter writer = new BufferedWriter(new FileWriter("ja.txt")); writer.write("ja"); writer.write(st); writer.close(); } catch(IOException e) { System.out.println("Fehler beim Erstellen des Log :" + e); }}