• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Add application context to WAS 5.0

 
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
author
Posts: 3902
10
Redhat Quarkus Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3902
10
Redhat Quarkus Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic