Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 174255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T13:29:20+00:00 2026-05-11T13:29:20+00:00

I have one simple User Registration form. It includes name, age, sex & city.

  • 0

I have one simple User Registration form. It includes name, age, sex & city. But here city is coming form city master table & displaying user as a combo box. But when i am trying to store full user registration information through my UserDAO, how can i access that current selected city value ? My User Registration jsp form contains :

<s:form action='UserAction' >             <s:textfield name='name' label='User Name' />             <s:textfield name='age' label='Age' />             <s:radio name='sex' label='Sex' list='{'M','F'}' />              <s:select list='cities' key='cities.name'  listValue='name'>             </s:select>          <s:submit /> </s:form> 

Now i am calling UserAction’s execute() method. It contains :

public String execute() throws Exception {         UserDAO.insert(user);         return SUCCESS;     } 

My DAO’s insert method has following code :

 public static void insert(UserBean daoUb) throws Exception {         Connection daoConn = null;         CityBean cb=new CityBean();         cb=daoUb.getCity();         System.out.println('cb = '+cb);         daoConn = connectionUtil.getConnection();          Statement daoSt = daoConn.createStatement();         String str = 'INSERT user (name,age,sex,city) VALUES('' + daoUb.getName() + '',' + daoUb.getAge() + ','' + daoUb.getSex() + '',''+cb.getName()+'')';         daoSt.executeUpdate(str);         //daoConn.close();     } 

Plz suggest me, if anyone have any suggestion. I am stuck with this problem….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T13:29:21+00:00Added an answer on May 11, 2026 at 1:29 pm

    You can get that using similar method what you are using for other fields. The only thing you need to do is give that field a name.

    Give your list the exact name what you have in your bean, in your case city. It should start working now.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple registration form. Once all information entered, user click submit button and
I have a PHP file with one simple echo function: echo 'アクセスは撥ねりません。'; but when
Im sure this will be a simple one but have a project that started
This is probably a basic html/css question... I have a simple one-button form that
all.I'm a beginner of Mysql and I have one simple question here. I want
I have in mind one simple application, but I would like to add some
I know zero javascript, and have one simple task: Find all text in the
I have a simple one-to-many relationship. I would like to select rows from the
A simple example: Let's say I have one alias being sourced somewhere as: alias
I got a simple problem in SQLAlchemy. I have one model in a table,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.