• Post Reply Bookmark Topic Watch Topic
  • New Topic

Combo Boxes

 
Alan Troy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im doing a project on an airline booking system and i want combo boxes on the main page allowing user to select their origin and destination, i was wondering if i should do all this on the jsp page or do it in the bean class?? was hoping someone could help me
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no 'combo box' control in JSP.

If you want to pull values from a database to populate your HTML select lists, I'd advise putting the JDBC code in a bean.
A search for "Model, View, Controller" or "MVC" will give you plenty of links on the best way to do this.
 
Alan Troy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i know there is no code but do i not create the combo boxes on the jsp and then retrieve date from the bean?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alan Troy:
i know there is no code but do i not create the combo boxes on the jsp and then retrieve date from the bean?


Yes, with the HTML SELECT element, as I am sure you know. What Ben meant was that there is no jsp:combobox type of component. You are correct though, create the select on the JSP page, throw the data for the list in a List of some sort then use JSTL to iterate over the list, supplying the option attributes.



Something like that anyway.
[ January 09, 2006: Message edited by: Gregg Bolinger ]
 
Alan Troy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, im not the best coder, so id welcome all the help you can give me. I will try it that way and let you know of any problems
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Al",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You changed your display name from "Alan Troy" (which is fine) to "Al" (which is not). What's up with that?

Thanks!
bear
Forum Bartender
 
fred rosenberger
lowercase baba
Bartender
Posts: 12341
38
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, do you want help posted in this thread, or this one?
 
Alan Troy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry about the name thing guys, i would like the help printed here. I have all my requirements done, first thing i want to do is set up the booking. I want 2 combo boxes on the main page, one for origin and one for destination, then allow the user to pick how many people, day of chosen flight, etc. They will then be brought onto a page listing available flights on chosen day. Im using Eclipse for java and mysql for datbase, i have a table in mysql of flights, problem is i dont who how to start.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alan Troy:
.... problem is i dont who how to start.


I would start by creating a plain old Java object (POJO) that performs the database lookup and returns the results as a list of beans.

If you're not familiar with database access from a Java app there are plenty of JDBC tutorials on the web.
http://www.google.com/search?hl=en&q=JDBC+TUTORIAL&btnG=Google+Search
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!