aspose file tools
The moose likes Websphere and the fly likes Add application context to WAS 5.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Add application context to WAS 5.0" Watch "Add application context to WAS 5.0" New topic
Author

Add application context to WAS 5.0

Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
I have servlets in C:\myapp\WEB-INF\classes. With Tomcat I add this line to server.xml to create a new context for these servlets.
<Context path="/webapp" docBase="C:\myapp" debug="1" reloadable="true" />
Then I can access servlets using http://domain/webapp/servlet/...

How to add context in WAS 5.0 to use folder C:\myapp\WEB-INF\classes?
Thanks.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
Originally posted by Bruce Jin:
I have servlets in C:\myapp\WEB-INF\classes. With Tomcat I add this line to server.xml to create a new context for these servlets.
<Context path="/webapp" docBase="C:\myapp" debug="1" reloadable="true" />
Then I can access servlets using http://domain/webapp/servlet/...

How to add context in WAS 5.0 to use folder C:\myapp\WEB-INF\classes?
Thanks.

You can't do that. WebSpehre won't let you serve from a directory structure like that. You MUST package your servlets & JSPs in a WAR file. When creating the WAR file with the AAT you can set the context there.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 666
Thanks Kyle:
Can I write a classloader to load servlets from my directory structure? I seem to see WAS 5 has a place to configure a classloader.
Thanks.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3879
Originally posted by Bruce Jin:
Thanks Kyle:
Can I write a classloader to load servlets from my directory structure? I seem to see WAS 5 has a place to configure a classloader.
Thanks.

You could, but as I said DON'T DO THAT. That's not the way WebSphere works, and trying to circumvent it will just cause you grief. Just use EAR files...
Kyle
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Add application context to WAS 5.0
 
Similar Threads
Tomcat 404 error
Help to find the error.
Executing my first servlet program
Fatal Eorror
Session lost due to....?