"What if? Why not? Challenge the Convention! Let's do some incredible things!"  More Quotes

Welcome to Aspire Knowledge Central (AKC)

   Home   Public Library   Author Content

Choose a data format:   classic-xml   object-xml   embedded-xml   text   excel

00.05-Articles

0) Using Servlet Filters to convert extra path info to url query parameters (29-Dec-10)

What needs to happen


/webapp/display/helllourl?a=b&b=c

should become internally


/webapp/display?url=helllourl&a=b&b=c

And


/webapp/update/uploadthis?a=b&b=c

should become internally


/webapp/update?request_name=uploadthis&a=b&b=c

1) Vagaries, vicissitudes, and occasional pleasures of submiting a form (6-Apr-09)

I thought I knew web forms. Atleast I thought I have a working knowledge of how forms work. I didn't realize the number of surprizes I found on the way.

My quest started with an innocent inspiration. I like words and their origins. I wanted to put a look up for dictionary.com on my web log. The form was simple enough with a single text field that takes a word or a phrase and then look up its meaning from an online dictionary.

While playing with the idea, I have realized that when a form has a single text field, "enter" button is acting like a submit with no need for an additional button on the form. I thought that was quite nice. I have added an additional link for unsuspecting users to explicitly look up the meaning if they were not yet clued into the enter. I liked the outcome as the form blended so unobtrusively into the homepage that it does not even look like a form.

Looking back, I liked this form because

  1. I could enter a word and look up the meaning by simply hitting enter. No need to shift the focus.
  2. For new users the link worked like a button, and yet takes lesser space and looks more like a web page and not a diaglogue

More over actions resulting from both controls are rerouted through the same javascript function that looked up the meaning using a url. I was thrilled. "Wow, this is nice" I told myself.

Time passed. Another day and one more form. But this time the form has a few more fields and a couple of buttons. With stoic confidence I was certain I could work the same magic again. However hard I have tried I could not see why the form is not getting submitted on "enter". So I have started cutting the form down half at a time. When I have reached the single text field it started working. I kind of guessed at this point that at least one of the buttons have to be a submit button and that resolved the issue. But now I wasn't sure if it was a fluke with ie that the single field worked at all with out a submit button.

I decided to google (investigate) the mater. What followed was a string of surprises.

I came to know that indeed the single text field case is part of the spec. I came to know that it is possible to use images as input controls in forms. I also have realized some common patterns that one can use by intelligently navigating the onclick, onsubmit and action javascript functions. It is also possible to make input controls read only or disable them. It is possible to change the target of a form to paint the result in the same page or a new page etc. This article explores some of these topics in more detail in addition to providing a further reading in the references section.

Nevertheless it continues to be a challenge to style text fields, buttons, and forms in general. Encoding of form data and submitting a form programmatically are large topics by themselves. I have included these items at the end for further exploration.

This article talks about the essentials and less exploited features of web forms for every day usage.

2) Monitor and fix connection leaks in web applications with "ThreadLocals" and "Events" (16-Aug-08)

An event based approach to monitoring and fixing connection leaks in web applications

3) A declarative approach to retrieving tree structures from databases: An example (5-May-06)

Like a picture, an example, is worth a thousand words. The following code retrieves all folders and files belonging to a user from a content management system.

4) Use Aspire and Tomcat to retrieve XML declaratively from any relational database (19-Apr-06)

Read the article as part of Aspire documentation

Aspire in combination with Tomcat presents a very viable and cost-effective option for generating XML directly and declaratively from relational databases. Developers will start by choosing a set of SQL statements or stored procedures. Developers will then arrange these assets into a calling hierarchy in a configuration file. Aspire will execute this hierarchical data definition and returns a java based hierarchical data set. Aspire has pre-defined transformations that can convert this hierarchical data set into varieties of XML formats. Aspire also allows you to transform the resulting XML using XSLT via JAXP. The final XML or HTML can then be sent to the browser or consumed programmatically.

In addition to SQL and Stored-Procedures, you can also use File readers, java classes, and potentially others in their place. These assets are called relational adapters producing relational data sets. New relational adapters can be written quite easily for other enterprise data sources when needed.

