V. Gyurjyan Clas12 Software Meeting

Slides:



Advertisements
Similar presentations
Apache Tomcat as a container for Servlets and JSP
Advertisements

 2002 Prentice Hall. All rights reserved. Chapter 9: Servlets Outline 9.1 Introduction 9.2 Servlet Overview and Architecture Interface Servlet and.
Servlets. A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password: In Netbeans you can graphically create.
Servlets and JDBC. Servlets A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password:
Objectives Ch. D - 1 At the end of this chapter students will: Know the general architecture and purpose of servlets Understand how to create a basic servlet.
An introduction to Java Servlet Programming
June 1, 2000 Object Oriented Programming in Java (95-707) Advanced Topics 1 Lecture 10 Object Oriented Programming in Java Advanced Topics Servlets.
Servlets. A form The HTML source Chapter 1 Please enter your name and password then press start Name: Password: In Netbeans you can graphically create.
Introduction to Servlet & JSP
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
Java Servlet. What is Java Servlet? A Servlet is a java based server side web technology. It is a java class that serves a client request and receives.
CSCI 6962: Server-side Design and Programming History and Background.
Java Servlets and JSP.
Gayle J Yaverbaum, PhD Professor of Information Systems Penn State Harrisburg.
Examples of Using Servlets and JSP Representation and Management of Data on the Internet.
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
Li Tak Sing COMPS311F. Static attributes in Servlets Since Servlets are also Java classes, you can also use static attributes to store values that can.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
DataBases and SQL INFSY 547 Spring Course Wrap Up April 12: Complete Work on Servlets Review of Team Projects Close of Portfolio Work April 19:
Web Server Programming 1. Nuts and Bolts. Premises of Course Provides general introduction, no in-depth training Assumes some HTML knowledge Assumes some.
Servlet Lifecycle Lec 28. Servlet Life Cycle  Initialize  Service  Destroy Time.
Java Servlets Outline 24.1 Introduction 24.2 Servlet Overview and Architecture Interface Servlet and the Servlet Life Cycle HttpServlet Class.
Java Servlets Lec 27. Creating a Simple Web Application in Tomcat.
Servlet Communication Other Servlets, HTML pages, objects shared among servlets on same server Servlets on another server with HTTP request of the other.
CS 160: Software Engineering September 3 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
S ERVLETS Hits Counter 21-Nov-15. S ERVLETS - H ITS C OUNTER Many times you would be interested in knowing total number of hits on a particular page of.
Top right corner for field-mark, customer or partner logotypes. See Best practice for example. Slide title 40 pt Slide subtitle 24 pt Text 24 pt Bullets.
Java Servlets and Java Server Pages Norman White Stern School of Business.
JSP Pages. What and Why of JSP? JSP = Java code imbedded in HTML or XML –Static portion of the page is HTML –Dynamic portion is Java Easy way to develop.
 2002 Prentice Hall. All rights reserved. 9.8 Multi-Tier Applications: Using JDBC from a Servlet Three-tier distributed applications –User interface –Business.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, Responds oriented other.
