/** * Overriding method of the heart of the matter. Gets the relative property * and leaves the rest up to the original tag implementation. Sweet. * @return int JSP continuation directive. * This is in the hands of the super class. */ public int doStartTag() throws JspException { // get the original properties originalName = getName(); originalProperty = getProperty(); originalLabelProperty = getLabelProperty(); // request HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); // if we have a label property if (originalLabelProperty != null) { // do the label property first if (getName() == null|| Constants.BEAN_KEY.equals(getName())) { super.setLabelProperty(NestedPropertyHelper.getAdjustedProperty(request, originalLabelProperty)); } else { super.setLabelProperty(originalLabelProperty); } } // set the other properties NestedPropertyHelper.setNestedProperties(request, this); // let the super do it's thing return super.doStartTag(); }
/** * Release the tag's resources and reset the values. */ public void release() { super.release(); // reset the originals originalName = null; originalProperty = null; originalLabelProperty = null; }
/** * Complete the processing of the tag. The nested tags here will restore * all the original value for the tag itself and the nesting context. * @return int to describe the next step for the JSP processor * @throws JspException for the bad things JSP's do */ public int doEndTag() throws JspException { // do the super's ending part int i = super.doEndTag(); // reset the properties setName(originalName); setProperty(originalProperty); setLabelProperty(originalLabelProperty); // continue return i; }
setCollection(string); setFilter(bool.booleanValue()); setLabelName(string); setLabelProperty(string); setName(string); setProperty(string); setStyle(string); setStyleClass(string);
private Tag createSelectTag( String name, String property, Map<String, String> attributes ) { // Select tag SelectTag select = new SelectTag(); // Empty option (if needed) if ( WidgetBuilderUtils.needsEmptyLookupItem( attributes ) ) { OptionTag emptyOption = new OptionTag(); emptyOption.setValue( "" ); JspUtils.addDeferredChild( select, emptyOption ); } // Options tag OptionsTag optionsTag = new OptionsTag(); optionsTag.setName( name ); optionsTag.setProperty( property ); // Optional labelName and labelProperty String labelName = attributes.get( STRUTS_LOOKUP_LABEL_NAME ); if ( labelName != null ) { optionsTag.setLabelName( labelName ); } String labelProperty = attributes.get( STRUTS_LOOKUP_LABEL_PROPERTY ); if ( labelProperty != null ) { optionsTag.setLabelProperty( labelProperty ); } JspUtils.addDeferredChild( select, optionsTag ); return select; }
/** * Process the start tag. * * @throws JspException if a JSP exception has occurred */ public int doStartTag() throws JspException { evaluateExpressions(); return (super.doStartTag()); }
Iterator collIterator = getIterator(collection, null); while (collIterator.hasNext()) { addOption(sb, stringValue, label.toString(), selectTag.isMatched(stringValue)); Iterator valuesIterator = getIterator(name, property); Iterator labelsIterator = null; if ((labelName != null) || (labelProperty != null)) { labelsIterator = getIterator(labelName, labelProperty); addOption(sb, value, label, selectTag.isMatched(value));
/** * Process the start tag. * * @exception JspException if a JSP exception has occurred */ public int doStartTag() throws JspException { evaluateExpressions(); return(super.doStartTag()); }
/** * Resets attribute values for tag reuse. */ public void release() { super.release(); setCollectionExpr(null); setFilterExpr(null); setLabelNameExpr(null); setLabelPropertyExpr(null); setNameExpr(null); setPropertyExpr(null); setStyleExpr(null); setStyleClassExpr(null); }
/** * Resets attribute values for tag reuse. */ public void release() { super.release(); setCollectionExpr(null); setFilterExpr(null); setLabelNameExpr(null); setLabelPropertyExpr(null); setNameExpr(null); setPropertyExpr(null); setStyleExpr(null); setStyleClassExpr(null); }