Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

scenarios for custom tags  RSS feed

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 67164
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
C Vivek
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
C Vivek
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
C Vivek
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That helps! thank you
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!