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

  • Home
  • SEARCH
  • 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 8937825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:28:54+00:00 2026-06-15T10:28:54+00:00

In PHP, I commonly would do something like this: foreach(array(‘street’,’town’,’county’,’postcode’) as $e) { echo

  • 0

In PHP, I commonly would do something like this:

foreach(array('street','town','county','postcode') as $e) {
    echo $address[$e] . '<br/>';
}

It’s concise and easy to work with. Is there any way of doing this in EL? I’m having trouble finding a good way to do it cleanly.

  • 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-06-15T10:28:54+00:00Added an answer on June 15, 2026 at 10:28 am

    There’s nothing like that in standard JSTL/EL, but you could use JSTL fn:split() to split a single delimited string to an array:

    <c:forEach items="${fn:split('street,town,county,postcode', ',')}" var="e">
        ${address[e]}<br/>
    </c:forEach>
    

    (provided that ${address} points to a Map with the given values as keys or a Javabean with the given properties)

    Or if the ${address} is indeed a Map which contains only those keys already, you could also just loop over the Map itself:

    <c:forEach items="${address}" var="entry">
        ${entry.value}<br/>
    </c:forEach>
    

    (the map key can in the above example be printed by ${entry.key}; also note that you need LinkedHashMap in order to maintain insertion order)

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

Sidebar

Related Questions

PHP code: echo date(c); //out put like this 2012-06-19T20:37:44+05:30 echo date(d M, Y); //out
PHP: I have made up a function that returns an array. I would like
(This seems like it should be one of the mostly commonly and easiest addressed
PHP - Access MSSQL datetime column from the returned array Array ( [0] =>
PHP experts, I've been working on this problem for about a day and a
commonly on say PHP or other web frameworks getting the total response time is
I'd like to use C#, Java and PHP in an upcoming project. What potential
An idiom commonly used in OO languages like Python and Ruby is instantiating an
I think one commonly known way of adding PHP to an Apache webserver is
I get this example from http://www.php.net/manual/ru/function.spl-autoload.php#92767 But this causes an error *Fatal error: spl_autoload()

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.