Java Reference
In-Depth Information
<h:panelGrid columns="2">
<h:outputLabel for="msgText" value="Enter Message
<h:inputText id="msgText"
<h:commandButton value="Submit"
The <h:inputText> tag binds user input to the msgText variable of
JMSMessageModel via its Unified Expression Language value binding
expression ( #{jmsMessageModel.msgText} ).
As is evident from the value of its action attribute, the <h:commandButton>
tag passes control to the sendMsg() method of JmsMessageController
when the user clicks on the rendered button. As we discussed in the chapter,
JmsMessageController.sendMsg() takes the value of JmsMessageModel.msgText
and puts it in a message queue. The JmsMessageController.sendMsg() method
also directs the user to a simple confirmation page. The code is as follows:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns=""
<title>JMS message sent</title>
JMS message sent successfully.
As we can see, the confirmation page for our example is very simple. It simply
displays the message JMS message sent successfully on the browser.
Now that we are done producing a message and placing it in a JMS queue, we will
see how to develop code that will retrieve the message from the queue.
Search WWH ::

Custom Search