Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

combining Struts Tags & Custom Tags

 
bela lugosi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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=\"javascriptnBlurEvent(this)\"");
sb.append(" onfocus=\"javascriptnFocusEvent(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


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic