J2EE 1
J2EE C AP 2
J2EE AP DD java *.class java *.class java *.class *.class DD EAR, WAR, JAR orionapplicationclient.xmweb.xmapplication.jar.xml orion- orion-ejb- ml Oracle Application Server 10g *.jsp *.jsp *.jsp *.jsp *.html,*.jpg, *.html,*.jpg, *.html,*.jpg, etc. etc. *.jpg, etc. etc. web.xml application.xml application-client.xml ejb-jar.xml J2EE weblogic.xml weblogic.xml weblogic.xml weblogic.xml ibm-webbnd.xmi ibm-web- ibm-webbnd.xmi ibm-webbnd.xmbnd.xmbnd.xmi ibm-webbnd.xmi ibm-webbnd.xmi WebLogic WebSphere AP others DD: Deployment Descriptor 3
Oracle Application Server DD DD java *.class java *.class java *.class *.class *.jsp *.jsp *.jsp *.jsp *.html,*.jpg, *.html,*.jpg, *.html,*.jpg, etc. etc. *.jpg, etc. etc. web.xml application.xml application-client.xml ejb-jar.xml EAR orion-ejbjar.xml orionweb.xml orionapplication.xml orionapplicationclient.xml Oracle Application Server 10g 4
J2SE J2EE J2EE J2EE AP J2EE AP InitialContext 5
UP AP EJB1.1 6
JSP 1.2 page import The default import list is java.lang.*, javax.servlet.*, javax.servlet.jsp.* and javax.servlet.http.*. JSP 1.1 1.0 JSP 1.0 java.util.* AP JSP java.util.* AP JSP 1.1 java.util.* UP java.util.* 7
Oracle Application Server JSP global-web-application.xml orion-web.xml extra_imports <init-param> <param-name>extra_imports</param-name> <param-value>java.util.* java.beans.*</param-value> </init-param> page JSP 1.2 import - forgive_dup_dir_attr 8
JSP charset=sjis <%@ page contenttype= text/html;charset=sjis %> JSP contenttype CHARSET, if present, must be the IANA name for a character encoding. SJIS IANA name charset=sjis Oracle Application Server charset=shift_jis windows-31j charset=windows-31j http://www.iana.org/assignments/character-sets 9
Servlet ServletContext.getRealPath public String getrealpath(string path) String /index.html http://host/contextpath/index.html contextpath ServletContext Servlet Servlet (.war ) null : path - String : String null http://www.ingrid.org/jajakarta/servletapi/servletapi-4.0/docs-ja/javax/servlet/servletcontext.html - getrealpath(java.lang.string) 10
getrealpath /index.html /index.html index.html index.html 11
String fstr = context.getrealpath( ) + asdf.txt ; String fstr = context.getrealpath( /asdf.txt ); AP getrealpath 12
getrealpath (1) AP Oracle Application Server 10g / /index.html index.html C: OracleAS j2ee applications test1 GetRealPathTest C: OracleAS j2ee applications test1 GetRealPathTest index.html C: OracleAS j2ee applications test1 GetRealPathTest C: OracleAS j2ee applications test1 GetRealPathTestindex.html A Tomcat / /index.html index.html / /index.html index.html D: JRun4 servers default default-ear default-war D: JRun4 servers default default-ear default-war index.html D: JRun4 servers default default-ear default-war D: JRun4 servers default default-ear default-war index.html D: tomcat41 webapps ROOT D: tomcat41 webapps ROOT index.html D: tomcat41 webapps ROOT D: tomcat41 webapps ROOT index.html 13
getrealpath (2) AP / D: IBM WebSphere AppServer GalleryJA.war /index.html D: IBM WebSphere AppServer GalleryJA.war index.html B D: IBM WebSphere AppServer GalleryJA.war C index.html / /index.html index.html D: IBM WebSphere AppServer GalleryJA.war index.html D: bea weblogic700 applications DefaultWebApp D: bea weblogic700 applications DefaultWebApp index.html D: bea weblogic700 applications DefaultWebApp D: bea weblogic700 applications DefaultWebApp index.html * Windows 14
getrealpath asdf.txt fstr = ctx.getrealpath( / ) + asdf.txt ; fstr = ctx.getrealpath( /asdf.txt ); fstr = ctx.getrealpath( ) + /asdf.txt ; fstr = ctx.getrealpath( ) + asdf.txt ; fstr = ctx.getrealpath( asdf.txt ); AP fstr = ctx.getrealpath( /asdf.txt ); Servlet 15
J2EE 16
AP JSP usebean JavaBean XML InitialContext J2EE EJB-QL INSERT UPDATE DELETE executeupdate executequery 17
AP Web public void doget(httpservletrequest request, HttpServletResponse response) throws ServletException, IOException { String var0 = ""; try { var0 = request.getparameter("param0"); request.setcharacterencoding("windows-31j"); try { var0 = request.getparameter("param0"); param0 J2EE AP Web J2EE var0 = new String(request.getParameter("param0").getBytes("8859_1"), "JISAutoDetect"); 18
JSP usebean JavaBean Oracle Application Server JSP usebean JavaBean JavaBean package com.stardeveloper.bean.test; public class SimpleBean implements java.io.serializable { /* Properties */ private String name = null; private int age = 0; } /* Empty Constructor */ public SimpleBean() {} /* Getter and Setter Methods */ public String getname() { return name; } public void setname(string s) { name = s; } public int getage() { return age; } public void setage(int i) { age = i; } JavaBeans are usual Java classes which adhere to certain coding conventions. Following are the coding conventions I am talking about : Implements java.io.serializable interface Provides no argument constructor Provides getter and setter methods for accessing it's properties http://www.stardeveloper.com/articles/display.html?article =2001071901&page=1 19
( ) OC4J Oracle Application Server J2EE ClassCastException OTN http://otndnld.oracle.co.jp/products/oc4j/pdf/902/classloadinginoc4j_wp. pdf 20
XML OC4J Oracle Application Server J2EE Oracle XML Parser XML J2EE Oracle XML Parser XML J2EE Xerces Xalan OC4J Xerces Xalan -Xbootclasspath/a:d: xerces xerces.jar OC4J FAQ (http://otndnld.oracle.co.jp/products/ias/htdocs/oc4j_faq_904/oc4j- FAQ-904.html) 21
InitialContext javax.naming.initialcontext Hashtable env = new Hashtable(); env.put(context.initial_context_factory, "com.ibm.ejs.ns.jndi.cninitialcontextfactory"); Context ic = new InitialContext(env); DataSource ds = (DataSource) ic.lookup("jdbc/ds_oracle"); Context ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup("jdbc/ds_oracle"); 22
J2EE EJB-QL AP J2EE 1.3 J2EE 1.4 J2EE 1.4 J2EE 1.3 AP <ejb-ql> SELECT OBJECT(o) FROM stock o WHERE stocktype LIKE?1 ORDER BY location </ejb-ql> LIKE ORDER BY EJB 2.0 23
OC4J HTML HREF= INSERT UPDATE DELETE executeupdate executequery AP JDBC INSERT UPDATE DELETE executequery SQLException 24
25 NO YES EAR WAR NO YES NO YES J2EE NO YES AP NO YES AP import NO YES AP J2EE NO YES J2SDK(JDK) YES OracleAS AP Deployment Descriptor NO Oracle JDeveloper YES
Oracle JDeveloper 1. DD(Deployment Descriptor) 2. Oracle JDeveloper DD 3. 4. DD 5. 6. OC4J 7. 26
AP Oracle JDeveloper InitialContext AP 27
Oracle JDeveloper J2EE Oracle Application Server J2EE OC4J JDeveloper Oracle Application Server Oracle JDeveloper AP Oracle JDeveloper 28
Oracle JDeveloper 29
J2EE AP AP J2EE Oracle JDeveloper 10g 30
Oracle Corporation Oracle Corporation