2

Does the param name in the context-param(i.e servlet context parameters) need to be unique? Or can I have multiple param values for the same param name ?

1
  • Are you using multiple servlet-contexts in your project?
    – midhunhk
    Aug 23, 2011 at 4:48

1 Answer 1

2

If you are talking about ServletContext#getInitParameter (the one which you can set in web.xml), then yes, it can only have a (single) String value.

But if the interpretation of that String is up to you (such as when it is your own servlet you are configuring), you could pass in something like a comma-separated list of values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.