Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the considerations for Ajax and WebSpherePortal design

2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what matters needing attention in the design of Ajax and WebSpherePortal". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Why Ajax and WebSpherePortal work well together

One of the most expensive operations in the portal environment is to refresh the page. When the user clicks a link or does something else on the page, the portal processes the actionPerformed () method of the target Portlet on the page and the doView () method of each Portlet. The results are then aggregated and the entire HTML document is sent down to the browser.

Although caching can reduce a lot of overhead, there are still many other problems. You can use Ajax to handle many user interaction events in the background and then update parts of the page without a full portal refresh cycle. This technology greatly improves the end-user experience by increasing the response to a single operation as well as significantly improving the overall performance of the application. In some environments, using Ajax can make the overall architecture of the application clearer. More powerful model code separation can be achieved using secondary Ajax controllers, such as Servlet or Web services.

When applying the entire Ajax controller design to your application, you should use the Ajax controller to handle all basic user input operations and segmented display updates. The portal actionPerformed () method is used only for page-level transitions or for handling major state changes.

Why don't Ajax and WebSpherePortal work well together?

So why don't you want to use this novel paradigm in your rich Internet applications? All technology weeklies think this is a good idea, and your boss informs you to use it because it is "one of the business goals". Of course, we won't ask you not to use it, but I do want you to know some potential flaws:

Using multiple controllers, such as Portlet, Servlet, and Web services, increases the complexity of the application.

Use Ajax to force the client to handle a lot of logic.

JavaScript is difficult to debug, especially in a cross-browser environment.

Accessibility issues and mobile devices can generate redundant code. Because many screen readers and other assistive devices do not support JavaScript/Ajax, you need to provide alternative functionality.

Your application may not need to make additional data updates between page switches.

To sum up, you may determine that Ajax is not suitable for you and need to change to other articles. Wait a minute, it's just a joke. My friend, please keep reading! Ajax is so cool that you will be sorry if you don't add it to your application.

At least you should accept it slowly. Find an application that can use tips and add the beauty of Ajax to a user form or wizard. Once you get started and understand that you can get some effective user enhancements with a little effort, you will certainly be ready to actually add some wonderful methods to your portal application.

What are the design considerations for Ajax and WebSpherePortal

After adding Ajax to the portal application, you can effectively add multiple controllers to the classic MVC mode. This decision has the potential benefit of enforcing a clear separation of model logic. The deficiency is that it increases complexity and inevitably divides the controller into the following three parts:

Portlet

Servlet or Web service

JavaScript-based client

The basic prerequisite for using Ajax in a portal application is the need for a separate controller. Typically, you can use Servlet to perform communication with Ajax clients. You can bundle Servlet with PortletWAR files or include them as part of a stand-alone Web application.

One of the drawbacks of implementing Ajax is that it is difficult to write a good cross-browser JavaScript. There are many JavaScript and DHTML toolkits that provide Ajax abstraction. In fact, there is so much to test that it is impossible to determine which toolkit is best for you. For all open source projects, new toolkits may be launched in the next two years.

Some of the most promising and well-designed toolkits we use are Dojo, Rico, and DWR. DoJo is the preferred toolkit because it has a high-level architecture similar to aspects. DWR or DirectWebRendering provides a convenient mechanism for referencing host-based JavaBeans from the client Javascript. Since many other good toolkits are available, you need to determine which ones are right for you.

Add Ajax to the Portlet application

To implement Ajax in a portal application, you need to follow these simple steps. The following discussion assumes that you bundle AjaxServlet and PortletWAR files together.

This is the end of the content of "what are the considerations for the design of Ajax and WebSpherePortal". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report