diff --git a/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateSubscriber.java b/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateSubscriber.java index fecfec9807..9081f30bf1 100644 --- a/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateSubscriber.java +++ b/activemq-web-console/src/main/java/org/apache/activemq/web/controller/CreateSubscriber.java @@ -40,6 +40,9 @@ public class CreateSubscriber extends DurableSubscriberFacade implements Control } public void setSelector(String selector) { + if (selector != null) { + selector = selector.trim(); + } this.selector = selector; } diff --git a/activemq-web-console/src/main/java/org/apache/activemq/web/controller/SendMessage.java b/activemq-web-console/src/main/java/org/apache/activemq/web/controller/SendMessage.java index e3c611ca80..e865f0e314 100644 --- a/activemq-web-console/src/main/java/org/apache/activemq/web/controller/SendMessage.java +++ b/activemq-web-console/src/main/java/org/apache/activemq/web/controller/SendMessage.java @@ -31,8 +31,8 @@ import org.springframework.web.servlet.mvc.Controller; /** * Sends a message - * - * + * + * */ public class SendMessage extends DestinationFacade implements Controller { @@ -88,6 +88,9 @@ public class SendMessage extends DestinationFacade implements Controller { } public void setJMSCorrelationID(String correlationID) { + if (correlationID != null) { + correlationID = correlationID.trim(); + } jmsCorrelationID = correlationID; } @@ -96,6 +99,9 @@ public class SendMessage extends DestinationFacade implements Controller { } public void setJMSReplyTo(String replyTo) { + if (replyTo != null) { + replyTo = replyTo.trim(); + } jmsReplyTo = replyTo; } @@ -104,6 +110,9 @@ public class SendMessage extends DestinationFacade implements Controller { } public void setJMSType(String type) { + if (type != null) { + type = type.trim(); + } jmsType = type; } @@ -152,6 +161,9 @@ public class SendMessage extends DestinationFacade implements Controller { } public void setJMSMessageCountHeader(String messageCountHeader) { + if (messageCountHeader != null) { + messageCountHeader = messageCountHeader.trim(); + } jmsMessageCountHeader = messageCountHeader; } @@ -165,6 +177,7 @@ public class SendMessage extends DestinationFacade implements Controller { return client.getSession().createMessage(); } + @SuppressWarnings("rawtypes") protected void appendHeaders(Message message, HttpServletRequest request) throws JMSException { message.setJMSCorrelationID(jmsCorrelationID); if (jmsReplyTo != null && jmsReplyTo.trim().length() > 0) { @@ -179,7 +192,7 @@ public class SendMessage extends DestinationFacade implements Controller { Map.Entry entry = (Map.Entry) iter.next(); String name = (String) entry.getKey(); if (name.equals("secret")) { - continue; + continue; } Object value = entry.getValue(); if (isValidPropertyName(name)) { @@ -233,8 +246,8 @@ public class SendMessage extends DestinationFacade implements Controller { // allow JMSX extensions or non JMS properties return name.startsWith("JMSX") || !name.startsWith("JMS"); } - - public String[] getSupportedHttpMethods() { - return new String[]{"POST"}; - } + + public String[] getSupportedHttpMethods() { + return new String[]{"POST"}; + } } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/DestinationFacade.java b/activemq-web/src/main/java/org/apache/activemq/web/DestinationFacade.java index cf2e36281b..2b476dc826 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/DestinationFacade.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/DestinationFacade.java @@ -88,6 +88,9 @@ public class DestinationFacade { } public void setJMSDestination(String destination) { + if (destination != null) { + destination = destination.trim(); + } this.jmsDestination = destination; } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/DurableSubscriberFacade.java b/activemq-web/src/main/java/org/apache/activemq/web/DurableSubscriberFacade.java index 9709152606..49a1c11b60 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/DurableSubscriberFacade.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/DurableSubscriberFacade.java @@ -34,6 +34,9 @@ public class DurableSubscriberFacade extends DestinationFacade { } public void setClientId(String clientId) { + if (clientId != null) { + clientId = clientId.trim(); + } this.clientId = clientId; } @@ -42,6 +45,9 @@ public class DurableSubscriberFacade extends DestinationFacade { } public void setSubscriberName(String subscriberName) { + if (subscriberName != null) { + subscriberName = subscriberName.trim(); + } this.subscriberName = subscriberName; } diff --git a/activemq-web/src/main/java/org/apache/activemq/web/package.html b/activemq-web/src/main/java/org/apache/activemq/web/package.html index a6871b7c9e..af57b179c0 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/package.html +++ b/activemq-web/src/main/java/org/apache/activemq/web/package.html @@ -21,7 +21,7 @@

Web Connectors so that messages can be sent via HTTP POST or read via - HTTP POST or GET as well as support for web streaming to we browser or + HTTP POST or GET as well as support for web streaming to web browser or JavaScript clients.