loics2
loics2

Reputation: 646

Configure eclipse to work with tomcat

Is there a way to configure eclipse to create dynamic web projects with the standard folder structure? Like :

/root
   /WEB-INF
      /web.xml
      /lib
      /classes
      /...
   /META-INF
      /...

Instead of

/root
  /src
  /build
  /WebContent
     /WEB-INF
      /web.xml
      /lib
      /...
   /META-INF
      /...

I know I can export the project into a *.war file, but it's not what I want.

Upvotes: 0

Views: 203

Answers (2)

loics2
loics2

Reputation: 646

I finally found a solution that looks like Shinichi Kai's one. I changed the default output folder like he did,and instead of setting the docBase in the server.xml, I created a new context.

To do so,I created an xml file in %CATALINA_HOME%/conf/Catalina/localhost/. In this file, the context is defined like this: <Context docBase="<Eclipse_Workspace_Path>\<Project_Name>\WebContent"/>

It's cleaner than setting the docBase directly in the server.xml

Upvotes: 0

Shinichi Kai
Shinichi Kai

Reputation: 4523

Do you want to set docBase to your project's root folder? If this is the case, you can change Default output folder from YourProject/build/classes to YourProject/WebContent/WEB-INF/classes in Java Build Path.

And, set docBase to YourProjectRoot\WebContent in your server.xml.

Hope this helps.

Upvotes: 1

Related Questions