Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location for putting files on glassfish server

We can put our file say one.txt in txt folder available in tomcat->webapp folder. Now we can access this file in browser using url as below:

http://localhost:8080/txt/one.txt

I am new in glassfish server. Can anybody please tell me how to do same thing in glssfish server as in tomcat server?

like image 266
S Singh Avatar asked Apr 06 '12 11:04

S Singh


2 Answers

GlassFish has very similar functionality.

There is a default application that serves static content from a domain's docroot defined with Glassfish.

You can do the following to see how it works.

Let's assume that you have installed GlassFish 3.1.2 into a directory named /foo (or C:\FOO) by unzipping one of the distros.

You will be able to create a directory /foo/glassfish3/glassfish/domains/domain1/docroot/txt and put the file one.txt into that directory.

Start domain1 using the command asadmin start-domain domain1

You will then be able to access one.txt via the url http://localhost:8080/txt/one.txt.

like image 198
vkraemer Avatar answered Sep 23 '22 03:09

vkraemer


By definition a ROOT application is the application that is available under the root url (e.g. http://locahost:8080/) of the server.

The only thing you have to do is to define an application that should be deployed under the root context. How to do this within glassfish can be found here.

like image 34
magomi Avatar answered Sep 26 '22 03:09

magomi