The main focus of this article to allow programmers to quickly download Aspire and start generating XML from data bases. This is a cook-book/tutorial like approach that tells you everything you need to get started and be on your way to generate XML with very little coding. This article also encourages see-before-you-paint approach to web page development, meaning you can see your data on the web page as XML or text first before actually writing code for that page. This is very useful for debugging and discovering available fields in the data.

5) Rewriting SendRedirect to deal with SSL (or https) offloading (12-Apr-06)

When "sendRedirect" is used, some times the relative url is being translated into an absolute url using wrong scheme (http vs https). This articles explores the problem and a possible solution using servlet filters.

6) Servlet Based Reosurce Readers in J2EE applications (8-Dec-05)

In a j2ee web app one needs to read config files, test data files, or xml files or xslt files at run time. If you read them from a file directory, the directories may not be valid at run time inside the web app container. One can use the class loader instead to load these files. But I prefer to read them using the servlet context of an init servlet. The approach will also work for containers that only work with war files (WebSphere is an example).

7) (Draft) Event Distributors: A delegation based approach to implementing typed events for server side applications (2-Nov-05)

This article documents a software pattern called an "EventDistributor" where event responders can be decoupled in a type safe manner. Although the decoupling events is not new, this article explores a typed delegation based approach without involving an explicit subscription to solve the problem. The approach also talks about how to take any interface and convert it to an event based interface.

8) A JSP Architecture for Oracle Stored Procedures (4-Oct-05)

http://javareport.com/java/toc.asp?mon=7&yr=2001

Stored procedures offer excellent design compromises between scalability and portability. Although the JDBC API provides a mechanism to call a stored procedure, a higher level abstraction is needed to treat the output as a hierarchical set of result sets. This is possible in Oracle only via REFCURSORS. This article shows readers how to write a stored procedure in Oracle using REFCURSORS, and how to access REFCURSORS from Java. Readers will also learn how to use stored procedures from a JSP page using a pattern called "Transparent Data Access" that eliminates middle-tier (data beans ) coding. July 2001

9) Developing Web Portals in Jetspeed Using JSP (4-Oct-05)

http://jdj.sys-con.com/read/45080.htm

A Web portal is an application that aggregates multiple Web applications on a single Web page. Popular examples of portals are My Yahoo (my.yahoo.com) and My MSN (my.msn.com). These portals allow users to aggregate multiple Web applications (like Stock Quote, News... Jun. 3, 2004

10) Evolving Functionality: Interfaces and Implementations (4-Oct-05)

http://jdj.sys-con.com/read/36295.htm

C++ brought into vogue the concept of interfaces, abstractness, and implementations. Java went a step further and formalized them with proper keywords for each of the concepts. There are a substantial number of patterns in which interfaces, abstract classes, and c... Jun. 1, 2001

11) Applying Java/XML/XSL Technology (4-Oct-05)

http://jdj.sys-con.com/read/40174.htm

XML/XSL are widely used for publishing and EDI. This article shows how XML/XSL can be used effectively for IT Web development by overcoming the disparities between relational data and XML. Apr, 2001

12) Exploring Laszlo Classes, Attributes, and Events (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2005/06/15/laszlo.html

Laszlo offers an interesting option for rich client-side GUIs--XML markup of widgets and their event handling, which is then converted into a Flash executable that is run with the Flash plugin in the user's browser. Satya Komatineni introduces Laszlo and shows how to get started writing web applications with it. Jun. 15, 2005

13) The State of JAXB: Availability, Suitability, Analysis, and Architecture (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2004/05/05/jaxb.html

JAXB, now part of Sun's Web Services Developer Pack, offers a means of converting between Java objects and an XML representation. But is it the ideal solution? Satya Komatineni investigates what JAXB has to offer. May. 5, 2004

14) The Effective Use of Joins in Select Statements (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2004/01/07/SQLJoins.html

A join construct helps you effectively use select statements to mine relational databases. This article examines syntax, surprises, and rules of thumb for the use of joins. Jan. 7, 2004

15) Dealing with Group By and Order By in .NET (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2003/01/14/groupbyds.html

In many situations, an ADO.NET developer will want to use the Order By and Group By semantic of SQL. This article by Satya Komatineni will show you how to do it. Jan. 14, 2003

16) Improve Your Career with Tomcat and Aspire (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2002/12/04/tomcat-aspire.html

RDBMS staff can be easily trained to develop Web-based Java apps with Tomcat and Aspire. This article tells how. Dec. 4, 2002

17) Understanding the Nuances of Delegates in C# (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/11/04/delegates.htm

C# introduced a keyword called delegate for utilizing such things as function pointers and call backs. The syntax of a delegate can be confusing, but one sure way to get latched on to the syntactical nuances of delegates is to understand a delegate's dual nature -- it exhibits the qualities of both a class and a function. Nov. 4, 2002

18) For Tomcat Developers, Aspire Comes in a JAR (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2002/10/30/aspire.html

Aspire.jar is a free, open source .jar file that can be used for declarative data access, configuration, logging and factory services needs. For Java developers who are continuing to adopt Tomcat as their primary development platform, this .jar file could save lot of time, while providing a highly-flexible data architecture. Oct. 30, 2002

19) .NET Localization, Part 3: Localizing Text.NET Localization, Part 4: Localizing Units (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/10/28/intlpart4.html

When a Web site is accessible by the international community, one of the considerations is how we present units of measure: Length, Width, Height, Weight, Area, Volume, etc. .NET provides some support by making available a RegionInfo class, which identifies whether a locale is mks (metric) or fps (imperial). Satya & Elena show you how. Oct. 28, 2002

20) .NET Localization, Part 3: Localizing Text (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/10/21/localpt3.htm

Creating satellite assemblies is one of the major keys to developing large-scale localized projects. This article will show you how and why to use satellite assemblies. Oct. 14, 2002

21) .NET Localization, Part 1: Resource Managers.NET Localization, Part 2: Creating Satellite Assemblies (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/10/14/local2.htm

Creating satellite assemblies is one of the major keys to developing large-scale localized projects. This article will show you how and why to use satellite assemblies. Oct. 14, 2002

22) .NET Localization, Part 1: Resource Managers (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/09/30/manager.html

Localization in ASP.NET happens with the resource manager. This article looks at some issues between resource manager and Visual Studio. Oct. 1, 2002

23) .NET Application Services Part 2: A Unified Factory service (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/09/16/factory.html

In part 2 of this series, we look at how the factory service builds on the simple config service to increase the flexibility of your .NET applications. Sep. 16, 2002

24) Beginnings of a Flexible .NET Architecture: A Simplified Config Service (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/08/19/config.html

Every app reads in configuration information at runtime. In .NET, this is done with an XML-based configuration file. This article proposes a "configuration service," which represents the beginning of a flexible architecture. Aug. 19, 2002

25) Controlling Web Pages on the Server Side (4-Oct-05)

http://www.ondotnet.com/pub/a/dotnet/2002/06/17/webforms.html

.NET's server-side programming model boasts huge advantages for Web development. Jun. 17, 2002

26) Data-Driven SVG Apps: A Rapid Development Approach (4-Oct-05)

http://www.onjava.com/pub/a/onjava/2002/02/13/svg.html

The authors present a middle-tier approach to reading and writing SVG documents to and from a database. Feb. 13, 2002

27) Understanding web urls (4-May-05)

A beginers introduction to understanding absolute and relative URLs

28) Understanding the interplay between utility classes and static initialization - ver 2 (13-Sep-04)

Static access happens when you access a static variable or invoke a static method, or instantiate one of its type. This will automatically trigger a whole lot of things. First off the class they are part of is initialized if it is not already initialized. This implies all of the static fields will be initialized. If this initialization involves any newing of classes, then a whole lot of constructors are called. This is followed by the execution of numerous static blocks that are there for that class. In fact the side affects are further compounded when the class in case is inheriting other classes.

29) Understanding the interplay between utility classes and static initialization (13-Aug-04)

