All Packages Class Hierarchy This Package Previous Next Index
Class oncore.StudInfo
java.lang.Object
|
+----javax.servlet.GenericServlet
|
+----javax.servlet.http.HttpServlet
|
+----oncore.StudInfo
- public class StudInfo
- extends HttpServlet
Servlet which provides about students from acad office database. The
request to this servlet is in the following format :
http://.../servlet/StudInfo?srollno=
The information returned by this servlet contains student name, roll
number, hostel, room number, CPI, link to her homepage, link to send her a
mail.
-
StudInfo()
-
-
doGet(HttpServletRequest, HttpServletResponse)
- Method to handle HTTP requests which are of the form GET http://...
-
init(ServletConfig)
- Method which does initialization stuff in the servlet.
StudInfo
public StudInfo()
init
public void init(ServletConfig cfg) throws ServletException
- Method which does initialization stuff in the servlet. This includes
reading configuration file in Configuration class, establishing
database connection.
- Parameters:
- cfg - This is passed to the method by servlet engine which
contains the initArgs given in servlet properties file.
- Throws: ServletException
- Thrown when database exception occurs .
This is because if database connection could not be established then
there is no point in continuing so throw some excpetion which won't be
caught and exit.
- Overrides:
- init in class GenericServlet
doGet
public void doGet(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException
- Method to handle HTTP requests which are of the form GET http://...
This method assumes that the request is in the format :
GET http://.../servlet/StudInfo?srollno=
If the srollno field does not exist then shows error.
- Parameters:
- req - request from browser.
- res - the response object to be sent back to user.
- Throws: ServletException
- thrown if something goes wrong with
servlet.
- Throws: IOException
- thrwon if some I/O error occurs with socket.
- Overrides:
- doGet in class HttpServlet
All Packages Class Hierarchy This Package Previous Next Index