How to store  double  variable in hash map

i need to store double variable using hash map, but i cant able to store it
my jsp coding contains
double et=24,j=5;
hm.put("stm",st);
hm.put("etm",et);
Generated servlet error
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\exam\org\apache\jsp\availability_jsp.java:752:
put(java.lang.Object,java.lang.Object) in java.util.Map cannot be applied to (java.lang.String,double)
hm.put("stm",st);
^
how to overcome this problem
thank u in advance

double etme;
etme = hm.getDouble("etm");
i'm getting this error
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\exam\org\apache\jsp\editdel_jsp.java:85: cannot resolve symbol
symbol : method getDouble (java.lang.String)
location: interface java.util.Map
etme = hm.getDouble("etm");
^
how to solve it
plz help me

Similar Messages

  • How to store double quote into a string?

    How to store double quote into a string?
    What I mean is:
    suppose I want to save the following sentence into string s:
    What is the syntax?
    Thanks a lot!

    String s = "<a href=\"../jsp/Logout.jsp\">"
    check out this page
    http://java.sun.com/docs/books/tutorial/index.html
    Hope this helps

  • How to store jython variable to java bean shell variable

    Hello experts.
    I have one procedure. here is the details
    1st step is with java bean shell techonolgy and one variable.
    <@
    String testv=" ";
    @>
    Second step is jython technology.
    str3='storing some value as per my logic'
    <@testv@>=str3 // here I am getting error because i want to store jython variable to java bean shell variable
    Once it will be stored , I will use in query as SELECT '<@=testv@>' from dual. If this is not possible is there any way to get the jython variable in side refreshing query
    how to achieve this please suggest.
    Thank you.

    Hello experts. Any suggestion on this. How to store jython variable value into java bean shell variable.
    Thank You.

  • How to create a dicitionary using hash map.

    Hi All,
    I want to create a dictionary using hash map where in i can add new words and there meaning. I have written some code But I am not happy with this. Can you suggest me how to add the words and there meanings to the hash map.
    I am not able to add the words and there meaning to the hash map.
    for this i tried creating a dictionary class.
    // Using hashmap
    import java.util.*;
    public class Dictionary
        public static void main(String[] args)
            // Create a hash map
            HashMap hm = new HashMap();
            // put elements to the map
            hm.put("Abode: ", "Home");
            hm.put("Balance: ", "An intrument to measure or weigh");
            hm.put("Car: ", "Automobile");
            hm.put("Dinner: ","Last meal of the day generally had after evening and before sleeping");
            hm.put("Embossed: ", "Engraved kind");
            Set set = hm.entrySet();
            Iterator i = set.iterator();
            while (i.hasNext())
                Map.Entry me = (Map.Entry) i.next();
                System.out.print(me.getKey() + ": ");
                System.out.println(me.getValue());
            System.out.println();
    }This is the other Dictionary class which i created.
    public class Main_Dictionary
        public static void main(String[] args)
            Content_Dictionary cd = new Content_Dictionary();
            cd.getContent_Dictionary("Abode", "Home");
            cd.displayValues();
    class Content_Dictionary
        String word, meaning;
        Content_Dictionary()
            word = "a";
            meaning = "b";
        Content_Dictionary(String x, String y)
            word = x;
            meaning = y;
        void getContent_Dictionary(String w, String m)
            word = w;
            meaning = m;
        void displayValues()
            System.out.print(word + ": ");
            System.out.println(meaning);
    }If i create an interface containing all the words and there meaning
    public interface Words_Dictionary
        String Abode = "Home";
        String Dark = "Lacking brightness";
        String Balance = "An intrument to measure or weigh";
        String Car = "Type of Automobile";
        String Dinner = "Last meal of the day";
        String Embossed  = "Engraved kind";
        String Adroit = "SkillFul";
    }and then create a another class which implements this interface, but how should i add these words and there meaning in the hashmap.

    I tried creating word document but i was unable to
    figure out how to do the operations on the word
    document and its content,
    So This is what i could come up with, i just created
    one class Dictionary , now I am able to search for
    the meaning of the word specified by me, and I am
    able to print all the words and there meanings added
    to the hashmap, but i am not able to figure out how
    to add a new word and the meaning in the hashmap and
    how to find is a word is there or not...May I suggest a slightly different approach?
    Do not create a String ==> String mapping, but a String ==> List<String> mapping. And do NOT place everything inside your main method.
    Here's a small demo:
    import java.util.ArrayList;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.List;
    public class Dictionary {
        private Map< String, List<String >> dictionary;
        public Dictionary() {
            dictionary = new HashMap< String, List<String >>();
        public void addWord(String base, String meaning) {
            List<String> allMeanings = dictionary.get(base);
            if(allMeanings == null) { // if null, there is no entry mapped to 'base' yet: create a new one
                List<String> newMeanings = new ArrayList<String>();
                newMeanings.add(meaning);
                dictionary.put(base, newMeanings);
            } else {
                allMeanings.add(meaning);
        public List<String> search(String base) {
            // your code here
            return null;
        // ... other methods ...
        public String toString() {
            StringBuilder strb = new StringBuilder();
            for(Map.Entry< String, List<String >> e : dictionary.entrySet()) {
                strb.append(e.getKey());
                strb.append(" : ");
                strb.append(e.getValue());
                strb.append('\n');
            return strb.toString();
        public static void main(String[] args) {
            Dictionary dict = new Dictionary();
            dict.addWord("Abode", "Home");
            dict.addWord("Abode", "House");
            dict.addWord("Car", "Automobile");
            dict.addWord("Car", "Vehicle");
            System.out.println(dict);
    }Good luck.

  • How to store session variables in drop down menu (and radiobutton/checkbox)

    How am I going to store session variables in the drop down menu, radio button, checkbox.
    In text area, I do like below:
    <input type="text" name="membershipno" size="5" maxlength="50" value="<%=((session.getValue("Smembershipno")!=null)?session.getValue("Smembershipno"):"") %>">
    Any idea?

    Hi jeffkyt79, I could have answered this on Expert's Exchange. But I suppose it would be hard as the site is down right now :-(
    Here is sample code for the form:
    <form action="" name="form1">
    <input type="text" name="field1" value="<%
    if (session.getAttribute("field1")!=null) {
    out.println(session.getAttribute("field1"));
    } %>"><br>
    <input type="text" name="field2" value="<%
    if (session.getAttribute("field2")!=null) {
    out.println(session.getAttribute("field2"));
    } %>"><br>
    <input type="text" name="field3" value="<%
    if (session.getAttribute("field3")!=null) {
    out.println(session.getAttribute("field3"));
    } %>"><br>
    <input type="checkbox" name="check1" value="tick"<% if (session.getAttribute("check1")!=null) out.println(" checked"); %>><br>
    <% String selRadio=(session.getAttribute("r1")!=null)?(String)session.getAttribute("r1"):""; %>
    <input type="radio" name="r1" value="yesdot"<% if (selRadio.equals("yesdot")) {out.println(" checked");} %>>
    <input type="radio" name="r1" value="nodot"<% if (selRadio.equals("nodot")) {out.println(" checked");} %>><br>
    <select name="sel">
    <% String selOption=(session.getAttribute("sel")!=null)?(String)session.getAttribute("sel"):""; %>
    <option value="option1"<% if (selOption.equals("option1")) {out.println(" selected");} %>>OPTION 1
    <option value="option2"<% if (selOption.equals("option2")) {out.println(" selected");} %>>OPTION 2
         <option value="option3"<% if (selOption.equals("option3")) {out.println(" selected");} %>>OPTION 3
    </select>
    </form>
    And here's the revised javascript function to put in form1.jsp:
    function newWin() {
    f=document.form1.elements;
    str="?";
    mypage="test2.jsp"; // I've hardcoded the url for testing but you can fix this
    for (i=0;i<f.length;i++) {
    if (f.type=="text") {
    if (f[i].value!="") {
    str=str+f[i].name+"="+f[i].value+"&";
              continue;
         if (f[i].type=="checkbox"||f[i].type=="radio") {
         if (f[i].checked) {
         str=str+f[i].name+"="+f[i].value+"&";
         if (f[i].type=="select-one") {
         str=str+f[i].name+"="+f[i].options[f[i].selectedIndex].value+"&";
    str=str.substr(0,str.length-1);
    // now open the popup
    mypage+=str;
    win=window.open(mypage, 'myname'); // I've left out the winprops but you can fix this
    If you can ask any more questions, could you do it on EE (if possible!!). I know this works because I've tested it.

  • How to store session variable in portal?

    Hi All,
    I have many webdynpro applications in portal. One of them displays list of project numbers read from backend. If user selects a project number and clicks OK button on that view, the same project number should be made available in all the other applications.
    For this purpose, I want to store the project number in the session.
    Is it necessary to create a portal service to store the session variable?
    Thanks and Regards,
    Deepti

    Hi Deepti,
      Through portal eventing you can pass data in the String format from Web Dynpro application to Portal application using WDPortalEventing API. Please check it.
    Regards,
    Ganga.

  • How to store Mapviewer objects (styles,themes,maps) in source control ?

    I'm wondering what's the best way for storing mapviewer data in source control ?
    So far MapBuilder provides the import/export metadata feature but it doesn't do cached map objects. Ideally we need an automated way to backup/restore these objects into a new database instance from source control for a daily build type setup.
    The MapBuilder text format looks promising, in that it supports diffs. Other options include dmp files but then we wouldn't be able to compare versions.
    Has anyone faced this problem ?
    What do the Oracle Mapviewer devs recommend ?
    Thanks.

    Hi,
    What kind of error are you seeing?
    Thanks

  • How to store a text file in a hash table in C#?

    I am fairly new to c#. I am creating a console application project for practice. I am supposed to create a program that reads a text file (it's a poem), store it in a hash table, have two different sorts, and unhash the table. I managed to get the poem read
    by using streamwriter, but now I am not sure how to store it in a hash table. 
    I'm not sure if I am doing this hash table correct, but I made my hash table like this to store the text file: 
          Hashtable hashtable = new Hashtable();
                hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");

    Hi,
    Hashtable in C# represents a collection of key/value pairs which maps keys to value. Any non-null object can be used as a key but a value can. We can retrieve  items from hashTable to provide the key . Both keys and values are Objects.
    Here is a sample about Hashtable,
    Hashtable weeks = new Hashtable();
    weeks.Add("1", "SunDay");
    weeks.Add("2", "MonDay");
    weeks.Add("3", "TueDay");
    weeks.Add("4", "WedDay");
    weeks.Add("5", "ThuDay");
    weeks.Add("6", "FriDay");
    weeks.Add("7", "SatDay");
    //Display a single Item
    MessageBox.Show(weeks["5"].ToString());
    //Search an Item
    if (weeks.ContainsValue("TueDay"))
    MessageBox.Show("Find");
    else
    MessageBox.Show("Not find");
    //remove an Item
    weeks.Remove("3");
    //Display all key value pairs
    foreach (DictionaryEntry day in weeks)
    MessageBox.Show(day.Key + " - " + day.Value);
    >>I managed to get the poem read by using streamwriter, but now I am not sure how to store it in a hash table
    Hashtable hashtable = new Hashtable();
    hashtable[1] = (@"C:\\Documents\\Datastructures\\Input\\Poem");
    But follow your scenario above, you just store a string path to hashtable not a file.
    About saving data to a file, you can use the following code.
    // Write the string to a file.
    System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
    file.WriteLine(lines);
    file.Close();
    Best wishes!
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to store this value in date variable?

    Hi sir,
    i am having one query which is
    select to_char(date '1900-01-01' + 1439/(24*60),'DD/MM/YYYY HH24:MI:ss')from dual;
    when i am running this query i am getting this value: 01/01/1900 23:59:00
    and this value i am inserting in one variable which has date datatype.
    here i am storing like this:
    v_nshiftmax := to_char(date '1900-01-01' + 1439/(24*60),'DD/MM/YYYY HH24:MI:SS');
    while storing getting error: not a valid month
    how to store it in this variable?
    thanks

    964430 wrote:
    why using TO_DATE (), to improve performance avoid function calling if you can do without it, just use v_nshiftmax := date '1900-01-01' + 1439/(24*60); remove TO_CHAR() function only, as you already converted it to date.Please prove to us that TO_DATE(...) is slower that using DATE '...'
    Both are internal functions that take a string and turn it into a date.

  • Hello apple guys, i can't open app store, reminders, contacts, mail(crash), maps, Image Capture, and other apps that comes with Mavericks OS, how i can solve this problem?

    hello apple guys, after installing OS X Mavericks, i can't open app store, reminders, contacts, mail(crash), maps, Image Capture, and other apps that comes with Mavericks OS, how i can solve this problem?

    So is this the way Apple works now? Not solving customers problems? I'm sure so many users have had this problem. I've had, and I reinstalled Mavericks 3 times. Works fine for some days and then several Apple Apps stop working. Is that a way to force us ti update to Yosemite? (I don't want to) and then pay to update some third party programs (i.e. Pro Tools). Also, there are so many 15" MacBooks Pro with graphic problems and of course the guys at the Apple Service Centers always say: "It's the logic board, you can have it replaced, but it's so expensive I would recommend a new Mac".  I really, really miss Steve Jobs!

  • How to use the variables used in the message mapping

    Hi ,
    In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
    I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
    Please guide me how to use the variables declared in the JAVA section in the message mapping .
    Thanks
    Anita Yadav

    Anita,
    I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
    If you declare a variable in the Declaration Section ,
    int i;
    then in any udf you can use if directly. No need to re declare  the variable in the UDF. If you do this, then it becomes a local variable.
    Regards,
    Bhavesh

  • How to clear the variable value in session store?

    I'll try to build form for search. There are LOV and
    search button on form. When user don't select anything then push
    search button, I'd like the report to show query everything. I
    mean the report will show like condition where id like '%'.
    And I send variable between form to report by using session
    store.
    I select nothing in LOV but value that return by LOV is
    not null. It's in stead of old value of LOV.
    Please tell me.. How to clear the variable value in
    session store? I'd like to set it to null. If you have greater
    way to do like this, please tell me.
    Thank you.

    Please suggest on this..
    Thanks.

  • HT1689 I tunes store double charged me for two songs, how do i get them to reverse the double charges off my account? also one song wong load on my iphone but i got charged for it anyway?

    Help
    I-Tunes Store double charged my account for two songs i downloaded on my phone,
    also a song i ordered wont load to my phone but i got charged for it anyway? how do i get ahold of Itunes store to reverse these charges off my account?
    Help
    Raider girl

    Connect the device to the computer.
    In iTunes, select the content desired to sync.
    Sync.
    This is all described in the User's Guide, reading it may be a good place to start.

  • How to store multiline string literal in to java bean shell variable

    Hello Experts
    How to store multiline string literals in java bean shell like we use triple quote for jython variable
    Using Jython
    str=""" helllo
    welcome to my world"""
    above syntax is working but not for java bean shell like below
    String str=""" hello
    welcome to my world""";
    So how to do this in java bean shell. I came to this scenario while storing logs to a variable. I believe there is no solution for storing multiline strings to java bean shell variable.
    <@
    String str="<%=odiRef.getPrevStepLog("MESSAGE")%>";
    @>
    Any suggestion will be highly appreciated.
    Thank You.

    maddythehunk wrote:
    Im trying this but its not working...
    while(billingQueryParamsItr.hasNext()) {
         billingQueryParam = (BillingQueryParam) billingQueryParamsItr.next();
         System.out.println("****** Param Name-->"+billingQueryParam.getParamName());
         String[0] name = billingQueryParam.getParamName(); // giving error ; expected
         //billingItemActionForm.setParamName(billingQueryParam.getParamName());
    Declare the array outside of the loop. Fill the array as you iterate. And stop putting your error messages inside of comments in the code.

  • How to Set a Variable with data from Srouce Data Store

    Hello ODI Experts,
    I have created a Physical & Logical Schema and a Source Data store to pickup data from a database table.
    On the other hand, I have a few variable that I will pass in a web service call (ODIInvokeWebService tool).
    Would yo please guide how I can set variables from my source data store.
    Thanks & Regards,
    Ahsan

    Hello Bos/Damodhar/ODI Experts,
    Doesn't it gives me a less optimized approach picking one column per query (per variable)?
    Lets say, I have to pick 35 columns from a table and put those in 35 variables...It would mean running 35 queries for fetching one record from the database table.
    Doesn't it seem less performance effective (less optimized)..a little scary..any thing better that I can do to make it more optimized?
    Another question, what if multiple new values have come in the DB table, since I am using Refresh Variable, would this variable have multiple values in it?
    Thanks for all your help,
    Ahsan
    Edited by: Ahsan Asghar on 21-Jun-2011 07:46

Maybe you are looking for

  • Multiple Apple tv's

    I love my Apple TV and am thinking about getting one for the bedroom. How many Apple tv's will iTunes recognize? If iTunes does recognize more than one, am I able to stream to both at the same time?

  • Error running Execution plan for 'Project Analytics in PeopleSoft 9.0 '

    Hi , I am running execution plan for Projects Peoplesoft 9.0 (BI Apps version 7.9.6) The issue is the file type data source went thru the database (data warehouse) the tasks that were completed SUCCESS were from the File source only from (SrcFiles).

  • Performance of filtering a report using another report

    Hello, There are really two questions in this post: i) Is there an easier way to select all contacts who have never responded positively to a campaign than to filter our report using the output of another report which selects all contacts who respond

  • Overprint Preview question and another issue...

    Hi... CS4, Win XP. Overprint Preview question: The other day i sent a file for printing (poster) in PDF and CS2 formats. For some reason, the printer converted the file to a .tif and then printed. Parts dropped out... Both the PDF and CS2 files looke

  • When connecting iphone to computer iphoto always loads

    When connecting iphone to my computer iphotos always loads on top. how do I stop iphotos from loading