• Post Reply Bookmark Topic Watch Topic
  • New Topic

Enable / disable Servlets

 
Kevin Nielsen
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to create a administration tool for a web-application, where it should be possible to enable / disable features like this:

| Cake feautre [X] |
| Apple feature [] |
| Coffee feature [X] |
| |
| [OK] [Cancel] |

Every feature is implemented in its seperated Servlet. How do I disable eg. the Cake feature and thus shutdown the Servlet? Do you how other suggestions for implementing this scenario?

/kews
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kews",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming all of these servlets are in a single "web application" context you just need an object shared by all via the ServletContext.
See the javax.servlet.ServletContext setAttribute and getAttribute methods.
The object you share between all the servlets should have some sort of flags to switch features on and off.

Bill
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:
Assuming all of these servlets are in a single "web application" context you just need an object shared by all via the ServletContext.
See the javax.servlet.ServletContext setAttribute and getAttribute methods.
The object you share between all the servlets should have some sort of flags to switch features on and off.

Bill


In case the flag is set you can throw ServletUnavailableException.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!