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

The Archive Base Latest Questions

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

im trying to create an xml data into JSP using a resource file: MyData.properties

  • 0

im trying to create an xml data into JSP using a resource file:

MyData.properties :

nombreOfQuestions=2
question1.description=what is the color?
question1.responseValue1=Red
question1.responseValue2=yellow
question1.responseValue3=white
question2.description=what is the Weight?
question2.responseValue1=70
question2.responseValue2=75
question2.responseValue3=80

myJsp.jsp :

<?xml version="1.0" encoding="UTF-8"?>
<%@ page import="MessageResourcesHelper"%>
<%
 MessageResourcesHelper helper = new MessageResourcesHelper (pageContext, "MyData");
 String nombreOfQuestions= helper.getProperty ("nombreOfQuestions",0);
 %>

<Question>
 <description>what is the color?</description>
 <response>
     <value>Red</value>
     <value>Yellow</value>
     <value>White</value>
 </response>
</Question>

<Question>
  <description>what is the Weight?</description>
  <response>
    <value>70</value>
    <value>75</value>
    <value>80</value>
  </response>
 </Question>

is there any way to use java to recuperate the “description” and the “values” dynamically from myData.properties whatever the nombre of question i have?

  • 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-27T09:16:25+00:00Added an answer on May 27, 2026 at 9:16 am

    After you load the properties file, iterate over the keys.

    For each key, you’ll have a question number, and a property of that question. For each question’s response properties you’ll have a response number, and the response value.

    Create either a map, or a collection, of Question objects. Each Question object has a description property, and a collection of response strings.

    The description property of each Question is set when you iterate over that question’s description property. For each response value property, add the property value to the collection of responses.

    To get it back to XML, you can either expose the question list to the JSP and iterate over each question (and inside that loop, iterate over the question’s responses). Or you could marshall the object directly to XML via any of the normal Java libraries for doing so.

    You don’t really need the number of questions property since they’re enumerated in the property names themselves.

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

Sidebar

Related Questions

I am trying to create an XML file based on data fields from a
I am using XmlReader.Create to retrieve data from an RSS xml file. Then I
I'm trying to create a site that will pull xml nodes into html using
I'm trying to access list data using SSRS 2008. I have created an XML
I am trying to create an XML file, but the XML file needs to
I'm trying to create an xml entry that looks like this using python and
I am trying to create an XML file to conform to someones XSD this
I'm trying to create an XML sitemap using CakePHP, from a table which has
I'm trying to embed a PDF file into a Word document using the OLE
I have this XML file that I parse into its elements and create a

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.