Программирование на стороне сервера. Языки для программирования на стороне сервера Языки программирования: Perl PHP Java Технология Microsoft для использования.

Slides:



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

Java Server Pages (JSP)
Java Servlet & JSP © copyright 2005 SNU OOPSLA Lab.
Introduction to Servlets Based on: Hall, Brown, Core Servlets and JavaServer Pages.
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.
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.
Servlets Stoney Jackson
CSE 190: Internet E-Commerce Lecture 7. HTML Templates Designed to separate server side logic from HTML presentation Key features –Escapes from HTML into.
18-Jun-15 JSP Java Server Pages Reference: Tutorial/Servlet-Tutorial-JSP.html.
JSP Java Server Pages Reference:
Servlets Servlets are modules that extend the functionality of a “java-enabled” web-server They normally generate HTML code and web content dynamically.
Язык Java. JSP..
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.
2/16/2004 Dynamic Content February 16, /16/2004 Assignments Due – Message of the Day Part 1 Due – Reading and Warmup Work on Message of the Day.
27-Jun-15 Directories and DDs. 2 Web apps A web application is basically a web site that: “Knows who you are”--it doesn’t just give you static pages,
Introduction to Servlet & JSP
Comp2513 Java Servlet Basics Daniel L. Silver, Ph.D.
Java Server and Servlet CS616 Team 9 Kim Doyle, Susan Kroha, Arunima Palchowdhury, Wei Xu.
Server Side Programming Web Information Systems 2012.
Servlets. Our Project 3-tier application Develop our own multi-threaded server Socket level communication.
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.
Introduction Servlets and JSP Celsina Bignoli
Web technologies and programming cse hypermedia and multimedia technology Fanis Tsandilas April 3, 2007.
Introduction to JAVA Instructor : Simon Hui & Louis Wong Industrial Centre The Hong Kong Polytechnic University Sep, 2002.
Servlets. - Java technology for Common Gateway Interface (CGI) programming. - It is a Java class that dynamically extends the function of a web server.
Java Servlets and Java Server Pages Carol Wolf Computer Science.
J2EE training: 1 Course Material Usage Rules PowerPoint slides for use only in full-semester, for-credit courses at degree-granting.
111 Java Servlets Dynamic Web Pages (Program Files) Servlets versus Java Server Pages Implementing Servlets Example: F15 Warranty Registration Tomcat Configuration.
CMPUT 391 – Database Management Systems Department of Computing Science University of Alberta CMPUT 391 Database Management Systems Web based Applications,
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 Lec 27. Creating a Simple Web Application in Tomcat.
Chapter 2 Web app architecture. High-level web app architecture  When a client request coming in and needs servlet to serve dynamic web content, what.
20-Nov-15introServlets.ppt Intro to servlets. 20-Nov-15introServlets.ppt typical web page – source Hello Hello.
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.
JavaServer Page by Antonio Ko. Overview ► Introduction ► What is a servlet? ► What can servlets do? ► Servlets Vs JSP ► Syntax ► Samples ► JavaBean ►
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.
Hints for Assignment #8. Initial Screen Hints for the initial page You need a DOCTYPE with the proper namespaces defined You need to import the facebook.
Middleware 3/29/2001 Kang, Seungwoo Lee, Jinwon. Description of Topics 1. CGI, Servlets, JSPs 2. Sessions/Cookies 3. Database Connection(JDBC, Connection.
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.
CS320 Web and Internet Programming Introduction to Java Servlets Chengyu Sun California State University, Los Angeles.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 3 1COMP9321, 15s2, Week.
Java Servlets Java Server Pages (JSP)
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 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.
 Java Server Pages (JSP) By Offir Golan. What is JSP?  A technology that allows for the creation of dynamically generated web pages based on HTML, XML,
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.
Distributed Web Systems Java Servlets Lecturer Department University.
Introduction to Servlets
Introduction Servlets and JSP
Servlet Fudamentals.
Net-centric Computing
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 Server Pages.
Servlets and Java Server Pages
Servlets and JSP 20-Nov-18 servletsJSP.ppt.
Java Servlets 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.
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
Presentation transcript:

Программирование на стороне сервера

Языки для программирования на стороне сервера Языки программирования: Perl PHP Java Технология Microsoft для использования программ в html-коде: ASP VisualBasic JavaScript

Perl Единственный тип данных – строка Переменная – строка, с которой связано значение $x – переменная с именем x $_ – анонимная переменная Регулярные выражения

Perl #!/usr/bin/perl open(HTM, "/text/sample.html") || die "Файл не найден!"; while( ){ print; } close(HTM);

Perl. Регулярные выражения if($ENV{'SERVER_NAME'} =~ /\.ru$/){ $word =~ s/a/b/g; $str =~ s/%(..)/pack('c',hex($1))/eg; $text =~ tr/А-Я/а-я/;

PHP Интерпретируемый язык Текст выглядит как Html-код с вставками Синтаксис близок к C г.

PHP Первая версия 1995 г. Расмус Лердорф (Rasmus Lerdorf) РНР 2.0, или PHP-FI (Personal Home Page — Form Interpretator) РНР 3.0, 1997 г. РНР 4.0, 1999 г. РНР 5.0 РНР Hypertext Processor

Синтаксис PHP-вставок echo ("как HTML"); ;

Примеры PHP кода Вы пришли со странички Первая страница <?php for ($i = 1; $i <= 10; $i++) { print " $i "; } ?>

Примеры PHP кода <?php} } ?>

Java: Апплеты, сервлеты и скриптлеты Апплеты – специализированные приложения для выполнения браузером Сервлеты – специализированные приложения для выполнения сервером Скриптлеты – JSP. Наиболее наглядный вид серверных страниц

Апплеты Приложения со значительными ограничениями Не могут работать с файлами Подклассы класса java.applet.Applet

public class Applet1 extends java.applet.Applet{ public void init(){... //Инициализация перед началом работы } public void start(){... //Обеспечивает основную функциональность } public void update(java.awt.Graphics g){... //Форсирование перерисовки } public void paint(java.awt.Graphics g){... //Обеспечивает визуализацию апплета } public String getAppletInfo(){ return "Справочная информация об апплете"; } Апплеты

Пример апплета на страничке Это пример апплета <object codebase="." code="Applet1.class" width=200 height=150> Альтернативный текст

Сервлеты import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class Hello extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html"); out.println( " Hello! "); out.println(" Hello! "); out.println(" "); }

JSP declaration scriptlet expression

JSP. Пример //:! c15:jsp:Hello.jsp <%! long loadTime= System.currentTimeMillis(); Date loadDate = new Date(); int hitCount = 0; %> Эта страница загружена Привет! Сейчас Здесь некий объект: Этой странице секунд. К странице обращались раз с <% System.out.println("Пока"); out.println("Cheerio"); %>