Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Struts iterating hashmap values in struts2
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


shanta
iterating hashmap values in struts2
0 Answer(s)      2 years and a month ago
Posted in : Struts


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;
    }
}

Advertisement
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
HashMap
HashMap  How to work hashmap and hashset internally
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...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
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
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. Properties...; i want the properties file values in jsp not in action class brother
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
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
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
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  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
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  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
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
Collection : HashMap Example
exist in the HashMap. values() : It returns a Collection view of all the values exist in the HashMap. Other methods are - clear(), clone(), containsKey...("key and values of HashMap : "+map); System.out.println("values
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
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
Differences between HashMap and Hashtable?
Differences between HashMap and Hashtable?  Differences between HashMap and Hashtable
Java hashmap, hashtable
Java hashmap, hashtable  When are you using hashmap and hashtable
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
 

 

 

DMCA.com