Skip to main content

Posts

Showing posts with the label tomcat

How to tune Tomcat 5.5 JVM Memory settings without using the configuration program

I need to configure Tomcat memory settings as part of a larger installation, so manually configuring tomcat with the configuration app after the fact is out of the question. I thought I could just throw the JVM memory settings into the JAVA_OPTS environment variable, but I'm testing that with jconsole to see if it works and it... doesn't.

Howto embed Tomcat 6?

I'm currently running my webapps on Tomcat 6 in production, and would like to evaluate running Tomcat in embedded mode. Is there a good tutorial or other resource besides what's in the api documentation ?

One Tomcat instance for two domains and two webapps

How can I configure Tomcat (in standalone mode, that is without Apache [*]) so that I can deploy it on one server and have it serve two different webapps, depending on the domain name requested? I found a blog entry describing such a setup, but it's for Tomcat 5.5: <Engine defaultHost="domain1.com" name="Catalina"> <Host name="domain1.com" appBase="/home/user1/domain1"> <Alias>www.domain1.com</Alias> <Context path="" docBase="."/> </Host> <Host name="domain2.com" appBase="/home/user1/domain2"> <Alias>www.domain2.com</Alias> <Context path="" docBase="."/> </Host> http://iam-rakesh.blogspot.com/2009/10/hosting-multiple-domains-in-tomcat.html Also, as of now I've got one webapp, ROOT.war, inside .../tomcat/webapps/ How would that work once I'd have two "roots&quo

How to make simplest servlet filter respect setted character encoding

Gentlemen, it feels like I'm stuck. I'm trying to write the simplest servlet Filter (and deploy it to tomcat). It's a groovy code, but actually I'm heavily usin java approaches here, so it is almost copypaste, that's the reason I've added java tag as well. My question is - how can I insert UTF-8 string to filter? Here is the code: `public class SimpleFilter implements javax.servlet.Filter { ... public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, javax.servlet.ServletException { PrintWriter out = response.getWriter() chain.doFilter(request, wrapResponse((HttpServletResponse) response)) response.setCharacterEncoding('UTF-8') response.setContentType('text/plain') def saw = 'АБВГДЕЙКА ЭТО НЕПРОСТАЯ ПЕРЕДАЧА ABCDEFGHIJKLMNOP!!!' def bytes = saw.getBytes('UTF-8') def content = new String(bytes,