tomcat6

Defining Tomcat servlet context parameters

*爱你&永不变心* 提交于 2019-11-27 04:26:02
问题 Scenario: foo.war file contains a default value of init parameter fooParam=1. This is defined in foo.war!WEB_INF/web.xml which contains: <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <context-param> <param-name>fooParam</param-name> <param-value>1</param-value> <description> my parameter "fooParam" </description> </context-param> ... OK, now I want to be able to

Is it possible to supply Tomcat6's context.xml file via the Maven Cargo plugin?

只谈情不闲聊 提交于 2019-11-27 03:36:46
问题 I'd like to keep Tomcat's context.xml file out of my WAR file's META-INF directory if possible. Can this be done with Maven's cargo plugin? I can't seem to find the correct configuration. 回答1: Eureka! After many days of studying this problem I finally found a very effective solution. The key is to take your Tomcat XML context fragment file and use the <configfiles> element of cargo to drop it in the conf/Catalina/localhost directory with the name context.xml.default . The only downside is

Tomcat 6, JMX and the dynamic port problem

你。 提交于 2019-11-27 02:47:14
问题 after reading and trying a lot around, I have to ask if anyone has a solution for my problem. I am trying to set up some Tomcats (V6) behind a firewall. This is no big deal - but I want to monitor them via JMX. I read the TC docu and came across the JMXRemoteLifecycleListener. My test TC installation is set up exactly as stated in the above link. Thus I don't get a connection from one host in our network to another. Additionally a third, random port is open every time I start TC. In my server

Communication between two web application in same server

倾然丶 夕夏残阳落幕 提交于 2019-11-27 02:11:58
问题 All, I have 2 web applications, Web1 and Web2, deployed on my tomcat server. I want classes in Web1 to call methods on classes in Web2. One way to do this is using webservice. Is there any other way similar to calling a method on class on same web application ?. Thanks. 回答1: Yes. It is possible. It tried for same servlet container by using getServletContext().getContext() method. First you need to make changes in below file (Windows) C:\Program Files\Apache Software Foundation\Tomcat 7.0\conf

Tomcat6 and Java 7

我怕爱的太早我们不能终老 提交于 2019-11-27 01:57:43
问题 In linux, is it possible to have a web application written using Java 7 be deployed on tomcat6? If so, what configuration needs to be modified to allow it to work? I have tried changing the JAVA_HOME variable in the tomcat6.conf file and restarting, but it is still using 1.6 according to the tomcat manager webpage, and only applications written in 1.6 or lower deploy correctly. I have both jdk 1.6 and 1.7 installed in different locations. 回答1: I had a major problem when I compiled my servlet

Tomcat fails to start because of jdbc driver loading

落爺英雄遲暮 提交于 2019-11-27 01:38:17
问题 Here's the relevant portion of the tomcat startup log: SEVERE: Context [/f360] startup failed due to previous errors Apr 8, 2010 6:45:56 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: A web application registered the JBDC driver [org.apache.derby.jdbc.ClientDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Apr 8, 2010 6:45:56 PM org.apache.catalina.loader

Get the server port number from tomcat without a request

☆樱花仙子☆ 提交于 2019-11-27 00:38:58
Is there any Tomcat API or configuration available which can tell an application (probably on startup), what port its running on without a request? Imagine a scenario where there are two web applications running in the same Tomcat and one of which need to invoke a web service from the other one. We don't want the request to leave the Tomcat (if you use the Apache server name or absolute URL, the request will go out and come back again and it can go to any instance) and come back in. For that I know the name of the machine but no way to get the port number. I know I can hard code this

message java.lang.IllegalStateException: No output folder

时间秒杀一切 提交于 2019-11-26 23:12:03
问题 I am new to Tomcat on Windows. I am trying to deploy my Java project which I have made in RHEL 5 using Tomcat. Now I want to run that project on window. So I copied and pasted my project folder inside the Tomcat web apps Directory i.e C:\Program Files\apache-tomcat-6.0.37\webapps but I am unable to run the project as I am facing below error while opening my first login page. Do I need to make any further changes in code or web.xml file as I am now deploying it on Windows? type Exception

Character encoding issue with Tomcat

為{幸葍}努か 提交于 2019-11-26 22:55:04
问题 There is strange character encoding going on. I am using JSP (JSTL) and Struts with Tomat 6. I have my JSP page encoding as such: <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> The issue is when I try to pass the url using encodeURI as such: <script type="text/javascript"> $('#mailer_filter').change(function(){ var val = $(this).val(); console.log(val); console.log(escape(val)); console.log(encodeURI(val)); location.href = 'mailList.a?' + encodeURI($(this).val()); });

Change Tomcat's Charset.defaultCharset in windows

谁都会走 提交于 2019-11-26 22:53:57
问题 I'm using tomcat 6.0.32 in windows 7. Inside a very simple servlet, inside the init method, I'm printing: System.out.println(Charset.defaultCharset()); The output is: windows-1253 As far as I understand this is how tomcat start's in the JVM since I'm printing the same in standalone java class and I get "UTF8" as a response. So, how can I change this to UTF-8? thanks 回答1: Just create a setenv.bat file inside the TOMCAT/bin directory with the following contents: set "JAVA_OPTS=%JAVA_OPTS%