User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 422,560 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,671 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 1512 | Replies: 4
Reply
Join Date: Apr 2007
Posts: 32
Reputation: push is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
push push is offline Offline
Light Poster

Help about scop at jap

  #1  
Apr 18th, 2007
Please any will u help me.....
what is the need of using application scope at the any project for jsp.
please give me examples of using application scope. and how to use taglib ..........please give examples which i can run and learn..........please...................................
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Posts: 28
Reputation: saurav is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
saurav saurav is offline Offline
Light Poster

Re: about scop at jap

  #2  
Apr 19th, 2007
application scope is used when u want to keep the variable for the whole lifetime of the application.

taglibs are library of tags that you can use in your JSP.
There is a default library for JSP.
But custom libraries can also be made.
The custom tags are powerful means for reusability.

Framweworks like struts are totally based on custom tags
Reply With Quote  
Join Date: Apr 2007
Posts: 32
Reputation: push is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
push push is offline Offline
Light Poster

Re: about scop at jap

  #3  
Apr 19th, 2007
thanks saurav.....
Reply With Quote  
Join Date: Jul 2004
Posts: 28
Reputation: saurav is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 2
saurav saurav is offline Offline
Light Poster

Re: about scop at jap

  #4  
Apr 20th, 2007
you are always welcome
Reply With Quote  
Join Date: Mar 2007
Posts: 83
Reputation: rgtaylor is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
rgtaylor rgtaylor is offline Offline
Junior Poster in Training

Re: about scop at jap

  #5  
Apr 24th, 2007
Application scope, as mentioned, is for sharing data among ALL sessions within an application... this can be useful for many purposes, often a hit count is used as an example, BUT that is a contrived example because any server restarts or application restarts will reset it to ZERO... but when you see XXXXX hits since DATEYYYYY type of comments, it is possible they are using it this way... they just date when the app is restarted and show the count since then...
It is cood for inter-session communications, which only happen when the server is running and don't need to be stored between restarts... It cal be used for longer term storage if you have scheduled runs of an routine to write application data into a db or the serialize it to the hard drive... but this should NEVER be used for important data as this doesn't cover the possibility of a server crash where you don't have the opporuntity to write the data prior to shutdown...
I know someone who uses it for logging... rather than write the log messages every time for normal behavior, he collects them in an application scope stored object and writes them on a schedule or during the application shutdown or restart processes... this reduces the disk overhead of logging for non-error conditions which improves performance... The errors are logged immediatly to avoid the possibility that an error could lead to application crash or restart... all non-error logs are written when any error happend too, so it is like a comit point...
Since logging eats performance quickly, yet robust logging is helpful and often a requirement, this allows a great balance to be struck...
Before anyone complains about memory usage... the buffered log sizes are set and reaching this limit will trigger the log comit also... and memory is so cheap not having enough is a dumb excuse... the disk I/O is a bigger issue for high performance system than a small amount of memory for a log buffer...
Under normal conditions, you don't need to worry about the logs too much, and under error conditions you comit them all immediately so you get the best of both worlds...

Some people believe that ALL Java code should be separate from the presentation layer, the JSP files. This is a valid choice, especially for an application that may have non-programmers involved in it... For this we create custom tag libraries. We code the functions we need, we determine what input / what out etc. we will use and code classes to take care of it. Then you map the specific tags you want to use with the class that will be called when that tag is encountered by the app-server...
Early JSP lacked any looping (or iteration) functionality, so professional projects and frameworks usually built a looping tag as one of the first things they did...


I recomend buying a good book on tag libraries, it should really help much more than we can in a forum, but when you reach points in the book you don't fully understand, then feel free to ask us for clarification... ;-)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 1:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC