File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Changing deployment variable values through UI at runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Changing deployment variable values through UI at runtime" Watch "Changing deployment variable values through UI at runtime" New topic
Author

Changing deployment variable values through UI at runtime

Roshan Khandelwal
Ranch Hand

Joined: Apr 16, 2009
Posts: 35
Hi ,

Application Overview :
  • The application uses a Configuration file , to decide on the paths to search for files on the server .
  • The Welcome page displays this information on the client side , allowing the user to change / edit or simply confirm the values .

  • For most of the times , it would be a simple confirm , but the edit and save options have been provided to be able to change these paths .

    Now these values are read and set in a "ConfigObject - simply getters and setters" at servlet startup [ init method ] , kind of global variable . and this object is available to all requests .

    There are two save options , that i intend to provide :

    a) Edit the values for this session / user only . So the User say changes a particular value and now the modified value is used for him .
    b) Edit the values permanently : So say the path on the server changed . A normal way would be to change the values in the configuration file and then redeploy the application .
    I want to ask , is it possible to change the values of a global variable at runtime and still it gets reflected for all new requests , without starting the server .
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61094
        
      66

    Sure, if it's common to all, just store it in application scope.


    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    Roshan Khandelwal
    Ranch Hand

    Joined: Apr 16, 2009
    Posts: 35
    I will try this out and update ..!!

    Thanks for replying .
     
    Don't get me started about those stupid light bulbs.
     
    subject: Changing deployment variable values through UI at runtime