|
just another regularban.info web blog |
| MEMBERS: | Passing Parameters In A Data Table Using JSF
Some working knowledge of J2EE or JSF is assumed for this article. Like some of you I've been frustrated with this technology known as JSF or Java Server Faces. There are several different flavors out there that are built on the shoulders of JSF. For instance Oracle's ADF (Application Development Framework). Oracle ADF Faces Components is a set of over a 100 JSF components that let you build a richer user interface for your Java EE applications. Oracle ADF Faces also includes many of the framework features most needed by JSF developers today. That is great, and in many ways it will make life easier to develop in a JSF environment. Some items you will find available in these "add on" packages have a real benefit. For instance, as of the date of this article, I was very surprised that a File Upload is a feature still not implemented in JSF in respect to using natural jsf tags. There are ways to accomplish this task in JSF but they are not native JSF approaches. The process is a "no brainer" in just about every other framework available today, including asp.net. Another simple task (I thought) was having a data table present the results of a query in an editable format. Possibly to update a user record or shopping cart. After working in other technologies it was very efficient to return a result set to a data table object and let that object take care of some of the trivial behaviors and characteristics of the table itself. When I started exploring JSF I was frequently and at every turn becoming more and more frustrated in trying to duplicate some of the most basic of processes similar to managing records through data tables. There are not a whole lot of resources out there yet on JSF although it is growing steadily, and I found that all too often the resources that I was finding on the internet either didn't apply to the more simple tasks or the information was just completely wrong. One example of that was that it was stated in one article I read that you cannot use command buttons inside of a JSF data table. The recommendation was to use JSF hyperlinks instead when trying to perform an action from a data table due to a bug in the framework that prevented command button actions to fire if the button resided inside of a data table. At first I thought "you've got to be kidding me"! Then I remembered that I've been finding a fair amount of "bogus" information in regards to JSF development so I decided to do further research and discovered that information to be less than accurate as well. I simply had to find a way to populate a data table through a result set and get a command button to fire an action and pass all of the data in the data table to the backing bean to update the record. Multiple command buttons would exist as well as hidden fields pertaining to id numbers and so forth. Pretty basic stuff and we've all done it before with relative ease. It turned out that the solution was in fact a simple one. "Binding". You've heard about it and read about it. But this approach was something a little different as far as I could find. Many of the blogs and articles that I read dealt with passing the values as parameters and following the steps to define the parameters in faces.config files etc., then retrieving the parameters in a backing bean. Processing the passed data required another set of procedures to utilize mapping to each of the field parameters passed and then processing could begin. That seemed like a whole heck of a lot to me just to retrieve form data. Then it occurred to me that I should be able to "bind" a text field component on a page to a backing bean. Once it is bound then all I have to do is extract the data. And that's all there is to it. My query returned results and pre-populated a data table including text fields with the values of the query pre-populated in the text fields. Each one of those text fields was bound to a "HtmlInputText" type in my backing bean. It was not a String type like other approaches define. Doing that does require you to map parameters and populate that String variable through your set methods once the form is submitted. What I found is that if I bind my text field to a property of text field type that it solved my problem of passing values from a data table, and I didn't have to define parameter fields anywhere in any xml file. Now that I had that figured that out I needed to figure out how to get the value of that property that I've bound my form field to, well why not getValue()? I personally hadn't seen any examples online or in books for retrieving the value from a form binding it to the type of form element it was and simply use the getValue() to pull out the value of the object. Used like this getParameterFromForm().getValue(). Let me clarify that I am NOT saying that trying this approach isn't documented anywhere, I find it hard to believe that I've had some stroke of genius that no one has had before in the world of java, especially since I'm coming from .NET and ColdFusion. After doing that I no longer had any problems passing form data to my backing bean. I was able to dynamically populate data tables with any number of records including any number of command buttons within that data table and I didn't have to concern myself with remembering to define parameters in any other areas of the application. So put simply you can bind your form fields to properties of the same type in your backing bean, and then extract the value of that object using getValue() if you prefer over utilizing parameter string mapping and similar approaches for processing form data. I found it to be easier and less time consuming which has costs associated to it as well.
Web Site Monetization - Turn Your Web Site into a Money Maker
Whether you're a blogger or just have a personal web site, you need to know something very important: With just a little bit of effort you can be making money from your web presence. It always amazes me the number of blogs I see that aren't taking advantage of some simple tactics to bring their owner some additional cash. I'm not saying you'll make thousands of dollars a month (although some people do), but even making $10-$20 a month can be a rewarding feeling. This article will introduce you to two of the most common ways of generating additional income from your web site: Pay Per Click (PPC) and Web Affiliates. Pay Per Click (PPC) The idea behind PPC is that your site will display ads or links for other web sites. If a visitor to your site clicks on one of the links you will get paid. There are many different PPC options out there, but by far the most common one is Google Adsense. The best part about PPC is that signing up to be a "publishers" (i.e,. one that publishes the ads on a site) is FREE! That's right, you can sign up for a Google Adsense account in just a few minutes and it costs you nothing. Once you sign up you can quickly use the online tools to generate some script code that you add to your web page(s). That's it. Then when a visitor comes to your site they will see context-relevant ads and links being displayed. If one of them catches their interest and they click on it you make money. The amount of money you make per click can vary greatly depending on the content of your site and the link clicked. I've gotten has little as a penny for a click and as much as $3.76 for a click! The great part about PPC is that you really only have a little initial setup time and then you just sit back and wait for the clicks to generate you money. If you are a blogger and use Wordpress there are several plug-ins available that will allow you to display Google Adsense ads on your blog. Web Affiliates The other money generation option I want to present is web affiliates. The world of web affiliates is huge. It seems that almost every business on the Internet offers an affiliate program. An affiliate program is when the business allows other people to market their products or services. If you send them a customer that buys something then the business will pay you a portion of the money or a fixed fee. Just like with PPC, the great part about affiliate programs is that there is no cost to you. When it comes to web affiliate programs you have two basic paths you can take. You can search out companies that seem to fit with the theme of your site and see if they offer an affiliate program, or you can sign up for an account (for no cost) with a large affiliate marketing company like Commission Junction, Clickbank, Share-a-Sale, and so on. There are certainly some difference between the affiliate companies I listed, but the common feature is that they have already found a bunch of companies with affiliate programs and they provide an easy way to search for what you want. Once you've found a few companies of interest and established an affiliate relationship with them, you can get links and banners from them. You take the links and/or banners and add them to your web site. If a visitor to your site clicks on one of the links or banners and ultimately purchases something from the company, the company will pay you. This is different than PPC, which pays you just when the person clicks the link. The upside of affiliates is that when you do make money it can be quite a bit more. I have some affiliate relationships that pay over $30 for each new customer that comes from my site. Not bad for just displaying a link or banner! Conclusion I hope you found this information helpful and understand enough to get started making some extra money. It really isn't that difficult and you might as well try to make a few dollars from something you're already doing.
Semantic Web
Introduction Semantic web as defined by the creator of the web Tim Berners-Lee is "a web of data, in some ways like a global database" (Berners-Lee, 1998). To elaborate further Mr. Berners-Lee explains in an interview held by IDG Now, data is expressed on computers as associated files with applications that deal specifically with information, an example would be, data in calendars, bank systems, spreadsheets, and database application. Looking at a web page, data is not clearly defined and not associated with any of the applications usually on computers. Semantic web will allow data to interact and connect together; it will bring on a common data format for all applications, for databases and web pages alike (Moon, 1999). Semantic web is not to build an artificial intelligence system which allows computers to understand what humans write on web pages; on the contrary, it is an attempt to make web pages more understandable and well-defined to support automatic extraction of data from within web content (Berners-Lee, 1998). Analysis The emergence of the web and the way HTML took off was driven by how society's needed to grew, from Internet chat to file transfer to high-end communities through blogs and wiki's. HTML was not limited to web content, knowledge base and help files adapted the language as a format to document software applications and provide training material. The revolution of technologies on the Internet allowed companies like Google to index pages; a thought that was very far away, says Tim Berners-Lee in his lecture at MIT. Web services have evolved to pave the road for distributed information and modular programming allowing interoperability among sites. Through XML, data in one site can be used by another using the common protocols and standards supported by both (Berners-Lee, 1998). XML defines schemas that deal with fields of data, what is required is a system that can tell the computer what sort of information (data) it can derive from within a page (Moon, 1999). With Web 3.0 a site will provide data that can be navigated through and extracted from multiple sites, this is a result of the fact that semantic web data model is closely related to a relational database where records of data share common fields that connect them together (Berners-Lee, 1998). The solution provided to support semantic web is in the form of metadata that describes the data contained on web pages. Resource Description Framework (RDF) is a base to manage metadata; it is the ground that computers can use to exchange and interact with applications on the Web (W3C RFC, 1999). The applications for RDF include digital libraries, online catalogs, and indexing systems that are usually associated with content and content relationships models deployed in most web pages. With RDF data within business portals will be analyzed and identified as resources, properties, or statements transparent to the domain, further more, the specifications will merge with other documents to comprise a framework of classes. Classes organized as a hierarchy comprises a schema that can be reusable as metadata definitions along side multiple platforms. Resources created in this hierarchy can be identified using a resource identifier (URI), which enables a document given to a machine with this identification to be recognized by the system and triggers it to dig and find similar data (Berners-Lee, 1998). Implications Semantic web can be the solution to overpower the limitations of current information management systems in finding and extracting data from unorganized resources. RDF is meant to describe any data regardless of its character, location, source, or type, the concept of URI is richer to uniquely identify any object on the web (Berners-Lee, 1998). The pillars of Semantic web are standards and common protocols that are the bases for knowledge representation; HTML, RDF, the data language resource description web ontology language (OWL) that describes to the machine what is going on, in addition to RDF1 which is a query language to make inquiries among machines much easer, will all emerge and collaborate to bring in more to the web and more intelligent programs that will bring the Internet more closer (Cleave, 2004). The current research and implementation of Abilene network and the Next Generation Internet (NGI) Internet 2 of high-performance backbone network linking major universities and research labs across the US, is a good foundation for what Semantic web can do, and represent the perfect platform for grid computing, digital libraries, virtual laboratories, and distance learning (Abilene, Internet2). Internet2 or I2 was developed by a group of universities in 1996 providing improved connectivity standards to reach 10gbps (gigabits per second). With more than 227 universities and libraries connected, network based applications and experimental programs can run on this network of high-bandwidth connection feeding on the latest technology of gigabit Ethernet and IP protocol version 6 (Reardon, 2004). Semantic web standards can be the base of material and data distributed on this network, providing the best test platform to explore the full potential and what can be achieved. Conclusion Tim Berners-Lee believes that with Web 3.0 we can succeed and fantastic things can happen, but the infrastructure need to be built, laws of privacy and security need to be revised and honored, further more, the web need to remain open for researchers to allow for continuous upgrade and development. Semantic web will kick off when individuals materialize the need to work on data processing, and think about collaborating their data, with company's information and that of the government (Moon, 1999). References:
|
* About Archives
Categories:
Last Updated: |
| regularban.info
is proudly powered by WordPress MU running
on regularban.info.
Create a new blog and join in the fun! Entries (RSS) and Comments (RSS). |