Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Design pattern needed: breaking webapp into modules

Thread view: 
Chris - 13 Nov 2007 23:08 GMT
We've got a webapp that has different modules. Let's say, just as an
example, the modules are Editing, Querying, and Reporting. Each module
has its own set of JSP pages. The modules also have some sub-pages in
common like headers and footers.

We'd really like to distribute the modules independently. A customer
might buy only Editing and Querying, but not Reporting, for example.

One of the modules is open source, which means that we'd like to
distribute it as a complete, standalone project. But we'd also like to
be able to integrate it with the rest of the webapp easily.

Does anyone have a good design pattern for this? I'm struggling with how
to organize the webapp, where to put the pages, how to have independent
projects that share common pages and code, etc. Any ideas appreciated.
Lew - 14 Nov 2007 01:54 GMT
> We've got a webapp that has different modules. Let's say, just as an
> example, the modules are Editing, Querying, and Reporting. Each module
[quoted text clipped - 11 lines]
> to organize the webapp, where to put the pages, how to have independent
> projects that share common pages and code, etc. Any ideas appreciated.

EAR - Enterprise ARchive.

Give each web app component its own context.  I've done this and it works all
right.

Signature

Lew

Chris - 14 Nov 2007 04:02 GMT
>> We've got a webapp that has different modules. Let's say, just as an
>> example, the modules are Editing, Querying, and Reporting. Each module
[quoted text clipped - 17 lines]
> Give each web app component its own context.  I've done this and it
> works all right.

Thanks. What I haven't been able to figure out, though, is how to share
the files that are common across modules. When I try to do a jsp include
of a file that isn't in the current webapp, I get an error message to
the effect that I can't access resources outside the current context.
Lew - 14 Nov 2007 05:20 GMT
> Thanks. What I haven't been able to figure out, though, is how to share
> the files that are common across modules. When I try to do a jsp include
> of a file that isn't in the current webapp, I get an error message to
> the effect that I can't access resources outside the current context.

Right.  <jsp:include> isn't the way to do it.  It's analogous to using
cooperative programs - they wouldn't use each other's variables, but
communicate more indirectly.

If you're selling separate modules to your customers, they will have that
degree of independence anyway.

In the application I did recently that used multiple web modules, we used
<http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getConte
xt(java.lang.String
)>

then
<http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html#getReque
stDispatcher(java.lang.String
)>

off the new ServletContext to manage the switch between contexts.

Signature

Lew

Are Nybakk - 14 Nov 2007 09:09 GMT
>> We've got a webapp that has different modules. Let's say, just as an
>> example, the modules are Editing, Querying, and Reporting. Each module
[quoted text clipped - 17 lines]
> Give each web app component its own context.  I've done this and it
> works all right.

Do you know any easy-to-understand tutorial or something about this
subject? We're having our graduation project this spring and we might
make a solution built on Java EE. Currently we've learned about the Java
EE containers (Servlets, JSP, Session beans) and some Java Persistence.
We're very interested in making modules like Chris is talking about
(offering different "packages"). I've looked a little bit into dynamic
class loading and such some time ago and I thought "aha, we could use
this", but that's not the way to do things in Java EE is it?
Lew - 14 Nov 2007 14:47 GMT
> Do you know any easy-to-understand tutorial or something about this [Java EE]?

Java?  Tutorial?  Java tutorial?  Java EE tutorial?  Hmm, let's see, where
would one go for a Java tutorial, specifically a Java EE tutorial?  Where
would one go?  Hmmm, could it be ...

<http://java.sun.com/javaee/5/docs/tutorial/doc/>?

Signature

Lew
No, the answer isn't, "Satan!", Church Lady.

Are Nybakk - 19 Nov 2007 21:43 GMT
>> Do you know any easy-to-understand tutorial or something about this
>> [Java EE]?
[quoted text clipped - 4 lines]
>
> <http://java.sun.com/javaee/5/docs/tutorial/doc/>?

=) I meant specifically about modularization and "contexts" as you
mentioned. Any pointer much appreciated.
Daniel Pitts - 14 Nov 2007 02:14 GMT
> We've got a webapp that has different modules. Let's say, just as an
> example, the modules are Editing, Querying, and Reporting. Each module
[quoted text clipped - 11 lines]
> to organize the webapp, where to put the pages, how to have independent
> projects that share common pages and code, etc. Any ideas appreciated.
I suggest looking into Spring Web Flow, it was design specifically for
this purpose.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.