Retaining vector elements

Hello,
I have 2 jsps. 1.jsp has a link to 2.jsp. 2.jsp has list of products from database. The user selects the product with the checkbox. I am getting the products that are checked for the first time and I am displaying them on 1.jsp. When the user wants to add more products, I am loosing the product list that he had selected before.
The following code is in 1.jsp. I think my problem is I am initializing vector each time user goes to 1.jsp.
I was wondering if anyone could guide me with this issue. I just want to retain all the selected products in one vector.
Vector vprod_id = new Vector();
arrId = request.getParameterValues("prodid");
     if(arrId != null)
     for(int i = 0; i < arrId.length; i++)
          vprod_id.addElement(new Integer(arrId));
     out.println(vprod_id.elementAt(i));
     else
          out.println("No Products Selected");

Keep the vector in a session attribute.
ie
session.setAttribute("productList", vprod_id);
session.getAttribute("productList");This will retain it between html pages.

Similar Messages

  • Copy vector elements to array

    if i create a vector called aList,
    and it had 2 elements "peter" and "june"
    and i create a new array >>String[] name = new String[5];
    how to use this method
    copyInto(Object[] anArray)
    Copies the components of this vector into the specified array.
    to copy the 2 elements in aList vector to my name[1]?

    if i create a vector called aList,
    and it had 2 elements "peter" and "june"
    and i create a new array >>String[] name = new
    String[5];
    how to use this method
    copyInto(Object[] anArray)
    Copies the components of this vector into
    ctor into the specified array.
    to copy the 2 elements in aList vector to my name[1]?A confusing question: you want to put two Vector elements into one array element? Can't put ten pounds of @%^@%^@^ in a five pound bag, can you?
    If you really want two Vector elements to be stored in one array element you'll have to combine them in some way. String concatenation will do.
    If you mean you'd like to copy all the Vector elements into the array, you'll have to do something like this:
    Vector aList = new Vector();
    // add some elements to aList
    int numNames = aList.size();
    String [] names = new String[numNames];
    for (int i = 0; i < numNames; ++i)
       names[i] = (String)aList.get(i);MOD

  • If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    If I'm copying text and/or vector elements from Indesign to Photoshop how come their pixel sizes change even though I opened the same sized document and my indesign file is a web file?

    >my indesign file is a web file
    Pardon?
    Or do you mean that, when you created a new document, you choose Web as intent maybe?

  • Something changed on my file and now my vector elements and fonts look pixelated in CS6

    Today an illustrator file with vector objects and fonts that I've been working on for days looked pixelated when enlarging at more than 400%. I couldn't find the fix so I started a new canvas, selected everything from my pixelated file, pasted it into a new canvas and everything transferred correctly so I was able to continue working with my vector elements again.  I was curious if anyone knows what made my vector elements change to pixels and how to fix it.  Thanks guys

    You are welcome Miss Modular.
    Even on web jobs people do not use that option too often, so really wish they would not assign a keyboard command to that, which is what I suspect happened to you.

  • I can't export vector elements with pdf

    Good morning,
    I have a problem.
    When I import a vector element from illustrator to photoshop with drag, from an application to other, my
    results is a vector element in photoshop (vector smart object).
    If I export in PDF (save as photoshop PDF) my results isn't a vector elements, the text and shape wrote in psd
    yes but the smart object no.
    Anyone have any suggestions?
    thank you very much.
    Nayaril

    There are a lot of features I would like to request, how about being able to rename a duplicate project.  Anyway, thanks for the answer.  I still can't send even a full project into compressor using the send to compressor button.  I did find I can use the export using compressor settings, then using the advanced menu I get a send to compressor button that does actually send my project to compressor.  I can then select an in and out point and render a small sellection from my timeline. 

  • Why does a excel pie chart fail to import as vector elements?

    Hello. I' m importing Excel 2008 excel pie charts to illustrator CS5. I am cutting and pasting content between the applications to import. When importing a pie chart - the chart imports OK, but the pie elements import as low resiolution non-vector elements. Is there a way to import as 100% vector elements? Note - all other chart types - bar graphs etc import fine!. thanks AH

    Hi Mylenium - thanks for your reply. I found this thread: http://forums.adobe.com/thread/732518. Looks like 'low budget dave' identited an 'excel' problem with conversion of pie charts to bitmap - thread was in 2010 - am hoping for more recent info or a solution. thanks.

  • PSD Placement in Muse (Retain Vector Layers)

    So in my eyes, Muse is for those like me. We can design, but can't code. Caters basically to designers without any HTML or CSS knowledge. Well, I think Muse needs to make a few improvements to really be a graphic designer's go-to tool for web design.
    I always prefer starting a website concept in Illustrator or Photoshop. It handles and renders images, text and vectors perfectly. Everything looks pixel perfect. This is why I would prefer to build an entire website in Photoshop first, then export elements to then re-organize in Muse.
    The problem with this process is that it is very time consuming. When I discovered that I could place a PSD file's layers into Muse, I was excited! BUT, that feature is a little behind the times... Every layer from that PSD is treated as a rasterized image. Logos, and even some text elements I like to use SVG (which is awesome that Muse can import SVG now). But this place PSD tool is useless to those smart object layers in the PSD file. This should be a feature to be added to reflect the new SVG support in Muse.
    On a side note / problem, Muse' handling of SVG files is pretty poor. It's not anything like handling a vector in Illustrator or Photoshop. It has the loading style spinning wheel when moved and sized, and has this odd white bar below each image in Muse preview. I wish Muse would render things properly within Muse. It's highly frustrating as a pixel-obsessed graphic designer.
    Adobe, please take note and add these to your to-do list!

    Thanks for your input , please feel free to add your suggestions in our ideas section. We are working actively to include more features.
    Thanks,
    Sanjit

  • InDesign CS5 PDF - Failure to Export Vector Elements

    Recently, we have had two separate incidents where the creation of an InDesign CS5 PDF failed to export certain vector art elements. The elements are not shared between jobs and the files were physically created in different locations (entirely different servers) within our organization. The elements are pdf and eps and appropriately linked. On the PDF, we're not even getting a low-res version of the artwork. When looking at the PDF in NEO, the containing box of the graphic is not present. One the most frustrating aspects of this is we haven't been able to repeat error in order to fix the error. The next time (or 50 times) the document is exported, the vector art is fine.
    Has anyone else had a similar issue?

    @rickphot
    I've had this same problem just today. I have a 64 page INDD that when exported to PDF (print) from CS5 (with no elements on my page set to "non printing elements"), only some of my vector shapes get exported. They are all merely 0.25pt Black Lines used to direct a reader from a comment to a matching illustration, and some pages exported them just fine, and some other pages will not work. I've tried moving them to a new layer, cutting and pasting in place, copying and pasting in place, changing the transparency modes, etc...nothing works...EXCEPT to just redraw the lines.
    @Bob Levine
    Do you work for Adobe? Can you offer any advice to this problem yet?
    Thanks all. Glad I'm not the ONLY one going crazy with a bizzare problem like this one.

  • Why content of a vector element changes when new element added

    in my program, i instantiate 2 Vector objects. one is TV(temporary vector), the other one is V. they all get instances of Class vElement as elements to them(of course, casted to Object first).
    Class vElement only cantains an int n, an int[] array.
    i create a text file: input.txt
    in this text file, there are 2 rows of content:
    1 2 3 1001
    4 5 6 1002
    at the beginning when the program runs, each row of input.txt will be read into a respective instance of vElement, that is, e.g. n = 1001, array = {1, 2, 3}.
    and then the 2 instances would be casted as Objects and added to V as elements
    then TV starts to get a new vElement from some methods generats 7 8 9 1003
    after that, V will add TV's newly-got element as its 3rd element.
    what is dramatical is that, the array of V's 1st element { {1, 2, 3} 1001 } will change to be the same as its 2nd one{{4, 5, 7} 1001 } after the 3rd element added to V from TV, yet, 1001 will not change to be 1102.
    this problem has challenged and tortured me for quite some days. who can help to conquer it?
    thanks a lot more!!

    I had the same problem. I believe this is because Vector stores references of everything it is added into it. My problem was solved by creating a new array everytime I had to add an element to Vector.
    Instead of:
    My_vector.addElement(My_array)
    I did:
    String[ ] Prov_array = new String[My_array.length];
    System.arraycopy(My_array,0,Prov_array, 0,My_array.length);
    My_vector.addElement(Prov_array);
    Might not be the best solution but it solved the problem.

  • Converting a gradient from a spot color to a process build, hides vector elements

    I have been using Illustrator for many years and consider myself very familiar with it, but recently ran into a strange issue I have never seen before.
    The background element is a radial gradient with points of 0% to 50% of a spot color. The file came to me as one single layer, with the gradient in question above a vector rectangle. The rectangle shows up fine, however, until I convert the gradient from a spot to a process build at which point the box is no longer visible. The initial issue I found was that the box is beneath the gradient, but my question is why would it be visible as long as the gradient uses a spot and then disappear behind it when converted to a process build?

    Version is CS5.
    Part of what made the issue so confusing is that there are no effects applied. Applying the overprint feature or multiply effect don't effect the outcome either. It's only something that can be fixed by moving the gradient to a layer behind the element which is disappearing. My question is less about how to fix it (I've done that and moved on) and more about why this would happen - it seems to be a strange anomoly.
    In response to the replies involving the method of color conversion:
    I have used all of the methods mentioned and the end result is the same. It is starting to look to me like this is a fluke that happened with this particular file and that it is not something that can be duplicated intentionally.

  • Boolean array from Vector element

    I have a Vector with each element being a boolean array. When I use the elementAt method it returns an object which I have to then cast in some way to a boolean array.
    Is this possible?
    Thanks for your help,
    Wallace

    By the way:
    - don't use Vectors if you don't have to. Other collections may be better suited and faster.
    - if you use Java 1.5, use Generics. Then you won't have to cast anymore.

  • Compare newly added Vector Element with all previous

    Hi all
    I am adding Point2D elements to a vector "Numbers" in such a way that every newly randomly created element that is at a distance of 0.3 from all the previous points is added else not.
    I have written a code that only checks from the last element but not all the previous elements.
    Can someone check what wrong am I doing.
    The code is runnable.
    import java.awt.geom.Point2D;
    import java.util.*;
    public class Distance
         Vector<Point2D> numbers = new Vector<Point2D>();
         Random rnd = new Random();
         void getList()
         double xCoord,yCoord;
         for(int i=0;i<5;i++)// is is the no. of coordinates stored later only "b" to be used
         xCoord = rnd.nextDouble();          // X-coord of AP
         yCoord = rnd.nextDouble();          // Y coord of AP
         if(i<2)
              numbers.addElement(new Point2D.Double(xCoord,yCoord));
              System.out.println("0th n 1st element added : "+i+ "   "+numbers.get(i));
         else
         for(int j=i-1;j>i-2;j--)
              if((numbers.get(j).distance(xCoord,yCoord))>0.3)
                   numbers.addElement(new Point2D.Double(xCoord,yCoord));
                   System.out.println("next element added : "+i+ "   "+numbers.get(j)+"  with distance: "
                             +(numbers.get(j).distance(xCoord,yCoord))+"from "+ xCoord + " "+ yCoord);
         Iterator it = numbers.iterator ();
           while (it.hasNext ())
            System.out.println(it.next());
         public static void main(String[] argv)
              Distance d = new Distance();
              d.getList();
    }Thanks a lot

    Hi all
    I am adding Point2D elements to a vector "Numbers" in such a way that every newly randomly created element that is at a distance of 0.3 from all the previous points is added else not.
    I have written a code that only checks from the last element but not all the previous elements.
    Can someone check what wrong am I doing.
    The code is runnable.
    import java.awt.geom.Point2D;
    import java.util.*;
    public class Distance
         Vector<Point2D> numbers = new Vector<Point2D>();
         Random rnd = new Random();
         void getList()
         double xCoord,yCoord;
         for(int i=0;i<5;i++)// is is the no. of coordinates stored later only "b" to be used
         xCoord = rnd.nextDouble();          // X-coord of AP
         yCoord = rnd.nextDouble();          // Y coord of AP
         if(i<2)
              numbers.addElement(new Point2D.Double(xCoord,yCoord));
              System.out.println("0th n 1st element added : "+i+ "   "+numbers.get(i));
         else
         for(int j=i-1;j>i-2;j--)
              if((numbers.get(j).distance(xCoord,yCoord))>0.3)
                   numbers.addElement(new Point2D.Double(xCoord,yCoord));
                   System.out.println("next element added : "+i+ "   "+numbers.get(j)+"  with distance: "
                             +(numbers.get(j).distance(xCoord,yCoord))+"from "+ xCoord + " "+ yCoord);
         Iterator it = numbers.iterator ();
           while (it.hasNext ())
            System.out.println(it.next());
         public static void main(String[] argv)
              Distance d = new Distance();
              d.getList();
    }Thanks a lot

  • Replacing imported vector elements in After effects CS4

    Hello
    I have imported a layered illustrator vector file into my composition, dragged individual elements to the working area and applied transitions and effects. I now have the need to make some subtle edits to the original vector files and am wondering the process to auto update these items in the composition. Without having to re edit the composition again, this would be similar to a replace symbol in Flash.
    thanks
    Matt

    That will replace a layer's contents without altering your effects.
    You can also use a couple of other trick like editing your Illustrator art, saving it to the same name and overwriting it, and then reloading the file in AE. This populates the project's comps with the new artwork.

  • Vector element retrieval

    Hello,
    I am designing a servlet to store the rows in a resultset. The solution that I have come up with is to store all of the elements in the row in an array and then storing the array as an element in a Vector. The user will then choose the index of the Vector which will be the array/row that the user wants to see. I wanted to know of the functionality of the Vector class and the ability that I can have to take the Object from the Vector and treat it as it was when I put it in there.
    Basically, I want the array to be converted back into an array from an Obejct so I can then take all of the elements of the array and use them as I please. Do you think that this is possible?

    try this....
          String[] array = {"asdf", "qwer", "lkjh"};
          vector.add(array);
          String[] result = (String[])vector.get(index);Caio
    Omer

  • Efficient compare among vector elements

    Hi guys,
    I've a basic question, I've solved it with lots of nester for and I'm sure it's not the best way to do it, so I hope you can help me.
    I've a vector of object User, so Vector<User> and user object has a property age.
    What I want is simply:
    1) iterating this vector and make comparing of age field for each user with each user (for example, 3 user, user1 - user2, user2 -user3,user3-user1).
    2) User older for each compare must be entered in a new vector.
    So starting from a vector of n element I should have a new vector with dimension equal to n*(n-1)/2.
    Could someone help me to find most efficient code? (please show some code example)
    Thanks,
    Regards

    new_to_java123 wrote:
    What I want is simply:
    1) iterating this vector and make comparing of age field for each user with each user (for example, 3 user, user1 - user2, user2 -user3,user3-user1).
    2) User older for each compare must be entered in a new vector.
    So starting from a vector of n element I should have a new vector with dimension equal to n*(n-1)/2.Well what you want is simply a very inefficient way to solve the problem. As you describe it you will use an algorithm of complexity O(n**2), while it can be done in O(n)!
    What you should do:
    1) Parse the vector once and determine the minAge and maxAge
    2) Create an array[min-age, max-age] which contains a list of users for each index. As this is not directly supported in Java, use an ArrayList of size (maxAge - minAge ++1) and populate it with an empty List for each index 0 .. maxAge - minAge. Each entry with index i in that ArrayList is a List of persons whose age is (i ++ minAge).
    3) Now iterate over the original Vector and append each user to the List of persons of his age (in code: ageList.get(user.getAge() - minAge()).add(user); )
    Voilá. Only two scans of the original Vector and you have a structure that holds
    1) List of the users of a given age (ageList.get(age - minAge()).
    2) All users older than the given age can be found by iterating the lists with greater index as (age - minAge()).
    And of course the memory requirements are much lower also!
    It needs to store only maxAge - minAge + 1 plus the outer ageList. if you store null instead of an empty list if no user has a specific age this can be further reduced at the cost of havein to do more null checks.

Maybe you are looking for

  • RE-FX and FM/BCS integration

    When trying to post a funds reservation via a lease in contract I get error Message no. FMEF009   -  Entry in field Unlimited not allowed; check the field control  Has anyone implemented RE-FX with Public Sector and committed via contracts

  • Slow log on with Windows XP / Active directory

    Hi I have been trying to work out what is causing my computers to take a long time to log on. The computers are Windows XP and take roughly a 1minute to log on(at worse). I have turned on  userenv debugging and reviewed the files. I think the problem

  • Error while creating procedure

    i am creating the procedure which is having year as arguemnt (i am couting total number of user in year) CREATE OR REPLACE PROCEDURE sample1 (a_year varchar2(4)) IS BEGIN select COUNT(*) Total_Count from users a where a.create_dt >= TO_DATE('01-JAN-'

  • Com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of vi

    I am getting the following exception when I trying to go to Details view from my results view. com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of view controller ResultsView does not exist.      at com.sap.tc.webdynpro.progmodel

  • How to find out the application server instance name?

    Hi, I installed an Oracle application server a long long while ago and completely forgot the things about the installation, including the name of the instance (I installed single instance, not cluster). Now I am trying to create a connection to the a