1 Introduction to Servlets. Topics Web Applications and the Java Server. HTTP protocol. Servlets 2.
Mark Dixon 1 11 – Java Servlets. Mark Dixon 2 Session Aims & Objectives Aims –To cover a range of web-application design techniques Objectives, by end.
Session Beans Based on: Patel, Brose, Silverman, Mastering Enterprise JavaBeans 3.0.
Configuration Web Server Tomcat - Install JDK Install Tom cat Configure Tom cat for running Servlet C:\Program Files\Apache Software Foundation\Tomcat.
©SoftMoore ConsultingSlide 1 Overview of Servlets and JavaServer Pages (JSP)
Java and the Web CSE 3330 Southern Methodist University.
Java Servlets and Java Server Pages
Introduction To HTML Dr. Magdi AMER. HTML elements.
ClaRA web services V. Gyurjyan Clas12 Software Meeting
How CGI and Java Servlets are Run By David Stein 14 November 2006.
J2EE/Java EE Apache Tomcat v9 IBM Websphere v8 Redhat JBoss EAP v6 Oracle Weblogic v12 Fusion Web Tier ServletsJSPJSF Business Tier JMXJMSEJB.
S ERVLETS Form Data 19-Mar-16. F ORM P ROCESSING You must have come across many situations when you need to pass some information from your browser to.
Programming with Java Lecture 6 Elements of a Java Servlet
Introduction to Servlets
Building Web Apps with Servlets
Handling Errors in Web Applications
Developing JavaServer Pages
Servlet Fudamentals.
Net-centric Computing
Course Outcomes of Advanced Java Programming AJP (17625, C603)
Servlets Hits Counter 20-Jul-18.
HTTP Servlet Overview Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might.
Java Servlets II: Session Tracking
In Class Assg 4 - Solution
In Class Assg 3 - Solution
Jagdish Gangolly State University of New York at Albany
Servlets and JSP 20-Nov-18 servletsJSP.ppt.
Advanced Java programming in J2EE Chapter 1
© copyright Janson Industries 2011
Java Servlets and JSP.
Servlets.
J2EE Lecture 1:Servlet and JSP
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Java Servlets Servlet Overview Servlets and HTML Forms Servlet Basics
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Basic servlet structure
Java Chapter 7 (Estifanos Tilahun Mihret--Tech with Estif)
Presentation transcript:

V. Gyurjyan Clas12 Software Meeting 03.10.2008 ClaRA web services V. Gyurjyan Clas12 Software Meeting 03.10.2008

Geometry services Geometry cMsg Service Web Service cMsg TCP port = 7788 SOAP HTTP Port = 8080 User

Java Client Application package geometryws_client_application; import javax.xml.ws.BindingProvider; /** * @author gurjyan */ public class Main { * @param args the command line arguments public static void main(String[] args) { try { // Call Web Service Operation org.jlab.clara.ws.client.GeometryWSService service = new org.jlab.clara.ws.client.GeometryWSService(); org.jlab.clara.ws.client.GeometryWS port = service.getGeometryWSPort(); //change the wsdl location ((BindingProvider) port).getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://sca2.jlab.org:8080/GeometryWSApplication/GeometryWSService?wsdl"); java.lang.String component = "SVT"; java.lang.String representation = "ascii"; // TODO process result here java.lang.String result = port.getGeometry(component, representation); System.out.println("Result = " + result); } catch (Exception ex) { ex.printStackTrace(); }

JSP client <%-- Document : index Created on : Mar 7, 2008, 10:55:19 AM Author : gurjyan --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <h2>ClaRA GeometryService JSP client!</h2> <%-- start web service invocation --%><hr/> <% try { org.jlab.clara.ws.client.GeometryWSService service = new org.jlab.clara.ws.client.GeometryWSService(); org.jlab.clara.ws.client.GeometryWS port = service.getGeometryWSPort(); // TODO initialize WS operation arguments here java.lang.String component = "SVT"; java.lang.String representation = "ascii"; // TODO process result here java.lang.String result = port.getGeometry(component, representation); out.println("Result = "+result); } catch (Exception ex) { // TODO handle custom exceptions here } %> <%-- end web service invocation --%><hr/> </body> </html>

Servlet client package org.jlab.clara.ws.client; import java.io.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; import javax.xml.ws.WebServiceRef; /** * * @author gurjyan */ public class ClientServlet extends HttpServlet { @WebServiceRef(wsdlLocation = "http://sca2.jlab.org:8080/GeometryWSApplication/GeometryWSService?wsdl") private GeometryWSService service; * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. * @param request servlet request * @param response servlet response protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); PrintWriter out = response.getWriter(); try { out.println("<html>"); out.println("<head>"); out.println("<title>Servlet ClientServlet</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet ClientServlet at " + request.getContextPath () + "</h1>"); try { // Call Web Service Operation org.jlab.clara.ws.client.GeometryWS port = service.getGeometryWSPort(); java.lang.String component = "SVT"; java.lang.String representation = "ascii"; // TODO process result here java.lang.String result = port.getGeometry(component, representation); out.println("Result = "+result); } catch (Exception ex) {} out.println("</body>"); out.println("</html>"); } finally { out.close(); }