name your web application folder with
the war extension...
And what do you do when the content you want to include is not in the JBOSS_DIST/server/your_app_name folder?
I have tons of files with different file formats (images, audio and video) that are referenced by the application. I don't want to copy everything to the
JBOSS_DIST/server/your_app_name folder because there are too many files.
From the documentation JBoss/Tomcat is not allowing creation of any sub-context below the virtual Web server. Is there any way to circumvent this inconvenience?
Tomcat or Jetty need to be given an indication fo where a package is to be deployed (the context). All servlet containers require this. It doesn't stop you from deploying static content and it does not stop you from deploying static content under the root context. But you need a deployment descriptor for it.
JBoss places its own constraints on this. It needs to know what the package is, so it can farm the deployment to the right system(s) (EJB container or servlet container).
Your static content can live in directories (any content actually), can live outside the internal deployment directories. You need to configure JBoss to scan the right places. However, your content directory (expanded) will need to have a .war extension so that JBoss knows it is a web application for deployment. Also, you need to create all the necessary things a WAR must have - namely a deployment descriptor, WEB-INF/web.xml under the topmost directory of this content heirarchy.
For JBoss, if you want to map the context explicitly, you will need WEB-INF/jboss-web.xml. For example, if you want to map the content to the root context, jboss-web.xml would contain:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN"
To find the content outside of the standard deployment directory, configure the URL scanner to look at your required points - controlled in server/instance/conf/jboss-service.xml, for the URLs attribute of your URLDeploymentScanner, assuming that the content for your ROOT context resides in ROOT.war at the top of the file hierarchy of the current disk:
This includes your expanded WAR content (it can even be a packaged WAR) in the deployment process.
Hope that helps.