• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

combining Struts Tags & Custom Tags

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to combine Struts Tags & Custom Tags, but i guess it's not possible to struts to bind the struts tags values to the jsp, isn't it?

I have this class:

public class InputTextTag extends TagSupport {

private String property;

public String getProperty() {
return property;
}

public void setProperty(String property) {
this.property = property;
}

public InputTextTag() {

}

public int doStartTag() throws JspException {
try {
JspWriter out = pageContext.getOut();
StringBuffer sb = new StringBuffer();

sb.append("<input type=\"text\"");
sb.append(" name=\""+ property + "\"" );
if (styleId!=null) {
sb.append(" id=\""+ property + "\"" );
} else {
sb.append(" id=\""+ styleId + "\"" );
}
sb.append(" onblur=\"javascript:onBlurEvent(this)\"");
sb.append(" onfocus=\"javascript:onFocusEvent(this)\"");
sb.append(" >");
out.print(sb.toString());

} catch (IOException ioe) {
throw new JspException("Error:IOException while writing to client");
}
return EVAL_PAGE;
}


public int doEndTag() throws JspException {
return EVAL_PAGE;
}

public void release() {
}

public void setPageContext(PageContext pageContext) {
this.pageContext = pageContext;
}

}

using strugs tag in the jsp
<html:text property="shortName" /> the value is NOT empty
using my tag in the jsp:
<myTag:text property="shortName" /> the value is empty

<br>
I guess there is no solution


 
Water proof donuts! Eat them while reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic