• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

global.jsa

 
M.K.Gopinathan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do advice me how to configure global.jsa
on Websphere 4.0?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe if you would explain what global.jsa is we could help you. I've never heard of it.
Kyle
 
M.K.Gopinathan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Kyle Brown
Global.jsa is a file which is a event handler for JSP pages. It has methods
1. onApplicationStart() --> which will fire when web server starts to serve the application for the first time.
2. onApplicationEnd() --> which will fire when web server end serving the application .
3. onSessionStart() ---> This method will fire when a user session starts.
4. onSessionEnd() --> This method will fire when a user session ends (invalidate).
This is file is as per the JSP 1.1 Specification. But nowhere it is documented. JRUN 3.0 Supports this file.
We are creating a database connections when a user session starts and we have to close it when the user close the session or when session times out. Global.jsa will helps you to do this task. If you have any other solution to the above problem, it is really appriciated.
I am thanking you for the response you made.
M.K.Gopinathn
 
james edwin
Ranch Hand
Posts: 393
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am doing R & D on WAS(AE)4.0 from last 15-20 day.But i never found anything related with global.jsa

IS WAs supports this kinds of stuff like Jun3.0 do?
 
Se Ravin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heard of HttpSessionBindingListener,
it has valueBound and
valueUnBound methods which u can use for this purpose.

Checkout http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSessionBindingListener.html
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by M.K.Gopinathan:
Dear Kyle Brown
Global.jsa is a file which is a event handler for JSP pages. It has methods
1. onApplicationStart() --> which will fire when web server starts to serve the application for the first time.
2. onApplicationEnd() --> which will fire when web server end serving the application .
3. onSessionStart() ---> This method will fire when a user session starts.
4. onSessionEnd() --> This method will fire when a user session ends (invalidate).
This is file is as per the JSP 1.1 Specification. But nowhere it is documented. JRUN 3.0 Supports this file.
We are creating a database connections when a user session starts and we have to close it when the user close the session or when session times out. Global.jsa will helps you to do this task. If you have any other solution to the above problem, it is really appriciated.
I am thanking you for the response you made.
M.K.Gopinathn

Mr. Gopinathn,
I'm sorry to contradict you, but this file and the concomitant functions are NOT part of the JSP 1.1 specification. Go download the spec and read it yourself. The file name and the applications are not mentioned at all. It is an extension used by Resin, JRun and Oracle (it was originally introduced by Oracle) but it is not part of the spec and the other major vendors have not picked it up. Servlet 2.3 (which is not implemented in WebSphere 4.0) handles up some of these issues, but in a different way.
Instead in WebSphere you can use the standard SessionBindingListener interface described in the previous post, or the WebSphere-specific ApplicationListener described in the product Javadoc Alex Polozoff's article on SNMP traps shows how to use the very similar ServletEventListener interface in your applications -- you can adapt his example code to use the nearly identical ApplicationListener.
Kyle
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by M.K.Gopinathan:
Dear Kyle Brown
Global.jsa is a file which is a event handler for JSP pages. It has methods
1. onApplicationStart() --> which will fire when web server starts to serve the application for the first time.
2. onApplicationEnd() --> which will fire when web server end serving the application .
3. onSessionStart() ---> This method will fire when a user session starts.
4. onSessionEnd() --> This method will fire when a user session ends (invalidate).
This is file is as per the JSP 1.1 Specification. But nowhere it is documented. JRUN 3.0 Supports this file.
We are creating a database connections when a user session starts and we have to close it when the user close the session or when session times out. Global.jsa will helps you to do this task. If you have any other solution to the above problem, it is really appriciated.
I am thanking you for the response you made.
M.K.Gopinathn

One more thing -- why are you creating database sessions like this? Just use the standard database connection pooling API (DataSource) in WebSphere -- you shouldn't ever have to put Database connections in a session -- that's a truly bad idea.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic