iterating hashmap values in struts2

iterating hashmap values in struts2

hi, i am not getting how to display this map values in jsp page using struts2

public class ViewOperation2 {

    public Map<String,Object> viewCustDetails(){
        Map<String, Object> m=new HashMap<String, Object>();
        ViewAction2 v=null;
        Connection dbconn=DatabaseConnection.connect();
        try{
            Statement stmt=dbconn.createStatement();
            String sql="select * from customer1";
            ResultSet rs=stmt.executeQuery(sql);
            while(rs.next()){
                v=new ViewAction2();
                v.setId(rs.getString("id"));
                v.setName(rs.getString("name"));
                v.setAddress(rs.getString("address"));
                v.setAge(rs.getString("age"));
                m.put("map", v);
            }
            v.setMap(m);
        }catch(Exception e){
            e.printStackTrace();
        }
        return m;
    }
}
View Answers









Related Tutorials/Questions & Answers:
iterating hashmap values in struts2
iterating hashmap values in struts2  hi, i am not getting how to display this map values in jsp page using struts2 public class ViewOperation2 { public Map<String,Object> viewCustDetails(){ Map<String
Example of values() method of HashMap.
Example of values() method of HashMap. The values() is the method of java HashMap. It returns a collection object of HashMap values.  Code: ...) { /* Create object of HashMap */ HashMap<Integer, String> obHashMap = new
Advertisements
How to get Keys and Values from HashMap in Java?
How to get Keys and Values from HashMap in Java? Example program of iterating... and values from HashMap? This is the most asked questions in the Java... through keys and get the values from a HashMap object. The entrySet() method
Struts2...problem in JSP..unable to get the values for menuTitle!!!
Struts2...problem in JSP..unable to get the values for menuTitle!!!  **Hello everyone... i'm trying to make a dynamic menu from database in struts2...; <filter> <filter-name>struts2</filter-name> <filter
HashMap
HashMap  How to work hashmap and hashset internally
how to display the values of one list in other upon clicking a button in struts2
how to display the values of one list in other upon clicking a button in struts2  Hello friends..Am new to struts2..Please any one has to guide me in struts2.. I have a problem, I have to display the values of one list in other
hashmap
hashmap  write a program that shows the use of Hashmap class
HASHMAP
HASHMAP  HI CAN WE ADD PRIMITIVE DATA TYPE IN HASHMAP IN JAVA 1.5 VERSION . THANKS KALINS NAIK   Java HashMap Example
Hashmap
Hashmap  Hi i want to date and day in hashmap , 1 want to display according to day with date, how to write aprograme
Hashmap
args[]){ HashMap hm=new HashMap(); hm.put(new Integer(2), "Two"); hm.put...*; public class HashTable { public static void main(String args[]){ HashMap hm=new HashMap(); hm.put(new Integer(2), "Two"); hm.put(new Integer(1
HashMap
HashMap  How can you get a HashMap to Display Text onto a Text Field that is defined and Set up to JPanel on a different Class static class public static Map <String, ActionListener> listener = new HashMap <String
Struts2
Struts2  i want select multiple items from select list in struts2.when i did like that the two selected values must saved into databse in two diffirent rows.pls provide any one code for this i am new to Struts2
STRUTS2
STRUTS2  sir but my question is using ApplicationResources.properties in STRUTS 2.i cant get the values into my application.but in the exmple given... along with properties file but i can't get the values from the properties file.plz
struts2
struts2  how to read properties file in jsp of struts2   Hi, You can use the Properties class of Java in your action class.ADS.... Thanks   i want the properties file values in jsp not in action
struts2
struts2  sir.... i am doing one struts2 application and i have to make pagination in struts2....how can i do
struts2
struts2  dear deepak sir plz give the struts 2 examples using applicationresources.properties file
struts2
struts2  hi all i am going to run struts2.x program i got this error when server started java.lang.RuntimeException...: Struts2 Tutorials
struts2
struts2   Sir when i have run my struts 2 web application,every time i get error " request resources is not available",,,what is this,,,plz help me
Struts2
Struts2  java.lang.NullPointerException org.apache.struts2.impl.StrutsActionProxy.getErrorMessage(StrutsActionProxy.java:69... exception while submitting the update form in struts2 I am using tomcat6.0 ... its
Struts2
Struts2  Hi I am using struts 2,In struts2 architecture ,I couldn't understand the purpose of ActionMapper and ActionProxy.My Question is,when the request comes into the picture,the filterdispatcher consult the ActionMapper
Struts2
Struts2  Hi, I need a solution for displaying success message in same page in struts2. how to redirect same page in struts2.Please help me.   hi friend, To know how redirect action can be done in struts 2 you can go
Example of HashMap class in java
Example of HashMap class in java. The HashMap is a class in java collection framwork. It stores values in the form of key/value pair. It is not synchronized
Iterating through pages
Iterating through pages  hello, I have a web page with a table display of 100 records. At the end of the page, we have a button, "Next Page". And the next 100 records will get displayed in the page2. The pages go on wrt
contains for list in struts2 - Struts
contains for list in struts2  Is there any way to check in the list or for existence of an enum ? Something like list.contains(string). iterating over list I want to do something like Display x display y
Struts2 - Struts
Struts2  Hi, I am using doubleselect tag in struts2.roseindia is giving example of it with hardcoded values,i want to use it with dynamic values. Please give a example of it. Thanks
Collection : HashMap Example
returns a set view of all the keys exist in the HashMap. values() : It returns a Collection view of all the values exist in the HashMap. Other methods... of HashMap : "+map.size()); System.out.println("key and values of HashMap
HashMap - Struts
HashMap  Can you please get me an example code for using HashMap in Jsp and what for what purpose it is used
Java HashMap example.
Java HashMap example. The HashMap is a class in java. It stores values in name values pair. You can store null value of key and values.   Here, you will see how to create an object of HashMap class. How to display vlaue
Help in Struts2
Help in Struts2  Hi, in struts 2 how to get the values from db and show in jsp page using display tag or iterator tag thanks in advance
JSON to HashMap
JSON to HashMap  Hi, How to convert a JSON String to HashMap in Java... it to HashMap. Include following in pom.xml file: <dependency> <... following code for conversion of JSON String to HashMap: String jsonString
Example of containsValues method of HashMap.
Example of containsValues method of HashMap. The containsValues is a method of HashMap class. It always returns boolean value. It checks, whether the values is present in HashMap or not.  If the given values is present in map, than
Struts2 and Hibernate
Struts2 and Hibernate   I have a simple application in Struts2... the site. When i am submitting the form with values it saved to database and it shows the values present in the database on the JSP page. But i want the values
Struts2 and Hibernate
Struts2 and Hibernate   I have a simple application in Struts2... the When i am submitting the form with values it saved to database and it shows the values present in the database on the JSP page. But i want the values from
Example of size() method of HashMap.
; obMap = new HashMap<Integer, String>(); /* Add values into HashMap...Example of size() method of HashMap. A HashMap is class of collection framwork.... The size() is also a method of HashMap class. It returns the size of HashMap
Java hashmap, hashtable
Java hashmap, hashtable  When are you using hashmap and hashtable
Differences between HashMap and Hashtable?
Differences between HashMap and Hashtable?  Differences between HashMap and Hashtable
HashMap in Java
HashMap class is used to implement Map interface. The value of HashMap is stored using get() and put(). HashMap provides key-value access to data. HashMap is almost equal to HashTable, the only difference is that HashMap allows null
struts2 excel downloads
struts2 excel downloads  hi friend, how to set Timestamps(Date+time) values to excel sheet cells
Java hashmap clear() method example.
of java HashMap class. It removes all values from HashMap. Code: ...({}); /* Add values into HashMap */ obMap.put(new Integer(1), "... */ System.out.println("HashMap : " + obMap); /*Remove all values from HashMap
struts2 - Struts
Struts2 and Ajax Example  how to use struts2 and ajax
HashMap and HashCode
.style1 { color: #FFFFFF; } HashMap and HashCode The HashMap... methods return equal integer values. Given below example will give you a clear idea... MapHashCode { public static void main(String args[]) { Map mp1 = new HashMap
struts2 - Struts
struts2  how to pre populate the fields using struts2 from the database
Struts2 and Hibernate
Struts2 and Hibernate  how to fetch database value from one page to another page in struts2 and hibernate
query on struts2 - Struts
query on struts2  I am using struts2 for my application.i have a form that contains 'select' tag, for this i am getting values form DB. The problem is after i am submitting the form it is giving the following error
struts2 excel downloads
struts2 excel downloads  hi sir, am new to the real time environment. am going to create excel sheet and setting values to excel sheet from db table dynamically by using Hibernate persistence logic.......am using struts2
Example of remove(Object key) method of HashMap.
;(); (adsbygoogle = window.adsbygoogle || []).push({}); /* Add values into HashMap...); /*Remove values from HashMap*/ (adsbygoogle = window.adsbygoogle...Example of remove(Object key) method of HashMap. In this tutorial, you
Struts2 tag
Struts2 tag  function of hidden tag?   Hi Friend, <s:hidden> tag create a hidden value field.It means it stores the value but cannot be visible. For more information, visit the following link: Struts2 Tutorial
struts2 - Framework
struts2   RoseIndia i m using this code for a bean in struts2.but geting error SEVERE: Could not instantiate bean how to resolve this.thnx
struts2 - Framework
struts2  Hello, I am sathish.. I got problem in stuts2 ? Do tomcat5.5 support struts2 ? Now , currently my application running on tomcat 6... and mainly i want support with tiles(struts 2)...now which struts2 jars i have to use
New to struts2
New to struts2   Please let me know the link where to start for struts 2 beginners   Struts 2 Tutorials

Ads