tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Tomcat Wiki] Update of "HowTo" by KonstantinKolinko
Date Sat, 02 Feb 2013 22:57:39 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification.

The "HowTo" page has been changed by KonstantinKolinko:
http://wiki.apache.org/tomcat/HowTo?action=diff&rev1=129&rev2=130

Comment:
Add note, update a link

          }
  }
  }}}
- A few caveats arise, as for instance while the `System.out` and `System.err` are redirected
as per above, no logging of these is done to files. You will need more legwork to do to make
the additional logging. It is important to backup and restore the original streams as the
above example does. Also, notice the use of `getOutputStream()`: when this method is called,
the `getWriter()` method can no longer be used in the same response object.
+ A few caveats arise, as for instance while the `System.out` and `System.err` are redirected
as per above, no logging of these is done to files. You will need more legwork to do to make
the additional logging. It is important to backup and restore the original streams as the
above example does. The servlet should not be used to process several requests in parallel
(some synchronization should be added to the above code to prevent that). Also, notice the
use of `getOutputStream()`: when this method is called, the `getWriter()` method can no longer
be used in the same response object.
  
  Corrections and comments are most welcome!
  
  == How do I connect to a Websphere MQ (MQ Series) server using JMS and JNDI? ==
- Basically, this works just as described in  http://tomcat.apache.org/tomcat-5.5-doc/jndi-resources-howto.html:
Within your application, you are using the standard JNDI and JMS API calls. In web.xml (the
container independent application descriptor), you specify resource references (stub resources).
And in context.xml (the container specific application descriptor), you are actually configuring
the JMS connection.
+ Basically, this works just as described in  http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html:
Within your application, you are using the standard JNDI and JMS API calls. In web.xml (the
container independent application descriptor), you specify resource references (stub resources).
And in context.xml (the container specific application descriptor), you are actually configuring
the JMS connection.
  
  More to the point. Here's some example code, which might be added to a Servlet. The example
is sending a message to an MQ server:
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message