Results 1 to 2 of 2
  1. #1
    tim.taylor is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default JSTL-EL: ServletException : Unable to convert to string "${foo}"

    Hi,

    I have a JSP (web.xml is 2.3 DTD) that I have added my own tag to.

    The page unfortunately is full of scriplets and I need to pass a scriplet variable to my new tag. My tag is EL enabled (i.e. it uses the ExpressionEvaluationManager to process its args)

    so I have something like:

    <% MyTopicClass mytopic = (MyTopicClass)iterator.next();
    pageContext.setAttribute("topic", topic);
    %>

    <mytag:footag topicvalue="${topic}"/>

    Now I get

    Unable to convert string "${topic}" to class MyTopicClass for attribute topicitem...

    It as though the ${} sytax is being completely ignored. I read on another forum that you shol use web.xml 2.4 schema rather than 2_3 DTD, but I know of another project that uses JSTL-EL with no issues that is using the 2_3 web.xml.

    Any suggestions.

  2. #2
    tim.taylor is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default

    ok, I figured out what the issue was.

    Mix up with the tag properties type. One is a String (the input property) which is the EL expression, and one is its sibling, the instance of a MyTopicClass which is generated by the expression. I got the input fileds mixed up is al.

Similar Threads

  1. genjar - "Unable to resolve:"
    By angryboy in forum New To Java
    Replies: 0
    Last Post: 06-28-2009, 06:48 AM
  2. Replies: 0
    Last Post: 04-02-2009, 07:02 PM
  3. Convert " ü " into simple " u "
    By nitinb4u in forum New To Java
    Replies: 4
    Last Post: 02-23-2009, 08:35 AM
  4. Replies: 1
    Last Post: 10-20-2008, 07:35 AM
  5. setting JSTL locale "java.util.MissingResourceException"
    By sabelosimelane in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 09-04-2008, 04:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •