Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jstl c:out tag does not display the value in the list

 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I add my game objects to an array list after querying from database as shown below:



Finally i am setting it to request so that i can display values in my jsp.


Here is my JSP,



But the JSP displays......

Choose to join pending games:


I can't see the values...........of ID and pattern. Please help me as early as possible.

Thanks in advance
[ September 30, 2008: Message edited by: kalyen kumar ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65535
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your code will not compile as shown. Please take the time to post the actual and real code without errors. Otherwise, you just waste people's time chasing errors that don't really exist. Please read this for more information.

Also, please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the .
[ September 30, 2008: Message edited by: Bear Bibeault ]
 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey sorry for wasting your time and thanks for guiding me in the right way of doing a post.

Now i edited my post, hope this is clear now, any help is appreciated.
Thanks in advance.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kalyen kumar:


Finally i am setting it to request so that i can display values in my jsp.


Here is my JSP,



But the JSP displays......

Choose to join pending games:


I can't see the values...........of ID and pattern. Please help me as early as possible.

Thanks in advance

[ September 30, 2008: Message edited by: kalyen kumar ][/QB]


please note the BOLD letters
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try checking two things. One, are you sure that you are getting values back from the database? You can check this by writing out the varStatus count value (see this for more info count example)

Then check that you have correctly named your getters and setters on the Game class. While these should throw an error if they aren't correct, it's still worth checking the basics.
[ October 01, 2008: Message edited by: Rachel Swailes ]
 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thnks for your response....

I made the changes indicated in bold




also the following is a collection...



but still i cant see the values printed on JSP.
Can any one help me, urgent.........please.

Thanks in advance
 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you declare var="game" you are saying that for every iteration of the loop, take the next value out of the games collection and assign it to the var called game. For this reason you don't need to reference game[0] in your loop. That doesn't mean anything always, what is the 0th item of game?

Change your code back to before you had the square brackets.

Then try my suggestion of writing out the number of items in the games collection and tell me what you see.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,



use game[0].gameID not GameID // if your getter name = getGameID()

please see the changes clearly...do not hurryup yourself
 
kalyen kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thank you very much.

Your are correct, the game class attributes are not according to naming conventions, i corrected that and now everything is working fine.

Thanks a lot once again.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by kalyen kumar:
Hey thank you very much.

Your are correct, the game class attributes are not according to naming conventions, i corrected that and now everything is working fine.

Thanks a lot once again.


you are welcome
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!