I have had other similar issues and I think a very useful enhancement to all
Struts tags would be to make them more granular so that they could be easily
sub-classed and modified. Currently methods such as doStartTag() tend to
have one big lump of code which means if you want to change it behaviour you
have to override it and then duplicate much of the code in the original
method. An example of the kind of structure I'm looking for is below:

>From the CheckboxTag:

  public int doStartTag() throws JspException {

        StringBuffer results = new StringBuffer("<input type=\"checkbox\"");

      results.append(prepareName());
      results.append(prepareAccessKey());
      results.append(prepareTabindex());
      results.append(prepareValue());
        results.append(prepareEventHandlers());
        results.append(prepareStyles());
        results.append(">");

        // Print this field to our output writer
        JspWriter writer = pageContext.getOut();
        try {
            writer.print(results.toString());
        } catch (IOException e) {
            throw new JspException
                (messages.getMessage("common.io", e.toString()));
        }

        // Continue processing this page
        return (EVAL_BODY_TAG);
  }
  protected String prepareName() {
      return " name=\""+this.property+"\"";
  }

  etc. etc.



> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> Matthias Bauer
> Sent: 09 May 2001 11:38
> To: [EMAIL PROTECTED]
> Subject: Re: textarea and wrap
>
>
> I posted a bug report and sent a patch for struts on this one. I
> think this was
> last week. The committers decided not to include it, because the
> wrap attribute
> is not in the HTML spec. This is really unfortunate, escpecially
> because the
> little patch I already provided is just a minor change and would
> be useful for
> pretty many developers, I think.
>
> So what I am doing: I am patching struts locally. You should be
> able to find my
> mail with the patch in the mail-archive.
>
> --- Matthias
>
>
>
> William Jaynes wrote:
> >
> > I usually need 'wrap="virtual"' as an attribute for my textareas. It
> > isn't part of the HTML spec, but it's supported in both Netscape and IE,
> > and it's pretty useful. I wonder how people are dealing with the lack of
> > a "wrap" attribute in the struts textarea tag.
> > --
> > William Jaynes | University of Michigan Medical School
> > [EMAIL PROTECTED] | 734-763-6751

Reply via email to