Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » why build/classes and not WEB-INF/classes?
why build/classes and not WEB-INF/classes? [message #174445] Fri, 14 July 2006 11:05 Go to next message
Graeme Harker is currently offline Graeme HarkerFriend
Messages: 12
Registered: July 2009
Junior Member
Is there a good reason that the default Java build target in WTP for a
Dynamic Web Project is build/classes? It would seem to make much more
sense if default was WEB-INF/classes as this is where the container
expects to find the servlet implementations?
Re: why build/classes and not WEB-INF/classes? [message #174466 is a reply to message #174445] Fri, 14 July 2006 17:00 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
I'm not sure how difficult it would be to keep the built class files out
of your CVS if they were being generated under the web content folder of
your web project. By putting them in a normal Java build folder, they
will stay out of your CVS automatically. WTP copies the build folder
contents to WEB-INF/classes when the web application is assembled for
publishing to a server or is exported.

If you want, you can "override" this behavior by creating a new Java
source folder and check the "Allow output folders for source folders"
checkbox. For the new source folder, specify its output folder to be
"<webcontent>\WEB-INF\classes". Since this new source folder isn't
listed in the ".component" file, WTP won't try to copy its contents to
WEB-INF/classes for you. I have done something somewhat similar to this
to put a Java applet in the content portion of a web application, so I
think it should work.

Cheers,
Larry


Graeme Harker wrote:
> Is there a good reason that the default Java build target in WTP for a
> Dynamic Web Project is build/classes? It would seem to make much more
> sense if default was WEB-INF/classes as this is where the container
> expects to find the servlet implementations?
>
Re: why build/classes and not WEB-INF/classes? [message #174499 is a reply to message #174466] Sat, 15 July 2006 08:44 Go to previous messageGo to next message
Graeme Harker is currently offline Graeme HarkerFriend
Messages: 12
Registered: July 2009
Junior Member
Larry Isaacs wrote:
> I'm not sure how difficult it would be to keep the built class files out
> of your CVS if they were being generated under the web content folder of
> your web project. By putting them in a normal Java build folder, they
> will stay out of your CVS automatically. WTP copies the build folder
> contents to WEB-INF/classes when the web application is assembled for
> publishing to a server or is exported.
>
> If you want, you can "override" this behavior by creating a new Java
> source folder and check the "Allow output folders for source folders"
> checkbox. For the new source folder, specify its output folder to be
> "<webcontent>\WEB-INF\classes". Since this new source folder isn't
> listed in the ".component" file, WTP won't try to copy its contents to
> WEB-INF/classes for you. I have done something somewhat similar to this
> to put a Java applet in the content portion of a web application, so I
> think it should work.
>
> Cheers,
> Larry
>
>
> Graeme Harker wrote:
>> Is there a good reason that the default Java build target in WTP for a
>> Dynamic Web Project is build/classes? It would seem to make much more
>> sense if default was WEB-INF/classes as this is where the container
>> expects to find the servlet implementations?
>>

Thanks for your reply. That explains a lot. Tell me, does what WTP does
at "Run at Server"-time (i.e. when it copies the target files to
<workspace>/<projectName>/<secretFolder>) constitute "publishing to a
server" i.e. does it also copy the contents of build/classes to
WEB-INF/classes?
Re: why build/classes and not WEB-INF/classes? [message #174653 is a reply to message #174499] Mon, 17 July 2006 13:29 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
The only version I'm aware of that did something with a
<workspace>/<projectName>/<secretFolder> was WTP 0.7. It built an image
of the webapp under a ".deployables" directory. WTP 0.7 also tried to
support multiple modules per project. Neither of these features
survived to WTP 1.0, as both proved unworkable. Can you be more
specific about the "<secretFolder>" you are referring to?

I can confirm that in WTP 1.0.x and 1.5, the build/classes contents are
copied to the target "WEB-INF/classes" as part of publishing.

Graeme Harker wrote:
> Larry Isaacs wrote:
>> I'm not sure how difficult it would be to keep the built class files
>> out of your CVS if they were being generated under the web content
>> folder of your web project. By putting them in a normal Java build
>> folder, they will stay out of your CVS automatically. WTP copies the
>> build folder contents to WEB-INF/classes when the web application is
>> assembled for publishing to a server or is exported.
>>
>> If you want, you can "override" this behavior by creating a new Java
>> source folder and check the "Allow output folders for source folders"
>> checkbox. For the new source folder, specify its output folder to be
>> "<webcontent>\WEB-INF\classes". Since this new source folder isn't
>> listed in the ".component" file, WTP won't try to copy its contents to
>> WEB-INF/classes for you. I have done something somewhat similar to
>> this to put a Java applet in the content portion of a web application,
>> so I think it should work.
>>
>> Cheers,
>> Larry
>>
>>
>> Graeme Harker wrote:
>>> Is there a good reason that the default Java build target in WTP for
>>> a Dynamic Web Project is build/classes? It would seem to make much
>>> more sense if default was WEB-INF/classes as this is where the
>>> container expects to find the servlet implementations?
>>>
>
> Thanks for your reply. That explains a lot. Tell me, does what WTP does
> at "Run at Server"-time (i.e. when it copies the target files to
> <workspace>/<projectName>/<secretFolder>) constitute "publishing to a
> server" i.e. does it also copy the contents of build/classes to
> WEB-INF/classes?
Re: why build/classes and not WEB-INF/classes? [message #174898 is a reply to message #174653] Wed, 19 July 2006 12:43 Go to previous message
Graeme Harker is currently offline Graeme HarkerFriend
Messages: 12
Registered: July 2009
Junior Member
<workspace>/.metadta/.plugins/org.eclipse.wst.server.core/tmp

I used the adjective "secret" since (unless I'm reading the wrong
documentation) it's not mentioned in the documentation for WTP.

WTP is a very nice piece of technology and I'm a fan already but the
learning curve for new users would be shorter if the black-box bits were
more transparent so people could figure out what was going on.


Larry Isaacs wrote:

> The only version I'm aware of that did something with a
> <workspace>/<projectName>/<secretFolder> was WTP 0.7. It built an image
> of the webapp under a ".deployables" directory. WTP 0.7 also tried to
> support multiple modules per project. Neither of these features
> survived to WTP 1.0, as both proved unworkable. Can you be more
> specific about the "<secretFolder>" you are referring to?

> I can confirm that in WTP 1.0.x and 1.5, the build/classes contents are
> copied to the target "WEB-INF/classes" as part of publishing.

> Graeme Harker wrote:
>> Larry Isaacs wrote:
>>> I'm not sure how difficult it would be to keep the built class files
>>> out of your CVS if they were being generated under the web content
>>> folder of your web project. By putting them in a normal Java build
>>> folder, they will stay out of your CVS automatically. WTP copies the
>>> build folder contents to WEB-INF/classes when the web application is
>>> assembled for publishing to a server or is exported.
>>>
>>> If you want, you can "override" this behavior by creating a new Java
>>> source folder and check the "Allow output folders for source folders"
>>> checkbox. For the new source folder, specify its output folder to be
>>> "<webcontent>WEB-INFclasses". Since this new source folder isn't
>>> listed in the ".component" file, WTP won't try to copy its contents to
>>> WEB-INF/classes for you. I have done something somewhat similar to
>>> this to put a Java applet in the content portion of a web application,
>>> so I think it should work.
>>>
>>> Cheers,
>>> Larry
>>>
>>>
>>> Graeme Harker wrote:
>>>> Is there a good reason that the default Java build target in WTP for
>>>> a Dynamic Web Project is build/classes? It would seem to make much
>>>> more sense if default was WEB-INF/classes as this is where the
>>>> container expects to find the servlet implementations?
>>>>
>>
>> Thanks for your reply. That explains a lot. Tell me, does what WTP does
>> at "Run at Server"-time (i.e. when it copies the target files to
>> <workspace>/<projectName>/<secretFolder>) constitute "publishing to a
>> server" i.e. does it also copy the contents of build/classes to
>> WEB-INF/classes?When I said "secret folder" I meant ...
Previous Topic:Does WTP reset CATALINA_HOME at "Run at Server"-time?
Next Topic:usage of wsexplorer.war
Goto Forum:
  


Current Time: Thu Apr 25 07:03:10 GMT 2024

Powered by FUDForum. Page generated in 0.03492 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top