Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/security UnsecureServlet.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/security UnsecureServlet.java

Author leonardr
Full name Leonard Richardson
Date 2001-04-16 17:18:51 PDT
Message User: leonardr
  Date: 01/04/16 17:18:51

  Modified: java/org/joist/security UnsecureServlet.java
  Log:
  Moved message code into a method which can be overridden.
  
  Revision Changes Path
  1.123 +36 -11 joist/java/org/joist​/security/UnsecureSe​rvlet.java
  
  Index: UnsecureServlet.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/security/Unsec​ureServlet.java,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- UnsecureServlet.java 2001/04/03 00:10:28 1.122
  +++ UnsecureServlet.java 2001/04/17 00:18:50 1.123
  @@ -80,7 +80,7 @@
    *
    * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
    * @author <a href="mailto:dlr@col​lab.net">Daniel Rall</a>
  - * @version $Revision: 1.122 $
  + * @version $Revision: 1.123 $
    *
    * Copyright (c) 1999 dataweb systems, inc.
    * Copyright (c) 1999-2001 CollabNet, Inc.
  @@ -118,6 +118,11 @@
       private static final boolean DEBUG = false;
   
       /**
  + * Context key for the current broadcast message
  + */
  + public static final String BROADCAST_MESSAGE_KEY = "broadcastMessage";
  +
  + /**
        * A constant for the empty {@link java.lang.String} object sometimes
        * supplied to the context by <code>processF​ield</code>.
        */
  @@ -211,6 +216,14 @@
       public Template handle (WebContext context)
           throws HandlerException
       {
  + try
  + {
  + throw new Exception("!");
  + }
  + catch (Exception e)
  + {
  + e.printStackTrace();
  + }
           ResourceBroker broker = (ResourceBroker) getBroker();
           String templateName;
           Template template = null;
  @@ -673,13 +686,34 @@
               }
           }
   
  + populateWithBroadcas​tMessage(connection,​ context);
  +
  + // Format date to YYYY-MM-DD.
  + DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
  + context.put("todayDate", df.format(new java.util.Date()));
  +
  + // Use the default template to start with. Another template could
  + // be substituted before we're done.
  +
  + return fullTemplate.toString();
  + }
   
  + /**
  + * Populates the context with the current broadcast message.
  + */
  + protected void populateWithBroadcas​tMessage(Connection connection,
  + WebContext context)
  + throws HandlerException
  + {
  + SessionManager sMgr = getSessionManager(context);
  + DataManager dMgr = sMgr.getDataManager();
  +
           // Get any broadcast message and put it into the context
           try
           {
               MessageManager mMgr = (MessageManager)
                   dMgr.getManager("org​.joist.admin.Message​Manager");
  - context.put("broadcastMessage",
  + context.put(BROADCAS​T_MESSAGE_KEY,
                           mMgr.getBroadcastMes​sage(connection));
           }
           catch (SQLException e)
  @@ -691,16 +725,7 @@
               throw new HandlerException(e.g​etMessage());
           }
   
  - // Format date to YYYY-MM-DD.
  - DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
  - context.put("todayDate", df.format(new java.util.Date()));
  -
  - // Use the default template to start with. Another template could
  - // be substituted before we're done.
  -
  - return fullTemplate.toString();
       }
  -
   
       /**
        * Redirect to use a different scheme, such as http or https.

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/security UnsecureServlet.java leonardr Leonard Richardson 2001-04-16 17:18:51 PDT
Messages per page: