Presentation is loading. Please wait.

Presentation is loading. Please wait.

DHTML,AJAX,JB, EJB By: Gaurav Srivastav.

Similar presentations


Presentation on theme: "DHTML,AJAX,JB, EJB By: Gaurav Srivastav."— Presentation transcript:

1 DHTML,AJAX,JB, EJB By: Gaurav Srivastav

2 DHTML Dynamic Hyper Text Mark-Up Language.
One Basic Difference between HTML and DHTML is that HTML is used to create static webpages and DHTML is used for dynamic web pages. It is consists of HTML + CSS+ Java Script. HTML is simple but less interactive but DHTML is complex but more interactive.

3 AJAX Asynchronous Java Script.
Not a new programming- Language but it’s a kind of web document which adopts some certain standards. It allows developer to exchange data between browser and server and updates part of web document without reloading the webpage. 1. Make User Request 2. XML http request is created. 3. Send http request 6. Processes the returned data 7. Update web document 4.Processes Http request 5. Create response and send data to browser. Request Response Server Browser

4 Example <html> <head> <title>array</title> <script type= "text/javascript"> function MyFun() { if(window.XMLHttpRequest) req= new XMLHttpRequest(); } else req= new ActiveXObject("Microsoft.req"); req.onreadysataechange=function() if(req.onreadysatae==4&&req.status==200) document.getElementById("myID").innerHTML=req.responseText; req.open("GET","newdata.txt",true); req.send(); </script> </head> <body> <button type="button" onclick="MyFun()">Change</button> </body> </html>

5 Explanation MyFun() XMLHttpRequest: used to exchange data and update data with server without reloading web page fully. ActiveXObject: for older browsers. req.onreadysataechange: when request sent to server , this event is triggered. Readystate: it holds the status of XMLHttpRequset. ReadyState = 4 request is finished and response is ready. Status=200 means ok. Open() and send(): used to send request to server. Difference b/w synchronous and asynchronous?

6 VB Script Scripting Language launched by Microsoft.
Lightweight version of Visual Basic Programming. Used in ASP.net

7 Features of VBS It posses characteristics of Visual Basic. So various programming constructs can be used in it too as in VB. User interactions can be done using MsgBox and InputBox. It is used to create dynamic views to be visualized at internet explorer. Used for network and system administration. It support methods for executing scripts on remote machine. It support for the functionality for embedding Vbscript engine in other applications.

8 Example <html> <head> <title>VB Script</title> </head> <body> <script type= "text/VBScript"> document.write("Have Fun In VB-SCRIPT") </script> </body> </html>

9

10 Variables Variables are declared using Dim, Public and Private.
Dim name// creates variable// name =“ABC” It holds the value or expression. It should not contain special characters like Only underscore is allowed (_).

11 Procedures and Function
What is procedure & function?: Procedure Does not have a return type while a function can have a return type. For VBScript procedure can be written using Sub and End Sub. Function is declared using Function key-word.

12 Procedure <html> <head> <title>VB Script</title> <script type= "text/VBScript"> Sub MyProc(a,b) //procedure definition// c=a+b alert(c) End Sub </script> </head> <body> <center> MyProc 2,3 //call procedure// </center> </body> </html>

13

14 Function <html> <head> <title>VB Script</title> <script type= "text/VBScript"> Function MyFun(a,b)//definition of function// c=a+b MyFun=c//return value// End Function </script> </head> <body> <center> document.write("Sum is") document.write(MyFun(2,3))//call the function// </center> </body> </html>

15

16 Condition and Looping if else then Select

17 If..else..then <html> <head> <title>VB Script</title> <script type= "text/VBScript"> Function display t= hour(time) If t < 10 Then document.write("Good Morning") Elseif t = 12 Then document.write("Good Afternoon") Else document.write("Good Evening") End If End Function </script> </head> <body onload="display()"> </body> </html>

18

19 Select <html> <head> <title>VB Script</title> <script type= "text/VBScript"> m=Month(date) Select Case m Case 1 document.write("Jan") Case 2 document.write("Feb") Case 3 document.write("Mar") Case 4 document.write("Apr") Case 5 document.write("May") Case 6 document.write("June") Case 7 document.write("Jul") Case 8 document.write("Aug") Case 9 document.write("Sept") Case 10 document.write("Oct") Case 11 document.write("Nov") Case 12 document.write("Dec") End Select </script> </head> </body> </html>

20

21 Looping Loop is a block of statements which executes repeatedly.
In VBScript there are 4 types of loops For…..Next For Each….Next Do…..Loop Statement While

22 Do…While <html> <head> <title>VB Script</title> <script type= "text/VBScript"> i=100 Do While i>10 document.write("<br/>") document.write(i) i=i-10 Loop </script> </head> </body> </html>

23

24 Array <html> <body> <script type= "text/VBScript"> Dim a(5) document.write("<h3> Storing elements in an arrary</h3>") For i = 0 to 5 a(i)=i Next document.write("<h3> Retriving elements in an arrary</h3>") document.write("</br>"&a(i)) </script> </body> </html>

25

26 Java Bean It is programming component written in Java. It can be embedded with Jscript. It developed using a tool called as bean development kit(BDK). With JB API we can create reusable platform independent components.

27 Advantages A Bean obtains all the benefits of Java's "write-once, run-anywhere" paradigm.  The properties, events, and methods of a Bean that are exposed to an application builder tool can be controlled. A Bean may be designed to operate correctly in different locales, which makes it useful in global markets. Auxiliary software can be provided to help a person configure a Bean. This software is only needed when the design-time parameters for that component are being set. It does not need to be included in the run-time environment. The configuration settings of a Bean can be saved in persistent storage and restored at a later time. A Bean may register to receive events from other objects and can generate events that are sent to other objects.

28 BDK Before Installing BDK it is required to have JDK on the system.
After installing BDK , you will get a folder name Bean, go to sub directory of it i.e. bean-box.

29

30

31 Description There are 4 windows open when JB is started. Tool Box :
Bean Box Properties-Bean Box Method tracer

32

33 JAR File JAR: Java Archive File
When we create any Java Bean the BDK wants that created java bean must be packaged in a “.jar” file. In Jar file set of classes and related resources are placed together. e.g. if we create a bean for designing two graphical objects viz. circle and rectangle, then this bean program will have some control information about designing the desired object.

34 JAR File : Features These are used for installing the software.
Digital signatures can be associated with various elements of Jar file. Hence authenticity of various elements can be verified. It can be compressed. Creating jar file: Command : jar option file name e.g. jar cf example.jar example.class jar cf example.jar example.mft example.class

35 Mainfest Files It denotes which component of Jar File is a java bean.
We must specify the correct path for class file created by java bean. e.g. Name: sunw/demo/Mybean/Myimg.jpg Name: sunw/demo/Mybean/mybean.class Java-Bean: True

36 Properties Single Boolean Indexed

37 EJB - Enterprise Java Bean
It is used to implement business logic. The complete Java Package i.e. J2EE application container contains those components those are ready to deploy the business logic and business data. These components are: Security Transaction Messaging Persistence Distributions Connectivity

38 EJB COMPONENTS Client Entity Bean EJB Container EJB Server
Use full in making distributed java components, that will be use full in server side programming. psvm Server{ psvm Container{ EJB Component }

39 Feature It provides a component framework that can be deployed over the server as a plugin. Plugin has its own built- in feature and has to just deploy and use. EJB is a managed component. It can be created, controlled and managed. There may be a number of instances of EJB, these are contained in J2EE container. These instances provide services to various clients. After using that instance client returns that to the instance pool. It keeps separate data base to EJB processing.

40 3-tier architecture of EJB Processing
JSP Servlet Web Browser Database http request JDBC Driver Connection EJB J2EE server 3-tier architecture of EJB Processing

41 Java Bean Vs EJB JB EJB May or may not visible to user
Invisible to user Run locally Runs on distributed Used as Activex Control. Can’t use as Activex. It is described with bean info, properties and customizers. Described with DeploymentDescripter

42 Types of EJB Entity Session Message Driven Bean Managed
Container Managed Session State-full Stateless Message Driven

43 Entity Bean It represents data. e.g. it can used to represent a bank account or a customer. It basically used to show real world data. It acts as a persistent unit of the database.

44 Bean Managed Persistent
It is a entity bean. It is used to save the bean’s state. Container does not need to make any call from database.

45 Container Bean It is used to save the persistence of entity bean. Basically Container is responsible for saving the state of a bean. It is independent of data source.

46 Session Bean It used to maintain a session.
It basically represents an activity. So these are transient because activity exits after short period of time. It has does not represents the database but it can access resources of databases. It is always client specific.

47 State-full It stores internal state of EJB.
There is only one state-full session bean per EJB client. It can be saved across the session.

48 Stateless Simple and light-weighted.
Brings scalability to server performance. It is not associated to any client when they are needed they provide there services.

49 Message Driven Similar to session bean but activates only when asynchronous message is arrived. It does not retain any data and client.

50 Uses Of EJB Development of e-commerce application.
For web-oriented application. For multiple number clients different instances of EJB can be used. EAI can use EJB for processing and mapping different application.

51 Java Bean API It provides set of classes and interfaces those are defined in the java.beans. EventStateDescriptor e.g. Classes: BeanDescriptor Interfaces: Bean BeanInfo Eventhandler AppletInitializer


Download ppt "DHTML,AJAX,JB, EJB By: Gaurav Srivastav."

Similar presentations


Ads by Google