Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsAdding Static Web Project to Tomcat server
https://www.eclipse.org/forums/index.php/mv/msg/226682/705049/#msg_705049
I managed to configure an existing Tomcat server in Eclipse following this guide 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,
Luís]]>Luís de Sousa2011-07-29T11:21:19-00:00Re: Adding Static Web Project to Tomcat server
https://www.eclipse.org/forums/index.php/mv/msg/226682/707343/#msg_707343
> 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,
>
> Luís
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.
Cheers,
Larry
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[1] for details.
[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ]]>Larry Isaacs2011-08-01T13:27:18-00:00Re: Adding Static Web Project to Tomcat server
https://www.eclipse.org/forums/index.php/mv/msg/226682/708261/#msg_708261
I'm aware Eclipse takes over the original Tomcat installation so it can start, stop, restart, publish etc. Right now I need to shutdown Tomcat manually every time I open Eclipse, otherwise it won't be able to do anything. But that's a different issue.