I've working on an application that will be used by 150 people concurrently.
When Tomcat starts up, I've got a servlet that creates a class that contains
about 800 html input tag hints. For example, when a user clicks into an input
field, the hint for that field displays in the status bar of their browser.
Everytime a user logs in, s/he gets a LoginBean class. This class has a
reference to the HintBean class. All of the html pages have forms that
include in their tags a getProperty such as the following:
<jsp:getProperty name="loginBean" property="childFirstName" />
The relevant parts of LoginBean are as follows:
public LoginBean(HintBeant hints) {
this.hints = hints;
}
public String getChildFirstName() {
return hints.get("childFirstName");
}
So, everyone has their own class with the specific getters for each text
field hint, but all of those getters point to a single class (HintBean) that
is in the application scope.
All of the hints are stored in a HashMap inside the HintBean, so the above
method just calls HashMap.get(String s) to return the hint.
My question is, should I make HintBean.get(String s) synchronized? Or is
there no chance that anyone will get the wrong text? And if not, why not?
Thanks for any help.
--Michael
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>