<p>I would like to know if there is some way to share a variable or an object between two or more Servlets, I mean some "standard" way. I suppose that this is not a good practice but is a easier way to build a prototype.</p>

<p>I don't know if it depends on the technologies used, but I'll use Tomcat 5.5</p>

<hr>

<p>I want to share a Vector of objects of a simple class (just public attributes, strings, ints, etc). My intention is to have a static data like in a DB, obviously it will be lost when the Tomcat is stopped. (it's just for Testing)</p>

Couldn't you just put the object in the HttpSession and then refer to it by its attribute name in each of the servlets?
e.g:
```
```
getSession().setAttribute("thing", object);
```
```
...then in another servlet:
```
```
Object obj = getSession.getAttribute("thing");
```
```