[ 
http://www.stripesframework.org/jira/browse/STS-514?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=11256#action_11256
 ] 

Frederic Daoud commented on STS-514:
------------------------------------

I've investigated this. The problem is that the useActionBean tag has 
UseActionBeanTagExtraInfo, which tries to tell the container the class of the 
action bean. If you assign beanclass to a String, such as 
beanclass="com.myco.MyActionBean", this works fine. But if you assign it to an 
rtexprvalue, whether it is a dynamic String as in the example above, or a Class 
object such as "${actionBean.class}" or "<%= someClassInstance %>", the 
UseActionBeanTagExtraInfo cannot determine the class of the Action Bean. 
Indeed, TagExtraInfo is given a TagData object, and the Javadocs clearly state 
that translation-time information only is available - request-time expressions 
are not yet available at this point.

The end result is that for rtexprvalues, UseActionBeanTagExtraInfo will either:

1) get a String such as "a.b.c.${beanclass}" (unresolved), and pass that on as 
the class name, causing an error
2) get the javax.servlet.jsp.tagext.TagData.REQUEST_TIME_VALUE Object. This 
object cannot be cast as a String, and causes the error shown above.

I'm not sure what's next. It'd be nice for the beanclass attribtue of 
<s:useActionBean> to work just like the beanclass attribute of all the other 
Stripes tags. I don't know the consequences of changing/removing 
UseActionBeanTagExtraInfo. People who know more in this area, please speak up 
:-)


> Problems with 'beanclass' 
> --------------------------
>
>                 Key: STS-514
>                 URL: http://www.stripesframework.org/jira/browse/STS-514
>             Project: Stripes
>          Issue Type: Bug
>          Components: Tag Library
>    Affects Versions: Release 1.5.1
>         Environment: XP, Tomcat 5.5
>            Reporter: Phil Sladen
>
> a) Assignment to 'var' appears to be missing in 
> UseActionBeanTagExtraInfo.getVariableInfo().
> b) When tag called as:
>     <s:useActionBean beanclass="a.b.c.${beanclass}" var="actionBean"/>
> get:
>     java.lang.ClassCastException: java.lang.Object cannot be cast to 
> java.lang.String
>         at 
> net.sourceforge.stripes.tag.UseActionBeanTagExtraInfo.getVariableInfo(UseActionBeanTagExtraInfo.java:53)
>         at 
> org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:715)
>         at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442)
>         at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2166)
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to