GeeCON Prague 2014*
The moose likes JSP and the fly likes Sort by price and sort by provence Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Sort by price and sort by provence" Watch "Sort by price and sort by provence" New topic
Author

Sort by price and sort by provence

Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Hello, i have a JSP page that present items from a category stored in XML. Im trying to build a way that when Sortby price and Sort by provence buttons clicked change the items respectively. Also my webpage has Purchase java class that takes item's name, price(double) and image address and Manager java class that has some usefull methods. My problem is until now when either by price or by provence buttons clicked, table is empty.

My jsp:
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

If the code you posted is goodslist.jsp, then I don't see any code which produces any output resembling "items". All I see is code which creates an empty Vector and then (uselessly) sorts it.

On the other hand if that isn't goodslist.jsp, then you should look at goodslist.jsp to see why it isn't performing right.

It's also possible that something is throwing an exception. You might want to look at the server logs to see about that.
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

This is the goodList.jsp forgive me but is my first time than im using Vector so i can't yet 100% understand it. What i have to do to fix the problem, how to add on Vector?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

I haven't any idea. You have a bunch of XPath code which seems to be doing something. Then you've got some unrelated code which uses a Vector<Purchase> but never creates any Purchase objects. I don't know if you should change that code so that it does something, or whether you should concentrate on changing the XPath code. In any case you would have to understand where the data was coming from in order to do anything with the code.

Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Yes using XPath i can figure out price and provenance for each item. Im just trying with vector, something i found on the web. If you have any better idea, by happy to change it
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Good luck, then!
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

That's mean you dont have any idea ? :P
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Nope. Wasn't that clear? How could anybody figure out what to change based just on seeing that code? You would have to understand where it was getting its data from and how the data was organized.

Am I correct in guessing that somebody else wrote this code, and you have been given it and told to do something with it? If that's the case then you should go back to whoever gave it to you and ask them to help you with that.
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

The only piece of code that is new, is Vector part, thats why im new on it
 
GeeCON Prague 2014
 
subject: Sort by price and sort by provence