* @exception JspException if a JSP exception has occurred
*/
public int doStartTag() throws JspException {
StringBuffer results = new StringBuffer();
ValidatorResources resources = (ValidatorResources)
pageContext.getAttribute(ValidatorPlugIn.VALIDATOR_KEY, PageContext.APPLICATION_SCOPE);
Locale locale = null;
try {
locale = (Locale) pageContext.getAttribute(Action.LOCALE_KEY, PageContext.SESSION_SCOPE);
} catch (IllegalStateException e) { // Invalidated session
locale = null;
}
if (locale == null) {
locale = defaultLocale;
}
Form form = null;
if ((form = resources.get(locale, formName)) != null && "true".equals(dynamicJavascript)) {
MessageResources messages = (MessageResources)
pageContext.getAttribute(bundle, PageContext.APPLICATION_SCOPE);
List lActions = new ArrayList();
List lActionMethods = new ArrayList();
// Get List of actions for this Form
for (Iterator i = form.getFields().iterator(); i.hasNext(); ) {
Field field = (Field)i.next();
for (Iterator x = field.getDependencies().iterator(); x.hasNext(); ) {
Object o = x.next();
if (o != null && !lActionMethods.contains(o)) {
lActionMethods.add(o);
}
}
}
// Create list of ValidatorActions based on lActionMethods
for (Iterator i = lActionMethods.iterator(); i.hasNext(); ) {
ValidatorAction va = resources.getValidatorAction((String)i.next());
String javascript = va.getJavascript();
if (javascript != null && javascript.length() > 0) {
lActions.add(va);
} else {