3

I'm a newbie to tomcat. My question is, can tomcat have the webapps sub-directories which include additional webapps? For example the root is in /webapps folder. But there is another folder same level as root folder which contains more webapps.

/webapps
 --- ROOT
 --- someFolder (just a folder)
     ---- app1
     ---- app2

So when accessing the url it is like http://localhost:8080/someFolder/app1 but also can access the root app as http://localhost:8080/

I hope it makes sense.

Min Naing Oo
  • 1,085
  • 5
  • 24
  • 49
user1865649
  • 31
  • 1
  • 3
  • Yes, it can have other webapps in addition to ROOT (i.e liferay) – Pankaj Kathiriya Apr 02 '14 at 04:51
  • Possible duplicate of [AutoDeploy a WAR file found in a subfolder of appBase](https://stackoverflow.com/questions/14523598/autodeploy-a-war-file-found-in-a-subfolder-of-appbase) – Vadzim Apr 05 '18 at 16:58

2 Answers2

0

When you deploy other webapps, they'll all be deployed inside the webapps/ folder. That is, they'll end up looking like this:

/webapps
 --- ROOT
 --- app1
 --- app2

But, if all you're looking for is to modify the URL (i.e. calling your app with http://localhost:8080/someName/app1), you can do this on some plugin types with a mapping inside your plugin's web.xml. For instance:

<servlet-mapping>
    <servlet-name>MyServlet</servlet-name>
    <url-pattern>/someName/*</url-pattern>
</servlet-mapping>

You can check out Servlet Mapping using web.xml for more details on servlet mappings, or https://www.liferay.com/community/forums/-/message_boards/message/9939167 for some discussion on getting this working in a Liferay Faces portlet.

Community
  • 1
  • 1
ethanbustad
  • 1,594
  • 1
  • 16
  • 27
  • 2
    Surely that would give you `/app/someName`, not `/someName/app`? After all, the servlets are inside the webapp, not vice-versa. – Robin Green Dec 10 '14 at 11:07
-1

you can download liferay bundle with tomcat. ROOT is where you can find the whole source of liferay. Besides you can deploy your own webapps. If you are with this bundle, you can see a folder call deploy. Whatever war you put there, It is going to deploy and you see your war deployed in webapps.