I have a EAR project that contains a Dynamic Web Project and a EJB project.
When I publish this to Weblogic, the WAR in the generated EAR has all the
WebContent stuffed under the WEB-INF directory.

The structure of the Dynamic Web project is as follows:

src - this is empty since all java classes are packaged into the EJB jar
itself and is referred in the Manifest of the WAR.
WebContent - Auto generated by the project creation wizard and has META-INF
and WEB-INF
www - linked source folder to all the Web app content - js/html files
build - Default output folder for the project.

The only folder that participates as a Source folder (if you see Java Build
Path) properties is www.

The default output folder is build.

When I "Build Project" the contents of www as well as META-INF and WEB-INF
appear in the build folder.

When I publish to the server, I expect the build output folder to be
packaged in the WAR. Instead it looks like this.