Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6337819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:19:27+00:00 2026-05-24T19:19:27+00:00

In plain JSP I can get first item by EL ${form.items[0]} , but in

  • 0

In plain JSP I can get first item by EL ${form.items[0]}, but in a JSP tag the same expression throws the following exception:

javax.el.PropertyNotFoundException: Could not find property 0 in class
java.lang.String

The value of ${form.items} is [Ljava.lang.String;@315e5b60.

JSP tag code is:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ attribute name="items" required="true" %>
${items[0]}

JSP code is:

<%@ taglib prefix="t" tagdir="/WEB-INF/tags"%>
<t:input items="${form.items}"></t:input>

Maybe I forgot type of the attribute or something else? Why is the way to access values different in JSP and JSP tag?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:19:28+00:00Added an answer on May 24, 2026 at 7:19 pm

    You need to specify the expeded type of the custom tag attribute. By default, it’s java.lang.String, and the JSP container coerces the attribute to a string before passing it to your tag. It thus calls toString on your String array.

    <%@ attribute name="items" required="true" type="java.lang.String[]" %>
    

    or

    <%@ attribute name="items" required="true" type="[Ljava.lang.String" %>
    

    should do the trick. If neither does, using

    <%@ attribute name="items" required="true" type="java.lang.Object" %>
    

    should, but it’s less clear.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, I lie, it's not really a plain jsp website. It has
given a plain text file, how can I do, using bash, awk, sed, etc,
I have a <form:options> in my jsp for which I have defined the path
Here is my jsp file: <%@ page contentType=text/plain %> <%@ page pageEncoding=UTF-8%><%@ taglib uri='http://java.sun.com/jsp/jstl/core'
We have the following code (listed below) in our JSP. We are seeing the
The question is: I can get the property value from the action class using:
I have been developing a plain JSP/Servlet web application, which focuses mainly in collecting
I can use: return new ModelAndView(viewName, model); Or I use: response.setContentType(text/plain); response.getWriter().print(Hello World!); Now
I want to submit a simple form, but instead of using a button, I
Plain-vanilla NHibernate setup, eg, no fluent NHibernate, no HQL, nothing except domain objects and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.