Ming has posted 2 posts at DZone. View Full User Profile

Enabling the Hover-Over-Help Feature Using JSP Custom Tags

10.21.2008
| 27509 views |
  • submit to reddit

This article introduces a presentation-tier JEE framework designed to enable the hover-over-help feature without hard coding JavaScript modules in the JSPs in your web or portal applications. The framework is packaged as a jar file for distribution and includes a server-side RESTful web service component and a set of JSP tag handlers which inserts JavaScript and Cascading Style Sheet (CSS) code into HTML files at the page rendering phrase. The targeted users are java developers who only have preliminary experience on writing JavaScript code.

 

1. Introduction

Mouseover is a standard JavaScript event that is raised when the user hovers the cursor over a particular HTML element on a web page.  This event has been widely used in web applications for navigation or causing an image or text to change. Hover-over-help, also called hover-over bubble, refers to the process of showing a small popup window when a mouseover event occurs in the browser. The window contains a message to either help the user to use the application or provide additional explanation and data. It is a useful feature which can make your web pages more intuitive and user-friendly and can carry more information on a single page in rich internet applications (RIAs). There are some tips and samples to enable the feature on the internet. However, they are not effective in developing large-scale web applications. Some of caveats include the following:

  • The message contents are directly hard-coded in JavaScript. They are tied-coupled with graphic user interface components, such as text labels in web pages. The re-usability is low.
  • If the same message needs to appear on several pages, the message and the pertaining JavaScript code have to be copied and pasted to each of these pages. It is hard to maintain these duplications in multiple places.
  • The messages are designed to be static and are typically created when the page is designed. It is difficult to insert runtime data into messages on the fly.
  • Portal applications are not completely supported. 

The framework introduced in this article is designed to address these issues and provides a comprehensive but easy-to-use solution to java developers who don’t have extensive JavaScript experiences. It leverages the JSP taglibary technology, the Dojo framework, and RESTful web services. Reusability in both web and portal environments, performance, and reliability are the factors that have been taken into consideration.

Published at DZone with permission of its author, Ming Yuan.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

Andrew Crawford replied on Tue, 2008/10/21 - 8:09pm

I know you are trying to do this without Javascript, but seriously, it's only one line to include a script library like OverLib and one or two lines to actually use it in your code. No extra CSS necessary.

There's also nothing stopping you from using JSP scriptlets to make sure multiple messages will still point to the same reference.

Dmitry Namiot replied on Wed, 2008/10/22 - 2:29pm

See this component from Coldtags suite: Ajax popup

Venkata Prasad replied on Tue, 2008/11/04 - 4:46am

Hello .. I am unable to find the downloadabel Jar file link. Is it free or commercial

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.