Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Dependent web projects
Dependent web projects [message #188218] Mon, 19 February 2007 16:19 Go to next message
Shash Chatterjee is currently offline Shash ChatterjeeFriend
Messages: 26
Registered: July 2009
Junior Member
Hi!

I tried but was unable to find any documents on dependent web-projects.

I have a Dynamic Web Project that I can deploy and run just fine. I
need to create a project that my Dynamic Web Project will depend on,
i.e. I expect to find this new project's JAR in WEB-INF/lib. How do I
accomplish this?

Also, this new project needs to contribute static and dynamic
web-content (JSP and HTML) that need to be added on to the web context
of the Dynamic Web Project, as well as resources that need to end up in
WEB-INF/classes. How can this be accomplished? While running/debugging
the Dynamic Web Project, if I change a JSP in the dependent project will
hot-deploy work?

Thanks for any pointers you might share with me!

Shash
Re: Dependent web projects [message #188241 is a reply to message #188218] Mon, 19 February 2007 18:42 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
You can create a Java project, and in the J2EE Module Dependencies page
of the Dynamic Web Project's Properties dialog, you can check this Java
project as a dependency. This will cause the classes in the Java
project to be built into a jar and included in the WEB-INF/lib of the
Dynamic Web Project. Beyond that, I'm not aware of any support for
including other resources from the dependency, such as JSP and HTML, in
the web content of the Dynamic Web Project. The dependency also can not
contribute to WEB-INF/classes, just the jar to WEB-INF/lib. Only
artifacts from the Dynamic Web Project's Java source directory are
targeted to the WEB-INF/classes directory.

Cheers,
Larry

Shash Chatterjee wrote:
> Hi!
>
> I tried but was unable to find any documents on dependent web-projects.
>
> I have a Dynamic Web Project that I can deploy and run just fine. I
> need to create a project that my Dynamic Web Project will depend on,
> i.e. I expect to find this new project's JAR in WEB-INF/lib. How do I
> accomplish this?
>
> Also, this new project needs to contribute static and dynamic
> web-content (JSP and HTML) that need to be added on to the web context
> of the Dynamic Web Project, as well as resources that need to end up in
> WEB-INF/classes. How can this be accomplished? While running/debugging
> the Dynamic Web Project, if I change a JSP in the dependent project will
> hot-deploy work?
>
> Thanks for any pointers you might share with me!
>
> Shash
Re: Dependent web projects [message #188364 is a reply to message #188241] Wed, 21 February 2007 03:07 Go to previous messageGo to next message
Shash Chatterjee is currently offline Shash ChatterjeeFriend
Messages: 26
Registered: July 2009
Junior Member
Larry, thanks, at least the JAR will be added.

So, am I out in left field in wanting to have a more modular and
componentized approach to developing webapps? That doesn't just mean
individual JARs, but also a way to keep the JSPs, HTMLs, and other
sundry artifacts separate. I would think almost everybody would want to
develop reusable pieces of a webapp separately and then use webapp
projects to tie in the pieces they need. What, then, is the WTP-way of
doing that?

Larry Isaacs wrote:
> You can create a Java project, and in the J2EE Module Dependencies page
> of the Dynamic Web Project's Properties dialog, you can check this Java
> project as a dependency. This will cause the classes in the Java
> project to be built into a jar and included in the WEB-INF/lib of the
> Dynamic Web Project. Beyond that, I'm not aware of any support for
> including other resources from the dependency, such as JSP and HTML, in
> the web content of the Dynamic Web Project. The dependency also can not
> contribute to WEB-INF/classes, just the jar to WEB-INF/lib. Only
> artifacts from the Dynamic Web Project's Java source directory are
> targeted to the WEB-INF/classes directory.
>
> Cheers,
> Larry
Re: Dependent web projects [message #188403 is a reply to message #188364] Wed, 21 February 2007 18:36 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
I agree that this would be a good feature. You might want to check
Bugzilla to see if an enhancement request for this already exists. If
not, you can add one.

Unfortunately, an obstacle for this feature is that "assembly" of such
resources is currently the responsibility of each individual server.
Thus, all the servers have to add support to "fully implement" this
feature. I don't think this situation is likely to change in WTP 2.0,
but perhaps in a later version this can be addressed.

Cheers,
Larry

Shash Chatterjee wrote:
> Larry, thanks, at least the JAR will be added.
>
> So, am I out in left field in wanting to have a more modular and
> componentized approach to developing webapps? That doesn't just mean
> individual JARs, but also a way to keep the JSPs, HTMLs, and other
> sundry artifacts separate. I would think almost everybody would want to
> develop reusable pieces of a webapp separately and then use webapp
> projects to tie in the pieces they need. What, then, is the WTP-way of
> doing that?
>
> Larry Isaacs wrote:
>> You can create a Java project, and in the J2EE Module Dependencies
>> page of the Dynamic Web Project's Properties dialog, you can check
>> this Java project as a dependency. This will cause the classes in the
>> Java project to be built into a jar and included in the WEB-INF/lib of
>> the Dynamic Web Project. Beyond that, I'm not aware of any support
>> for including other resources from the dependency, such as JSP and
>> HTML, in the web content of the Dynamic Web Project. The dependency
>> also can not contribute to WEB-INF/classes, just the jar to
>> WEB-INF/lib. Only artifacts from the Dynamic Web Project's Java
>> source directory are targeted to the WEB-INF/classes directory.
>>
>> Cheers,
>> Larry
Re: Dependent web projects [message #188436 is a reply to message #188403] Thu, 22 February 2007 01:12 Go to previous messageGo to next message
Shash Chatterjee is currently offline Shash ChatterjeeFriend
Messages: 26
Registered: July 2009
Junior Member
Larry,

I will give Bugzilla a whirl and enter a feature request if needed.

I don't think the servers need to do this. I think WTP could handle
this just fine on its own as part of an extended deploy process. I
think some kind of configuration language is needed. WTP would need to
monitor for changes in not only the webapp project, but it's dependent
(or, "contributory") projects as well. The configuration on those
projects would define:
- which directories/files to contribute to any webapp that it provides
contributions to (for reusability, cannot be tied to a particular webapp)
- what path relative to the webapp context root should those
contributions be copied over

Shash

Larry Isaacs wrote:
> I agree that this would be a good feature. You might want to check
> Bugzilla to see if an enhancement request for this already exists. If
> not, you can add one.
>
> Unfortunately, an obstacle for this feature is that "assembly" of such
> resources is currently the responsibility of each individual server.
> Thus, all the servers have to add support to "fully implement" this
> feature. I don't think this situation is likely to change in WTP 2.0,
> but perhaps in a later version this can be addressed.
>
> Cheers,
> Larry
>
>
Re: Dependent web projects [message #188444 is a reply to message #188436] Thu, 22 February 2007 01:14 Go to previous messageGo to next message
Shash Chatterjee is currently offline Shash ChatterjeeFriend
Messages: 26
Registered: July 2009
Junior Member
Shash Chatterjee wrote:

> I don't think the servers need to do this. I think WTP could handle

>
> Larry Isaacs wrote:

>> Unfortunately, an obstacle for this feature is that "assembly" of such
>> resources is currently the responsibility of each individual server.
>> Thus, all the servers have to add support to "fully implement" this
>> feature.

Or maybe I misunderstood you. By "server" do you mean Tomcat,
Websphere, etc. Or do you mean the WTP "adapters" that interface to
those servers? If the latter, I understand your point.

Shash
Re: Dependent web projects [message #188469 is a reply to message #188444] Thu, 22 February 2007 13:16 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1310
Registered: July 2009
Senior Member
You are correct. I'm referring to the server's support within WTP, i.e.
the adapter.

Larry

Shash Chatterjee wrote:
> Shash Chatterjee wrote:
>
>> I don't think the servers need to do this. I think WTP could handle
>
>>
>> Larry Isaacs wrote:
>
>>> Unfortunately, an obstacle for this feature is that "assembly" of
>>> such resources is currently the responsibility of each individual
>>> server. Thus, all the servers have to add support to "fully
>>> implement" this feature.
>
> Or maybe I misunderstood you. By "server" do you mean Tomcat,
> Websphere, etc. Or do you mean the WTP "adapters" that interface to
> those servers? If the latter, I understand your point.
>
> Shash
dependency between synamic web project and java project [message #191045 is a reply to message #188469] Tue, 03 April 2007 18:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kenji.vettatech.com

I am using wtp-all-in-one-sdk-R-1.5.3-linux-gtk.tar.gz

I've created two projects.

project p1 - dynamic web project. contains one single JSP like this

Hello People...
<%
sandbox.SimpleDBConnection s = new sandbox.SimpleDBConnection();
out.print(s.connect());
%>

project p2 - regular java project. contains a mysql jdbc driver jar and
a single class sandbox.SimpleDBConnection that performs a simple SELECT
query

I've left-clicked project p1, choose properties->j2ee module
dependencies and checked p2

everything compiles.

when I run p1 from a tomcat server (from inside eclipse, of course), I
get the following error message

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 11 in the jsp file: /index.jsp
Generated servlet error:
SimpleDBConnection cannot be resolved to a type

then, if I try, left-clicking project p1, properties->java build
path->projects tab->add project p2, I get the following error

"Build path contains duplicate entry: 'p2' for project p1"

probably because it's already referenced by the "j2ee module
dependencies" project property

what am I doing wrong?

thanks in advance

Kenji
Re: dependency between synamic web project and java project [message #191053 is a reply to message #191045] Tue, 03 April 2007 18:52 Go to previous message
Eclipse UserFriend
Originally posted by: kenji.vettatech.com

sorry. my bad

what I needed to do

1. restart the server, even it being marked as "synchronized"
2. add manually a dependency to mysql jdbc driver at "j2ee module
dependencies" project property

solved

best regards

Kenji

Leonardo Kenji Shikida wrote:
> I am using wtp-all-in-one-sdk-R-1.5.3-linux-gtk.tar.gz
>
> I've created two projects.
>
> project p1 - dynamic web project. contains one single JSP like this
>
> Hello People...
> <%
> sandbox.SimpleDBConnection s = new sandbox.SimpleDBConnection();
> out.print(s.connect());
> %>
>
> project p2 - regular java project. contains a mysql jdbc driver jar and
> a single class sandbox.SimpleDBConnection that performs a simple SELECT
> query
>
> I've left-clicked project p1, choose properties->j2ee module
> dependencies and checked p2
>
> everything compiles.
>
> when I run p1 from a tomcat server (from inside eclipse, of course), I
> get the following error message
>
> org.apache.jasper.JasperException: Unable to compile class for JSP
>
> An error occurred at line: 11 in the jsp file: /index.jsp
> Generated servlet error:
> SimpleDBConnection cannot be resolved to a type
>
> then, if I try, left-clicking project p1, properties->java build
> path->projects tab->add project p2, I get the following error
>
> "Build path contains duplicate entry: 'p2' for project p1"
>
> probably because it's already referenced by the "j2ee module
> dependencies" project property
>
> what am I doing wrong?
>
> thanks in advance
>
> Kenji
Previous Topic:My first Session bean...
Next Topic:Multiple "WebContent" folders
Goto Forum:
  


Current Time: Sat Nov 29 04:07:20 GMT 2014

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

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