This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSP and the fly likes Problem with JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with JSTL" Watch "Problem with JSTL" New topic
Author

Problem with JSTL

Bharadwaj Adepu
Ranch Hand

Joined: Dec 30, 2007
Posts: 99


This is piece of code that gives a list of fruit names in a drop down.
When i iterate and print this list in the bean this gives

But the output of the JSP prints this in the dropdown

Why is this list returning in square brackets and a space before each fruit name?


SCJP 1.5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

First, a few questions about your code:

Is it really formated like that? Do you find it easily readable?

Why is there Java code in your JSP? if you are using JSTL an EL, there should be no Java code in your JSP.

Why are you copying the attribute from request scope to page scope? What is the purpose?

Why is this list returning in square brackets and a space before each fruit name?

What is the nature of the data in fruitsLst?

And what happened to the "i" in fruitsList?
[ September 06, 2008: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
GeeCON Prague 2014
 
subject: Problem with JSTL