File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes combining Struts Tags & Custom Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "combining Struts Tags & Custom Tags" Watch "combining Struts Tags & Custom Tags" New topic

combining Struts Tags & Custom Tags

bela lugosi

Joined: Jul 13, 2009
Posts: 1
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) { = 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(" >");

} 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

I guess there is no solution

I agree. Here's the link:
subject: combining Struts Tags & Custom Tags
It's not a secret anymore!