Hey guys I am trying to fetch the information present in servlet into jsp page and i am getting difficulty in writing above tag.
So please help me.
For your help i am writing my code here , so that you can understand it.
now see this lines in Action classes.
now tell me how to write that tag, i m writing here for trial but i m sure it is wrong, so please help me
So please help to solve it.
"Learn and Grow rich"
"Painting comes to the painter , poem comes to the poet similarly code comes to the developer"
I don't really understand what are you trying to do but I have seen some thins that seem to be wrong, I thing your code will not compile at all!
You are using Public and it should be public, not capital letters! The same for the For loop and the While. You have also called an ArrayList final, that is not allowed!!! final is a reserved word, as you cannot call a variable 'class' or 'if' you cannot call it final, read this about java naming convention
And then, where does the rs came from? Are you storing the result in an static class attribute? Where does rset came from? I see rs and rset vars in your code but I don't know where they come from...
Dear Friend Alberto ,
You are completely right about all the things you pointed out.
Frankly speaking I was becoming a little bit lazy by posting only the main sentences of the code and that too incorrect due to my hurry,but please forgive me for that
here with I am attaching the code.
now look at another class.
And now in my Action class, I have
Then please can you specify what should be my jsp code, to fetch p1,p2 and p3 in the jsp form.
Thanks for your help , and thanks for taking time for it.
I am sorry for all the inconvenience.
Joined: Apr 08, 2009
gunjan wrote: Frankly speaking I was becoming a little bit lazy by posting only the main sentences of the code and that too incorrect due to my hurry,but please forgive me for that
hahaha funny answer, let's see if I can help you.
You want to use <logic:iterate>, I have no idea that that existed so I cannot help you with that too much, but I guess that this tag is expecting an array, or a List or something like this to iterate over and you are not setting anything like that, you are just setting String attributes to the request, I suppouse that you only recive one row per select because you are only sending the last row of the resultset to the application.
I think you should create a List with VO objects and then access them in the application iterating the List and showing the VO.product, VO.family, etc...
What's the target of this? Is it learning how to use <logic:iterate>? Is it just showing the information of the database in the screen or what?
The <logic:iterate> goes like this :
You lets say you have a collection of objects, and they contain some property called someProperty. now you create a list of such objects and load it on request by the name somDTOList from your action...(using request.setAttribute()) and then use it in your JSP like :