Also, you do not need to create a list class. By the way, you'd just use ArrayList to collect the individual beans,
Bear,
I have made the change already. By the way, is there any difference? My jsp page in which i want to translate the scriptlets to jstl and el is as follows:
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Paul Ngom wrote:By the way, is there any difference?
Difference between what?
What did you end up naming the bean?
My jsp page in which i want to translate the scriptlets to jstl and el is as follows:
First steps:
Make sure that your controller places the List in request scope so that it is available to the JSP. I'd suggest a good name such as stockList or something else that describes the list well.
Get rid of the getAttribute() call. It is not needed. Scoped variables are automatically available to the JSP by their name. E.g. stockList if that's what you use.
Replace the while loop with the <c:forEach> tag. Look up this tag -- it works very much like the ehnanced for loop in Java.
Two things: you're losing your indentation again. I'm not inspecting unindented code.
And your code is full of invalid markup. Tags that aren't closed and so on. And why do you still have tags in the code? We cannot move forward until you have addressed the issues that have already been brought up previously. And cleaning up the code is essential to moving forward.
A blank page is also usually an indication that an exception has occurred. Be sure that you are looking at the log file to see if exceptions are occurring on the server.
The server log says: The end tag "</c:if" is unbalanced
Then it probably is. Cleaning up the code by using proper indentation and removing invalid and unnecessary markup should help reveal the structural problems.
I'm not harping on properly formatted code just for giggles -- it's an essential tool in revealing the structure of the code and revealing problems with that structure.
It looks like you plan to have a counter which will tell you when you are processing the first row of the list. You don't have to do this yourself; the <c:forEach> tag has an attribute which will provide this counter for you. Check out the documentation for that tag.
It looks like you plan to have a counter which will tell you when you are processing the first row of the list. You don't have to do this yourself; the <c:forEach> tag has an attribute which will provide this counter for you. Check out the documentation for that tag.
Thanks a lot Paul.
I am always surprised at the added knowledge i can get from others when i give my opinion on a topic.
Yeah, but how did the squirrel get in there? Was it because of the tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss