Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 7 - where do I set 'system properties'?

My webapp is having an issue since upgrading to Tomcat 7. My session will go null after I login and try to do anything (submitting a request). I've read that setting the following may help:

org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR=false 

Does anyone know where to set this? Should this be set in web.xml, context.xml or somewhere else?

The other thing I want to check is the following:

org.apache.catalina.STRICT_SERVLET_COMPLIANCE 
like image 791
LuckY07 Avatar asked Mar 01 '12 17:03

LuckY07


People also ask

Where is Tomcat system property set?

Select Run > Run Configurations. Make sure your server is selected. Select Environment Tab.

How do I set Catalina properties?

You could add necessary properties to catalina. properties file in <tomcat installation directory>/conf directory. All system properties are available including those set using the -D syntax, those automatically made available by the JVM and those configured in the $CATALINA_BASE/conf/catalina. properties file.

How do I open the Tomcat properties dialog box?

Right click the "Computer" icon in the Start Menu, and choose "Properties" from the context menu. Click the System Tab. You should see a list of information about your system, including your chip architecture and whether you are running a 32- or 64-bit version of Windows.

How do I open Tomcat configuration?

Open the Tomcat configuration tool from the Windows menu at Start > All Programs > Apache Tomcat > Tomcat Configuration. Click Configure and select the Java tab. Stop and restart the application server.


2 Answers

You can set any of the system properties in

apache-tomcat-7.0.33\conf\catalina.properties 

file. Adding your entry in this file should resolve your problem.

E.g.

environment=local 
like image 71
user2335780 Avatar answered Sep 29 '22 18:09

user2335780


You can set system properties in Tomcat by creating a setenv.sh file in /bin directory. I did the following to set the system properties.

export JAVA_OPTS="-Dmyprojectvar.subname=value -Danothervariable=value -Danother.variable=value" 

Remember:

There is no space between the export JAVA_OPTS and =. Also: the symbol & is different, use ..

Now, run your catalina.sh to start tomcat.

like image 23
Sreevidya Aravind Avatar answered Sep 29 '22 19:09

Sreevidya Aravind