*
The moose likes Servlets and the fly likes Servlets in JAR files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets in JAR files" Watch "Servlets in JAR files" New topic
Author

Servlets in JAR files

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Can you take all your servlets, JAR them up, put them in the WEB-INF/lib folder, and they still be accessible? Can you use them just like they were in the classes folder?


GenRocket - Experts at Building Test Data
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Yes, you can do that.
The /WEB-INF/lib/*.jar area for Java ARchive files. These files contain
servlets, beans, and other utility classes useful to the web application. The web
application class loader must be able to load classes from any of these archive
files.
The web application classloader must load classes from the WEB-INF/ classes
directory first, and then from library JARs in the WEB-INF/lib directory.


Groovy
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thanks! Now, is there any reason why we should NOT do this?
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

I dont see reasons why we should not. :roll:
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Thanks.
Joe Pluta
Ranch Hand

Joined: Jun 23, 2003
Posts: 1376
Greg, in my next release of my product, I plan to JAR all my servlets.
Joe
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Joe Pluta:
Greg, in my next release of my product, I plan to JAR all my servlets.
Joe

What product is that Joe?
BTW - I am anxiously awaiting an Eclipse Step By Step Volume 2.
Joe Pluta
Ranch Hand

Joined: Jun 23, 2003
Posts: 1376
I sell a product that uses JSP Model II to web enable green-screen applications (you know, those clunky 24x80 text-only applications?). The IBM iSeries is perhaps the most powerful business machine made, for a whole host of reasons, but it is severely lacking in the UI department. So I developed a middleware platform that actually goes in and analyzes your programs, makes source changes to connect them to a servlet, then displays the data in a JSP.
There are shops that have been running this stuff in production for over a year, and I'm getting ready for a new release that will eventually support portlets and web services as well as JSPs. It's pretty exciting stuff .
Joe
P.S. Eclipse Step by Step is not getting anywhere near the action it did in its first month. I'm not sure why, except that we missed the major momentum of June and July (don't make me go there ). I'm still trying to decide whether a followup book will have a market.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Joe Pluta:
I sell a product that uses JSP Model II to web enable green-screen applications (you know, those clunky 24x80 text-only applications?). The IBM iSeries is perhaps the most powerful business machine made, for a whole host of reasons, but it is severely lacking in the UI department. So I developed a middleware platform that actually goes in and analyzes your programs, makes source changes to connect them to a servlet, then displays the data in a JSP.
There are shops that have been running this stuff in production for over a year, and I'm getting ready for a new release that will eventually support portlets and web services as well as JSPs. It's pretty exciting stuff

That sounds pretty cool. Sounds like you found a market. All these people griping about not being able to find jobs or the IT market being dead, it makes me laugh. We are in an age where you have to make jobs for yourself. And that means, if you are a programmer, finding a market and the need for something which usually means you come up with a custom solution for someone that ends up having a need in more than one place. When are people going to realize that we have enough Word Processors and Email Clients and start using their brains for something a little more recolutionary.
I am working on a similar task in the sense that I found a need for something that doesn't really exist. Although, the idea behind the app is nothing new or breakthrough.
That sucks about your book. I try and mention it when I can when replying to eclipse questions. Don't take this the wrong way, but I wonder if you dropped the price down a bit, if it would do better? I know your publisher probably set the price and I am not saying it is not worth the $$, but....
Joe Pluta
Ranch Hand

Joined: Jun 23, 2003
Posts: 1376
You're probably right, Gregg. I have no idea how all of this works, but I bet lowering the price would help. I'll mention it to the powers that be.
Joe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlets in JAR files