java - JSP How can I get a Hashmap Value from an ArrayList -


I am using JSP on a Tomcat server and have read the contents of an INI file and have an array of Hashmaps Has put in the list. When I see the result of the loop through them;

- INI file -

[General]
item0 = 0
item1 = 1
item2 = 2
item 3 = 3
item 4 = 4

[specific]
item0 = 5
item1 = 6
item2 = 7 item3 = 8
item4 = 9

- My results -

  {General = {item0 = 0, item1 = 1, item 2 = 2, item 3 = 3, item 4 = 4}} & lt; Br> {Specific = {item 0 = 5, item 1 = 6, item 2 = 7, item 3 = 8, item 4 = 9}} & lt; Br> Unfortunately, the server is running a limited version of Tomcat, and there is no access to the Internet on the intranet, so I can not use JSTL, and the company's policy does not allow me. To install JavaBeans.  

Is there any way to get specific value without JSTL or JavaBeans from these results?

i.e. should retrieve item 2 from normal 2 and item 2 should be returned to 2.

If possible, can I change the value of an item and cycle, though the list of updates to the INI file?

You must include public methods to expose the values ​​stored in your data types. Methods such as getInt (string key) and getBoolean (string key) that will validate the stored data and will give it a default value on failure or failure.

You can choose to expand this category and add convenience methods to access settings of known II files.

  public class GeneralSettingsIni SettingsInie {extended static string FILEPATH = "file.ini"; Private Static String KEY_ITEM0 = "item0"; Public general settingsin () {super (file path); } Public int getItem0 () {return super.getInt (KEY_ITEM0); } ...}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -