chapter3.doc

Similar documents
04장

chapter5.doc

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

KYO_SCCD.PDF

14-Servlet

JavaGeneralProgramming.PDF

TP_jsp7.PDF

J2EE Concepts

중간고사

chapter1,2.doc

MasoJava4_Dongbin.PDF

Interstage5 SOAP서비스 설정 가이드

Microsoft PowerPoint - 4강.pptx

PowerPoint 프레젠테이션

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

chapter6.doc

rmi_박준용_final.PDF

1

2장 변수와 프로시저 작성하기

뇌를 자극하는 JSP & Servlet 슬라이드

02 C h a p t e r Java

Intro to Servlet, EJB, JSP, WS

10-Java Applet

다른 JSP 페이지호출 forward() 메서드 - 하나의 JSP 페이지실행이끝나고다른 JSP 페이지를호출할때사용한다. 예 ) <% RequestDispatcher dispatcher = request.getrequestdispatcher(" 실행할페이지.jsp");

2장 변수와 프로시저 작성하기

Analytics > Log & Crash Search > Unity ios SDK [Deprecated] Log & Crash Unity ios SDK. TOAST SDK. Log & Crash Unity SDK Log & Crash Search. Log & Cras

뇌를 자극하는 JSP & Servlet 슬라이드

Data Provisioning Services for mobile clients

untitled

Chap12

<C4FBC1EEB7CE20C1A4B8AEC7D5BDC3B4D95FC1A4B4E42E687770>

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

슬라이드 1

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

PowerPoint 프레젠테이션

서블릿의라이프사이클 뇌를자극하는 JSP & Servlet

교육2 ? 그림

자바-11장N'1-502

목차 1. SDK Package 구성 2. 설치 3. API 소스설명 CTI 기능 luxsys_killsession Pop창에서웹링크로들어온세샨키를없세버리는방법 / 루틴 luxsys_click2dial 전화통화방식 : (Click-to-Dial 하고 Power/Mult

Microsoft PowerPoint - 7강.pptx

혼자서일을다하는 JSP. 이젠일을 Servlet 과나눠서한다. JSP와서블릿의표현적인차이 - JSP는 <html> 내에서자바를사용할수있는수단을제공한다. - 서블릿은자바내에서 <html> 을작성할수있는수단을제공한다. - JSP나서블릿으로만웹페이지를작성하면자바와다양한코드가

12-file.key

신림프로그래머_클린코드.key

untitled

6강.hwp

PowerPoint Presentation

Apache2 + Tomcat 5 + JK2 를 사용한 로드밸런싱과 세션 복제 클러스터링 사이트 구축

Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

Microsoft PowerPoint - aj-lecture7.ppt [호환 모드]

뇌를 자극하는 JSP & Servlet 슬라이드

<4D F736F F F696E74202D20B5A5C0CCC5CDBAA3C0CCBDBA5F3130C1D6C2F75F31C2F7BDC32E >

09-interface.key

C H A P T E R 2

자바로

User's Guide Manual

Microsoft PowerPoint - Chap6_cmpl

07 자바의 다양한 클래스.key

초보자를 위한 자바 2 21일 완성 - 최신개정판

Eclipse 와 Firefox 를이용한 Javascript 개발 발표자 : 문경대 11 년 10 월 26 일수요일

Microsoft PowerPoint - web-part03-ch19-node.js기본.pptx

Week13

PowerPoint 프레젠테이션

JAVA Bean & Session - Cookie

비긴쿡-자바 00앞부속

뇌를 자극하는 JSP & Servlet 슬라이드

Microsoft PowerPoint - JasperReports 개발자 매뉴얼.ppt

01-OOPConcepts(2).PDF

Modern Javascript

자바 프로그래밍

03장

JMF2_심빈구.PDF

Microsoft PowerPoint - aj-lecture9.ppt [호환 모드]

<param-value> 파라미터의값 </param-value> </init-param> </servlet> <servlet-mapping> <url-pattern>/ 매핑문자열 </url-pattern> </servlet-mapping> - 위의예에서 ServletC

DocsPin_Korean.pages

자바GUI실전프로그래밍2_장대원.PDF

No Slide Title

Microsoft PowerPoint - aj-lecture3.ppt [호환 모드]

3장

Data Provisioning Services for mobile clients

untitled

Dialog Box 실행파일을 Web에 포함시키는 방법

Ext JS À¥¾ÖÇø®ÄÉÀ̼ǰ³¹ß-³¹Àå.PDF

C++-¿Ïº®Çؼ³10Àå

2파트-07

Chap7.PDF

<4D F736F F F696E74202D203130C0E52EBFA1B7AF20C3B3B8AE205BC8A3C8AF20B8F0B5E55D>

Microsoft PowerPoint - 04-UDP Programming.ppt

API STORE 키발급및 API 사용가이드 Document Information 문서명 : API STORE 언어별 Client 사용가이드작성자 : 작성일 : 업무영역 : 버전 : 1 st Draft. 서브시스템 : 문서번호 : 단계 : Docum

PowerPoint 프레젠테이션

Corporate PPT Template

<4D F736F F D20C0DAB9D9C0A5BDBAC5B8C6AE2E646F63>

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에


thesis

uFOCS

블로그_별책부록

Secure Programming Lecture1 : Introduction

歯Writing_Enterprise_Applications_2_JunoYoon.PDF

DIY 챗봇 - LangCon

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

Transcription:

Chapter 3 : / Hello JSP Hello (?) Hello jsp List 31 <html> <body> <center> <h1>hello jsp</h1> </center> </body> </html> hellojsp jsp? html tag jsp jsp jsp 31 http://wwwjava2xmlcom

hello jsp List 32 <html> <body> <center> <h1><%= hello jsp %></h1> </center> </body> </html>, [ 3-1] Html Jsp expression Hello jsp List 33 <html> <body> <center> <h1><jsp:expression>hello jsp</jsp:expression></h1> </center> </body> </html> List 32List33 (?)? jsp xml xml : List33 Jspxml tag Tomcat321, Resin123, Hello jsp? http://wwwjava2xmlcom

List 34 package comboolpaejsp; public class HelloBean{ String hello = Hello jsp ; public String gethello(){ return hello; } public void sethello(string hello){ thishello = hello; } } List 35 <jsp:usebean id= hello class= comboolpaejsphellobean /> <jsp:setproperty name= hello property= hello /> <html> <body> <center> <h1><jsp:getproperty name= hello property= hello /></h1> </center> </body> </html> 34/35 class classpath jsp hello jsp? (?) List 36 package comboolpaejsp; import javaxservletjsp*; import javaxservletjsptagext*; import javaio*; import javaxservlet*; public class HelloTag extends TagSupport{ String value; public int dostarttag(){ try{ http://wwwjava2xmlcom

} } JspWriter out = pagecontextgetout(); outprint("hello jsp"); }catch(ioexception e){ Systemoutprintln(e); } return SKIP_BODY; List 36custom tag, jsp, class List 37 tld TLD(tag library descripter) List 37 <?xml version="10" encoding="iso-8859-1"?> <!DOCTYPE taglib PUBLIC "-//Sun MicroSystems, Inc //DTD JSP Tag Library 11//EN" "http://javasuncom/j2ee/dtds/web-jsptaglibrary_1_1dtd"> <taglib> <tlibversion>10</tlibversion> <jspversion>11</jspversion> <shortname>jspace</shortname> <urn/> <info> JavaServer Pages </info> <tag> <name>hello</name> <tagclass>comboolpaejsphellotag</tagclass> <info>simple example : Hello jsp</info> <bodycontent>empty</bodycontent> </tag> </taglib> List 38 jsp xml <tag> <name> hello Jsp tld (List 37 xml ) tld ( hello) class(list 36 ) comboolpaejsphellotag custom tag http://wwwjava2xmlcom

List 38 <%@ taglib uri="web-inf/classes/tld/hellotld" prefix="jspace" %> <html> <body> <center> <h1> <jspace:hello /> </h1> </center> </body> </html> jsp hello jsp Hello jsp Hello jsp Hello JSP jsp (?), JSP Jsp JSP 1 2 jsp80%, ( ) ( ),? http://wwwjava2xmlcom

(?) jsp JavaBeans, Custom Tag, Servlet jsp Servlet jsp, servlet jsp (Element Syntax) jsp ( ) Jsp jsp 1 Directives 2 Scripting Elements 3 Actions Directives Directives jsp <%@ directive {attr= value }* %> : EBNF EBNF {} 0 1, * http://wwwjava2xmlcom

page, include, taglib page Directive jsp, Jsp <%@ page attributelist %> attributelist ::= {language= scriptinglanguage } {extends = classname } {import = importlist } {session = true false } {buffer = none sizekb } {autoflush = true false } {istreadsafe = true false } {info = info_text } {errorpage = error_url } {iserrorpage = true false } {contenttype = contenttype information } ::= attributelist11 ( ) or (or ), <%@ page language= java extends= javaxservletjsphttpjsppage import= javautil* session= false buffer= 8kb autoflus= true istreadsafe= true info= This page is example page errorpage= /error/error01jsp iserrorpage= false contenttype= text/html;charset=euc-kr %> http://wwwjava2xmlcom

import import List <%@ page contenttype= text/plain %> <%@ page contenttype= text/html %> (Default) Default ( ) language java (?) (??? ) extends jsp super jsp jsp request jsp response jakarta-tomcat-321\work\ extends jsp javaxservletjsphttpjsppage (implements)? (?)jsp import jsp java package full name? Date javautil javasql URI? * jsp import java http://wwwjava2xmlcom

import import list (,) <%@ page import= javasql*, javautil*, comboolpaejsphelloclass %> import javalang*, javaxservlet*, javaxservletjsp*, javaxservlethttp* javalang String, import?, javaxservlet (?) jspweb jsp Cookie c = new Cookie( id, bluenote ); javaxservlethttp session jsp session true false true true session( javaxservlethttphttpsession ) false session session Session buffer jsp JspWriter(JavaxservletjspJspWriter) jsp JspWriter autoflush java (javaservlet ~ ~ ) kb, none 8kb ~ autoflush JspWriter Buffer http://wwwjava2xmlcom

true / false true false buffer (overflow) buffer= none autoflush= false Buffer isthreadsafe jsp SingleThreadModel true / false true true thread, false SingleThreadModel Thread false true true, false,, DB (syncronized) SingleThreadModel info ServletgetServletInfo() iserrorpage jsp false true exception jsp jsp errorpage List 39 <%@ page iserrorpage= true %> <HTML> http://wwwjava2xmlcom

<BODY> ~!!! <br> <%=exception %><br><br> <% exceptionprintstacktrace(new PrintWriter(out)); %> </BODY> </HTML> jsp errorpage jsp List 39 Resin error, tomcat error error, List39 errorpage jsp jsp ContentType jsp response MIME MIME jsp html text/html Acrobat PDF application/pdf charset charset= encoding <%@ page contenttype= text/html;charset=euc-kr %> NOTE MIME TYPE : Multipurpose Internet Mail Extenstion,, smtp,,,, 1991 SMTP, Nathan Borenstein http://wwwjava2xmlcom

Internet Engineering Task Force, IP 3-1 MIME TYPE application/msword application/octet-stream application/pdf application/vndlotus-notes application/vndms-excel application/vndms-powerpoint application/x-gzip application/x-java-archive application/x-java-serialized-object application/x-java-vm application/zip audio/basic audio/x-wav audio/midi text/css text/html text/xml text/plain image/gif image/jpeg image/png image/x-bitmap video/mpeg binary (PDF) Lotus Notes Gzip JAR Java Java class ZIP au, snd wav midi cascading style sheet html xml text gif jpeg png mpeg page Directive default 3-2 Attribute language import Java Default javalang*, javaxservlet*, javaxservletjsp*, http://wwwjava2xmlcom

extends session buffer autoflush isthreadsafe errorpage iserrorpage info ContentType Jsp12 spec final Draft javaxservlethttp* true 8kb ture true false ( ) text/html;charset=iso-8859-1 12 pageencoding ContentType charset pageencoding taglib Directive jsp (custom tag) jsp TLD ( :Tag Library Descriptor)URItag prefix( ) <%@ taglib uri= taglibraryuri prefix= tagprefix %> uri (prefix), jsp,jspx,javajavax,servlet,sun,sunw jsp, <%@ taglib uri= WEB-INF/classes/tlds/jspace-taglibtld prefix= jspace %> <jspace:hello> </jspace:hello> http://wwwjava2xmlcom

include Directive include jsp (translation-time) <%@ include file= %> include Jsp,, jsp Jsp include <jsp:include> (action) action (request-time) (request) ( ) Request jsp jsp (Directive) Jsp xml (Directive) xml xml XML <jsp:directivedirectivetype attribute= value /> <jsp:directivepage import= javautil* /> <jsp:directivetaglib uri= classes/jspace-tldtld prefix= jspace /> <jsp:directiveinclude file= /jspacejsp /> / xml (Body) http://wwwjava2xmlcom

< />, <tag></tag> page <jsp:directivepage import= javautil*></jsp:directivepage> <tag> (Body)</tag> well-formed xml xml, xml jsp xml (namespace) namespace xml, Html jspxml Scripting Element( ),? Jsp Scripting Elements jsp 1 Expression <%= code %> 2 Scriptlets <% code %> 3 Declarations <! code %> Expression output, Scriptlets _jspservice, Declarations,,,! Jsp //, http://wwwjava2xmlcom

/* */ Jsp <%-- --%>, Html Html <!- - - -> Expression (Expression) jsp Jsp (wrapper) tostring(), tostring() Object ( ) ObjecttoString() tostring() String Vector, int javalanginteger Expression xml <jsp:expression> code </jsp:expression>, 3 3? : (value) (value) <%= (1+3)==5? true : false %> String false, output Html, jsp <a href= http://jspboolpaecom/expressionjsp?id=<%=mathrandom()%> > html expressionjsp id Mathrandom() http://wwwjava2xmlcom

(expression) (;) Scriptlets (, ) Scriptletsxml <jsp:scriptlet> code </jsp:scriptlet> _jspservice Jsp html _jspservice, (expression) _jspservice Declaratin( ) Note : Servlet Life Cycle _jspservice() Life Cycle, init init() init() service() _jspservice() jsp service() jsp service() Http request doget, dopost, doxxx request, (unload) destroy() Lift cycle jsp init() destroy? (Decalration) jspinit(), jspdestory() Declarations http://wwwjava2xmlcom

(declaration) jsp _jspservice <%! Code %> (expression) _jspservice, Life cycle _jspservice isthreadsafe jsp isthreadsafe false SingleThreadModel xml <jsp:declaration> code </jsp:declaration> Action (action), Jsp (Standard) jsp, (custom tag), taglib ( ) <jsp:usebean> <jsp:setproperty> <jsp:getproperty> <jsp:param> <jsp:include> <jsp:forward> <jsp:plugin> usebean, setproperty, getpropertyjavabeans JavaBeans chapter <jsp:param> include, forward, plugin param keyvalue http://wwwjava2xmlcom

<jsp:include> include include (directive) include request time, ( include ), include, include, jsp:include List 39 includefile 01, includefile 02 List 39 <%-- includedfilejsp --%> <%! int i = 0; %> <%-- includefile 01 --%> <%@ include file= includedfilejsp %> <%= i %> <%-- includefile 02 --%> <jsp:include page= includefilejsp flush= true /> <%= i %> include, <jsp:include page= relative url flush= true /> <jsp:include page= relative url flush= true > {<jsp:param /> }* </jsp:include> page, flush http://wwwjava2xmlcom

, true, 11 true 12final Draft <jsp:param> List 310 <%@ page contenttype="text/html;charset=euc-kr" %> <HTML> <BODY> <center><h1> </h1></center><br> <OL> </OL> <LI>include action : <jsp:include page= jspacehtml flush= true /> <LI>include directive <%@ include file= jspacehtml %> </BODY> </HTML> List 311 jspacehtml <B>J</B>space <br>, List 310List 311jspacehtml include List 310 http://wwwjava2xmlcom

Tomcat-321 Jsp charset include Action, List 311, 311html include include (,!) jsp:param <jsp:param> jsp:param jsp:include jsp:forward, jsp:plugin ( 3 ) List 312 paramjsp <HTML> <BODY> http://wwwjava2xmlcom

<center><h1> </h1></center><br> <OL> <LI>include Action : <jsp:include page="jspacejsp" flush="true"> <jsp:param name="para01" value=" " /> </jsp:include> </OL> </BODY> </HTML> List 313 jspacejsp <% String para01 = requestgetparameter("para01"); %> <B>J</B>space <br>, <br>? <%=para01%> List 312List 313include para01 List 313 para01 String http://wwwjava2xmlcom

jsp:param keyvalue jsp:param keyvalue jsp:forward jsp:plugin <jsp:forward> jsp:forward jsp jsp:forward (?), ( ) jsp jsp jsp jsp:forward <jsp:forward page= relativeurl /> <jsp:forward page= relativeurl > {<jsp:param />}* </jsp:forward> jsp:param jsp:include include jsp:forward jsp:param List 314 List 314 <% String despage; if("yes"equalsignorecase(requestgetparameter("destination"))){ despage = "page01jsp"; }else{ despage = "page02jsp"; } %> <jsp:forward page="<%=despage%>" /> destination yespage01jsp page02jsp (Expression) http://wwwjava2xmlcom

NOTE, forward jsp:forward,? javaxservlet RequestDispatcher RequestDispatcher ServletContext getrequestdispatcher() String url = page01jsp ; RequestDispatcher dis = getservletcontext()getrequestdispatcher(url); getservletcontext() javaxservletgenericservlet, javaxservlethttphttpservlet, HttpServlet GenericServletgetServletContext() ( ), getservletcontext() ServletContext ServletContext getrequestdispatcher() RequestDispatcher RequestDispatcher include request (forward) disforward(request, response); request response request (jsp:param ) setattribute() requestsetattribute( key, value ); RequestDispatcher forwardinclude include forward http://wwwjava2xmlcom

jsp jsp servlet <jsp:plugin> jsp, applet, html<applet> <applet> jsp:plugin java12 jdk12 (?) 1 jdk12 Swing, 2 Java 2D 3 Java2 (Collections), EMBED OBJECT (?) jsp:plugin <jsp:plugin type= bean applet code= ObjectCode codebase= ObjectCodebase { align= alignment } { archive= archivelist } { height= height } { hspace= hspace } http://wwwjava2xmlcom

{ jreversion= jreversion } { name= componentname } { vspace= vspace } { width= width } { nspluginurl= url } { iepluginurl= url }> { <jsp:params> <jsp:param name= paramname value= paramvalue />}+ </jsp:params> } { <jsp:fallback> arbitrary_text </jsp:fallback> } </jsp:plugin>, EBNF + * + - type : type appletbean applet bean, bean - code : class Html <applet> jsp:plugin jspxml - height : - Width : HTML<applet> Html tag <applet code= Applet01class width= 200 height= 200 > </applet> jsp:plugin Action <jsp:plugin type= applet code= Applet01class width= 200 height= 200 /> - codebase : http://wwwjava2xmlcom

