1 / 9

Understanding Web Server, Applets, and Security in Java

Learn about web servers, applets, and security in Java programming, including the sandbox model and the applet life cycle.

dagnew
Download Presentation

Understanding Web Server, Applets, and Security in Java

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More about applets A Web server is stateless page 2Distributed processing page 3The sandbox model in Java page 4Security manager page 5The applet classes’ place in the class tree page 6The life cycle of an applet page 7Security in practice page 8Communication between applet and browser page 9 Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  2. A Web Server is Stateless • The main task of a Web server is to answer clients’ requests to get files. • A HTML page is a fairly ”dead” affair with limited possibilities for manipulation of data (but some with JavaScript). • The user may enter data into a form on a Web page. • These are sent to the Web server, which could pass it on as input to a program. • After this, the Web server forgets this request. It is stateless, like an object without any variables. • If the same client continues to work on the same tasks, it can’t suppose that the server remembers the last time they had contact. • In practice, the server will in these cases have finished the last sub-task by sending data back to the client. brow-ser Webserver programusingthedata Internet CGI HTTP HTTP client server Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  3. Distributed Processing • We can reduce the network traffic by letting the browser download small programs which do calculations and work on data in other ways. • The browser runs these programs automatically • Other technologies • Java applets • Microsoft ActiveX • Shockwave Flash from Macromedia Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  4. The Sandbox Model in Java C:\windows lpt1 System.out AppletContext /etc/passwd Suspicious applet doesn’t get access to many resources on the computer. Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  5. Security Manager • A security manager is an object of the class SecurityManager. • A running Java program can have one of these installed. • If the program wishes to perform a task that is a security hazard, it has to ask the security handler for permission. • It should not be possible for us to write risky code without having to use methods in the API that perform the security check. • An applet always has a security manager installed. • The applet can’t change its own security manager. Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  6. The Applet Classes’ Place in the Class Tree Object Not all browsers support Swing. See the book’s web page for relevant information. Component Container JComponent Window Panel Applet JInternalFrame JWindow Frame Dialog JFrame JDialog JApplet Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  7. The Life Cycle of an Applet The applet is out of theworld because thebrowser is closed, or foranother reason. The applet isrunning, theuser is watching. start() destroy() init() start() loaded dead running stopped stop() The applet is stopped, the user has left theWeb page. The applet isloaded and startsright away. Show program listing 18.1, pp. 568-569.Solve problem page 570. Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  8. Security in Practice Show program listings 18.2 and 18.3, pp. 570-571. Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

  9. Communication Between Applet and Browser • Applet context • AppletContext browser = getAppletContext(); • The applet gets a reference to the browser it runs in • Relevant messages to send to the object browser • void showDocument(URL url) • void showStatus(String statusText) • Parameters for the applet, examples <html><head> </head> <body> <h1>Applet which demonstrates use of parameters</h1> <object classid="java:Parameter.class" width="500" height="100"> <param name="name" value="Wally"> <param name="telephone" value="12 34 56 78"> Your browser does not support applets, or it's turned off. </object> </body></html> Show program listing 18.4, page 574. Only to be used in connection with the book "Java the UML Way", by Else Lervik and Vegard B. Havdal. ISBN 0-470-84386-1, John Wiley & Sons Ltd 2002The Research Foundation TISIP, http://tisip.no/engelsk/

More Related