Class AddNewTopic

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--SuperServlet
                    |
                    +--AddNewTopic
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class AddNewTopic
extends SuperServlet

This class implements a servlet for adding a new topic in the forum. It uses tables in database: 'db_03_peta_la' at 'atlas.dsv.su.se'.

Version:
$Revision: 1.0.1, 2003-11-10 $
Author:
Peter Larsson
See Also:
Serialized Form

Constructor Summary
AddNewTopic()
           
 
Method Summary
 void addNewTopic(java.io.PrintWriter pw, java.lang.String forum, int forum_id, java.lang.String topic, java.lang.String message, java.lang.String uName)
          Adds a new topic to the selected forum.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The Get method is run when the Client requests the htmlFile.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The Post method is run when a new message is added to the guestbook.
 void init()
          The init-method which is run when servlet is run for the first time.
 void showForum(javax.servlet.http.HttpServletRequest req, java.io.PrintWriter pw, java.lang.String forum, int forum_id, java.lang.String uName)
          Fetches the content of one forum in the database and puts it on the Web.
 
Methods inherited from class SuperServlet
destroy
 
Methods inherited from class javax.servlet.http.HttpServlet
service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddNewTopic

public AddNewTopic()
Method Detail

init

public void init()
          throws javax.servlet.ServletException

The init-method which is run when servlet is run for the first time.

Overrides:
init in class SuperServlet
Throws:
javax.servlet.ServletException - The standard ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException

The Get method is run when the Client requests the htmlFile.

Parameters:
request - The Request
response - The Response
Throws:
java.io.IOException - The standard IOException
javax.servlet.ServletException - The standard ServletException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException

The Post method is run when a new message is added to the guestbook.

Parameters:
request - The Request
response - The Response
Throws:
java.io.IOException - The standard IOException
javax.servlet.ServletException - The standard ServletException

showForum

public void showForum(javax.servlet.http.HttpServletRequest req,
                      java.io.PrintWriter pw,
                      java.lang.String forum,
                      int forum_id,
                      java.lang.String uName)
               throws javax.servlet.ServletException,
                      java.io.IOException

Fetches the content of one forum in the database and puts it on the Web.

Parameters:
req - The Request
pw - The PrintWriter
forum - The Forum
forum_id - The Forum identity
uName - The User Name
Throws:
java.io.IOException - The standard IOException
javax.servlet.ServletException - The standard ServletException

addNewTopic

public void addNewTopic(java.io.PrintWriter pw,
                        java.lang.String forum,
                        int forum_id,
                        java.lang.String topic,
                        java.lang.String message,
                        java.lang.String uName)
                 throws javax.servlet.ServletException,
                        java.io.IOException

Adds a new topic to the selected forum.

Parameters:
pw - The PrintWriter
forum - The Forum
forum_id - The Forum identity
topic - The Topic
message - The Message
uName - The User Name
Throws:
java.io.IOException - The standard IOException
javax.servlet.ServletException - The standard ServletException