[Resin-interest] Tag attributes which can't be converted from strings
This didn't fix my problem. I still receive this error: [13:43:28.296] /customercare/screens/include/accountDetails.jsp:850: expected `< %= ... %>' at `${accountDetails.loyaltyJoinDate}' for tag attribute setter `setV alue(java.util.Date)'. Tag attributes which can't be converted from strings mus t use a runtime attribute expression. I use version 3.0.23, and my web.xml starts with: http://java.sun.com/xml/ns/j2ee"; version="2.3"> Vlad On 11/27/06, Scott Ferguson wrote: On Nov 27, 2006, at 9:13 AM, Plat wrote: > Hopefully this is a JSP-newbie question. Pleasepleaseplease let it > be a newbie question! :-) > Somewhat. It's a very annoying feature of the JSP 2.1 spec (and it's required by the TCK, so we can't avoid it.) If you have an old-style web.xml (basically you don't have a namespace declaration), then JSP won't understand the ${...} syntax. You can avoid this by changing your web.xml to start like: http://caucho.com/ns/resin";> (You can also use xmlns="http://java.sun.com/xml/ns/j2ee";). -- Scott > I've recently upgraded from Resin 3.0.14 to 3.0.22. My JSP pages > pass attribute values to JSP Tag Files using EL expressions. Here's > some example code based on my "real" code: > > > <%-- myUser is an instance of the MyUser class --%> > > Although this worked fine in 3.0.14, after upgrading Resin I see > the error: > > expected `<%= ... %>' at `${myUser}' > for tag attribute setter `setUser(MyUser)'. > Tag attributes which can't be converted from strings must use a > runtime > attribute expression. > > The error (thrown from JspNode.java in the Resin source) makes > sense from the standpoint that "MyUser" cannot be converted from a > string. For my purposes it would be very difficult to support full > conversion to/from strings, so MyUser does not support this. > > Now, if I change my tag call to use runtime expressions for such > attributes, everything works how I want it to. > > > <%-- This works great in 3.0.22 --%> > > > So now I'm wondering: > > 1) Is the latter syntax (use of runtime expressions) generally > supported by JSP engines? That is, if I pass such a value using a > runtime expression, am I generally protected from having to change > this again? I was reading through JSR 152 and it seems like I > should be OK, but I'm no pro yet. > > 2) Why is it that "Tag attributes which can't be converted from > strings must use a runtime attribute expression"? Is this a > limitation of Resin, or is this in the JSP specification somewhere? > (Or some implicit requirement of PropertyEditors?) > > > I'm fine with changing my code to use runtime expressions instead, > but I'd really like to understand _why_ I need to do so. > > > Thanks for your insight! ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Tag attributes which can't be converted from strings
Wow... that fixed my problem! But why (how does that work)? Voodoo monkeys? I'm familiar with how XML namespaces work, but not how Resin seems to apply the settings differently. I'm mainly curious whether this is suitable as a long-term solution, or just a short-term patch. I'd hate to have all my tag-file-related code break on a future release of Resin if I can prevent it now. Thanks again. If there's a specific section of an M for me to RTF, let me know and I'll be all over it! :) On 11/27/06, Scott Ferguson <[EMAIL PROTECTED]> wrote: On Nov 27, 2006, at 9:13 AM, Plat wrote: > Hopefully this is a JSP-newbie question. Pleasepleaseplease let it > be a newbie question! :-) > Somewhat. It's a very annoying feature of the JSP 2.1 spec (and it's required by the TCK, so we can't avoid it.) If you have an old-style web.xml (basically you don't have a namespace declaration), then JSP won't understand the ${...} syntax. You can avoid this by changing your web.xml to start like: http://caucho.com/ns/resin";> (You can also use xmlns="http://java.sun.com/xml/ns/j2ee";). -- Scott > I've recently upgraded from Resin 3.0.14 to 3.0.22. My JSP pages > pass attribute values to JSP Tag Files using EL expressions. Here's > some example code based on my "real" code: > > > <%-- myUser is an instance of the MyUser class --%> > > Although this worked fine in 3.0.14, after upgrading Resin I see > the error: > > expected `<%= ... %>' at `${myUser}' > for tag attribute setter `setUser(MyUser)'. > Tag attributes which can't be converted from strings must use a > runtime > attribute expression. > > The error (thrown from JspNode.java in the Resin source) makes > sense from the standpoint that "MyUser" cannot be converted from a > string. For my purposes it would be very difficult to support full > conversion to/from strings, so MyUser does not support this. > > Now, if I change my tag call to use runtime expressions for such > attributes, everything works how I want it to. > > > <%-- This works great in 3.0.22 --%> > > > So now I'm wondering: > > 1) Is the latter syntax (use of runtime expressions) generally > supported by JSP engines? That is, if I pass such a value using a > runtime expression, am I generally protected from having to change > this again? I was reading through JSR 152 and it seems like I > should be OK, but I'm no pro yet. > > 2) Why is it that "Tag attributes which can't be converted from > strings must use a runtime attribute expression"? Is this a > limitation of Resin, or is this in the JSP specification somewhere? > (Or some implicit requirement of PropertyEditors?) > > > I'm fine with changing my code to use runtime expressions instead, > but I'd really like to understand _why_ I need to do so. > > > Thanks for your insight! > ___ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
Re: [Resin-interest] Tag attributes which can't be converted from strings
On Nov 27, 2006, at 9:13 AM, Plat wrote: > Hopefully this is a JSP-newbie question. Pleasepleaseplease let it > be a newbie question! :-) > Somewhat. It's a very annoying feature of the JSP 2.1 spec (and it's required by the TCK, so we can't avoid it.) If you have an old-style web.xml (basically you don't have a namespace declaration), then JSP won't understand the ${...} syntax. You can avoid this by changing your web.xml to start like: http://caucho.com/ns/resin";> (You can also use xmlns="http://java.sun.com/xml/ns/j2ee";). -- Scott > I've recently upgraded from Resin 3.0.14 to 3.0.22. My JSP pages > pass attribute values to JSP Tag Files using EL expressions. Here's > some example code based on my "real" code: > > > <%-- myUser is an instance of the MyUser class --%> > > Although this worked fine in 3.0.14, after upgrading Resin I see > the error: > > expected `<%= ... %>' at `${myUser}' > for tag attribute setter `setUser(MyUser)'. > Tag attributes which can't be converted from strings must use a > runtime > attribute expression. > > The error (thrown from JspNode.java in the Resin source) makes > sense from the standpoint that "MyUser" cannot be converted from a > string. For my purposes it would be very difficult to support full > conversion to/from strings, so MyUser does not support this. > > Now, if I change my tag call to use runtime expressions for such > attributes, everything works how I want it to. > > > <%-- This works great in 3.0.22 --%> > > > So now I'm wondering: > > 1) Is the latter syntax (use of runtime expressions) generally > supported by JSP engines? That is, if I pass such a value using a > runtime expression, am I generally protected from having to change > this again? I was reading through JSR 152 and it seems like I > should be OK, but I'm no pro yet. > > 2) Why is it that "Tag attributes which can't be converted from > strings must use a runtime attribute expression"? Is this a > limitation of Resin, or is this in the JSP specification somewhere? > (Or some implicit requirement of PropertyEditors?) > > > I'm fine with changing my code to use runtime expressions instead, > but I'd really like to understand _why_ I need to do so. > > > Thanks for your insight! > ___ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest
[Resin-interest] Tag attributes which can't be converted from strings
Hopefully this is a JSP-newbie question. Pleasepleaseplease let it be a newbie question! :-) I've recently upgraded from Resin 3.0.14 to 3.0.22. My JSP pages pass attribute values to JSP Tag Files using EL expressions. Here's some example code based on my "real" code: <%-- myUser is an instance of the MyUser class --%> Although this worked fine in 3.0.14, after upgrading Resin I see the error: expected `<%= ... %>' at `${myUser}' for tag attribute setter `setUser(MyUser)'. Tag attributes which can't be converted from strings must use a runtime attribute expression. The error (thrown from JspNode.java in the Resin source) makes sense from the standpoint that "MyUser" cannot be converted from a string. For my purposes it would be very difficult to support full conversion to/from strings, so MyUser does not support this. Now, if I change my tag call to use runtime expressions for such attributes, everything works how I want it to. <%-- This works great in 3.0.22 --%> So now I'm wondering: 1) Is the latter syntax (use of runtime expressions) generally supported by JSP engines? That is, if I pass such a value using a runtime expression, am I generally protected from having to change this again? I was reading through JSR 152 and it seems like I should be OK, but I'm no pro yet. 2) Why is it that "Tag attributes which can't be converted from strings must use a runtime attribute expression"? Is this a limitation of Resin, or is this in the JSP specification somewhere? (Or some implicit requirement of PropertyEditors?) I'm fine with changing my code to use runtime expressions instead, but I'd really like to understand _why_ I need to do so. Thanks for your insight! ___ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest