Recently, ESET add my domain name to the black-list of their database. You can’t open my site and been warned my site is not safe if your PC is running the ESS or EAV. Why Eset block my site?The answer is obvious. That is reason that you come here. I promise that my site is pure, no virus, no spyware, no Trojan, no pop ads. You can test my word through intalling Kaspersky or other Antivirus Software. If you want open my site and take latest escalation ID & Activation Code, close your ESET software(disable antivirus and antispyware protection function temporarily) or by proxy or virtual machinor. You can also feed the RSS source http://feed.loserblog.cn.
Recently, ESET add my domain name to the black-list of their database. You can’t open my site and been warned my site is not safe if your PC is running the ESS or EAV. Why Eset block my site?The answer is obvious. That is reason that you come here. I promise that my site is pure, no virus, no spyware, no Trojan, no pop ads. You can test my word through intalling Kaspersky or other Antivirus Software. If you want open my site and take latest escalation ID & Activation Code, close your ESET software(disable antivirus and antispyware protection function temporarily) or by proxy or virtual machinor. You can also feed the RSS source http://feed.loserblog.cn.
Portal combat new features-and WebSphere Portal
You certainly heard that some of the Ajax usage, you may want to know whether their application is the gateway to the use of it. Certainly, this article will introduce you to some introductory knowledge. Portal in the operation of one of the biggest expenses is refresh the page. You can use Ajax to address many user interaction, and then applied to the page will be updated every part, without the need to refresh the entire page. You can improve the performance of portals, create a clear gateway to the overall application architecture, and most important of all, your users will be very pleased with the response to this portal.
INTRODUCTION
This article introduces you to Ajax will be integrated into the portal application methods. Because several of Ajax has been a general introduction to the article (see reference), so we assume that you understand the basics of Ajax; other words, you already know what is Ajax, the origin of its name, Is not a new technology that fact, and how Google this technology into the global managers and technical experts for each mode of thinking. Our aim is to provide you with useful information that the portals and applications related to the use of Ajax, the CTO's office when the officers asked you whether the application is the gateway to the opening of the Ajax, you can confidently said: " Of course!. "
So, if you have decided to introduce Ajax portal, to discuss the contents of this paper is very worthy of your attention. While this paper focuses on the portal applications, but these techniques are usually applicable to most complex applications. In this paper, you're ready for a follow-up handbook, in this tutorial, we will detail the application of Ajax Portlet created.
As we will soon begin to return to the subject of discussion before the first outline of the following: you see or read the contents of the Ajax introduced by the majority is not a true Ajax; but Dynamic HTML, or DHTML. Ajax from the correct meaning of the individual known as the XMLHttpRequest object of JavaScript. Such as servers and the response to the background communication channel. Bear all the other tasks (including drag and drop, DOM update, create patterns, and everybody likes to do all the other things) is DHTML.
Top
Why Ajax and WebSphere Portal can well with »
Gateway to the environment in operating expenses is one of the largest refresh the page. When users click on the link on the page or some other operation, the portal will be dealt with on the page Portlet goal of the actionPerformed () methods and each of the Portlet doView () methods. Then, polymerization results, and down the entire HTML document sent to the browser.
Although the cache can reduce a lot of overhead, but there are still many other problems. You can use Ajax in the background to address many user interaction, and then update the pages of the various parts, without the need to complete the gateway to refresh cycles. The technology by increasing the response of individual operations significantly improved the end-user experience, but also significantly improve the application's overall performance. In some circumstances, the use of Ajax can make the overall application architecture more clearly. The use of two Ajax controller (such as Servlet or Web services) can be more powerful model code separation.
Ajax controller design will be applied to the entire application process, you should use Ajax controller to deal with all the basic user input operation and sub-display updated. And the only gateway actionPerformed () method or conversion class for the pages dealing with major status changes.
Top
Why Ajax and WebSphere Portal can not be well with »
Why, then, you do not want in your rich Internet applications using this new paradigm? » All the technical magazine that this is a good way, in addition, your boss also let you use it, because it is "business objectives." Of course, we will not ask you do not use it, but I really want you to know that some of the potential shortcomings:
* Use multiple controllers (for example, Portlet, Servlet and Web services) will increase the complexity of the application.
* Mandatory use of Ajax client to address many logic.
* JavaScript debugging it is very difficult, especially in cross-browser environment in particular.
* Accessibility and mobile devices will have redundant code. Because many screen readers and other auxiliary equipment does not support JavaScript / Ajax, so you need to provide alternative functions.
* Your application may not need to switch among the pages of additional data updates.
To sum up, you may determine Ajax not suitable for you, need to read other articles. Wait, this is just a joke. A friend, read on! Ajax is too cool, if you are not to add it to your application, you will surely regret.
At least you should gradually accept it. Find a small can use the skills of the applications, and will add to the beauty of Ajax users form or wizard. Once you get started and learned to do something to get some valid user enhancements, you will certainly be prepared to some wonderful way to add to their practical application in the portal.
Top
Note Design
Ajax will be added to the portal application, you can effectively be added to the number of controllers classic MVC model. The decision to enforce a clear separation of the logic model has the potential benefits. Is the inadequacy of the increased complexity of the controller and will inevitably divided into the following three parts:
1. Portlet
2. Servlet or Web services
3. JavaScript on the client
Portal applications in the use of Ajax is the basic premise of the need for a separate controller. Under normal circumstances, you can use the Servlet implementation and Ajax client communications. You can Servlet and bundled with Portlet WAR file, or as an independent Web application part included.
Figure 1 shows a potential target Ajax server.
* If you Portlet WAR Servlet and bind together, then can be shared between Servlet and Portlet session data. Servlet, Portlet and the model code is closely coupled.
* If you do not need the level of coupling, and Ajax of data and processing logic does not depend on Portlet, then you can reuse for the creation of an independent long-distance Servlet or Web services.
Figure 1. Ajax goal of the possibility of server
Ajax goal of the possibility of server
Top
Ajax tool kit
Ajax one of the shortcomings to achieve it is difficult to prepare a good cross-browser JavaScript. There are many JavaScript and DHTML Ajax tool kits can provide the abstract. In fact, too many to test the contents, it is not possible to determine which one best fits your tool kit. For all open-source projects, in the next two years may be a new tool kits.
We use the most promising, design a reasonable number of kits is: Dojo, Rico and the DWR (see references). DoJo is the preferred tool kits, because it is similar to the senior architecture. DWR or Direct Web Rendering provided a quote from the client Javascript host-based mechanism to facilitate the JavaBeans. By providing a good many other kits, so you need to determine what is right for you.
Top
Ajax will be added to the Portlet Application
To achieve portal applications in Ajax, you need to follow a few simple steps on. The following discussion will assume that you Portlet WAR Ajax Servlet and bind together.
 
; 1. Creation and definition of Ajax Servlet.
2. Servlet definition at the JavaScript cited variables.
3. Load any external JavaScript file.
4. Realization of Ajax framework.
The creation and definition of Ajax Servlet
Servlet and will be bundled with Portlet WAR documents the process is very simple, but even experienced Portlet developers have not always been able to ensure that all the details are correct. Therefore, Below are all easy to overlook the details.
1. Web.xml file in the definition of Servlet, such as the one shown in the list
2. Including Servlet JAR file or category.
List 1. Web.xml in the Servlet Mapping
<servlet>
<servlet-name> MyAjaxServlet </ servlet-name>
<display-name> MyAjaxServlet </ display-name>
<description> </ description>
<servlet-class>
com.ibm.ajax.MyAjaxServlet
</ servlet-class>
</ servlet>
<servlet-mapping>
<servlet-name> MyAjaxServlet </ servlet-name>
<url-pattern> / Ajax </ url-pattern>
</ servlet-mapping>
Definition of the JavaScript quoted at Servlet
You need to JSP documents cited in the definition of the overall situation (see list 2), to Portlet so that it can request for a visit. Definition of global variables, including any JavaScript can safely use it, to point to Servlet.
List 2. Servlet at the overall situation of quote.
<script type="text/javaScript">
var PATH = "<% = request.getContextPath ()%>";
var Ajax_SERVLET = PATH + "/ Ajax";
</ script>
To load any external JavaScript file
Portlet pages to add to any external resources, you must encode the URL, and set the basic context, as shown in the list 3.
List 3. URL encoded and set the basic context of the script.
<script type = "text / javascript"
src ="<%= renderResponse.encodeURL (
renderRequest.getContextPath () + "/ js / myajax.js? v1.1.2 ")%>">
</ script>
Tip: parameters through the use of JavaScript string parameters, you can make the browser each time loading enforcement cache refresh. If your JavaScript may change frequently, this will refresh your browser cache can not use the old code. This example is the use of the version of ID (? V1.1.2), but can also use any string.
Ajax framework to achieve
Ajax to the implementation of its wonderful way of the process involves several template file operations. We here to brief you about. You will see after the note describes the relevant code, and can be tutorial instructions.
1. XMLHttpRequest object to create global variables. Because all communications are asynchronous, so you must be defined for each incident Ajax the only variable.
2. Trigger the process of definition of the events. Usually, you can enter tags used in the JavaScript events. For example: <input onChange = 'eventHandlerFunction ()' …>
3. Definition of a function to deal with incidents in particular, to achieve the following tasks:
* Examples of XMLHttpRequest (xhr) target variables. This variable is the specific details of the browser, we will conduct follow-up tutorial on.
* Set xhr callback function. xhr.onreadystatechange ()
* Set Servlet, types and parameters. xhr.open (), xhr.setRequestHandler (), and xhr.send ()
4. Definition callback function to deal with communication and response to state data.
* This function will deal with all kinds of communication status changes (such as calls start, and when connected to receive response).
* Respond to treatment usually involves the analysis to return to the XML (or other content) and use this data to update the DOM tree.
Figure 2 shows how various parts of aggregate.
Figure 2. Ajax communications event model
Ajax communications event model
Top
Gateway to a specific note
In the portal application in the realization of Ajax, you should pay attention to several issues.
Global JavaScript variables
Usually, portal applications, avoid the use of JavaScript in the global variables, because the portal will be a few Portlet polymerization to a single page. Global namespace JavaScript variables (such as shown in the list 4) is a good approach, because you can guarantee is the only variable name, even though the same page on the deployment of the same Portlet twice.
List 4. Namespace JavaScript variables.
/ / Global XMLHttpRequest variable
var <portlet:namespace /> xhrFieldsRequest;
If you use Ajax tool kits, the level of abstraction will be named to resolve any conflict.
The use of ID attribute
Ajax is usually in the use of ID attribute to quickly update a part of the page. Because any HTML tags in the ID attribute the DOM are the overall, so you need to ensure that they are unique. If you have to repeat the ID attribute, then the result is unpredictable, but usually this is not your hoped-for results, and problems are very difficult to determine.
For security purposes, the names of all the ID attribute of space, even if this operation will make your code as the list of five difficult to see in the same reading.
5 list. Secure ID attribute to the name space.
<h1 id = "<portlet:namespace /> header"> Hello </ h1>
<script type="text/javascript">
var x = document.getElementByID
( "<portlet:namespace/> header");
x.innerHtml = "GOODBYE!";
</ script>
State maintenance
The gateway to the use of Ajax call, you vulnerable to the flaw is the lack of internal management of the state. Not what you can allow users to stop the implementation of the Portlet may lead to pages refresh operation. You need to ensure that any resumption of Ajax, without relying on any previous state. Although the use of Cookies to the Servlet or Ajax call to check and storage status information, but to avoid dependence on the state of the page. So that all the atoms into called Ajax.
Easily allow you to the failure of another state is back button and bookmarks tag's URL. Usually, based on Ajax to avoid the major status changes. It will retain the true gateway to the actionPerformed () call.
Sharing session data
When you Servlet and portal applications are bundled together, you can Servlet and Portlet session data sharing between. Usually, data sharing conversation, you want to use the application scope. For Servlet, which is the normal scope of the conversation. Servlet Portlet visit from the scope of the need for a variable is set namespace name of the special value, the value based on its initial deployment will be set up at the gateway to the Portl
et the ID. In the process of extracting the deployment of this value is very difficult. Although the majority of that theory, Portlet scope of variables is the syntax:
javax.portlet.p. <ID>? <NAME>
Of which:
<ID> Portlet is the only logo
<NAME> For Portlet conversation in the name of the set targets.
Action URL
In the use of Ajax, Action URL address will be very troublesome. Normally, you should not try to share in a conversation storage Action URL, because they are the only current doView () effectively. Try to use in conversation (from the previous doView () cycle) stored in ActionURL will not lead to expected results.
Action URL you need to store the conversations example is the Ajax-driven page data sheet, which includes Action URL links as part of the data sets. When users click Next, the browser will generate an Servlet the Ajax call. Then, Servlet extract from the conversation in the next data, and it must have a pre-defined Action URL. Just to ensure that doView () call at any time are capable of handling, storage of any Action URL of any session data can regenerate.
Events
As many polymerization of information have been filled to a single page, the portal page is usually very busy. Because Ajax is in the background called the Executive, and they do not trigger the activities of the browser icon, so you need to provide a consistent visual mechanism to notify users continue to carry out a certain thing. Otherwise, they will feel confused, I do not know the application is busy dealing with any operation. (Indeed, we do not want users confused.)
You can use the course of the activities of the floating-point DIV display or use the browser's status bar on the simple message the realization of this notice (However, some people think that this is not good form). You can also integrate custom theme expansion, it will appear on any page in the opening of the Ajax Portlet Please Wait general news.