mirror of https://github.com/apache/activemq.git
Apply fix for: https://issues.apache.org/jira/browse/AMQ-3518
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1177445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7d8ce02dee
commit
ccca44a620
|
@ -41,10 +41,10 @@ import org.slf4j.LoggerFactory;
|
|||
* A useful base class for any JMS related servlet; there are various ways to
|
||||
* map JMS operations to web requests so we put most of the common behaviour in
|
||||
* a reusable base class. This servlet can be configured with the following init
|
||||
* paramters
|
||||
* parameters
|
||||
* <dl>
|
||||
* <dt>topic</dt>
|
||||
* <dd>Set to 'true' if the servle should default to using topics rather than
|
||||
* <dd>Set to 'true' if the servlet should default to using topics rather than
|
||||
* channels</dd>
|
||||
* <dt>destination</dt>
|
||||
* <dd>The default destination to use if one is not specifiied</dd>
|
||||
|
@ -54,6 +54,7 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public abstract class MessageServletSupport extends HttpServlet {
|
||||
|
||||
private static final transient Logger LOG = LoggerFactory.getLogger(MessageServletSupport.class);
|
||||
|
@ -106,6 +107,7 @@ public abstract class MessageServletSupport extends HttpServlet {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
protected void appendParametersToMessage(HttpServletRequest request, TextMessage message) throws JMSException {
|
||||
Map parameterMap = request.getParameterMap();
|
||||
if (parameterMap == null) {
|
||||
|
@ -338,7 +340,8 @@ public abstract class MessageServletSupport extends HttpServlet {
|
|||
*/
|
||||
protected String getPostedMessageBody(HttpServletRequest request) throws IOException {
|
||||
String answer = request.getParameter(bodyParameter);
|
||||
if (answer == null && "text/xml".equals(request.getContentType())) {
|
||||
String contentType = request.getContentType();
|
||||
if (answer == null && contentType != null && contentType.toLowerCase().startsWith("text/xml")) {
|
||||
// lets read the message body instead
|
||||
BufferedReader reader = request.getReader();
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
|
Loading…
Reference in New Issue