Skip to main content

Posts

Showing posts with the label IGNOU

MCS-051,June, 2010 ,

Write a web application for a online support 20 of a video library. This application should have the following features : Add a new video information in the library. Check in / check out process for renting purpose. Status report containing the current status of videos in the library. You are required to use the following tables for your online video library.   <html >      < head >          < title ></ title >          < meta http - equiv = "Content-Type"  content = "text/html; charset=UTF-8" >      </ head >      < body >          < div > Add  new  Customer :  </ div >          < form action = "AddNewCustomer"  method = "...

Diffrences between forward and sendRedirect, MCS-051, June 2009, 5a(i)

forward() sendRedirect() it is used to invoke another server from one servlet with is same server it can send request to page on another server It forward the same request and response object from one servlet to another servlet. It does not send request and response object to another servlet. Redirection occures within server. it sends response code to client side application to send the request to another serlver or resoures. this method is availabe through RequestDispatcher Object. This is method of response object. It transfer control to another servlet for further processing It send response to browser and then browser agian sends request for second servlet or resource Data submitted to first servlet will be availble for second servlet. Data of first servlet is not availble for secind servlet.

Diffrences between Servlet config and servlet context, MCS-051, June 2009, 5a(i)

Servlet context Servlet config It is an Object to be shared by all servlets and JSPs. this object is associated to specific servlet unlimited store of data as per as server capability limited support for data handling can be used to collaboration between multiple servlet. It is for single servlet Data stored here can be access from any servlet and JSP Data stored here can be access from the servlet for which this object is associated It is created using getServletContext() method of Servlet class Created using getServletConfig() method Only Single instance available within web application Multiple instances for each servlet. contains global properties like classpath, context path etc Only contains property related to specific servlet.

Differences between Session and cookie, MCS-051, June-2008-4b

Session Cookie Data on server-side data on client side unlimited side of data as per as server capability limited support for data data handling It can store any type of data only text age of data is not fixed . fixed destroy after session timeout or logout remains on client machine less data traveling over the network All cookie need to travel each time client sends request to server. More secure mechanism to session tracking less secure

Using SSL in java program

import java.net.*; import java.security.cert.Certificate; import java.io.*; import javax.net.ssl.*; public class SSLTest { public static voi d main(String[] args) throws Exception { String https_url = " https://www.google.com/ " ; URL url; url = new URL(https_url); HttpsURLConnection con = (HttpsURLConnection) url.openConnection(); if (con != null ) { System.out.println( " Response Code : " + con.getResponseCode()); System.out.println( " Cipher Suite : " + con.getCipherSuite()); System.out.println( " \n " ); Certificate[] certs = con.getServerCertificates(); int i=0; for (Certificate cert : certs) { System.out.println( " Cert NO : " +i++); System.out.println( " Cert Type : " + cert.getType()); System.out.printl...

Write a program to create a XML document from a telephone directory database. Dec08_4a

import java.sql.*; public class Dec08_4a { public static void main(String ar[])throws Exception { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=database.mdb"); //Connection con = DriverManager.getConnection("jdbc:odbc:mydsn"); Statement st = con.createStatement(); ResultSet rs = st.executeQuery("select * from phoneDirectory"); System.out.println("<phone-directory>"); while (rs.next()) { System.out.println(" <customer>"); String s1 = rs.getString(1); System.out.println(" <customer-name>"+s1+"</customer-name>"); String s2 = rs.getString(2); System.out.println(" <address>"+s2+"</address>"); String s3 = rs.getString(3); System.out.println(" <phone-number>...

Write a code for servlet which will display all the fields of Employee table in tabular form.MCS-051,Dec09-3a

import javax.servlet.*; import java.io.*; import java.sql.*;   import javax.servlet.http.*;   public class Employee extends HttpServlet   {   public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,      ServletException   {   res.setContentType("text/Html");   PrintWriter pw = res.getWriter();   try   {   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");   Connection con=DriverManager.getConnection("jdbc:odbc:dsn");   Statement st=con.createStatement();   ResultSet rs=st.executeQuery("select emp_id,emp_name,emp_dob,mob_no,email from employee");   String tr="";   while(rs.next()){   tr=tr+"<tr>";   tr=tr+"<td>"+rs.getString(1)+"</td>";   tr=tr+"<td>"+rs.getString(2)+"</td>";   tr=tr+"<td>"+rs.getString(3)+"</td>";   tr=tr+"<td>"+rs.getString(4)+"</td>...

Web application for student registration, where student can register online with enrollment number. ther registered students should be able to log on after getting registered. you are required to use JSP, servlet, and JDBC. . MCS-051, Dec2009-1b.

StudentRegistration │ index.html │ login.html │ └───WEB-INF │ web.xml │ └───classes login.class login.java regform.class regform.java Index.html <html> <head> <title>registration</title> </head> <body> <form method="post" action="reg"> NAME:<input type="text"name="t1"/><br> ENROLLMENT:<input type="text"name="t2"/><br> PASSWORD:<input type="password"name="t3"/><br> <input type="submit"value="send"/><br> </form> <a href='login.html'>if already registered plz login</a> </body> </html> login.html <html> <head> <title>login</title> </head> <body> <form method="post" action="login"> <h2>ENTER VALID USER NAME AND PASSWORD</h...