struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From holod <>
Subject How to pass date from action to custom jsp tag?
Date Fri, 05 Nov 2010 19:17:11 GMT

Hello, I want to create simple dummy tag.
I have an action:

class MyAction extends ActionSupport{

  /** Some code*/
  public Department getRoot(){
    /** Some code foes here...*/
    return departmentInstance;

a tag:
<%@tag language="java" pageEncoding="UTF-8"  body-content="empty"  %><%@
attribute name="tree" required="true"%><%@ taglib
uri="" prefix="p"%><p:defineObjects /><%@tag
	Object attrTree = pageContext.getAttribute("tree");
	//some code...
	}catch(Exception e){
		System.out.println("Error while drawing tree["+e.getMessage()+"]");

and my jsp with tag:

<pext:drawTree tree="root"/>

What do I have to do if I want to pass result of MyAction#getRoot to my
dummy tag?

I've tried to these:
<pext:drawTree tree="root"/>
<pext:drawTree tree="#{root}"/>
<pext:drawTree tree="${root}"/>
<pext:drawTree tree="%{root}"/>

Nothing happens, i tag I get String with value "root" or get null. 

I can't pass an object to tag attribute... ((((

What do I do wrong?
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message