|Re: Adding Static Web Project to Tomcat server [message #707343 is a reply to message #705049]
||Mon, 01 August 2011 13:27
| Larry Isaacs
Registered: July 2009
On 7/29/2011 7:21 AM, Luis wrote:|
> Hello everyone,
> I managed to configure an existing Tomcat server in Eclipse following
> http://www.mulesoft.com/tomcat-wtp and selecting the "Use Tomcat
> installation" option at the "Server Locations" tab.
> Presently I'm able to create new Dynamic Web Projects associated with
> this server, by selecting the appropriate "Target runtime" option at the
> project creation menu. The problem is that when I try to create a Static
> Web Project no options show up in the "Target runtime" drop down list.
> Is it possible to associate Static Web Projects to a Tomcat server? Does
> it need a different server configuration?
> Thank you,
Technically, Tomcat only supports serving Web applications. WTP doesn't
currently support adding Static Web projects to servers which are
Servlet Containers, like Tomcat. Not all versions of Tomcat could
support this, but recent versions probably can. I'll look into that as
a feature for WTP 3.4.
In the meantime, I can think of a couple workarounds that would let
serve your static content with Tomcat and have Run As -> Run on Server work.
1. The simplest is to create Dynamic Web projects and put your static
content in the WebContent folder like you do now in the Static Web project.
2. Only slightly more complicated is to create "proxy" Dynamic Web
project and link it's WebContent folder to the "WebContent" folder of
the Static Web project. You could add this "proxy" project to the
Tomcat server and it should serve the same content as your Static Web
project. The "Serve modules without publishing" option available in the
Tomcat server editor would no longer work, but that's probably not
important. Run As -> Run on Server would still work.
P.S. I assume you are aware that enabling the "Use Tomcat installation"
option means that the Tomcat server in Eclipse now "owns" your Tomcat
installation and are okay with that. If you aren't sure what this
means, see the Tomcat FAQ for details.
Powered by FUDForum
. Page generated in 0.02514 seconds