Advanced java
Transcript of Advanced java
![Page 1: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/1.jpg)
ADVANCED JAVA
Presented bySandeep Kumar Prasad
Roll no-1150980
Submitted to:Department of CSERIMT-IET ,Mandi Gobindgarh punjab
![Page 2: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/2.jpg)
JEE(java enterprise edition)
• It is not a installable software.• It is a set of software specifications to develop
web server/application server.• Working with JEE module is nothing but working
with web server or application server.• In Advanced java software training we study
one JSE technology(JDBC) and two JEE technology(SERVLET, JSP).
![Page 3: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/3.jpg)
Java Web Servers in IT market
• Tomcat- From Apache.• Resin- From Resin soft.• JWS(java web server)-From Sun MS.• Jetty-From Adobe.
![Page 4: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/4.jpg)
Java Application Servers
• Weblogic-From BEA(Oracle).• Websphere-From IBM• Glassfish-From Oracle Corp.• Oracle 10g AS-From Oracle Corp.• Jboss- Initially from Apache but now under Red
Hat.• Jrun-From Adobe.• PAS- It is developed by Indian vendor company
called Pramathi software solution,Hyderabad.
![Page 5: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/5.jpg)
JDBC• It is a JSE persistence technology can be used to
write persistence logic performing persistence operation on persistence data of persistence store. Its latest version is
4.x.• Jdbc 4.x important api package are: java.sql javax.sql javax.sql.rowset
![Page 6: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/6.jpg)
Sun microsystems Jdbc technology contains rules and guidelines to develop JDBC drivers
JDBC driver for Oracle
JDBC driver for mysql
JDBC driver for postgresql
![Page 7: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/7.jpg)
Servlet
• Servlet is a java web technology that allows to develop single instance multiple thread based server side web components in java web application.
• Servlet is JEE technology given by sun microsystems having set of rules and guidelines to develop container.
• Servlet is used to develop enterprise application that means web application and distributed application.
![Page 8: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/8.jpg)
Servlet API 3.0 important packages
• java.servlet• javax.servlet.http• javax.servlet.annotation• javax.servlet.jsp
![Page 9: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/9.jpg)
Web deployment directoryExampleTestApp(web application) WEB-INF test.html classes Test.jsp TestSrv.java web.xml com.rimt TestSrv.class
![Page 10: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/10.jpg)
• To send “hyper text” from browser to server and server to browser we use protocol http.
• The text that allows non-sequential access is called hyper text.
• The latest version of protocol http is 1.1.
Protocol Http
![Page 11: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/11.jpg)
The Data carries along with request(taken as hhpp)
h-http request method(GET,POST etc).h-http request header(user- agent, accept
etc).
p-path of resource(/TestApp/test.html).p-request params (sno=101&sname=raja).
![Page 12: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/12.jpg)
The Data carries along with response(taken as SCH)
S-http response status code(100-599).C-response content(the message of
pw.println(-)method)H-response hesders(refresh, contextType
etc).
![Page 13: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/13.jpg)
Http request with detailed data
• Post• /TestApp/test.html Misc Info
• Accept: text/html, text/xml
Host: www.rimt.ac.inuser-agent: mozilaAccept-language: un-usAccept-encoding: gzip Request HeadersKeep-alive:300Connection: keep-alive<<<<<<<<<<<<<<<blank line
<<<<<<<<<<<<<<<<<<<<<<<<<<user=raja & pwd= hyd request body/payload/form
data
![Page 14: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/14.jpg)
JSP
• It is a Sun microsystems supplied java based web technology that allows to develop tag based web resource in java web application having capability to generate dynamic web pages.
• Now days in real time project JSP is used to write view layer presentation logic
![Page 15: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/15.jpg)
• Internally for every jsp an equivalent JES(jsp equivalent servlet) class will be generated by jsp page compiler and the container JASPER uses the support of servlet container CATALINA to execute the JES class.
Jsp Life Cycle Convenience • jspInit(): for instantiation event• _jspService(-,-): for request arrival event• jspDestroy(): fro destruction event
JSP Internals
![Page 16: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/16.jpg)
Conclusion
In Real time MVC 2 Based enterprise application
• JSP is used as presentation logic(view layer)
• Servlet is used for controller logic(controller layer)
• JDBC is used for persistence logic using the help of java class.(model layer)
![Page 17: Advanced java](https://reader035.fdocuments.us/reader035/viewer/2022071901/55c0d48abb61eb1a038b461d/html5/thumbnails/17.jpg)
Thank you!