aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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: 61433
    
  67

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]
 
jQuery in Action, 2nd edition
 
subject: Problem with JSTL