Glassfish vhost to serve only static content. Disconnect a session, how?

I have a folder on the server containing all the images, static files, etc. This is the storage of my application, I need to service these files at http: // host: 8080 / storage / **. At this point, I am mounting a symbolic link in the root of the application in the statup application called "storage", I am trying to configure a virtual host in Glassfish Application Server v2.1 to serve only static content, but there was a big problem, how to disable httpsession control? Each request in a JS, CSS or IMG file, a session was received by jsessionid. All this work will be in vain. Any discussion on how best to serve static content in the context of "storage" and how to disable session management on a particular host?

Sincerely. Rigoni

+3
source share
1 answer

I don’t know if you know about this, but GlassFish supports Alternative docks and local resource paths that are very nice to serve static content:

As another example, consider the following alternative docroot in sun-web.xml:

<property name="alternatedocroot_1" value="from=/myimages/* dir=/images"/>

and this request url:

http://localhost:8080/myimages/image1.jpg

Further, suppose that the above request is mapped to a web application deployed in the root context ("/"). In this case, the request path information evaluates:

/myimages/image1.jpg

means this corresponds to the above alternative docroot. The local path to the file system in which the resource is requested will consider the value of the alternative docroot's Value "dir":

/images

with request path information:

/myimages/image1.jpg

as a result:

/images/myimages/image1.jpg

, , ?

+3

Source: https://habr.com/ru/post/1763084/


All Articles