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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:50:59+00:00 2026-06-17T22:50:59+00:00

Basically am using jsp:fn:split to construct an array as a parameter passed to bean.

  • 0

Basically am using jsp:fn:split to construct an array as a parameter passed to bean.

The strings are parsed from the warning/cauation elements of the following XML:

<?xml version="1.0" encoding="UTF-8"?>
<task><caution>fs43sd</caution>
<title>aaaa<warning>fsdfas</warning></title>
<warning>asddas</warning><sbsb><warning>fsdasds</warning></sbsb>
<aaaaa>
<bbb><caution>fsdfsd243sd</caution>
<warning>fsdfsd</warning>
</bbb>
</aaaaa>
</task>

And the string array is constructed and parameterized to bean using the following JSP:

<c:set var="wids">
<x:forEach select="$output/descendant::warning" var="warning">
<x:out select="$warning" />,</x:forEach></c:set>
<c:set var="cids">
<x:forEach select="$output/descendant::caution" var="caution">
<x:out select="$caution" />,</x:forEach></c:set>
<jsp:useBean id="wc" class="main.beans.WCBean">
<jsp:setProperty name="wc" property="wids" value="${fn:split(wids, ',')}"/>
<jsp:setProperty name="wc" property="cids" value="${fn:split(cids, ',')}"/>
</jsp:useBean>

And when I print the constructed array using <c:forEach items="${fn:split(wids, ',')}" var="entry">${entry},</c:forEach>:

fsdfas,
asddas,
fsdasds,
fsdfsd,

Note that line breaks are appended to the end of each value. Any thought?


Tried to delete the line break preceding the select and its gone. Guess c:set is treating whatever not jsp tag inside as string literal.

  • 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-17T22:51:00+00:00Added an answer on June 17, 2026 at 10:51 pm

    The line breaks are copied faithfully from those in your XML inside the c:set element.

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

Sidebar

Related Questions

I am rendering a Tree using Jason array that i get from a jsp
I'd like to create a dynamic reporting webpage using JSP. Basically it should contain
Basically I am using some open source code called OrderedDictionary that is derived from
I'm using the JQuery DropdownChecklist as available from here: http://code.google.com/p/dropdown-check-list/ Basically I'm using some
How can I expose a Java bean to a JSP page by using struts?
I have a webpage in which I am using 2 jsp:include directives. Basically one
I have problem using jstl tag <c:if> in jsp file. Basically I should make
I have a jsp/html form that collects an array of choices from user. For
I am developing a user login authentication, using jsp/servlets and glassfish v3. Basically the
Is there any extended JSP taglib available? Basically, because of project constraints, we're using

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.