...try { URL servURL = new URL( "http://localhost:8080/rk/servlet/rk.TippSpeichern" ); URLConnection servConn = servURL.openConnection(); servConn.setUseCaches( false ); servConn.setDoOutput( true ); servConn.setRequestProperty( "Content-Type", "application/octet-stream" ); ObjectOutputStream oos = new ObjectOutputStream( servConn.getOutputStream() ); oos.writeObject( (String) URLEncoder.encode( strLine ) ); oos.close(); } catch ( Exception ex ) {}...
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ... try { ois = new ObjectInputStream( request.getInputStream() ); NeuerTipp = (String) ois.readObject(); ois.close(); } catch ( Exception ex ) { } ... try { DataInputStream myData = new DataInputStream( new FileInputStream( fileName ) ); for ( Zeile=1; (strLine=myData.readLine())!=null; Zeile++ ) myZeile.put( new Integer( Zeile ).toString(), strLine ); myData.close(); ... PrintWriter pw = new PrintWriter( new FileWriter( fileName ), true ); for ( Zeile=1; Zeile<=myZeile.size(); Zeile++ ) pw.println( (String) myZeile.get( new Integer( Zeile ).toString() ) ); pw.close(); } catch ( IOException ioe ) { }//catch ...