After experimentation, I guess you can't use the <jsp:getProperty> tag as an attribute of a custom tag, although you can use a JSP expression to achieve the same effect. So, it works, just not the way that I originally tried to do it.

Erik



Erik Price wrote:

Tim Moore wrote:

I have a class I've written and I'd love to find a way to pass it to a custom tag for processing. This would separate the display logic from the business logic.

<jsp:useBean id="user" class="UserBean" />

<ptcbe:mainpagetable src="<%= user.getBudgetList() %>" />


This didn't work?  Just make your tag handler have a method like
setSrc(UserBean src) and that should work fine.

I have written everything according to the spec and now I am running into some kind of a JavaBeans problem. If anyone can help me that'd be great.

1. The servlet has stored a UserBean into the session with the key "user".
2. The JSP pulls the UserBean from the session like this:

<jsp:useBean id="user" class="com.ptc.budgetease.beans.UserBean"/>

3. My new custom tag tries to refer to the bean in one of its attributes:

<ptcbe:brltable size="small" list="
<jsp:getProperty name="user"
property="mainPageBudgetRequestList"
/>"
/>
(it is all on one line in the app, I broke it up for email)

The error I get when I go to the JSP (after passing through the servlet that stores the UserBean in the session) is:


org.apache.jasper.compiler.ParseException: /main.jsp(47,70) Attribute user has no value
at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:563)
at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:681)



Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to