Static access happens when you access a static variable or invoke a static method, or instantiate one of its type. This will automatically trigger a whole lot of things. First off the class they are part of is initialized if it is not already initialized. This implies all of the static fields will be initialized. If this initialization involves any newing of classes, then a whole lot of constructors are called. This is followed by the execution of numerous static blocks that are there for that class. In fact the side affects are further compounded when the class in case is inheriting other classes.

30) Qualtiies of a good Middle Tier Architecture (12-Sep-03)

IT programmers and consultants spend a lot of time designing Middle Tier architectures. This practice is common in typed languages like c++, Java, and C#. This article examines the "qualities of a good Middle Tier architecture" so that an assessment can be drawn of these architectures. In conclusion the more popular Middle Tier solutions, namely, Stored Procedures, EJBs, COM+, and SQLJ are examined for their pros and cons.

31) Bringing the J2EE Cathedral to the Bazaar (4-Sep-03)

http://www.onjava.com/lpt/a/2408

While Sun is quite diligently planning, coordinating, and building infrastructure for building cathedrals around J2EE, Microsoft's .NET is poised to steal the marketplace and own the bazaar, as they did with VB and the component market in the client-server wars. We have some parallels to go by. While CORBA focused on rearing thoroughbreds, COM stole the market with a mule called VB.

The only way out of this quandary is to wake up and invite the J2EE cathedral to the bazaar. (Both words are used in a positive sense in this article.) I believe there is a lot at stake; not only for Sun and Java, but also for regular programmers like you and me. The potential of enabling programmers of all kinds to this work in this wonderful world of the Web is a prize worth contending for.

32) Understanding UDDI and JAXR (4-Sep-03)

http://www.onjava.com/lpt/a/1570

Over the past few years, much of the Java developer community has embraced the various pieces of J2EE, and in the process has given server-side programming the high status formerly enjoyed by client-side programming tools (GUI frameworks that include Swing). Now, the developer community is being challenged once more to weigh SOAP services to see if they can raise the bar for server-side programming.

33) Infrastructure for an Interconnected Enterprise (4-Sep-03)

http://www.onjava.com/lpt/a/1498

The need for communications between applications across enterprises is well recognized; EDI has been serving this need for a number of years now. The Internet is providing a means for secure transactions between applications on a public network, bringing down the price point considerably. This makes electronic communication affordable for even smaller businesses.

34) Transparent Data Pipelines for JSP (4-Sep-03)

http://www.onjava.com/lpt/a/1378

Learn of a new declarative architecture for effectively coding web based applications.

35) Apply servlet filters for transaction management and logging (4-Sep-03)

http://www.onjava.com/lpt/a/1111

It has been a pet peeve of mine that one should not buy into an entire EJB solution just to gain the transparent (container-managed) transactional support for Java objects dealing with relational databases. One could inquire, what is the cost of implementing such a solution in the servlet tier itself? Because transactional support is valuable, whether the solution is distributed or not.

Typically, this transparent transactional support is accomplished by enrolling the active thread with a connection pool manager that the application relies upon for connections. The filtering mechanism is positioned to intercept the calls to an eventual servlet by registering the current thread with a connection pool manager in order to accomplish this. As one can see, the filtering mechanism is ideally suited for interposition, similar in concept to the EJB interposition of remote object calls from the EJB object to the bean instance.

36) Understanding Attributes in C# (16-Jul-03)

Attributes are widely used in .Net libraries such as XML serialization. The syntax of attributes is very confusing until you realize that attributes are actually classes. This article provides a quick guide to understanding attribute syntax, how to read it, and how to look up an attribute documentation to be able to spcify them in your programming practice.

37) How to use static constructors to initialize c# classes, utilities and singletons (20-Jun-03)

Understand some of the issues surrounding static constructors, beforeFieldInit, and static field initialization for effectively using this c# initialization feature.

38) List of published articles at O'Reilly (13-Jun-03)

http://www.oreillynet.com/pub/au/241

These articles cover Java, .Net, XML, JavaScript, and Aspire