I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
You don't create the array in the JSP. The data gets created in the page controller servlet and set into a request-scoped variable (via setAttribute()).
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
If you don't have a controller, then you are not ready to use the JSTL and EL.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
See how much you cna get done with these three tips and post where you get stuck.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
And that scriptlet you have there would also be moved to the controller
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
In any case, at your request I will bow out of this topic.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
It's almost always better to use a List of beans for such data; where one bean represents one row of the table with properties that (usually) represent the columns.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I will ask one last time: what is the data representing? What does one row of the array/table represent?
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Paul Ngom wrote:
One row in array contains the following information:
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Indent your code! You have been asked numerous times to properly indent your code. Indent your code. Indent your code. I will not read any more code that is not properly indented.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Paul Ngom wrote:About your first remark, can you tell me if this edited code is better indented?
Follow proper Java naming conventions. Variables should be in camel case with no underscores. So not heure_first_stock, but something like firstStockHeure. Note that i have changed the words to make it more readable. The class name should be ItemData, not Itemdata.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
If they are real words in your language, fine.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Next, create your list of beans in place of the 2D array
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I note that in the getListOfItemData method you're only creating a single ItemData object, instead of one for each DB record. This will not work.
And I agree that "ItemData" and "ListOfItemData" are not particularly meaningful class names.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Can you direct me exactly to the place in getListOfItemData where i need to effect a modification?
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
I'd also wonder if a generic class name like "ItemData" is the best choice. It could mean anything. What is one of these beans/rows representing?
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
A bean represents the stock information about an item. Can i change ItemData to ItemStockData?
Also note that "the next person" could be you yourself, 2 years down the road when you have all forgotten about this project: is "X" a name you would like to see?
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |