web server - Borland Technical Publications
web server - Borland Technical Publications web server - Borland Technical Publications
Using HTTP sessions For example, you can change state without calling setAttribute () as depicted in the following code example: Object myState = session.getAttribute("myState"); Note // Modify mystate here and do not call setAttribute () Your configuration file, server.xml, will have the following code snippet: where xxx is the time interval in seconds that you want the session data to be stored. For more information about the server.xml file, go to Chapter 5, “Web server to web container connectivity.” When using the Automatic implementation, you need to consider the following limitations: 1 If the web container goes down between two save intervals, the latest changes are not visible for the next web container instance. This is an important concern when defining the time interval value for the heartbeat. 2 The data is saved at the specified time interval no matter if the data is changed or not. This can be wasteful if a session frequently does not change and the defined time interval value is set too low. Using HTTP sessions The HyperText Transfer Protocol (HTTP) is a stateless protocol. In the client/server paradigm, it means that all client requests that the Apache web server receives are viewed as independent transactions. There is no relationship between each client request. This is a typical stateless connection between the client and the server. However, there are times when the client deems it necessary to have a session concept for transaction completeness. A session concept typically means having a stateful interaction between the client and server. An example of the session concept is shopping online with an interactive shopping cart. Every time you add a new item into your shopping cart, you expect to see that new item added to a list of previously added items. HTTP is not usually regarded for handling client request in a stateful manner. But it can. BES supports the HTTP sessions through two methods of implementations: ■ Cookies: The web server send a cookie to identify a session. The web browser keeps sending back the same cookie with future requests. This cookie helps the server-side components to determine how to handle the transaction for a given session. ■ URL rewriting: The URL that the user clicks on is dynamically rewritten to have session information. Chapter 7: Clustering web components 65
66 BES Developer’s Guide
- Page 25 and 26: 14 BES Developer’s Guide
- Page 27 and 28: Creating Partitions Creating Partit
- Page 29 and 30: Running Partitions Table 3.1 Option
- Page 31 and 32: Configuring Partitions You can also
- Page 33 and 34: JMX support in Partitions ■ ■ A
- Page 35 and 36: JMX support in Partitions Figure 3.
- Page 37 and 38: Thread pools Partition properties r
- Page 39 and 40: 28 BES Developer’s Guide
- Page 41 and 42: Apache web server implementation Fo
- Page 43 and 44: Borland web container implementatio
- Page 45 and 46: Borland web container implementatio
- Page 47 and 48: Borland web container implementatio
- Page 49 and 50: Smart Agent implementation Smart Ag
- Page 51 and 52: 40 BES Developer’s Guide
- Page 53 and 54: Apache web server to Borland web co
- Page 55 and 56: Apache web server to Borland web co
- Page 57 and 58: Apache web server to Borland web co
- Page 59 and 60: Large data transfer Downloading lar
- Page 61 and 62: Large data transfer Uploading large
- Page 63 and 64: IIS web server to Borland web conta
- Page 65 and 66: IIS web server to Borland web conta
- Page 67 and 68: IIS web server to Borland web conta
- Page 69 and 70: Session management with JSS If an i
- Page 71 and 72: Managing and configuring the JSS Co
- Page 73 and 74: The Borland IIOP connector BES supp
- Page 75: Setting up your web container with
- Page 79 and 80: Web-enabling your CORBA server Impo
- Page 81 and 82: Configuring your Apache web server
- Page 83 and 84: Configuring your Apache web server
- Page 85 and 86: Web Services and Partitions ■ ■
- Page 87 and 88: Web Service providers Java:RPC prov
- Page 89 and 90: How Borland Web Services work
- Page 91 and 92: Packaging Web Service Application A
- Page 93 and 94: Tools Overview Java2WSDL tool Note
- Page 95 and 96: 84 BES Developer’s Guide
- Page 97 and 98: Client view of an enterprise bean L
- Page 99 and 100: Client view of an enterprise bean E
- Page 101 and 102: Managing transactions Managing tran
- Page 103 and 104: Support for JNDI Support for JNDI T
- Page 105 and 106: EJB to CORBA mapping A CORBA progra
- Page 107 and 108: 96 BES Developer’s Guide
- Page 109 and 110: Application Client architecture Pac
- Page 111 and 112: Document Type Definitions (DTDs) my
- Page 113 and 114: Support of references and links The
- Page 115 and 116: Use of Manifest files Use of Manife
- Page 117 and 118: 106 BES Developer’s Guide
- Page 119 and 120: Sessions in secondary storage If yo
- Page 121 and 122: 110 BES Developer’s Guide
- Page 123 and 124: Container-managed persistence and R
- Page 125 and 126: Implementing an entity bean Generat
Using HTTP sessions<br />
For example, you can change state without calling setAttribute () as depicted in the<br />
following code example:<br />
Object myState = session.getAttribute("myState");<br />
Note<br />
// Modify mystate here and do not call setAttribute ()<br />
Your configuration file, <strong>server</strong>.xml, will have the following code snippet:<br />
<br />
<br />
<br />
where xxx is the time interval in seconds that you want the session data to be stored.<br />
For more information about the <strong>server</strong>.xml file, go to Chapter 5, “Web <strong>server</strong> to <strong>web</strong><br />
container connectivity.”<br />
When using the Automatic implementation, you need to consider the following<br />
limitations:<br />
1 If the <strong>web</strong> container goes down between two save intervals, the latest changes are<br />
not visible for the next <strong>web</strong> container instance. This is an important concern when<br />
defining the time interval value for the heartbeat.<br />
2 The data is saved at the specified time interval no matter if the data is changed or<br />
not. This can be wasteful if a session frequently does not change and the defined<br />
time interval value is set too low.<br />
Using HTTP sessions<br />
The HyperText Transfer Protocol (HTTP) is a stateless protocol. In the client/<strong>server</strong><br />
paradigm, it means that all client requests that the Apache <strong>web</strong> <strong>server</strong> receives are<br />
viewed as independent transactions. There is no relationship between each client<br />
request. This is a typical stateless connection between the client and the <strong>server</strong>.<br />
However, there are times when the client deems it necessary to have a session<br />
concept for transaction completeness. A session concept typically means having a<br />
stateful interaction between the client and <strong>server</strong>. An example of the session concept is<br />
shopping online with an interactive shopping cart. Every time you add a new item into<br />
your shopping cart, you expect to see that new item added to a list of previously added<br />
items. HTTP is not usually regarded for handling client request in a stateful manner.<br />
But it can.<br />
BES supports the HTTP sessions through two methods of implementations:<br />
■<br />
Cookies: The <strong>web</strong> <strong>server</strong> send a cookie to identify a session. The <strong>web</strong> browser<br />
keeps sending back the same cookie with future requests. This cookie helps the<br />
<strong>server</strong>-side components to determine how to handle the transaction for a given<br />
session.<br />
■<br />
URL rewriting: The URL that the user clicks on is dynamically rewritten to have<br />
session information.<br />
Chapter 7: Clustering <strong>web</strong> components 65