- align : Html image align - name : Form - archive : jar - vspace : - hspace : - jreversion : JRE (Default11 ) - nsplugin : - ieplugin :, <jsp:plugin> jsp:plug-in jsp:param jsp:params, jsp:param jsp:params, jsp:param jsp:params jsp:param name valuehtml <applet> <param> Html tag <applet code= Applet02class width= 200 height= 200 > <param name= param01 value= value01 > <parma name= param02 value= value02 > </applet> jsp:param / jsp:params Action <jsp:plugin type= applet code= Applet02class width= 200 height= 200 > <jsp:params> <jsp:param name= param01 value= value01 /> <jsp:param name= param02 value= value02 /> </jsp:params> </jsp:plugin> jsp:plugin <jsp:fallback> http://wwwjava2xmlcom

Chapter 3 1 jsp, 2 3 hello jsp jsp jsp jsp, jsp, (Implicit Object) jsp (expression), (scriptlets) (automatically defined variables), (predefined variables), jsp (declaration) ( 3-, ) jsp _jspservice(), _jspservice() _jspservice() 8 http://wwwjava2xmlcom

request request javaxservlethttphttpservletrequest ( http javaxservletservletrequest ) request request (get, post)request http JavaxservlethttpHttpServletRequest API response response javaxservlethttphttpservletresponse ( ) response, API out out javaxservletjspjspwriter javaiowriter PrintWriter, javaioprintwriter out (expression) jsp out outprint( xxx ); <%= xxx %> session javaxservlethttphttpsession jsp,, page (directive) session false session chapter application application javaxservletservletcontext http://wwwjava2xmlcom

Servletcontext (persistence) ServletContext setattribute() application, <% applicationsetattribute( key, value ); %> config javaxservletserveletconfig, pagecontext jsp javaxservletjsppagecontext request (request getrequest() ) page java this Jsp java 8 9? Exception exception page (directive) iserrorpage true jsp javalangthrowable exception iserrorpage (implicit Object) http://wwwjava2xmlcom

[4-1] Request Type scope javaxservletservletrequest javaxservlethttpservletreqeust request response pagecontext session application out config page javaxservletservletresponse javaxservlethttpservletrequest javaxservletjsppagecontext javaxservlethttphttpsession javaxserlvetservletcontext javaxservletjspjspwriter javaxservletservletconfig javalangobject page page session application page page page scope, scope, JavaBeans Beanscope [4-3] scope page scope request (request) page include, forward request session application ( ) http://wwwjava2xmlcom

http://wwwjava2xmlcom