• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Combo Boxes

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic