old school Weblogic 5 ServletContext question

Discussion in 'Java' started by laredotornado@zipmail.com, Jul 6, 2005.

  1. Guest

    Hello,
    Someone had written an application in Tomcat and we were moving it
    to WebLogic 5, sp 12 for Solaris (I know it's old, we'll upgrade one
    day). For now, I was curious, if there is a call like

    public final class InitServlet extends HttpServlet^M
    {^M
    /** Initializes the servlet.^M
    * @param config of type ServletConfig^M
    * @throws ServletException for any reason^M
    */^M
    public void init(ServletConfig config) throws ServletException^M
    {^M
    super.init(config);^M
    ^M
    //Used to log in the file^M
    ServletContext context = getServletContext();^M
    //Check if logging is necessary^M
    String szLogLevel = context.getInitParameter("system.log");

    ....

    1. Where would we define what the parameter "system.log" should be??

    2. When and how would the "init" method of the "InitServlet" class get
    called?

    Thanks, - Dave
     
    , Jul 6, 2005
    #1
    1. Advertising

  2. wrote:
    > Hello,
    > Someone had written an application in Tomcat and we were moving it
    > to WebLogic 5, sp 12 for Solaris (I know it's old, we'll upgrade one
    > day). For now, I was curious, if there is a call like
    >
    > public final class InitServlet extends HttpServlet^M
    > {^M
    > /** Initializes the servlet.^M
    > * @param config of type ServletConfig^M
    > * @throws ServletException for any reason^M
    > */^M
    > public void init(ServletConfig config) throws ServletException^M
    > {^M
    > super.init(config);^M
    > ^M
    > //Used to log in the file^M
    > ServletContext context = getServletContext();^M
    > //Check if logging is necessary^M
    > String szLogLevel = context.getInitParameter("system.log");
    >
    > ...
    >
    > 1. Where would we define what the parameter "system.log" should be??
    >
    > 2. When and how would the "init" method of the "InitServlet" class get
    > called?
    >


    You should read over the servlet specification from Sun. It is really
    not a difficult read. If you need something more digested, get a book
    on servlets (the O'Rielly book is good).

    The initialization parameters are defined in the web.xml file for the WAR.

    The init() method of a servlet is invoked by the application server
    before the servlet handles requests. There is also a destroy() method,
    called when the application server has finished with the servlet.

    HTH,
    Ray

    --
    XML is the programmer's duct tape.
     
    Raymond DeCampo, Jul 6, 2005
    #2
    1. Advertising

  3. Guest

    Thanks for your response, but unfortunately WebLogic 5 predates the
    concept of WAR/web.xml files.

    Knowing this, do you have any other suggestions?

    Thanks, -
     
    , Jul 6, 2005
    #3
  4. wrote:
    > Thanks for your response, but unfortunately WebLogic 5 predates the
    > concept of WAR/web.xml files.


    I see.

    >
    > Knowing this, do you have any other suggestions?


    I think you are into totally WebLogic-specific territory here if the
    above is true. I think you will have to read the WebLogic 5 manual.

    >
    > Thanks, -
    >


    Ray

    --
    XML is the programmer's duct tape.
     
    Raymond DeCampo, Jul 6, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    2
    Views:
    10,340
  2. CoreyWhite
    Replies:
    0
    Views:
    373
    CoreyWhite
    Mar 23, 2007
  3. CoreyWhite

    The Old School Meet's The New School.

    CoreyWhite, Mar 23, 2007, in forum: C Programming
    Replies:
    0
    Views:
    359
    CoreyWhite
    Mar 23, 2007
  4. jack
    Replies:
    0
    Views:
    385
  5. Intransition

    Ruby 1.9 Old School $LOAD_PATH

    Intransition, Jul 7, 2010, in forum: Ruby
    Replies:
    1
    Views:
    112
Loading...

Share This Page