Results 1 to 2 of 2

Thread: JSTL problem

  1. #1
    mihir66 is offline Member
    Join Date
    Mar 2009
    Posts
    2
    Rep Power
    0

    Default JSTL problem

    <sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/fusionpals" user="root" password="root" />
    <sql:query var="users" dataSource="${dataSource}">
    select userid1,userid2 from friends_tbl where userid1=<c:out value="${param.id}"/> or userid2=<c:out value="${param.id}"/>;
    </sql:query>

    <c:forEach var="row" items="${users.rows}">

    <c:choose>
    <c:set var="di" value="${param.id}"/>
    -------->> <c:when test="${row.userid1}==${di}"> ----ERROR PART

    <sql:query var="users" dataSource="${dataSource}">
    select id,firstname from registrationtbl where id=${row.userid2};
    </sql:query>
    <c:forEach var="row1" items="${users.rows}">
    <a href="postscrap.jsp?id=<c:out value='${row1.id}'/>"><c:out value="${row1.firstname}"/></a>
    </c:forEach>
    </c:when>

    <c:otherwise>
    <sql:query var="users" dataSource="${dataSource}">
    select id,firstname from registrationtbl where id=${row.userid1};
    </sql:query>
    <c:forEach var="row1" items="${users.rows}">
    <a href="postscrap.jsp?id=<c:out value='${row1.id}'/>"><c:out value="${row1.firstname}"/></a>
    </c:forEach>
    </c:otherwise>

    </c:choose>

    </c:forEach>

    Hello friends ,
    In above code I am not able to compare to variables
    <c:when test="${row.userid1}==${di}"> // ERROR
    So please help me.....

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    7

    Default

    Java Code:
    <c:if test="${row.userid1}==${di}">

Similar Threads

  1. jstl in jsp
    By nagaprasanna in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-18-2008, 08:18 AM
  2. Problem is getting the data to browser(JSTL)
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 6
    Last Post: 07-15-2008, 03:04 PM
  3. Problem using jstl and displaytags
    By NikhilSrivastava in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 02-18-2008, 11:01 AM
  4. JSTL Exception Handling
    By chaatf in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-18-2007, 02:24 AM
  5. JSTL error
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-11-2007, 09:36 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
  •