open-menu closeme
Home
RetroComp icon
Retro Computing Articles Composition Notebooks 8bit
DevOps icon
Automation K8s Done Right
GenAI icon
Fatlama Newsletter Generative AI
Projects icon
Software Projects Arduino Esp8266 SQLite
Status
Links icon
GitHub LinkedIn
About
馃寪
English Italiano
github linkedin rss
  • Java Session Fancy Printing

    calendar Mar 27, 2007 路 2 min read
     blog-objectsrootcom en  路 http java list sage
     路
    Share on: twitter facebook linkedin copy
    Java Session Fancy Printing

    聽聽聽 public static final String convertToString(HttpServletRequest request) {
    聽聽聽聽聽聽聽 StringBuffer msg = new StringBuffer();
    聽聽聽聽聽聽聽 try {

    聽聽聽聽聽聽聽聽聽聽聽 msg.append("*RequestURI:" + request.getRequestURI() + "\n");
    聽聽聽聽聽聽聽聽聽聽聽 msg.append("*ContentType:" + request.getContentType() + "\n");

    聽聽聽聽聽聽聽聽聽聽聽 msg.append("== Request Header\n");
    聽聽聽聽聽聽聽聽聽聽聽 Enumeration headers = request.getHeaderNames();
    聽聽聽聽聽聽聽聽聽聽聽 while (headers.hasMoreElements()) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 String headerName = "" + headers.nextElement();
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append(headerName + ":" + request.getHeader(headerName) + "\n");
    聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽 msg.append("\n");
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 Enumeration attr = request.getParameterNames();聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 ArrayList l = new ArrayList();
    聽聽聽聽聽聽聽聽聽聽聽 String att;
    聽聽聽聽聽聽聽聽聽聽聽 while (attr.hasMoreElements()) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 att = (String) attr.nextElement();
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 l.add(att + " -> " + request.getParameter(att));
    聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 msg.append("=== Request ( " + l.size() + " ) ===\n");
    聽聽聽聽聽聽聽聽聽聽聽 Object a[] = l.toArray();
    聽聽聽聽聽聽聽聽聽聽聽 Arrays.sort(a);
    聽聽聽聽聽聽聽聽聽聽聽 for (int i = 0; i < a.length; i++) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append((String) a[i]);
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append("\n");
    聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽 msg.append("===聽聽 ===聽聽 ===\n");
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 // Process the Session
    聽聽聽聽聽聽聽聽聽聽聽 HttpSession session = request.getSession();
    聽聽聽聽聽聽聽聽聽聽聽 // msg.append("\n");
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 Enumeration e = session.getAttributeNames();
    聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 TreeMap t = new TreeMap();
    聽聽聽聽聽聽聽聽聽聽聽 String k;
    聽聽聽聽聽聽聽聽聽聽聽 while (e.hasMoreElements()) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 k = (String) e.nextElement();
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 Object oggetto;
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 try {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 oggetto = session.getAttribute(k);
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 } catch (Throwable notSerializableException) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 oggetto = "NON DESERIALIZZABILE. Chiave:" + k;
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 t.put(k, oggetto);
    聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 聽
    聽聽聽聽聽聽聽聽聽聽聽 Object orderedKeys[] = t.keySet().toArray();
    聽聽聽聽聽聽聽聽聽聽聽 msg.append("=== Session聽 ( " + orderedKeys.length + " " + (usertempz != null ? "+ 1UT" : " NO UT!") + " )===\n");
    聽聽聽聽聽聽聽聽聽聽聽 Object elem;

    聽聽聽聽聽聽聽聽聽聽聽 for (int i = 0; i < orderedKeys.length; i++) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 elem = t.get(orderedKeys[i]);
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append(orderedKeys[i]);

    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append("\t-> ");
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 if (elem != null) {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 nicePrintSessionObj(msg, elem);
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 } else {
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append("null");
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 msg.append("\n");
    聽聽聽聽聽聽聽聽聽聽聽 }
    聽聽聽聽聽聽聽聽聽聽聽 return msg.toString();
    聽聽聽聽聽聽聽 } catch (RuntimeException e) {
    聽聽聽聽聽聽聽聽聽聽聽 return msg + "\nERR: Cannot print session/request!!" + e.getMessage();
    聽聽聽聽聽聽聽 }
    聽聽聽 }


    Read More
  • Smoking Gio

    calendar Mar 26, 2007 路 1 min read
     blog-objectsrootcom en  路 ant bad car http pd vi video web
     路
    Share on: twitter facebook linkedin copy
    Smoking Gio

    My first webcam video....
    See and have fun: http://www.youtube.com/watch?v=53CIgqpD0S8


    Read More
  • Against drm

    calendar Mar 6, 2007 路 0 min read
     blog-objectsrootcom en  路 again
     路
    Share on: twitter facebook linkedin copy
    Against drm


    Sign an Open Letter To Steve Jobs


    Read More
  • Site Update: Happy new editor!

    calendar Feb 28, 2007 路 1 min read
     blog-objectsrootcom en site  路 ajax ant complex django easy editor framework good java javascript make news opinion pd script site touch vi web
     路
    Share on: twitter facebook linkedin copy
    Site Update: Happy new editor!

    (First published on 2007-01-20)

    Hi all, ObjectsRoot now has correct story ordering ontags view!


    Read More
  • Modena e Padova twin trip

    calendar Jan 21, 2007 路 1 min read
     blog-objectsrootcom en  路 good pd reader tip trip ui
     路
    Share on: twitter facebook linkedin copy
    Modena e Padova twin trip

    Hi blog readers! Your trip master has just come back from a win trip done in the swap of the year. We have been in Modena in December and in Padova, this month. We have done one-day-trips, fast and furious as usual. I have done about 6 photos to Modena. I liked a bit more Padova, which needs at least two days to be seen. Padova has a lot of beautiful and nice churches to see. Consider only the Scrovengi’s Chapel, very well known.


    Read More
  • humble ajax

    calendar Jan 20, 2007 路 1 min read
     blog-objectsrootcom en  路 ajax easy good hacking ibm interface simple site system
     路
    Share on: twitter facebook linkedin copy
    humble ajax

    I think ajax is a very new technology, but with too much hype on it. I think we’d try to do simple things with it, avoiding too much bloated interfaces.


    Read More
  • Vampata d’amore

    calendar Dec 13, 2006 路 1 min read
     blog-objectsrootcom en  路 italia vi
     路
    Share on: twitter facebook linkedin copy
    Vampata d&#39;amore

    I am very proud to present an Italian comedy called Vampata D'amore (Love's Flush) written by my cusin, Alessandro Bonvini.


    Read More
  • Rocket boom rocks

    calendar Nov 21, 2006 路 1 min read
     blog-objectsrootcom en  路 google site vi video
     路
    Share on: twitter facebook linkedin copy
    Rocket boom rocks

    I have surfed today and I have found two sites worth to see: <a href=“http://www.rocketboom.com/"


    Read More
  • Software Trends1

    calendar Oct 12, 2006 路 2 min read
     blog-objectsrootcom en lang software  路 ant apple book commercial developement ejb ibm ideas italy linux news perl php ping programming programming-languages project python ruby site small smalltalk smart squeak system trends ui vi war web
     路
    Share on: twitter facebook linkedin copy
    Software Trends1

    The trends of this october are about some upcoming products. A clear analisys of <a href=“http://www.roughlydrafted.com/Sept05.Quark.html"


    Read More
  • Exupery: byte compiler for Squeak

    calendar Oct 6, 2006 路 1 min read
     blog-objectsrootcom en  路 link rim squeak usa
     路
    Share on: twitter facebook linkedin copy
    Exupery: byte compiler for Squeak

    I have tried Exupery, the Squeak byte compiler written by Bryce Kampjes. Exupery is still in beta but is usable for experimenting. SqueakWeekly is happy to publish a prime-time FAQ!

    聽


    Read More
    • ««
    • «
    • 45
    • 46
    • 47
    • 48
    • 49
    • »
    • »»

Recent Posts

  • 6,76%
  • Il tizio con il cappello che crede di comandare il mondo intero
  • Murderbot: i diari della macchina assassina
  • Breve guida agli ETF

Latest comments

    Giovanni Giorgi

    Copyright 1999-  GIOVANNI GIORGI. All Rights Reserved

    to-top