views:

401

answers:

1

HI, I am learning struts 2 with Tiles 2 and the word "topic" shows up very frequently... What is a topic?

for example:

The sx:a tag (specifically the ajax a template) and the div tag support an ajax event system, providing the ability to broadcast events to topics. You can specify the topics to listen to using a comma separated list in the listenTopics attribute. What this means is that when a topic is published, usually through the ajax a template, the URL specified in the href attribute will be re-requested.

<sx:div theme="ajax" id="weather" href="http://www.weather.com/weather?zip=97239"
    loadingText="Loading weather information..."
    errorText="Unable to contact weather server"
    listenTopics="weather_topic,some_topic">Placeholder...
</sx:div>
<sx:a id="link1"
      theme="ajax"
      href="refreshWeather.action"
      notifyTopics="weather_topic,other_topic"
      errorText="An Error ocurred">Refresh</sx:a>
A: 

answer to myself:

From Struts 2 Design and Programming - A tutorial, Budi kurniawan, Chapter 27 - AJAX

In addition to the normalized event object, Dojo supports a topic-based messaging system that enables anonymous event communication. Anonymous in the sense that you can connect elements in a web page that have no previous knowledge about each other. A topic is logical channel similar to an Internet mailing list. Anyone interested in a mailing list can subscribe to it to get notification every time a subscriber broadcasts a message. With a topic-based messaging system such as that in Dojo, a web object (a button, a link, a form, a div element) may subscribe to a topic and publish a topic. This means, an AJAX component can be programmed to do something upon the publication of a topic as well as publish a topic that may trigger other subscribers to do something. ...

nacho4d