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 466449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:28:48+00:00 2026-05-12T23:28:48+00:00

Say I have the following for each in a stripes layout definition <c:foreach items=${foo}

  • 0

Say I have the following for each in a stripes layout definition

<c:foreach items="${foo}" var="bar" >
     <s:layout-component name="whatever" />
</c:foreach>

Then when I render I do something like this

<s:layout-component name="whatever">
    //Do something with bar
</s:layout-component>

The whatever component is rendered before being placed in the layout so bar is null and it fails. Is there a way I can build a whole page before the jsp is parsed?

  • 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-12T23:28:48+00:00Added an answer on May 12, 2026 at 11:28 pm

    Seeing the absence of any answer and the question looking fairly trivial, I don’t think there are many Stripes users out here. so here are my two cents:

    This is definitely a scoping problem. the <s:layout-component> doesn’t have access to the page/loop scope of the parent page. Similar problem exist in JSP/JSTL when you do a <jsp:include> inside a <c:forEach>. The loop variable is inaccessible in the code snippet included by <jsp:include>. But in JSP/JSTL that could be solved by passing a <jsp:param> along the <jsp:include>. I took a quick look in the Stripes documentation and I discovered a <stripes:param>. See if that helps. At least here’s a JSP/JSTL based SSCCE to get the idea:

    main.jsp

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
    <% 
        // Just for demo purposes. Do NOT use scriptlets in real work.
        request.setAttribute("items", java.util.Arrays.asList("foo", "bar", "waa"));
    %>
    
    <c:forEach items="${items}" var="item">
        <jsp:include page="include.jsp">
            <jsp:param name="item" value="${item}" />
        </jsp:include>
    </c:forEach>
    

    include.jsp

    ${param.item}<br>
    

    output:

    foo
    bar
    waa
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have the following html: <ul id=portfolio-list class=clearfix span-24> <li class=2012#foo bar
Let's say I have the following items: ID Category Name 1 Fruit Banana 2
Let's say I have the following HTML: <table id=foo> <th class=sortasc>Header</th> </table> <table id=bar>
Say, I have the following mixins that overlaps with each other by touching dispatch()
Say we have the following method: private MyObject foo = new MyObject(); // and
Let's say I have the following javascript: (function($) { $.getJSON(url, function(data) { $.each(data.rows, function(index,
Say I have the following for a bunch of items. item position item size
Say I have the following models: class Baz(models.Model): winning = models.CharField(max_length=100) class Bar(models.Model): baz
say I have the following string: "Hello there. My name is Fred. I am
lets say we have the following array $myArray = array( foo => value1 ,

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.