Вы находитесь на странице: 1из 61

Ex.

No: 1 Date:

To Embed Image Map in Web Page

Aim Create a web page with the following using HTML i. ii.
iii.

To embed an image map in a web page To fix the hot spots Show all the related information when the hot spots are clicked.

Algorithm To embed an image using Image Tag <Img> <area shape= coords=" href="" alt="" /> To create a map with different attributes <map name="planetmap"> </map> To Fix hot spot with different styles i. ii. iii. Circle <area shape="circle" coords="0,0,82,126" href="sun.htm" alt="Sun" Rectangle <area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun" Poly <area shape="poly" coords="0,0,82,126" href="sun.htm" alt="Sun"

4. Create a web pages related to the hotspot 5. Open a browser and display a web pages

Source Code: <html> <head> <title> IMage Map Example </title> </head> <body> <DIV ALIGN=CENTER> <MAP NAME="map1"> <AREA HREF="contacts.html" ALT="Contacts" TITLE="Contacts" SHAPE=RECT COORDS="6,116,97,184"> <AREA HREF="products.html" ALT="Products" TITLE="Products" SHAPE=CIRCLE COORDS="251,143,47"> <AREA HREF="new.html" ALT="New!" TITLE="New!" SHAPE=POLY COORDS="150,217, 190,257, 150,297,110,257"> </MAP> <IMG SRC="testmap.gif" ALT="map of GH site" BORDER=0 WIDTH=300 HEIGHT=300 USEMAP="#map1"><BR> [ <A HREF="contacts.html" ALT="Contacts">Contacts</A> ] [ <A HREF="products.html" ALT="Products">Products</A> ] [ <A HREF="new.html" </DIV> </body> </html> ALT="New!">New!</A> ]

Output:

Ex. No: 2 Date:

Cascading Style Sheets

Aim: To create a web page using Cascading Style Sheets in HTML.

Algorithm:

1. Create a web page using college information. 2. Main page is developed using FrameSet tag 3. Create three different HTML page using three different style sheets as following i. ii. iii. Inline Style Sheet Embedded Style Sheet External Style Sheet

4. Link all the HTML pages to the main 5. Display the output in Internet Explorer

Source Code: CSS.html <html> <head> <style> shan { font-family: Arial, Verdana, sans-serif; font-size: 18px; color: purple; } </style> <link rel="stylesheet" type="text/css" href="shan.css" /> </head> <body bgcolor=pink> <h1 class="special"> <center> This page is created using Embed and inline and External Style Sheet</center> </h1> <h2> </h2> <p> The External style sheet is the compact representation of Cascading Style Sheets. This paragraph is written in Monotype Corsiva font with font size of 14. </p> <h3> <shan> This is from External Link </shan> </body> </html> This is a blue <a href=colorname.html>colored</a> line. </h3> This line is aligned left and red colored.

Shan.css h1 { font-family:Arial } h2 { font-family:times new roman; color:red; left:20px } h3 { font-family:arial; color:blue; } p { font-size:14pt; font-family:Monotype Corsiva }

Output:

Ex. No: 3

Client Side Scripts for Validating Web Form Controls

Date:

Aim Client Side Scripts for Validating Web Form Controls using DHTML Algorithm

1. The form will include one text field called "Your Name", and a submit button. 2. Validation script will ensure that the user enters their name before the form is sent to the server. 3. Open this page to see it in action.
4. Try pressing the Send Details button without filling anything in the "Your Name" field.

5. You might like to open the source code for this form in a separate window 6. the page consists of a JavaScript function called validate_form() that performs the form validation, followed by the form itself.

Source Code:

<html> <head> <title>The Student Registration Form</title> <script type=text/javascript> function validate() { var i; var name_str=document.my_form.name; var phoneID=document.my_form.ph_txt; var ph_str=document.my_form.ph_txt.value; var str=document.my_form.Email_txt.value; if((name_str.value==null)||(name_str.value=="")) { alert("Enter some name"); return false; } if(document.my_form.Age_txt.value=="") { alert("Enter Some Age"); return false; } if((document.my_form.Age_txt.value<"5")&& (document.my_form.Age_txt.value>"21")) {

alert("Invalid Age");

return false; if(ph_str.length<1 ||ph_str.length>11) { alert("Invalid length of Phone Number"); return false; } for (i = 0; i < ph_str.length; i++) { var ch = ph_str.charAt(i); if (((ch < "0") || (ch > "9"))) { alert("Invalid Phone Number"); phoneID.focus() return false } } var index_at=str.indexOf("@"); var len=str.length; var index_dot=str.indexOf("."); var emailID=document.my_form.Email_txt; if ((emailID.value==null)||(emailID.value=="")) {

alert("Please Enter your Email ID");

emailID.focus(); return false } if (str.indexOf("@")==-1) { alert("Invalid E-mail ID"); return false; } if (str.indexOf(".")==-1 || str.indexOf(".")==0 || str.indexOf(".")==index_at) { alert("Invalid E-mail ID"); return false; } if (str.indexOf("@",(index_at+1))!=-1) { alert("Invalid E-mail ID"); return false; } if (str.indexOf(" ")!=-1) { alert("Invalid E-mail ID"); return false; }

if (!document.my_form.group1[0].checked && !document.my_form.group1[0].checked) { alert("Please Select Sex"); return false; } if (!document.my_form.group1[0].checked && !document.my_form.group1[0].checked) { alert("Please Select Sex"); return false; } return true; } </script> </head> <body bgcolor=aqua> <center><h3>Application Form</h3></center> <form name=my_form onsubmit=validate()> <strong>Name:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong> <input type=text name=name><br/> <strong>Age:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong>

<input type=text name=Age_txt><br/>

<strong>Phone No:&nbsp</strong> <input type=text name=ph_txt><br/> <strong>Email:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</strong> <input type=text name=Email_txt><br/><br/> <strong>Sex:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp </strong> <input type="radio" name="group1" value="Male">Male&nbsp&nbsp&nbsp&nbsp <input type="radio" name="group1" value="Female">Female<br/><br/><br/> <strong>Hoby: </strong> &nbsp&nbsp <input type="checkbox" name ="option1" value="Singing">Singing<br/> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="checkbox" name ="option1" value="Reading">Reading<br/> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp <input type="checkbox" name ="option1" value="T.V.">Watching T.V<br/> <br/><br/> <strong>Country:</strong> <select name="My_Menu"> <option value="India">India</option> <option value="China">China</option> <option value="Shrilanka">Shrilanka</option> </select><center><input type=submit value=Submit></br></center> </body> </html>

Output:

Ex. No: 4 Date:

Color Palette Using Applet

Aim

Write programs in Java to create applets incorporating the following features: i. ii. iii. buttons iv. To set background images Create a color palette with matrix of buttons Set background and foreground of the control text area by selecting a color from color palette. In order to select Foreground or background use check box control as radio

Algorithm

1. Create a main class which implements Action Listener, Item Listener. 2. Declare Checkbox, Buttons and Images. 3. Create Checkbox for foreground and background using the object. 4. Create buttons using the object. 5. Get images using getDocumentBase() method. 6. Display the images using g.drawImage() method.

Source Code:

import java.awt.*; import java.awt.event.*; import java.applet.*; /* <applet code="Experiment3" width=300 height=300> </applet> */ public class Experiment3 extends Applet implements ItemListener { int currcolor=5; int flag=1; String text="Click any of the button"; Button buttons[]=new Button[5]; String colours[]={"Red","Blue","Green","Yellow","Magenta"}; Image img; CheckboxGroup cbg=new CheckboxGroup(); Checkbox box1=new Checkbox("Background Color",cbg,true); Checkbox box2=new Checkbox("Text Color",cbg,false); Checkbox box3=new Checkbox("Loading Image",cbg,false); public void init() { for(int i=0;i<5;i++) { buttons[i]=new Button(" add(buttons[i]); ");

} buttons[0].setBackground(Color.red); buttons[1].setBackground(Color.blue); buttons[2].setBackground(Color.green); buttons[3].setBackground(Color.yellow); buttons[4].setBackground(Color.magenta); add(box1); add(box2); add(box3); box1.addItemListener(this); box2.addItemListener(this); box3.addItemListener(this); } public void itemStateChanged(ItemEvent ev) { if(box1.getState()==true) flag=1; else if(box2.getState()==true) { text="Default color is black"; flag=2; }

else if(box3.getState()==true)

{ img=getImage(getDocumentBase(),"flowers.jpg"); flag=3; } repaint(); } public void paint(Graphics g) { if(flag==2) { g.drawString(text,30,100); switch(currcolor) { case 0: g.setColor(Color.red); break; case 1: g.setColor(Color.blue); break; case 2: g.setColor(Color.green); break;

case 3:

g.setColor(Color.yellow); break; case 4: g.setColor(Color.magenta); break; case 5: g.setColor(Color.black); break; } g.drawString(text,30,100); } else if(flag==1) { g.drawString(text,30,100); switch(currcolor) { case 0: setBackground(Color.red); break; case 1: setBackground(Color.blue); break;

case 2:

setBackground(Color.green); break; case 3: setBackground(Color.yellow); break; case 4: setBackground(Color.magenta); break; case 5: setBackground(Color.white); break;

} } else if(flag==3) { g.drawImage(img,20,90,this); } } public boolean action(Event e,Object o) {

for(int i=0;i<5;i++)

{ if(e.target==buttons[i]) { currcolor=i; text="You have chosen "+colours[i]; repaint(); return true; } } return false; } }

Output:

Ex. No: 5

Invoke Servlets from HTML forms

Date:

Aim Program to invoke servlets from HTML Form

Algorithm

1. Create a new web project. 2. Create Java application logic that represents the Java servlet. 3. Create the web page for the web application. 4. Package the web application to a WAR file. 5. Deploy the WAR file to the J2EE application server. 6. Test your web application.

Source Code:

invokeServlet.java <html> <head> <title>Student Information Form</title> </head> <body> <center> <form name="form1" action="http://localhost:8080/shan/servlets/servlet/my_servletDemo"> <h3>Enter student information in following fields -</h3> <table> <tr> <td><b>Roll Number</b></td> <td><input type="text" name="Roll Number" size="25" value=" "></td> </tr>

<tr> <td><b>Student Name</b></td> <td><input type="text" name="Student Name" size="25" value=" "></td> </tr> <tr> <tr> <td><b>Student Address</b></td>

<td><input type="text" name="Address" size="50" value=" "></td> </tr> <tr> <td><b>Phone</td> <td><input type="text" name="Phone" size="25" value=" "></td> </tr> <tr> <td><b>Total Marks</td> <td><input type="text" name="Total Marks" size="10" value=" "></td> </tr> </table> <input type="submit" value="submit"> </form> </center> </body> </html>

my_servletDemo.java import java.io.*; import java.util.*; import javax.servlet.*; public class my_servletDemo extends GenericServlet { public void service(ServletRequest req,ServletResponse res) throws ServletException,IOException { PrintWriter out=res.getWriter(); Enumeration en=req.getParameterNames(); while(en.hasMoreElements()) { String name_received=(String)en.nextElement(); out.print(name_received+ " = "); String value_received=req.getParameter(name_received); out.println(value_received); out.println(" "); } out.close(); } }

Output:

Ex. No: 6 Date:

Three-Tier Applications Write a Program for Online examination System using Servlet and Database

Aim Write programs in Java to create three-tier applications using servlets and Databases for conducting on-line examination for displaying student mark list. Assume that student information is available in a database which has been stored in a database server.

Procedure 1. First install the tomcat into the system. 2. Then make a subdirectly(eg., tr) in the \tomcat\webapps. 3. Under tr create WEB-INF directory and also place the html files in this tr directory only. 4. Next under WEB-INF create two subclasses lib,classes and web.xml 5. Next place all the class files under the classes and jar files(servlet-api.jar,classes12.jar 6. After this start tomcat by giving the following command at the instll_dir>tomcat>bin 7. Catalina.bat run 8. At the I.E(web browser) give the url as http;//localhost:8080//tr/htmlfile or servlet url 9. Portno 8080 is assigned for the tomcat. pattern etc) under lib subdirectories.

Source Code:

index.jsp <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Welcome to Online Examination</title> </head> <body bgcolor="cyan"> <form name="index" action="exam.jsp" method="post"> <center><h1><span><font color="red">Welcome to Online Examination</font></span></h1> <br> <h2><u><span><font color="blue">Instructions to the Candidates</font></span></u></h2> <br><h3><ol><li>Fill the correct Registration number.</li> <br><li>Enter your name.</li> <br><li>Read the questions carefully.</li> <br><li>No negative marking.</li></ol></h3> <br> <b>Enter your Register number</b> <input type="text" name="txt_reg"> <b>Enter your Name</b> <input type="text" name="txt_name"><br><br> <input name ="submit" value="Submit" type="submit"/> </center> </form> </body> </html>

exam.jsp <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Examination Panel</title> </head> <body bgcolor="cyan"> <%@ page language="java" %> <%@ page import ="java.sql.*" %> <% String reg= request.getParameter("txt_reg"); String name = request.getParameter("txt_name"); out.println("<h2>Welcome" name "...Your Register number is " reg "!! </h2><br><br><br>"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String sTable = "exam"; String sSql = "SELECT * FROM " sTable ""; String sDBQ = "C:/Users/A/Documents/NetBeansProjects/Online Examination/exam.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" sDBQ ";DriverID=22;READONLY=true"; Connection cn = null; Statement st = null; ResultSet rs = null; try { cn = DriverManager.getConnection( database ,"",""); st = cn.createStatement(); rs = st.executeQuery( sSql ); ResultSetMetaData rsmd = rs.getMetaData(); String s1,s2,s3,s4; int i=1;

while(rs.next()) { out.println("<form name='exam' action='report.jsp' method='post'><b>" i " . " rs.getString(1) "</b><br><br>"); s1 = rs.getString(2); s2 = rs.getString(3); s3 = rs.getString(4); s4 = rs.getString(5); out.println("<input type=radio name=opt" i " value=" s1 " CHECKED>" s1 " <br><br>"); out.println("<input type=radio name=opt" i " value=" s2 ">" s2 "<br><br>"); out.println("<input type=radio name=opt" i " value=" s3 ">" s3 "<br><br>"); out.println("<input type=radio name=opt" i " value=" s4 ">" s4 "<br><br>"); i ; } out.println("<input name ='submit' value='Submit' type='submit'/>"); /*int n = rsmd.getColumnCount(); out.println( "<table border=1 cellspacing=3><tr>" ); for( int i=1; i<=n; i ) // Achtung: erste Spalte mit 1 statt 0 out.println( "<th>" rsmd.getColumnName( i ) "</th>" ); while( rs.next() ) { out.println( "</tr><tr>" ); for( int i=1; i<=n; i ) // Achtung: erste Spalte mit 1 statt 0 out.println( "<td nowrap>" rs.getString( i ) "</td>" ); } out.println( "</tr></table>" );*/ } finally { try { if( null != rs ) rs.close(); } catch( Exception ex ) {} try { if( null != st ) st.close(); } catch( Exception ex ) {} try { if( null != cn ) cn.close(); } catch( Exception ex ) {} } %> </body> </html>

report.jsp <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Exam Report</title> </head> <body bgcolor="cyan"> <center><h1>Your Report Card</h1></center> <%@ page language="java" %> <%@ page import ="java.sql.*" %> <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String sTable = "exam"; String sSql = "SELECT * FROM " sTable ""; String sDBQ = "C:/Users/A/Documents/NetBeansProjects/Online Examination/exam.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=" sDBQ ";DriverID=22;READONLY=true"; Connection cn = null; Statement st = null; ResultSet rs = null; try { cn = DriverManager.getConnection( database ,"",""); st = cn.createStatement(); rs = st.executeQuery( sSql ); ResultSetMetaData rsmd = rs.getMetaData(); String s1,s2,s3,s4; int i=1; int correct=0,incorrect=0,total=0; out.println("<h2><br><br><center><table border=1 cellpadding=2 cellspacing=2><tr><th>Question</th><th>Your Answer</th><th>Correct Answer</th><th>Status</th></tr>"); while(rs.next()) { total ;

s1 = rs.getString(1); s2 = request.getParameter("opt" i); s3 = rs.getString(6); if(s2.equals(s3)) { s4="Correct"; correct ; } else { s4="Incorrect"; incorrect ; } out.println("<tr><td>" s1 "</td><td>" s2 "</td><td>" s3 "</td><td>" s4 "</td></tr>"); i ; } out.println("</table><br><br><table><b><tr><td>Correct Answers</td><td>" correct "</td></tr>"); out.println("<tr><td>Incorrect Answers</td><td>" incorrect "</td></tr>"); out.println("<tr><td>Total Questions</td><td>" total "</td></tr></table></b></center></h2>"); } finally { try { if( null != rs ) rs.close(); } catch( Exception ex ) {} try { if( null != st ) st.close(); } catch( Exception ex ) {} try { if( null != cn ) cn.close(); } catch( Exception ex ) {} } %> </body> </html>

Output:

Ex. No: 7

XML Schema

Date:

Aim

Develop a program using XML Schema XSLT/XSL

Procedure

1. The xsl:output element specifies how to display the result tree. 2. The XSL processor produces the output result tree. 3. It should be specified by xsl:output element. 4. The method attribute of xsl:output specifies the overall process to produce the result tree. 5. The HTML output method results the tree as HTML document.

Source Code: XSTL.html <html> <head> <script> function loadXMLDoc(dname) { if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET",dname,false); xhttp.send(""); return xhttp.responseXML; } function displayResult() { xml=loadXMLDoc("cdcatalog.xml"); xsl=loadXMLDoc("cdcatalog.xsl");

// code for IE if (window.ActiveXObject) { ex=xml.transformNode(xsl); document.getElementById("example").innerHTML=ex; } // code for Mozilla, Firefox, Opera, etc. else if (document.implementation && document.implementation.createDocument) { xsltProcessor=new XSLTProcessor(); xsltProcessor.importStylesheet(xsl); resultDocument = xsltProcessor.transformToFragment(xml,document); document.getElementById("example").appendChild(resultDocument); } } </script> </head> <body onload="displayResult()"> <div id="example" /> </body> </html>

Cdcatalog.xml <?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <cd> <title>Object oriented Programming</title> <artist>Balagurusamy</artist> <country>India</country> <company>PHI</company> <price>230</price> <year>2001</year> </cd> <cd> <title>Basic Java</title> <artist>Ramesh</artist> <country>India</country> <company>KK</company> <price>250</price> <year>2009</year> </cd> </catalog>

Cdcatalog.css <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <center> <h2>My Book Collection</h2> <table border="1"> <tr bgcolor="#8712F3"> <th align="left">Title</th> <th align="left">Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr>

<td><xsl:value-of select="title" /></td> <td><xsl:value-of select="artist" /></td> </tr> </xsl:for-each> </table> </center> </body> </html></xsl:template> </xsl:stylesheet>

Output:

Ex. No: 8

Programs using AJAX

Date:

Aim Develop a enterprise program using AJAX Algorithm 1. use Javascript to initialise the XML HTML request object 2. use HTML to create areas for user input and output 3. use Javascript to send the user inputs to a server
4. process the data on a server use Javascript to process any response from the server and

display the Result

Source Code: <html> <head> <title>The Hello World of AJAX</title> <script language="JavaScript" type="text/javascript"> //Gets the browser specific XmlHttpRequest Object function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); //IE } else { //Display your error message here. //and inform the user they might want to upgrade //their browser. //Not IE

alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox."); } } //Get our browser specific XmlHttpRequest object. var receiveReq = getXmlHttpRequestObject(); //Initiate the asyncronous request. function sayHello() { //If our XmlHttpRequest object is not in the middle of a request, start the new //asyncronous call. if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { //Setup the connection as a GET call to SayHello.html. //True explicity sets the request to asyncronous (default). receiveReq.open("GET", 'SayHello.html', true); //Set the function that will be called when the XmlHttpRequest objects state //changes. receiveReq.onreadystatechange = handleSayHello; //Make the actual request. receiveReq.send(null); } }

//Called every time our XmlHttpRequest objects state changes.

function handleSayHello() { //Check to see if the XmlHttpRequests state is finished. if (receiveReq.readyState == 4) { //Set the contents of our span element to the result of the asyncronous call. document.getElementById('span_result').innerHTML = receiveReq.responseText; } } </script> </head> <body> <!-- Clicking this link initiates the asyncronous request --> <a href="javascript:sayHello();">Say Hello</a><br /> <!-- used to display the results of the asyncronous request --> <span id="span_result"></span> </body> </html>

SayHello.html hello, world This is from Web Technology

Output:

Ex. No: 9

Air line Reservation System using Web Services

Date:

Aim: Consider a case where we have two web Services- an airline service and a travel agent and the travel agent is searching for an airline. Implement this scenario using Web Services and Data base. Algorithm

1. Define the service's interface. This is done with WSDL 2. Implement the service. This is done with Java. 3. Define the deployment parameters. This is done with WSDD and JNDI 4. Compile everything and generate a GAR file. This is done with Ant 5. Deploy service. This is also done with a GT4 tool

Source Code: package airinfo; import java.rmi.RemoteException; public interface MyInterface extends java.rmi.Remote { public String getInfo(String src,String dest)throws java.rmi.RemoteException; } package airinfo; import java.sql.*; public class TestDB implements MyInterface { public String getInfo(String src,String dest) { String str=""; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:Airways","",""); Statement s=con.createStatement(); if(src.equals("Mumbai")) { if(dest.equals("Pune"))

s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Pune'"); else if(dest.equals("Chennai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Mumbai' AND Dest='Chennai'"); } else if(src.equals("Pune")) { if(dest.equals("Mumbai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Mumbai'"); else if(dest.equals("Chennai"))

s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Pune' AND Dest='Chennai'"); } else if(src.equals("Chennai")) { if(dest.equals("Pune")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Pune'");

else if(dest.equals("Mumbai")) s.executeQuery("SELECT * FROM Airways_table WHERE Start_from='Chennai' AND Dest='Mumbai'"); }

ResultSet rs=s.getResultSet(); str+="<table border=1>"; while(rs.next()) { str+="<tr><b>"; str+="<td>"; str+=rs.getString("name"); str+="</td>"; str+="<td>"; str+=rs.getString("Time"); str+="</td>"; str+="</tr></b>"; } str+="</table>";

}catch(ClassNotFoundException ex)

{ System.out.println(ex); } catch(SQLException ex) { System.out.println(ex); } return str; } }

// This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3

package myairreservationclient; import com.sun.xml.rpc.client.BasicService; import com.sun.xml.rpc.encoding.*; import com.sun.xml.rpc.encoding.simpletype.*; import com.sun.xml.rpc.encoding.soap.*; import com.sun.xml.rpc.encoding.literal.*;

import com.sun.xml.rpc.soap.SOAPVersion; import com.sun.xml.rpc.wsdl.document.schema.SchemaConstants; import javax.xml.rpc.*; import javax.xml.rpc.encoding.*; import javax.xml.namespace.QName;

public class AirLineReservation_SerializerRegistry implements SerializerConstants { public AirLineReservation_SerializerRegistry() { }

public TypeMappingRegistry getRegistry() {

TypeMappingRegistry registry = BasicService.createStandardTypeMappingRegistry(); TypeMapping mapping12 = registry.getTypeMapping(SOAP12Constants.NS_SOAP_ENCODING); TypeMapping mapping = registry.getTypeMapping(SOAPConstants.NS_SOAP_ENCODING);

TypeMapping mapping2 = registry.getTypeMapping(""); { QName type = new QName("http://tempuri.org/wsdl", "getInfo");

CombinedSerializer serializer = new myairreservationclient.MyInterface_getInfo_RequestStruct_SOAPSerializer(type, DONT_ENCODE_TYPE, NULLABLE, SOAPConstants.NS_SOAP_ENCODING); serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF, serializer, SOAPVersion.SOAP_11); registerSerializer(mapping,myairreservationclient.MyInterface_getInfo_RequestStruct.cla ss, type, serializer); } { QName type = new QName("http://tempuri.org/wsdl", "getInfoResponse"); CombinedSerializer serializer = new myairreservationclient.MyInterface_getInfo_ResponseStruct_SOAPSerializer(type, DONT_ENCODE_TYPE, NULLABLE, SOAPConstants.NS_SOAP_ENCODING); serializer = new ReferenceableSerializerImpl(DONT_SERIALIZE_AS_REF, serializer, SOAPVersion.SOAP_11); registerSerializer(mapping,myairreservationclient.MyInterface_getInfo_ResponseStruct.cl ass, type, serializer); } return registry; }

private static void registerSerializer(TypeMapping mapping, java.lang.Class javaType, javax.xml.namespace.QName xmlType, Serializer ser) { mapping.register(javaType, xmlType, new SingletonSerializerFactory(ser), new SingletonDeserializerFactory((Deserializer)ser)); }

} // This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3

package myairreservationclient; public class MyInterface_getInfo_ResponseStruct { protected java.lang.String result; public MyInterface_getInfo_ResponseStruct() { } public MyInterface_getInfo_ResponseStruct(java.lang.String result) { this.result = result; } public java.lang.String getResult() { return result; }

public void setResult(java.lang.String result) { this.result = result; } } // This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3

package myairreservationclient;

import com.sun.xml.rpc.encoding.*; import com.sun.xml.rpc.util.exception.LocalizableExceptionAdapter;

public class MyInterface_getInfo_RequestStruct_SOAPBuilder implements SOAPInstanceBuilder { private myairreservationclient.MyInterface_getInfo_RequestStruct _instance; private java.lang.String string_1; private java.lang.String string_2; private static final int mySTRING_1_INDEX = 0; private static final int mySTRING_2_INDEX = 1;

public MyInterface_getInfo_RequestStruct_SOAPBuilder() { }

public void setString_1(java.lang.String string_1) { this.string_1 = string_1; }

public void setString_2(java.lang.String string_2) { this.string_2 = string_2; }

public int memberGateType(int memberIndex) { switch (memberIndex) { case mySTRING_1_INDEX: return GATES_INITIALIZATION | REQUIRES_CREATION; case mySTRING_2_INDEX: return GATES_INITIALIZATION | REQUIRES_CREATION; default: throw new IllegalArgumentException(); } }

public void construct() { }

public void setMember(int index, java.lang.Object memberValue) { try { switch(index) { case mySTRING_1_INDEX: _instance.setString_1((java.lang.String)memberValue); break; case mySTRING_2_INDEX: _instance.setString_2((java.lang.String)memberValue); break; default: throw new java.lang.IllegalArgumentException(); } } catch (java.lang.RuntimeException e) { throw e; } catch (java.lang.Exception e) { throw new DeserializationException(new LocalizableExceptionAdapter(e)); } }

public void initialize() { }

public void setInstance(java.lang.Object instance) { _instance = (myairreservationclient.MyInterface_getInfo_RequestStruct)instance; }

public java.lang.Object getInstance() { return _instance; } }

// This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3

package myairreservationclient;

public interface MyInterface extends java.rmi.Remote { public java.lang.String getInfo(java.lang.String string_1, java.lang.String string_2) throws java.rmi.RemoteException; }

// This class was generated by the JAXRPC SI, do not edit. // Contents subject to change without notice. // JAX-RPC Standard Implementation (1.1.3, build R1) // Generated source version: 1.1.3

package myairreservationclient;

import com.sun.xml.rpc.encoding.*; import com.sun.xml.rpc.client.ServiceExceptionImpl; import com.sun.xml.rpc.util.exception.*; import com.sun.xml.rpc.soap.SOAPVersion; import com.sun.xml.rpc.client.HandlerChainImpl; import javax.xml.rpc.*; import javax.xml.rpc.encoding.*; import javax.xml.rpc.handler.HandlerChain; import javax.xml.rpc.handler.HandlerInfo; import javax.xml.namespace.QName;

public class AirLineReservation_Impl extends com.sun.xml.rpc.client.BasicService implements AirLineReservation {

private static final QName serviceName = new QName("http://tempuri.org/wsdl", "AirLineReservation"); private static final QName ns1_MyInterfacePort_QNAME = new QName("http://tempuri.org/wsdl", "MyInterfacePort");

private static final Class myInterface_PortClass = myairreservationclient.MyInterface.class;

public AirLineReservation_Impl() { super(serviceName, new QName[] { ns1_MyInterfacePort_QNAME }, new myairreservationclient.AirLineReservation_SerializerRegistry().getRegistry());

public java.rmi.Remote getPort(javax.xml.namespace.QName portName, java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException { try { if (portName.equals(ns1_MyInterfacePort_QNAME) && serviceDefInterface.equals(myInterface_PortClass)) { return getMyInterfacePort(); } }

catch (Exception e) { throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e)); } return super.getPort(portName, serviceDefInterface); }

public java.rmi.Remote getPort(java.lang.Class serviceDefInterface) throws javax.xml.rpc.ServiceException { try { if (serviceDefInterface.equals(myInterface_PortClass)) { return getMyInterfacePort(); } } catch (Exception e) { throw new ServiceExceptionImpl(new LocalizableExceptionAdapter(e)); } return super.getPort(serviceDefInterface); }

public myairreservationclient.MyInterface getMyInterfacePort() { java.lang.String[] roles = new java.lang.String[] {}; HandlerChainImpl handlerChain = new HandlerChainImpl(getHandlerRegistry().getHandlerChain(ns1_MyInterfacePort_QNAME));

handlerChain.setRoles(roles);

myairreservationclient.MyInterface_Stub stub = new myairreservationclient.MyInterface_Stub(handlerChain); try { stub._initialize(super.internalTypeRegistry); } catch (JAXRPCException e) { throw e; } catch (Exception e) { throw new JAXRPCException(e.getMessage(), e); } return stub; } }

Output:

Вам также может понравиться