File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes scenarios for custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "scenarios for custom tags" Watch "scenarios for custom tags" New topic
Author

scenarios for custom tags

C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Hi!
Could you guys please give me a couple of scenarios where I could use a custom tag, or think of using a custom tag.

Many Thanks
Vivek
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Anyplace where the JSTL or EL does not meet the needs for your display markup, or that you want to package some re-usable code or components.

For example, I recently set up a number of custom actions for the buttons we use in our web ap. The buttons have differening styles depending on how and where they are used, and are instrumented via JavaScript with five possible states. All of these details are hidden from the page authors who simply employ the reusable button tags.
[ June 26, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Thanks!
C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
Hi Bear,
Just another quick question. What are the scenarios I would need a filter or a set of filters? Is it just to get the user info or can I do something else.
When my Web page is opened in some x country. I would like to post adds specific to that local. Can this be achieved using filters?

Many Thanks,
Vivek
Ramu Pamidimarri
Greenhorn

Joined: Jun 29, 2007
Posts: 2
Hi ,
we can do using filters, when the particular is hitting by the user, then we can use the filters(in filters we will get the local and we will prepare the dynamic popup's in the opening page or requested page,here we will use context params or some properties file to prepare the dynamci hyper links...

Thanks,
Ram
SCJP
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by C Vivek:
Hi Bear,
Just another quick question. What are the scenarios I would need a filter or a set of filters? Is it just to get the user info or can I do something else.
When my Web page is opened in some x country. I would like to post adds specific to that local. Can this be achieved using filters?

Many Thanks,
Vivek


Filters are ideal for situations where you want to apply behavior across multiple pages.
A common example is a compression filter that gzips the response of your pages to improve performance for users with slow connections.

Another would a validation filter that removes any HTML markup from input fields before the request actually reaches the servlet.

In both cases, this behavior can be applied without having to touch the original pages.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
C Vivek
Ranch Hand

Joined: Oct 03, 2004
Posts: 115
That helps! thank you
 
wood burning stoves
 
subject: scenarios for custom tags
 
Similar Threads
Code re-use - what's the best practice
Letters with accent
Design Issue
JSP Custom tags with Oracle Database
Select Box question