# Send JMS Message Dialog Box

You use this dialog box to send a Java Message Service (JMS) message to a message destination. A JMS message is an object that communicates information between JMS clients. The message is sent from one client to a second client that listens for messages through a JMS destination on an application server.

The file must be in an EJB module project or a standard web application project. You cannot generate lookup code in a free-form web application project.

Use the dialog box to select the destination for the JMS message:

Element | Description
--- | ---
Project Destinations | Choose from the list of available destinations in your project. If no destination is available in the drop-down list, you can click Add to create a new destination. Alternatively, you can create a JMS destination by opening the New File wizard and choosing JMS Resource in the GlassFish category.
Server Destinations. | Choose from the list of available destinations that exist on the server.
Message Driven Bean | Choose a message-driven bean from the drop-down list. The drop-down list displays the message-driven beans in the same project and fills the Destination field with the name of the destination resource found in the bean.

To specify a Service Locator Strategy choose between generating an inline lookup code or use an existing service locator. You can click Browse to search for the service locator class name.

The IDE creates two methods:

- `createJMSMessageForNewMessageDestination`. The method that creates the message that is sent. You should implement your business logic in this method.
- `sendJMSMessageToNewMessageDestination`. The method that handles the message you created in the method above. You should not modify this message.

The IDE also registers the resource reference and message destination reference in your module's general deployment descriptor.

Note: If your project's target server is the GlassFish server, the IDE automatically configures a destination and connection factory for the message-driven bean when you create the bean. If you are deploying to a different application server, you have to configure the server-specific deployment descriptors and the server resources yourself.

Related Topics

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Developing Applications with NetBeans IDE,

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.