New to XI (help needed urgent)

hi all i am new to XI . i have just started learning . so if any one have some documents regarding it then plz share with me.iam lookig for the documents in following areas
1. XI Fundamentals.
2. Mapping Concepts.
3. Adapters Concepts.
4. Business Process Management Concepts.
5. Mapping,Adapters and BPM.
i will be grateful to u and ur efforts.
i will also give points for ur efforts.
my id - [email protected]
plz i am looking for all ur helps.
its very urgent
Message was edited by: sanjeev singh

Hi,
This is very good document regargding mapping
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/190eb190-0201-0010-0ab3-e69f70b6c257
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6658bd90-0201-0010-fbb6-afe25fb398d3
Regards,
Prakash

Similar Messages

  • New to java,,,help needed urgently

    I am geeting a compile error..."cannot resolve symbol" in my main class. The program is supposed to prompt the user for five sets of data, and calculate the tax and total of the entered products and print it back to the screen, it is also supposed to calculate the cheapest and most expensive item and print them back. can someone pls shed some light on this error msg, as I cant seem to get my head around it.
    import java .io.*;
    import java.util.StringTokenizer;
    import java.text.NumberFormat;
    import java.util.Locale;
    //set up a class to call on the constructors from the catalogueitem class
    public class Myassg4
         private static final int MAX = 2;//sets the length to 2
         private static CatalogueItem[] prodlist ;//sets array for product list
         NumberFormat cash = NumberFormat.getCurrencyInstance(new Locale("en","AU"));
         private static void main(String[] args) throws IOException
         {//declare the variables and initialize
         double preTotal = 0.00;
         String inString;
         double maximum, lowest;
         double sum = 0.00;
         BufferedReader stdin = new BufferedReader (new
         InputStreamReader(System.in));
         prodlist = new CatalogueItem[];//sets the length (THIS IS WHERE THE PROBLEM OCCURS!!!!)
    System.out.println("Enter 5 sets of data");
         //loop through the array and read the data in
         for(int i = 0;i <prodlist.length;i++)
              inString = stdin.readLine();
              //create a String Tokenizer to read the data separately
              StringTokenizer tok = new StringTokenizer(inString, ":");
    prodlist[i] = new CatalogueItem(tok.nextToken(), tok.nextToken(),
    Double.parseDouble(tok.nextToken()));
    }//end of loop
    //create a header and print the data back to the screen
    System.out.println();
    System.out.println("LISTING OF ALL GOODS");
    System.out.println();
    System.out.println("Cat\tDescription\tExTax\tTax\tIncTax");
    System.out.println("___\t___________\t_____\t___\t______");
    System.out.println();
    for(int j = 0;j <prodlist.length;j++){
    System.out.println(prodlist[j].getCatno()+"\t"+prodlist[j].getDesc()+
    "\t"+prodlist[j].getPrice()+"\t"+prodlist[j].getTax()
    +"\t"+prodlist[j].getIncTax());
    I have errors every where the prodlist is used, I know I am not initializing it correctly but dont know what the alternatives are.

    daniel here is the entire code if you do get a chance can you pls have a look at it for me thanks.
    import java .io.*;
    import java.util.StringTokenizer;
    import java.text.NumberFormat;
    import java.util.Locale;
    //set up a class to call on the constructors from the catalogueitem class
    public class Myassg4
         private static final int MAX = 2; //sets the length to 2
         private static CatalogueItem[] prodlist; //sets array for product list
         NumberFormat cash = NumberFormat.getCurrencyInstance(new Locale("en","AU"));
         private static void main(String[] args) throws IOException
         {//declare the variables and initialize
         double preTotal = 0.00;
         String inString;
         double maximum, lowest;
         double sum = 0.00;
         BufferedReader stdin = new BufferedReader (new
         InputStreamReader(System.in));
         prodlist = new CatalogueItem[5];//sets the length
         System.out.println("Enter 5 sets of data");
         //loop through the array and read the data in
         for(int i = 0;i <prodlist.length;i++)
              inString = stdin.readLine();
              //create a String Tokenizer to read the data separately
              StringTokenizer tok = new StringTokenizer(inString, ":");
    prodlist[i] = new CatalogueItem(tok.nextToken(), tok.nextToken(),
    Double.parseDouble(tok.nextToken()));
    }//end of loop
    //create a header and print the data back to the screen
    System.out.println();
    System.out.println("LISTING OF ALL GOODS");
    System.out.println();
    System.out.println("Cat\tDescription\tExTax\tTax\tIncTax");
    System.out.println("___\t___________\t_____\t___\t______");
    System.out.println();
    for(int j = 0;j <prodlist.length;j++){
    System.out.println(prodlist[j].getCatno()+"\t"+prodlist[j].getDesc()+
    "\t"+prodlist[j].getPrice()+"\t"+prodlist[j].getTax()
    +"\t"+prodlist[j].getIncTax());
    //use this data and call the cheapest method to print
    //the cheapest goods in the catalogue
    System.out.println();
    System.out.println("CHEAPEST GOODS IN THE CATALOGUE");
    System.out.println();
    lowest = cheapest(prodlist, MAX);
    System.out.println("Cat\tDescription\tExTax\tTax\tIncTax");
    System.out.println("___\t___________\t_____\t___\t______");
    System.out.println();
    for(int k = 0;k <prodlist.length;k++){
    if(prodlist[k].getTaxInc == lowest)
    System.out.println(prodlist[k].Catno()+"\t"+prodlist[k].getDesc()+
    "\t"+prodlist[k].getPrice()+"\t"+prodlist[k].getTax()
    +"\t"+prodlist[k].getIncTax());
    //use the listing of all goods and call the most expensive method
    //to calculate and display back on screen
    System.out.println();//create two lines of space in between
    System.out.println();
    System.out.println("MOST EXPENSIVE GOODS IN THE CATALOGUE");
    System.out.println();
    maximun = expensive(prodlist, MAX);
    System.out.println("Cat\tDescription\tExTax\tTax\tIncTax");
    System.out.println("___\t___________\t_____\t___\t______");
    System.out.println();
    for(int l = 0;l < prodlist.length;l++){
    if(prodlist[l].getTaxInc == maximum)
    System.out.println(prodlist[l].Catno()+"\t"+prodlist[l].getDesc()+
    "\t"+prodlist[l].getPrice()+"\t"+prodlist[l].getTax()
    +"\t"+prodlist[l].getIncTax());
    //print the pretax worth of goods by calling the method and display
    System.out.println();//create a two lines of space in between
    System.out.println();
    System.out.println("TOTAL OF PRE-TAX WORTH OF CATALOGUE ITEMS: "+preTaxWorth
    (prodlist));
    //print the avg tax payable per item
    System.out.println();
    System.out.println("AVERAGE AMOUNT OF TAX PAYABLE PER ITEM:"+avgTax
    (prodlist));
    //declare the other methods within the scope of the main class
    public static double cheapest(CatalogueItem[] prodlist, int size)
         double lowest = prodlist[0].getIncTac();
         for(int i = 0; i < size;i++)
              if(prodlist.getIncTax() < lowest)
              lowest = prodlist[i].getIncTax();
         return lowest;
    public static double expensive(CatalogueItem[] prodlist, int size)
         double maximum = prodlist[0].getTaxInc();
         for(int i = 0; i < size; i++)
              if(prodlist[i].getIncTax() > maximum)
              maximum = prodlist[i].getIncTax();
         return maximum;
    public static double preTaxWorth(CatalogueItem[] prodlist)
    {//add all the getPrice's in together
    double preTax = 0; //prodlist[0].getPrice();
    for(int i =0; i <prodlist.length; i++)
         preTax += prodlist[i].getPrice();
    return preTax;
    public static double avgTax(CatalogueItem[] prodlist)
    {//run through the array and add all the getTax amounts up.
         double sum = 0;
         for(int i = 0; i < prodlist.length; i++)
              sum = sum + prodlist[i].getTax();
         //to get the avg we divide the sum by the MAX number of entries
         double Total = sum / MAX;
         return Total;
    }//end of main class
    //CatalogueItem class      
    //catalogue item class
    //ensure that the accesors and mutators
    //are visible and cannot be overridden
    class CatalogueItem
    //declare the data types
    private String catno;
    private String desc;
    private double price;     
    //declare the taxation rate constant
    //but make it visible
    public CatalogueItem(){
         catno = " ";
         desc = " ";
         double price;
    //declare the full constructor
    CatalogueItem (String inCatno, String inDesc, double Price)
         inCatno = catno;
         inDesc = desc;
         Price = price;
    //name accessor---not overidable
    public final String getCatno()
         return catno;
    //name product description accessor--not overidable
    public final String getDesc()
         return desc;
    //name the extax method
    public double getPrice()
         return price;
    //tax utility method
    public double Tax()
    double Tax;     
         Tax = 00.15 * getPrice();
         return Tax;
    //Including Tax method
    public double IncTax()
         double IncTax;
         IncTax = Tax() + getPrice();
         return IncTax;

  • HT201210 i have an error of no 11. kindly help, needed urgently

    i have an error of no 11. kindly help, needed urgently
    when i try to upgrage my
    iphone 3gs wit 4.1 to new latest 5.1
    it gives the erorr of 11. what that mean? Reply as soon as you can !
    thnx

    Error -1 may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.

  • Some J2ME midlets doubts!! help needed urgently!!!

    Hi,
    I am currently working in a company where it does wireless technology like WAP and I am assigned a task of creating a screensaver midlet. I have some doubts on the midlets.
    1) How do i use a midlet suites? From what I heard from my colleagues & friends, a servlet is needed for midlets to interact with one another. is it true?
    2) How do I get the startin midlet to take note the phone is idling so that the screen saver midlet can be called?
    Help needed urgently... if there is any source codes for me to refer to would be better... Thanks...
    Leonard

    indicates that MIDlet suites are isolated (on purpose) from each other, so you can't write over another one's address space.
    Also, I believe (at least on cell phones) that you have to specifically enter the Java Apps mode; unless you do the app won't execute. If you are in Java apps mode and a call comes in, the cell's OS puts the Java app currently executing on "Pause" mode and switches back to phone mode.
    Not sure if you will be able to have a Java app do that automatically.
    BTW why do you need a screensaver on an LCD display? Is it really intended to show an advertisement?
    Download and real all the docs you can from Sun, once you get over the generic Java deficiencies MIDlet's aren't that hard.

  • Load bar at start up, then shut down. HELP NEEDED URGENTLY!!! plss....

    Load bar at start up, then shut down. HELP NEEDED URGENTLY!!! plss..

    The startup disk may need repairing.
    Startup your Mac while holding down the Command + R keys so you can access the built in utiliites to repair the startup disk if necessary or restore OS X using OS X Recovery

  • Help needed urgently on a problem..plzzz

    hi..this is a linear congruential generator. I have to implement it and i need the execution time for the program.
    for your understanding i'm providing an example below.
    Xn=(( a* xn-1 )+b) mod m
    If X0=7 ; a = 7 ; b =7 ; m=10
    Then
    X0 = 7
    X1 =((7 * 7) + 7))mod 10 = 6
    X2 = ((6*7)+7))mod 10 = 9
    X3 = ((9*7)+7) mod 10 = 0
    X4 = ((0*7)+7) mod 10 = 7
    Now since the cycle is being repeated i.e 7 appears again�so the period is 4 coz there are 4 diff nos. i.e 7,6,9,0�..
    help required urgently....your help will be appreciated...thankyou..

    Hi,
    I wrote the code so that it catches any cycle (not only the "big" one).
    Otherwise it will enter infinite loop...
    The time complexity is O(N*logN): it can do at most N iterations (here N is your 'm'), and in each iteration there can be O(log N) comparisons (since I maintain TreeSet).
    Interesting issue: is it possible to supply such (x0, a, b, m) tuple such that all possible values from 0 to m-1 will be output? I think no :)
    Here is the program:
    package recurr;
    import java.util.TreeSet;
    import java.util.Comparator;
    public class Recurrences {
         private static long x0, a, b, m;
         private static TreeSet theSet;
         public static void main(String[] args)
              long l0, l1, l2, l3;
              try {
                   x0 = Long.parseLong(args[0]);
                   a = Long.parseLong(args[1]);
                   b = Long.parseLong(args[2]);
                   m = Long.parseLong(args[3]);
              } catch(NumberFormatException nfe) {
                   nfe.printStackTrace();
              System.out.println("X[0]: " + x0 + "\n");
              long curr = x0;
              boolean cut = false;
              int i;
              // initialize the set
              theSet = new TreeSet(new LongComparator());
              // we can get at most m distinct values (from 0 to m-1) through recurrences
              for(i=1; i <= m; ++i) {
                   // iterate until we find duplicate
                   theSet.add(new Long(curr));
                   curr = recurrence(curr);
                   if(theSet.contains(new Long(curr))) {
                        cut = true;
                        break;
                   System.out.println("X[" + i + "]: " + curr + "\n");
              if(cut) {
                   System.out.println("Cycle found: the next will come " + curr + "\n");
              } else {
                   System.out.println("No cycle found!");
              System.out.println("----------------------------------");
              System.out.println("Totally " + (i-1) + " iterations");
         private static long recurrence(long previous)
              return (a*previous + b)%m;
         static class LongComparator implements Comparator
              public int compare(Object o1, Object o2)
                   if(((Long)o1).longValue() < ((Long)o2).longValue()) {
                        return -1;
                   } else if(((Long)o1).longValue() > ((Long)o2).longValue()) {
                        return 1;
                   } else return 0;
    }

  • Help needed Urgently- Rebate based on collected amount

    Dear all,
    I come across scenario while discussiion with client that they require rebate with collection. Details of the requirement are given below:
    1. SAP rebates run on billed values & set the accrual in rebate agreement on the rate what we have specified in the rebate agreement. Requirement is that, If i have billed on 1000$ & my accrual value is 100$ with the rate of 10%. If i collected 800$ instead of 1000$, then i need to pay the accrual on the basis of 800$ not on the basis of 1000$. It means i have to adjust accrual amount on the basis of 800$. Conclusion is that i have to pay not 100$ accrual instead less then 100$ on the basis of 800$ which i collected.
    2. In month 1 have billed on 5000$, my accrual amount is 500$ with rate of 10%. In the 2nd month i have to bill 1000$ and i have given an discount of 500$, it means my billed value is 500$ and my accrual amount is 50$@10%. In month 3 again i billed 500$ and my accrual amount is 50$@10%.
    Requirement is that, when i am going to pay the accrual to client, i should pay correct accrual for which he is entitled for. Means i should pay 100$ accrual not 600$ because i have already given an discount of 500$. Discount which i have given already of 500$ should need to be offest with the first month accrual of 500$. So remaning accrual is 100$.
    Great if somebody can help me out for the solutioning of the above requirements.

    Thanks Ivano,
    Somebody has started the conversation.
    Let me put my questions again.
    This requirement is nothing to do with Payment procedure in the agreement type.
    1. In any month if i billed 1000$, so my account receivable would be 1000$. My rebate for that month is 100$ at the rate of 10%. During customer receipt if i collected against my invoice 900$ instead of 1000$, my accrual needs to be corrected 90$ instead of 100$.
    I know this can not be fullfilled by standard SAP, by any thoughts on this welcomed.
    2. I know Rebate can be settled partially or full settlement by payment method( by cheque, bank transfer, or by credit memo) we have configure in rebate agreement type. But here requirement is totally different.
    Here, i need to pay the Rebate as a Discount instead of by cheque or by credit memo. While doing the partial or full settlement system will take into account collected accrual up to that day & apply as a discount to the final bill.
    Scenario is like that sometimes customer asked to give us the discount on bill for whatever they accrued so far.
    This is again cannot solved by standard SAP, but any thought by any body welcome. We have already thought that we need to enhance the solution.
    Solution needed urgently.

  • New to Java:   Help Needed

    Hi,
    I am writing a utility to monitor all the objects created by my application. I want to be able to get not only values of class variables(for which the reflection package seems pretty useful), but also instance variables.
    For example.
    public class myClass {
    //Constructor
    public myClass(int i) {
    // another class instantiates this one
    myClass mc = new myClass(10);
    myClass mc1 = new myClass(20);
    I need to keep track of the the handles mc and mc1 and the
    other initializations they do based on the value passed at runtime.
    Is there a way to to this. Or even better, is there someplace in Java which stores all the objects instantiated and their handles?
    Any suggestions would be greatly appreciated.
    Thnx
    cvsan

    How do I access private and proteced variables. By default only the public variables are accessible via the reflect class as in the example below.
    Class c = rc.getClass();
    String s = c.getName();
    System.out.println(s);
    try { abcField = c.getField("abc");
    where abc is a public instance variable. If abc is a private instance variable, the above example fails.
    Is there any way to override the data hiding feature of Java?
    Thanks
    cvsan

  • Unable to allocate 27160 bytes.........Help needed urgently

    hi
    in my production database in getting this error..
    ORA-04031: unable to allocate 27160 bytes of shared memory ("shared
    pool","unknown object","sga heap(1,0)","session param values")
    help needed urgently

    If you have a program that does not use bind variables you can get this error.
    In such cases you do not want to increase the size of the shared pool, but reduce it, and flush regularly. This is a bug in the application and should be fixed to use bind variables.
    Another possible workaround is setting cursor_sharing = force, but this can cause other problems, so should only be used as a last resort. If the apps connections can be distinguished by user account or machine, then a log on trigger could be set cursor_sharing just for that application, to limit the damage until the vendor can fix it.

  • New motherboard faulty boot help needed urgently

    So i just baught my new amd athlon  64 3000 +with a msi k8mm3 mainboared. when i finshed installing it and booted it up it detects both hard drives and all the memory. then it says "loading dmi pool .........." then the maxtor drive overlay splash appears. after that it goes to where you can select to start in safe mode and what ever you select it loads for a second and then restarts and does the same thing again. i've tried changing the power supply, leads, reset the cmos and unplugged all unnessery equipment but it still does it. any help will be appreciated.
    here's my spec
    HD (1) western digital 40gb  (windows xp home OS installed)
    HD (2) maxtor 200gb
    ATI radeon 9600xt 256mb graphics card
    350 watt power supply
    cd rom
    floppy 

    If this is a current system in where you had Windows installed and you just replaced those parts, then you will have to do a repair/install of windows due to different chipset drivers and whatnot. This might prevent you from having to do a complete format/re-install. Otherwise you might have to completely format your system. No other way around it.

  • Java Progrramming HELP, Needed Urgently, T hanks

    hey guys,
    I have this lab I need to be done tomorrow, its been weeks lol of thinking and figuring things out can someone make it work ? Pleaseeeee !
    I feel like going out and yelling for help lol I have been trying to figure this out for weeks now.
    I am pasting my Lab and My Codes I did so far, And Please I really need this done today at any rate, all help would be kindly appreciated.
    A Java program is required that will produce a number of reports based on the data from the Product file. This file contains the product name, cost, quantity and UPC. The file name must be input. Valid data from the file will be loaded into an array.
    A menu will provide the following options: (Note there are changes from previous assignment.)
    1     Display of all valid product information including extended price and GST including totals sorted by name.
    2     Display of all invalid records sorted by name.
    3     Search and display a certain product by name.
    4     Sort by UPC and use a binary search and display a certain product by UPC. (valid records)
    9 Exit.
    Processing requirements:
    Input the data from a file and load the records into an object array. Use this object array to produce the above reports.
    Code a class definition exactly as given in the following UML.
    (For specific students: you may code the UPC as an integer but if not numeric throw an exception that is handled in main. Document your choice in your submission).
    Product
    ? Name : String
    ? UPC : String
    ? Cost : Real
    ? Quantity : Integer
    + Product (Name : String, UPC : String, Cost : Real, Quantity : Integer)
    + Calculate Extended Cost() : Real
    + Calculate GST(): Real
    Input Record:
    Product name: String
    UPC: String
    Cost: real
    Quantity: integer
    Output Reports
    1. Display of all product information including extended cost and GST including totals of these 3 fields.
    Following is a sample of the output required:
    ************************ Product Cost REPORT ****************************
    Product                    Cost Quantity Extended Cost     GST     Total Cost
    Diamond Necklace 12345678901x 54,321.99 188 10,212,534.12 510,626.71 10,723,160.83
    Tissues 98989898989x 1.99 2 3.98      0.20     4.18
    TOTALS                         10,212,538.10 510,626.91 10,723,165.01
    2. Display of all invalid records and the count.
    Following is a sample of the output required:
    Invalid UPC Records = 1
    Count Record
    1          Tiara Diamond, 12345678901x, 36020.00, 2
    3. Search and display a certain product by name. Display appropriate message if not found.
    Following is a sample of the output required:
    Enter product name: CrownJewels
    CrownJewels 99999999991x     100,000.00 1 100,000.00 5,000.00 $105,000.00
    6. Display the product information sorted by name
    Following is a sample of the output required:
    ************************ Product Cost REPORT ****************************
    Product                    Cost Quantity Extended Cost     GST     Total Cost
    CrownJewels 99999999991x 100,000.00 1 100,000.00 5,000.00 $105,000.00
    Diamond Necklace 12345678901x 54,321.99 188 10,212,534.12 510,626.71 $10,723,160.83
    Pearls      88888888881x 10,000.00 1 10,000.00 500.00 $10,500.00
    RubyRing      77777777771x 10,000.00 1 10,000.00 500.00 $10,500.00
    Tissues      98989898989x 1.99 2 3.98 0.20     $4.18
    TOTALS          (complete these values)           xxx           xxx      xxx
    Java coding requirements for this assignment
    Main methods required
    1.     Load array with all records. Display exception messages only for records that have invalid data in any of the fields. Return array of valid records and logical size.
    2.     Validate the UPC. Display each report when requested from the menu.
    3.     Justify the data in the columns. Right justify numeric fields; left justify the alpha fields.
    4.     A method for each report required in the menu.
    Class methods
    5.     Use the object method for the extended cost.
    6.     Use the object method for the GST.
    You may use additional methods in the main program but do not add any methods in the class definition.
    Use DecimalFormat for rounding.
    Create an array to hold the objects. Assume that we only need to process a file of a maximum of 500 records but the file may be larger than 500 records.
    A Universal Product Code consists of 12 digits. The first digit (from the left) is the UPC type. The next five digits are the Manufacturer code. The next five digits are the product code which is assigned by the manufacturer. The final digit is the check digit. A person can determine the check digit of a Universal Product Code by doing the following:
    Step 1: Sum all of the digits in the odd positions together.
    0+4+0+1+5+9 = 19
    Step 2: Multiply the sum from Step 1 by 3.
    3 * 19 = 57
    Step 3: Sum all of the digits in the even positions together.
    6+2+0+1+8 = 17
    Step 4: Sum together the results from Step 2 and Step 3.
    17 + 57 = 74
    Step 5: Subtract the sum from the next highest multiple of 10.
    80 - 74 = 6 [check digit]
    TEST DATA:
    Step 1: Create 5 or MORE additional records that will test all conditions. Include these in your documentation. Identify what field is tested in your test data. (Example: error in each field of the record, rounding up, rounding down, valid UPC, invalid UPC, formatting of report, file too large
    Step 2: Use the file attached.
    GODDDDDDDDDDDDDD lol pasting it made me go crazy,
    these are my codes so far, HOwever the problem is ONLY DISPLAY MENU SHOWS, nothing else even though i have enough codes that it can show something,
    My codes are as follows:
    I am working on Eclipse.
    import java.util.Arrays;
    import java.util.Scanner;
    import java.io.*;
    import java.util.*;
    import java.io.IOException;
    * Name : Sana Ghani
    * Date : July 10
    public class lab56
         public static Scanner file;
         public static Scanner parse;
         public static Scanner input = new Scanner(System.in);
         public static Scanner searchInput = new Scanner(System.in);
         public static void main(String[] args) throws Exception
              Product1[] validProduct = new Product1[500];
              int logicalSize = 0;
              int menuChoice=0;
              String FileName = getFileName();
              displayMenu();
              switch(menuChoice)
              case 1:
                   displayAllValidRecords(validProduct, logicalSize);
                   try
                   // Open an output stream
                   OutputStream fout = new FileOutputStream ("myfile.txt");
                   // Print a line of text
                   new PrintStream(fout).println ("hello world!");
                   // Close our output stream
                   fout.close();          
                   // Catches any error conditions
                   catch (IOException e)
                        System.err.println ("Unable to write to file");
                        System.exit(-1);
                   break;
              case 2:
                   break;
              case 3:
                   binarySearchByName( validProduct,logicalSize);
                   break;
              case 4:
                   break;
              case 5:
                   break;
              menuChoice = displayMenu();
         public static void display(Product1[]validProduct, int logicalSize)throws Exception
              String Product, UPC;
              double Cost;
              int Quantity;
              for(int index =0; index<logicalSize; index++)
                   Product = validProduct[index].GetName();
                   UPC = validProduct[index].GetUPC();
                   Cost=validProduct[index].GetCost();
                   Quantity=validProduct[index].GetQuantity();
                   System.out.println(Product+"\t\t"+UPC+"\t\t"+Cost+"\t\t"+Quantity);
         public static String getFileName()
              String fileName;
              Scanner input = new Scanner(System.in);
              System.out.print("Please enter a file name: ");
              fileName = input.next();
              return fileName;
         public static int displayMenu()
              int menuChoice;
              boolean validFlag = false;
              do
                   System.out.println("\n\n*************************************");
                   System.out.println(" Product Display Menu ");
                   System.out.println("*************************************");
                   System.out.println("(1)Display All Records");
                   System.out.println("(2)Display All Invalid Records");
                   System.out.println("(3)Search by Product Name");
                   System.out.println("(4)Sort by Product Name");
                   System.out.println("(5)Exit");
                   System.out.println("*************************************");
                   System.out.print("Enter your choice(1-5): ");
                   menuChoice = input.nextInt();
                   if ((menuChoice >= 1) && (menuChoice <= 5))
                        validFlag = true;
                   if (!validFlag)
                        System.out.println("You have chosen " + menuChoice + ", " + menuChoice +
                        " is not valid. Please try again");
              }while(!validFlag);
              return menuChoice;
         public static String loadArray(Product1 [] ValidProduct, String fileName)throws Exception
              int logicalSize=0;//will always have to declare
              String record;//will always have to declare
              String Product, UPC;//variable names from
              double Quantity;
              double Cost;
              Scanner file = new Scanner(new File(fileName));//open
              record = file.nextLine();//read a line
              record = file.nextLine();//read a line
              for(int index = 0; index < ValidProduct.length && file.hasNext(); index++)//check to see if the file has data
                   record = file.nextLine();
                   parse = new Scanner(record).useDelimiter(",");
                   String Name = parse.next();
                   UPC = parse.next();
                   Cost = parse.nextDouble();
                   Quantity=parse.nextDouble();
                   ValidProduct[index] = new Product1 ( Name, UPC, Cost, (int) Quantity);
    //               create the object-- call the constructor and pass info
                   logicalSize++;
              return logicalSize+".txt";
         public static double roundDouble(double value, int position)
              java.math.BigDecimal bd = new java.math.BigDecimal(value);
              bd = bd.setScale(position,java.math.BigDecimal.ROUND_UP);
              return bd.doubleValue();
         * This method will print report about valid records
         public static void displayAllRecords( Product1[]valid, int ValidProduct,
                   Product1[] invalid, int InvalidProduct)
    //          Print valid records
              displayAllValidRecords(valid, ValidProduct);
    //          Print invalid UPC records
              displayAllValidRecords(invalid, InvalidProduct);
         public static void displayOneRecord(Product1[]valid, int index)
              double extendedCost, GST, SumofGST = 0, // Total Extended Cost
              totalCost, SumOfTotalCost = 0; // Total Extended Cost + GST
    //          Print title
              System.out.println(leftJustify("Product", 50) +
                        leftJustify("UPC", 15) +
                        rightJustify("Cost", 10) +
                        rightJustify("Quantity", 5) +
                        rightJustify("Extended Cost", 15) +
                        rightJustify("GST", 5) +
                        rightJustify("Total Cost", 13));
              extendedCost = valid[index].CalculateExtendedCost();
              extendedCost = roundDouble(extendedCost, 2);
              GST = valid[index].CalculateGST();
              GST = roundDouble(GST, 2);
              totalCost = extendedCost + GST;
              totalCost = roundDouble(totalCost, 2);
    //          justify method ensures all values are of the same size
              System.out.println(//leftJustify(i+"",3) + ": " +
                        leftJustify(valid[index].GetName(), 50) +
                        leftJustify(valid[index].GetUPC(), 15) +
                        rightJustify(valid[index].GetCost()+"", 10) +
                        rightJustify(valid[index].GetQuantity()+"", 5) +
                        rightJustify(extendedCost+"", 10) +
                        rightJustify(GST+"", 10) +
                        rightJustify(totalCost+"", 10));
         * This method will print report about valid records
         public static void displayAllValidRecords( Product1[]valid, int validCounter)
              double extendedCost, sumOfExtendedCost = 0, // Total Extended Cost
              GST, sumOfGST = 0, // Total GST
              totalCost, sumOfTotalCost = 0; // Total Extended Cost + GST
              System.out.println("************************ XYZ Product " +
                        "Cost REPORT ****************************" +
    //          Print title
              System.out.println(leftJustify("Product", 50) +
                        leftJustify("UPC", 15) +
                        rightJustify("Cost", 10) +
                        rightJustify("Qty", 5) +
                        rightJustify("Extended Cost", 15) +
                        rightJustify("GST", 5) +
                        rightJustify("Total Cost", 13));
    //          Print Records
              for(int i=0; i<validCounter; i++)
                   extendedCost = valid.CalculateExtendedCost();
                   extendedCost = roundDouble(extendedCost, 2);
                   GST = valid[i].CalculateGST();
                   GST = roundDouble(GST, 2);
                   totalCost = extendedCost + GST;
                   totalCost = roundDouble(totalCost, 2);
    //               justify method ensures all values are of the same size
                   System.out.println(//leftJustify(i+"",3) + ": " +
                             leftJustify(valid[i].GetName(), 50) +
                             leftJustify(valid[i].GetUPC(), 15) +
                             rightJustify(valid[i].getClass()+"", 10) +
                             rightJustify(valid[i].GetQuantity()+"", 5) +
                             rightJustify(extendedCost+"", 10) +
                             rightJustify(GST+"", 10) +
                             rightJustify(totalCost+"", 10));
                   sumOfExtendedCost += extendedCost;
                   sumOfGST += GST;
                   sumOfTotalCost += totalCost;
         private static void sortByName(Product1 [] ValidProduct, int logicalSize) throws Exception
              Product1 temp;
              for (int outer = logicalSize-1; outer > 1; outer --)
                   for (int inner = 0; inner < outer; inner ++)
                        if (ValidProduct[inner].GetName().compareToIgnoreCase(ValidProduct[inner+1].GetName())>0)
                             temp = ValidProduct[inner];
                             ValidProduct[inner] = ValidProduct[inner + 1];
                             ValidProduct [+ 1] = temp;
         public static void binarySearchByName(Product1 [] ValidProduct, int logicalSize)
              int high = logicalSize - 1;
              int low = 0;
              int mid = 0;
              int count = 0;
              int compare = 0;
              boolean found = false;
              System.out.print("Enter a product name");
              String product = input.nextLine();
              while (high >= low && !found)
                   count += 1;
                   mid = (high + low) / 2;
                   compare = ValidProduct[mid].GetName().compareToIgnoreCase(product);
                   if (compare == 0)
                        System.out.println("Found: " + ValidProduct[mid].GetName());
                        found = true;
                   else if (compare < 0)
                        low = mid + 1;
                   else
                        high = mid - 1;
              if (!found)
                   System.out.println(product + " not found.");
              System.out.println(count + " steps");
              System.out.println();
         public static String leftJustify(String field, int width)
              StringBuffer buffer = new StringBuffer(field);
              while (buffer.length() < width)
                   buffer.append(' ');
              return buffer.toString();
         public static String rightJustify(String field, int width)
              StringBuffer buffer = new StringBuffer(field);
              while (buffer.length() < width)
                   buffer.append(' ');
              return buffer.toString();
         public static void displayValidRecords(Product1 [] ValidProduct, int logicalSize) throws Exception {
              long longMAX_POSSIBLE_UPC_CODE = 999999999999L;
              // set input stream and get number
              Scanner stdin = new Scanner(System.in);
              System.out.print("Enter a 12-digit UPC number: ");
              long input =stdin.nextLong();
              long number = input;
              // determine whether number is a possible UPC code
              if ((input < 0)|| (input > longMAX_POSSIBLE_UPC_CODE)) {
                   // not a UPC code
                   System.out.println(input +"is an invalid UPC code");
              else {   
                   // might be a UPC code
                   // determine digits
                   int d12 = (int) (number % 10);
                   number /= 10;
                   int d11 = (int) (number % 10);
                   number /= 10;
                   int d10 = (int) (number % 10);
                   number /= 10;
                   int d9 = (int) (number % 10);
                   number /= 10;
                   int d8 = (int) (number % 10);
                   number /= 10;
                   int d7 = (int) (number % 10);
                   number /= 10;
                   int d6 = (int) (number % 10);
                   number /= 10;
                   int d5 = (int) (number % 10);
                   number /= 10;
                   int d4 = (int) (number % 10);
                   number /= 10;
                   int d3 = (int) (number % 10);
                   number /= 10;
                   int d2 = (int) (number % 10);
                   number /= 10;
                   int d1 = (int) (number % 10);
                   number /= 10;
                   // compute sums of first 5 even digits and the odd digits
                   int m = d2 + d4 d6 d8 + d10;
                   int n = d1 + d3 d5 d7 + d9 + d11;
                   // use UPC formula to determine required value for d12
                   int r = 10 - ((m +3*n) % 10);
                   // based on r, can test whether number is a UPC code
                   if (r == d12) {
                        // is a UPCcode
                        System.out.println(input+" is a valid UPC code");
                   else {   
                        // not a UPCcode
                        System.out.println(input+" is not valid UPC code");
    Any help would be great thanks !!
    Take care,

    1) It's your problem that you waited until the last minute before you went for help...not ours. We'll give your problem the same attention as anyone elses...therefore your problem isn't any more urgent than any other problem here.
    2) I don't intend on doing your entire assignment. Nor do I intend on reading all of it. If you need help with a specific requirement, then post the information/code relevant to that requirement. I don't know how to help you when you bury the problem inside a 9 mile long essay.
    3) Post code in tags so it's formatted and readable. (there's a *code* button up above that makes the tags for you).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help neede urgently(Problem in adding exponential numbers)

    Hi,
    Actually i want to add the contents of two files which contains exponential numbers.
    i'm not able to add these numbers. Can any one help me?
    import java.io.*;
    import java.nio.*;
    class  userFile
         public static void main(String[] args) throws IOException
              try
                   BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
              String s1,s2,s3;
              FileReader fr1,fr2;
              System.out.println("Enter first file :");
              s1=br.readLine();
              System.out.println("Enter second file :");
              s2=br.readLine();
              System.out.println("Enter new file :");
              s3=br.readLine();
              fr1= new FileReader(s1);
              fr2= new FileReader(s2);
              BufferedReader fin1=new BufferedReader(fr1);
              BufferedReader fin2=new BufferedReader(fr2);
              String str1,str2,str3;
              double i1,i2,i3;
              OutputStream fout=new FileOutputStream(s3);
              while((str1=fin1.readLine()) != null)
                   while((str2=fin2.readLine()) != null)
                   i1=Float.parseFloat(str1);
                   System.out.println(i1);
                   i2=Float.parseFloat(str2);
                   System.out.println(i2);
                   i3=i1+i2;
                   System.out.println("i3=" +i3);
                   str3 = Float.toString(i3);
                   byte buf[]=str3.getBytes();
                   fout.write(buf);
                   fout.write('\n');
              catch(NumberFormatException e)
                   System.out.println(e);
    }I need help urgently.
    Thanks in advance.

    By "exponential number, do you mean one in scientific notation (eg. -1.55743e21) or what?
    What do your files look like?
    What problem are you encountering? Is an exception being thrown? If so, give us the exact message (copy/paste). Is the results simply not what was expected? If so, give us the input, the expected results and the actual results for us to compare and consider.
    Chuck

  • Html to wml conversion help needed urgently

    Hello everybody,
    I need static HTML to WML code urgently as soon as possible.
    Can please somebody help.
    Moreover, how to discard the tags in HTML which are not in WML.The problem is that few tags are not mandatory to close.So, what should be the rule of discarding tags?
    Please help!!!!
    iwapsms

    http://www.google.co.uk/search?q=html+2+wml&start=0&ie=utf-8&oe=utf-8

  • A puzzling situation...help needed urgently!

    This is somewhat related to the topic I posted here (the app is the same) : http://forum.java.sun.com/thread.jspa?threadID=5253292
    So I managed to set things straight and pass the value of the floor selected from the drop down list to a page called FloorPlanRender.jsp (the parameter name is "floorselected", and I store this parameter into an integer variable of the same name as shown in the code for the whole page below). A controller class receives the request, initializes the DB connection and redirects to the appropriate JSP page (not shown in the codes below, but it works fine) -
    [BTW, I have posted the entire code for the page and classes involved...that was just to make the code more informative. The problem seems to be in a very small part of the code alone].
    <%@page language="java" contentType="text/html"%>
    <%@page import="java.util.Iterator"%>
    <%@page import="java.util.ArrayList"%>
    <%@page import="seatplanner.beans.FloorPlanRenderElement"%>
    <% String base = (String)application.getAttribute("base"); %>
    <% String imageURL = (String)application.getAttribute("imageURL"); %>
    <jsp:useBean id="dataManager" scope="application"
      class="seatplanner.model.DataManager"/>
    <!DOCTYPE html
         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <title>Tech Mahindra SeatMaster&reg; | Floor Plan</title>
      <link rel="stylesheet" href="/TechMSeatPlan/css/pagestyle.css" type="text/css"/>
    </head>
    <body>
    <div id="all">
    <!-- Display logo -->
    <div id="toppanel"> <jsp:include page="TopPanel.jsp"/> </div>
    <br/> <br/>
    <!-- Display main content -->
    <div id="contentpanel">
    <!-- Store the floor selected and get the row and column count for the floor -->
    <% String floorselect = request.getParameter("floorselected");
       int floorselected = Integer.parseInt(floorselect);
       int rowcount = dataManager.getRowCount(floorselected);
       int columncount = dataManager.getColumnCount(floorselected);
       ArrayList<FloorPlanRenderElement> floorplanelements = dataManager.getFloorPlanElements(floorselected);
       Iterator<FloorPlanRenderElement> iterator = floorplanelements.iterator(); %>
    <!-- Create Table to display the grid -->
    <% if(!(floorplanelements.isEmpty())) // Checks whether the retrieved ArrayList is empty or not
    FloorPlanRenderElement anelement = new FloorPlanRenderElement();%>
    <table id="floorplan">
    <% while(iterator.hasNext())
         for(int i=1; i==rowcount; i++)
              { %>
                   <tr>
                   <% for(int j=1; j==columncount; j++)
                        anelement = iterator.next(); // Store the elements one by one
                   %>
                   <td width=30px height=30px> <img src="<%=imageURL + anelement.floorelement.getElementType() + "-" + anelement.floorelement.getOccupied()%>"/> </td>
                    <% } //close for...j loop %>
                    </tr>
          <% } //close for...i loop %>
    <% } //close while... loop %>
    </table>
    <% } //close if, start else
    else { %>
    No floor plan exists. Please choose another floor.
    <% } //close else %>
    </div>
    </div>
    </body>
    </html>
                        Now, using this value for floor selected, I have to get the rows and columns configured for this floor from a database. This involves performing a select max statement so that I can get the maximum row and column number respectively. So I call upon the relevant methods in the DataManager class by creating an object, which in turn gets forwarded to a class known as FloorPlanRenderPeer.java [The code for both are shown below]:
    DataManager.java
    package seatplanner.model;
    import java.util.Hashtable;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    import java.sql.Statement;
    import seatplanner.beans.FloorPlanRenderElement;
    public class DataManager {
      private String dbURL = "";
      private String dbUserName = "";
      private String dbPassword = "";
      /*Basic and connectivity operations */
      public void setDbURL(String dbURL) {
        this.dbURL = dbURL;
      public String getDbURL() {
        return dbURL;
      public void setDbUserName(String dbUserName) {
        this.dbUserName = dbUserName;
      public String getDbUserName() {
        return dbUserName;
      public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
      public String getDbPassword() {
        return dbPassword;
      public Connection getConnection() {
        Connection conn = null;
        try {
          conn = DriverManager.getConnection(getDbURL(), getDbUserName(),
              getDbPassword());
        catch (SQLException e) {
          System.out.println("Could not connect to DB: " + e.getMessage());
        return conn;
      public void putConnection(Connection conn) {
        if (conn != null) {
          try { conn.close(); }
          catch (SQLException e) { }
         /* Floor related operations */
         public ArrayList<Integer> getAllFloorNumbers() {
              return FloorPeer.getAllFloorNumbers(this);
         /* Floor Plan Rendering related operations */
         public int getRowCount(int floorselected) {
              return (FloorPlanRenderPeer.getRowCount(this, floorselected));
         public int getColumnCount(int floorselected) {
              return (FloorPlanRenderPeer.getColumnCount(this, floorselected));
         public ArrayList<FloorPlanRenderElement> getFloorPlanElements(int floorselected) {
              return FloorPlanRenderPeer.getFloorPlanElements(this, floorselected);
    FloorPlanRenderPeer.java
    package seatplanner.model;
    import java.sql.Connection;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import seatplanner.beans.FloorPlanRenderElement;
    /* This class handles all floor plan rendering operations */
    public class FloorPlanRenderPeer
    /* This method returns the number of rows configured for the floor */
    public static int getRowCount(DataManager dataManager, int floorselected) {
         int rowcount=0;
        Connection connection = dataManager.getConnection();
        if (connection != null) {
          try { 
              Statement s = connection.createStatement();
              try
            String sql = "select max(grid_x_pos) from seatplanner.floorgridpart where floor_id =" + floorselected;
            ResultSet rs = s.executeQuery(sql);
              try {
                  rowcount = rs.getInt(1);
              finally { rs.close(); }
            finally {s.close(); }
          catch (SQLException e) {
            System.out.println("Could not get row count: " + e.getMessage());
          finally {
            dataManager.putConnection(connection);
        return (rowcount);
    /* This method returns the number of columns configured for the floor */
    public static int getColumnCount(DataManager dataManager, int floorselected) {
         int columncount=0;
        Connection connection = dataManager.getConnection();
        if (connection != null) {
          try {
            Statement s = connection.createStatement();
               try {
            String sql = "select max(grid_y_pos) from seatplanner.floorgridpart where floor_id =" + floorselected;
              ResultSet rs = s.executeQuery(sql);
              try {
                  columncount = rs.getInt(1);
                        } finally { rs.close(); }
               } finally {s.close(); }
          catch (SQLException e) {
            System.out.println("Could not get column count: " + e.getMessage());
          finally {
            dataManager.putConnection(connection);
        return columncount;
    /* This method returns all the grid elements needed to render the floor plan for the selected floor */
    public static ArrayList<FloorPlanRenderElement> getFloorPlanElements(DataManager dataManager, int floorselected) {
        ArrayList<FloorPlanRenderElement> floorplanrenderelements = new ArrayList<FloorPlanRenderElement>();
         FloorPlanRenderElement oneelement = new FloorPlanRenderElement();
        Connection connection = dataManager.getConnection();
        if (connection != null) {
          try {
            Statement s = connection.createStatement();
            String sql = "select distinct A.grid_x_pos, A.grid_y_pos, A.element_ID, B.element_type, B.occupied" +
                              "from seatplanner.floorgridpart A, seatplanner.floorelement B where (A.floor_ID = " + floorselected +
                              "and A.element_ID = B.ID) order by A.grid_x_pos, A.grid_y_pos asc";     
            try {
              ResultSet rs = s.executeQuery(sql);
              try {
                while (rs.next()) {
                  oneelement.floorgridpart.setGridXPos(rs.getInt(1));
                     oneelement.floorgridpart.setGridYPos(rs.getInt(2));
                     oneelement.floorgridpart.setElementID(rs.getString(3));
                     oneelement.floorelement.setID(rs.getString(3));
                     oneelement.floorelement.setElementType(rs.getString(4));
                     oneelement.floorelement.setOccupied(rs.getString(5));
                     floorplanrenderelements.add(oneelement);
              finally { rs.close(); }
            finally {s.close(); }
          catch (SQLException e) {
            System.out.println("Could not get floor numbers: " + e.getMessage());
          finally {
            dataManager.putConnection(connection);
        return floorplanrenderelements;
    }When I run the application and choose my floor, the result throws me a "No floor plan exists...." [the else...part in the jsp page].
    I have come to know that it is because for some odd reason, the rowcount and columncount variables are not being set properly. I have tested the queries used in the FloorPlanRender peer class in the mySQL query browser and they work (both the row and column count for floor 3 for example, should return 20). But they don't. When I printed out the rowcount and columncount variables, they were set to a 0. I thought the floorselected parameter wasn't retrieved from the previous page properly, but to my surprise it was successfully set to 3, indicating the desired floor number.
    I can't begin to see where the error is. There is nothing wrong with the DB connection or the query, but the correct value is not being set to the variables in the jsp page.
    Can someone please have a look at the code and guide me as to what possibly is going wrong? I have spent a lot of time and effort and still haven't spotted the mistake, if any. Your help is much appreciated.

    Again wrong usage of Iterator :)
    <%@page language="java" contentType="text/html"%>
    <%@page import="java.util.Iterator"%>
    <%@page import="java.util.ArrayList"%>
    <%@page import="seatplanner.beans.FloorPlanRenderElement"%>
    <% String base = (String)application.getAttribute("base"); %>
    <% String imageURL = (String)application.getAttribute("imageURL"); %>
    <jsp:useBean id="dataManager" scope="application"
      class="seatplanner.model.DataManager"/>
    <!DOCTYPE html
         PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
      <title>Tech Mahindra SeatMaster&reg; | Floor Plan</title>
      <link rel="stylesheet" href="/TechMSeatPlan/css/pagestyle.css" type="text/css"/>
    </head>
    <body>
    <div id="all">
    <!-- Display logo -->
    <div id="toppanel"> <jsp:include page="TopPanel.jsp"/> </div>
    <br/> <br/>
    <!-- Display main content -->
    <div id="contentpanel">
    <!-- Store the floor selected and get the row and column count for the floor -->
    <% String floorselect = request.getParameter("floorselected");
       int floorselected = Integer.parseInt(floorselect);
       int rowcount = dataManager.getRowCount(floorselected);
       int columncount = dataManager.getColumnCount(floorselected);
       ArrayList<FloorPlanRenderElement> floorplanelements = dataManager.getFloorPlanElements(floorselected);
       Iterator<FloorPlanRenderElement> iterator = floorplanelements.iterator(); %>
    <!-- Create Table to display the grid -->
    <% if(!(floorplanelements.isEmpty())) // Checks whether the retrieved ArrayList is empty or not
    FloorPlanRenderElement anelement = new FloorPlanRenderElement();%>
    <table id="floorplan">
    <% while(iterator.hasNext()){
    anelement = iterator.next(); // The iterator.next() every call would takes the pointer to the next element in the collection
    for(int i=1; i==rowcount; i++){ %>
    <tr>
    <% for(int j=1; j==columncount; j++){%>
    <td width=30px height=30px> <img src="<%=imageURL + anelement.floorelement.getElementType() + "-" + anelement.floorelement.getOccupied()%>"/> </td>
    <% } //close for...j loop %>
    </tr>
    <% } //close for...i loop %>
    <% } //close while... loop %>
    </table>
    <% } //close if, start else
    else { %>
    No floor plan exists. Please choose another floor.
    <% } //close else %>
    </div>
    </div>
    </body>
    </html>For god sake please bother to understand how any implementation of java.util.Iterator works
    for more info go through javadocs
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Iterator.html
    and i believe you have completey ignored my other suggestion of using enhanced loop in J2SE 5.0+ if iterator is confusing.
    Anyways,hope the above might help you in fixing of what you are trying to..
    REGARDS,
    RaHuL

  • Pdf showed in new window. Help needed!

    Hi all,
    This is my first post (but a thousand read), and i want first to thank you all for all the information i have read in this forums for years.
    I have a problem which is giving me more problems that i expected. In my webapp, i want to show a pdf document in a new page of the navigator when a button is pressed. I have discarded the target blank option in the container form because i have others buttons and dont want them to be opened in new windows, just the one that open the pdf.
    So, I used another navigation rule to open a new window. This page have to make de pdf in code an send it to the client. I dont know how to execute that code on the load of the page.
    The solution i am trying is using a poll that only will be called once and in the pollListener execute that code. The problem is that does not work to send the response to the client in the client. Here is the code of the pollListener:
    byte[] file; //Don't worry about it. Contains the file pdf i want to show.
    FacesContext fctx = FacesContext.getCurrentInstance();
    HttpServletResponse response =
    (HttpServletResponse) fctx.getExternalContext().getResponse();
    response.setContentType("application/pdf");
    response.setHeader("Content-Disposition",
    "inline; filename=\"file.pdf\"");
    response.setHeader("Cache-Control", "no-cache");
    response.setContentLength(file.length);
    ServletOutputStream sos = response.getOutputStream();
    sos.write(fichero);
    sos.flush();
    sos.close();
    fctx.responseComplete();
    The curious thing is that if i change the content-disposition to atachemement instead inline, it works asking me to download the file, however, i want it to open directly in the new window and is because of that i use content-disposition inline.
    I am almost killing myself because of this problem. Anyone can help me?
    Thanks in advance!

    First of all, you don't need to do this with a workaround using a Poll listener. I assume that one page has a commandButton or commandLink that is used to show the PDF, right?
    Set the useWindow property of the button or link to "true".
    Set the actionListener property of the button or link to a method in a backing bean that looks something like this:
        public void showPDF(ActionEvent actionEvent) throws IOException {
            //Setup the output
            String contentType = "application/pdf";
            FacesContext fc = FacesContext.getCurrentInstance();
            HttpServletResponse response =
                (HttpServletResponse)fc.getExternalContext().getResponse();
            /* Notice that I don't set the Content-Disposition header - inline is default. */
            response.setContentType(contentType);
            ServletOuputStream out = response.getOutputStream();
            /*  Do whatever you need to do to write the pdf to "out" here. */       
            out.flush();
            out.close();
            fc.responseComplete();
        }

Maybe you are looking for