Results 1 to 3 of 3
  1. #1
    nn12 is offline Member
    Join Date
    Sep 2008
    Posts
    85
    Rep Power
    0

    Default JSTL: Help in displaying a particular element

    Hello! I have the below code where I want to display a specific element from the words array. I tried showing a specific element by using items="${words[2]}" but that threw an error.
    Can you please help

    Java Code:
    <% String[] words = { "foo", "bar", "baz"};
    pageContext.setAttribute("words", words); %>
    <%@ taglib prefix="c" uri="<//java sun url here>" %>
    <H2>Key Words:</H2>
    <c:out value="${words[2]}"/>

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    8

    Default Javascript ?

    Are we talking about Javascript here? Because
    Java Code:
    java != javascript;
    This is a Java development forum. If somebody knows the answer to your problem, I'm sure that they will help you out. If you don't get an answer fast, you would probably have better luck at a javascript forum.

    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

  3. #3
    nn12 is offline Member
    Join Date
    Sep 2008
    Posts
    85
    Rep Power
    0

    Default

    This is not javascript. JSTL means JavaServer Pages Standard Tag Library

Similar Threads

  1. jstl in jsp
    By nagaprasanna in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 11-18-2008, 09:18 AM
  2. JSTL forEach Query
    By wonderpets in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 07-14-2008, 07:35 PM
  3. Iterating through result set in JSTL
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-15-2008, 04:13 PM
  4. Iterating through result set in JSTL
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-14-2008, 10:31 AM
  5. JSTL error
    By Eric in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 06-11-2007, 10: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
  •