Why are taglibraries and handlers so complex ?

Not trying to offend anyone here. I developed a lot of servlet and jsp code in 1996-98, and then had to switch to
C++ due to project demands at a new employer. Now I get to make my own technology choices and I must say I am SO PLEASED to be back to java.
But now, I have to get up to speed with a lot of new features and some existing features (circa 97) that I never got around to before. I just took a look at tag libraries and tag handlers, and frankly it all looks overly complicated.
For example, in the "midnight" demo application ButtonHandler.java 234 lines of code and almost a dozen methods are dedicated to the herculean task of writing a localized version of this:
All this so you can add a button in jsp using the tag.
<fmt:message key="cookieTray" bundle="${bundle}"
var="buttonLabel" scope="page"/>
<midnight:button/>
Seems like a LOT OF CODE for a button. Wouldn't it be much easier to use a JavaBean? The bean could emit the entire button HTML, or you could simply use the jsp expression language to resolve the localized string attribute for the button label, and write the button manually in raw HTML.
Also, this seems like a lot of "registration code" connecting all the dots for a language that supports reflection.
Shouldn't this all be easier??
Thanks -- not meaning to offend anyone, please enlighten me, what am I missing?
MarcusWelby,

Shouldn't this all be easier??Yes it should be, and is.
235 lines in the file, much of which is comment, and another bunch which just looks like it was copied/pasted from a template of sorts.
The real meat of the the code is only about 5 lines, and I don't really agree with their approach here of using a page attribute called "buttonLabel".
Where do they document what page attribute is to be used?
Wouldn't it be better to specify the label with as an attribute of the tag? Or in the body maybe?
I would NOT use this as an example of how to write a custom tag.
If you do want to look at tag libraries, tag handlers, custom tags et al, I would recommend looking at
1 - JSTL
2 - Struts tag libraries
Both of which are open source. You can get the code from the jakarta project.
Those are what I consider reasonably well designed and implemented tag libraries.
Also note, that as of JSP2.0 there are "tag files" which make little snippets like this even easier to write.
Tag files are to TagHandlers what JSPs are to servlets.
Hope this helps,
evnafets

Similar Messages

  • Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?

    Hypertext links are not always preserved from Word to PDF, using Aperçu or Adobe, depending on OS 10 or Lion. Why? This generally works perfectly in Windows. Why are Apple and Adobe unable to correctly handle links when converting from Word to PDF?
    Depending on the system version, and Office Word version:
    - a pure URL link starting with http or even www sometimes works in PDF, either produced by Aperçu or Adobe, sometimes does not work;
    - other kind of links where the text under display is not a URL, never work!
    I like everything with Apple computers and software, except PDF generation. Output files are usually bigger in size, and no better quality, than under Windows. Furthermore, it is weird that something as common as hyperlinks does not work correctly!
    I related this question with Mac OS X Snow Leopard, but the problem is still there with Mac OS Lion.
    This problem seems to have been around for years, without any proper solution from Apple and/or Adobe! To me, this is very embarrassing!

    Greetings NoNameGiven,
    If I understand the problem correctly (I’m not sure I do) you would prefer ‘iii’ to be read as “eye eye eye” rather than “three”? The alt text property is the only way that I know of to make this happen. Hope this helps.
    a ‘C’ student

  • Why are PS and SG asking me to choose between purchasing the product or a 30 day trial?

    I have the one-year Creative Cloud Subscription and I downloaded several apps like Photoshop, Premiere Pro, and SpeedGrade.
    However, when I start up Photoshop and SpeedGrade I had to choose between purchasing the product or register for a 30 day trial.
    Anybody who knows why?

    Thanks a lot! I will give it a try!
    Verstuurd vanaf mijn iPhone
    Op 3 sep. 2012 om 07:21 heeft "Arpit Kapoor" <[email protected]> het volgende geschreven:
    Re: Why are PS and SG asking me to choose between purchasing the product or a 30 day trial?
    created by Arpit Kapoor in Adobe Creative Cloud - View the full discussion
    This should help : http://helpx.adobe.com/creative-suite/kb/trial--1-launch.html
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4668611#4668611
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4668611#4668611. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Creative Cloud by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Why are downloads and all library unlistenable?

    Why are all old downloads and new scramboed and unlistenable in library and itunes?

    not sure about podcasts. but at least audiobooks have to be .m4b format to be recognized as such.
    a very stupid solution would be... take the aac files (convert them, if they are not already), run the "make bookmarkable" script ( http://www.dougscripts.com/itunes/scripts/ss.php?sp=makebookmarkable ), delete from the music list but keep files and drag them back in audioboos.
    there HAS to be a better way. but at least it works.
    G5 2x2,3   Mac OS X (10.4.6)  

  • Why are Links and forms not working in mobile safari?

    Why do links and forms on the site I am designing not work in mobile safari? They work fine in desktop browsers.
    The controls change state when focused, so it's not that they're being blocked, they simply don't activate. Behavior tested and observed on iPad running iOS 6.1.2 and iPhone running iOS 7.0.2.
    Reference: http://gilli.co/test.html

    I had the same problem but I just found a solution. Siri mistakenly suggests to enable reminders (which you should), but the setting that enables all these, is under System Services (on the bottom of the page) -> Location Based Alerts. I had deactivated it alleviate battery problems and had forgotten about it. Hope this helps!

  • Why are google and youtube inconsistent with encrypted transmission of pages?

    Typically I get the padlock icon when I am on a google or youtube page but sometimes -- particularly recently -- I get the exclamation point with the further message that "the connection to this website is not fully secure because it contains unencrypted elements (such as images)." However, invariably when I refresh the page the padlock icon instead of the exclamation point appears. I don't understand why this happens since nothing otherwise on the page appears to have changed, and yet the refresh switches it from the exclamation point to the padlock icon. I'd appreciate any insight that someone can offer.

    Some pages may have rotating ads to insecure pages, so you may get other links if you refresh the page.
    You can open the Web Console (Firefox/Tools > Web Developer) to check if there are (red) lines with [mixed]to see if that helps to identify the mixed content.

  • Why are Sound and Vibration Toolset examples missing?

    I have installed the November Developer Suite CDs, the full Sound and Vibration Toolset and appropriate NI-DSA/NI-DAQ drivers for my PCI-4552. Why aren't all the SVTXMPs found? Specifically, Engine Run-up and Transient Analysis examples are missing from Labview->Find Examples->Browse->Toolsets and Modules->Sound and Vibration.

    I think the examples are there, they've just been installed in a different path from the one the "Search Examples" app is looking for. Try:
    C:\Program Files\National Instruments\LabVIEW 6.1\examples\Sound and Vibration\Transients Analysis
    This should get you to the examples your looking for.
    Criag

  • Why are iLife and iWork apps not installed on my Mac?

    Recently purchased a used iMac late 2013 model and met the seller at the Apple Store to factory reset the mac. Well that was done succesfully but upon my return home and unboxing the iMac once i logged on and went to look for iMovie app it was nowhere to be found. I looked for the other apps from iLife and iWork and they were nowhere either. I tried the search tool and nothing came up and when I went to search for them in the app store thinking I just had to re-download them they were not FREE for me to install.
    Isn't iLife and iWorks included with every mac for free? CAn someone please help me get these if I am entitled to them for free or explain why I have to pay for them? TIA.
    -Freddy

    They are free for the initial owner and if he accepts them at the app store, then they are permanently tied to his Apple ID and password. Their licenses are not transferable - subsequent owners must purchase the apps if they want them. Here are some excerpts from the licensing agreement:
    B. If you obtained the Apple Software preinstalled by Apple on Apple-branded hardware, in order to use
    the Apple Software on more than one of the Apple-branded computers you own or control under the
    Usage Rules, you must log in to the Mac App Store and associate the Apple Software with your Mac
    App Store account. If you choose not to associate the preinstalled Apple Software with your Mac App
    Store account, you are permitted to install, use and run one (1) copy of the Apple Software on a single
    Apple-branded computer at any one time. Please also note that by choosing to associate the
    preinstalled Apple Software with your Mac App Store account, you will also associate any other Apple
    software applications that also came preinstalled by Apple on your Apple-branded hardware at the time
    of purchase (excluding OS X, Safari, and system applications and tools).
    and:
    Apple Software obtained from the Mac App Store is not transferable. If you sell your Apple-branded
    hardware to a third party, you must remove the Apple Software from the Apple-branded hardware before doing so.
    If the initial owner does NOT associate the software with his app store account (in other words, he does not accept / install them), then he may transfer his license rights to a subsequent buyer.

  • Why are Linux and Windows UI different?

    On Windows, appmenu button is orange and it's always at titlebar (saving a good space). On Linux, it appears gray and it's not at titlebar.
    Button icons are different also. Why?
    I think if there weren't that UI differences, addons should work on all platforms without drastic changes.

    @budchekov - You can use "Hide Caption", seach for it here: http://addons.mozilla.org/
    @topic
    If is impossible to put button and tabs at KDE/Gnome title bar (I think it's possible, because they have successfully put them at Windows XP), they can simulate a title bar like Chromium.
    I really don't know why Mozilla is purposely making that differences.

  • Why are Loops and Drum Kit greyed out on GarageBand 10?

    I've looked and researched every forum and help section on fixing this issue but to no avail, I see some people having success but they seem to have different situations. Unless I'm missing a step or something.
    Here is my situation: I have OSX Mavericks installed on my iMac, I re-installed GarageBand from the App Store. I also bought the $5 loop in-app purchase. When I opened GarageBand and signed in, it asked if I wanted to download the loops and drum kits, so I clicked to download rather than cancel, it seemed to be downloading ok and after 2 hours the progress bar was filled up with blue but nothing happened, seemed like the app crashed, so I Force Quit GB. When I re-opened the app, I noticed the loops and drums were still greyed out, then a pop-up came up saying that it was unable to complete download and to check internet connection. When I go to Software Update, there are no updates showing for GB and the purchases tab shows GB installed.
    I'd like to get these activated since I made the purchase. If I need to speak to someone directly from Apple, does anyone have a number I can call?
    Thanks for any help offered.

    If I need to speak to someone directly from Apple, does anyone have a number I can call?
    There is a "Contact Us" link directly on this page, in the lower right corner. On the page that will open look for the link "Start your Request Online".
    Check the following things:
    Do you have enough free disk space? The in-app purchase has 20.1 GB.
    Do you have any firewall or antivirus filters active? Disable them, when you try again.
    Try the download from an administrator account.
    It may also be a problem with your AppleID and Region settings.
    Did you buy (or accept) GarageBand 10 on your Mac with the same AppleID you are using to restore the Purchase? Did you buy GarageBand in the same country where you are now?
    Check your account settings at the AppleStore page  http://store.apple.com/us/account/home
    Click the "ViewAccount " link and reenter (not only check) all billing address setting.
    And then enable "Express checkout", if it is not enabled.

  • New Mac: Why are CC and Photoshop Elements not working when Lightroom and Reader are fine

    Last week I changed computers (swapping an old Mac for a 13-in MacBook Pro Retina running OSX Yosemite 10.10.3. I copied all my data over to the new machine using Migration Assistant.
    All programs work fine (including my copy of Lightroom 3 and Reader XI). But my CC and Photoshop Elements 10 do not. I have tried uninstalling both, but whenever I try to reinstall PE10 from its disk or download it just stops almost at the end. I then I get an "initiation failed" message, along with a request to download the now defunct "Support Advisor" app!
    I cannot download Adobe Application Manager, or the CC desktop app either - for the former I get an "initiation failed" message, along with the "download Support Advisor" app" message again! For the latter I get a message saying "Adobe Creative Cloud Is Needed to Resolve this problem - however it is missing or damaged." Then I get a message and a link to download Creative Cloud. Then when I've downloaded it and I click on the installer... it runs for a bit and then I get the message again: "Adobe Creative Cloud Is Needed to Resolve this problem - however it is missing or damaged." And I get a prompt and link to download the CC app. Guess what happens next? And so it goes on. And on and on, in a tedious circle.
    This is incredibly annoying and frustrating as I have work to do! Anyone have any ideas what's happening?
    Cheers
    K

    do not use migration to install adobe programs.
    you should uninstall and clean whatever you've done, Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    then dl the cc desktop app to your new computer and use it to install your adobe cc programs, Download Adobe Creative Cloud apps | Free Adobe CC trial
    if you have non-subscription adobe programs, use the installation files for them:
    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5 | 1
    Contribute:  CS5 | CS4, CS3 | 3,2
    FrameMaker:  12, 11, 10, 9, 8, 7.2
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • Why are pictures and pages missing from doc created in Pages 09 when I try to open it in the new Pages?

    I created a large document earlier this year in Pages 09 ... over 100 pages and it has screen prints, pictures and text boxes ... when I try to open it in the new Pages 5.5.1, all of these pics, text boxes, etc, are missing!!!  I can open it in the old Pages, and they are all there, but in the new Pages, half of my document is missing!  I want to have it work in the new Pages because what if I upgrade to a new computer ... I will not have access to Pages 09 anymore!  Plus, the "Page Layout" option is missing in Pages 5.5.1 - what was Apple thinking with this update?  Please help!

    Bean doesn't do layout and is no longer being developed.
    MsOffice or LibreOffice [free] are alternatives but not at the moment 100% solutions.
    MsOffice has most of the features in a clumsier fashion in most cases but is a bit of a kludge on the Mac.
    LibreOffice has a rather rough user interface and still lacks Pages '09 features.
    Really we are in Limbo until we get something else completely.
    For office work, I suggest LibreOffice or NisusWriter. Just so you can still get at it in the future.
    I have been warning about this inevitability for years. Hasn't made me popular.
    Peter

  • Why are url and email addresses not fully viewable in a PDF when generated from a Word file?

    I have a question?
    A colleague in our Copenhagen office wanted to generate a pdf from a Word file.  She is working on a Windows 2007 operating system and is running Acrobat Pro 9.  When she generated the PDF only part of a url and an email address was visible when the PDF was viewed.  She was wofking from Standard settings.  I am running the same software on the same Windows platform and using the same computer equipment with the same settings yet I was able to generate a PDF where the full url and email address was visible.
    Can anyone out in Adobe Acrobat land provide me with an answer?
    Patrick Lennon

    That's probably because the Mac people are opening or viewing the PDFs within the Mac's "Mail" program or with the "Preview" program and not with Acrobat.
    Since the Windows people aren't using these programs and most likely just Acrobat or Adobe Reader, the layers are kept hidden.
    I'm afraid the only way to truly keep those layers hidden is to delete them before saving your file as a PDF. (Of course, do a "Save As" and keep your original .ai file intact.

  • Why are PDF and Image Files embedded in all sent mail messages?

    When sending mail with either PDF or Image Files as attachments, the person receiving the message does get the attachment, but the files are also embedded in the mail message. This will display the image file below my text, however with a PDF, it's just trying to display as an image but is just lots of garbled characters. Word docs are not embedded, just attached. Any ideas how to prevent this? I'm attaching files by using the attach button and browsing for the file like normal. Thanks!

    View menu (alt+V) > Display attachments inline.

  • Why are system and application sound files appearing in itunes?

    Suddenly, over 900 system and application sound files, each about a second or 2 long, have appeared in my iPhone 4S music player. They've also appeared in my iTunes on my desktop iMac. Not sure whether they appeared on the computer first or on the phone first. I can't figure out why they appeared there or how to get rid of them (without also removing them from the system and applications which, of course, I don't want to do).
    I searched through the discussions here and found several other people complaining about the same thing, going back a couple of years, but no solutions offered. I hope someone can offer a clue.

    Thanks for the suggestions and help. While the cause of this problem is still obscure, we've managed, with an Apple tech's help, to remove the system/application sound files from both the iPhone and iTunes. We used Time Machine to backtrack to the point at which the sound files first appeared in the iTunes folder, then moved back one more day and restored the iTunes Media folder (where all the music was stored) and 2 iTunes files: iTunes Library.itl and iTunes Music Library.xml (we could also have simply restored the entire iTunes folder with the same effect). Then we synced the iPhone.
    As for the cause, that's still a puzzle. From Time Machine, we were able to determine that the files were added between midnight and 12:47 AM on a particular day, but that computer was not in use at that time (the user was asleep in bed, and the only other person in the house at the time was me -- and I don't touch that computer).

Maybe you are looking for