• 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

passing parameters

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a situation, in firstpage i will populate data from the database to get the order at the same time want to get quantity from the user and send all parameters to the next page. What do we need to do here .
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Assuming your firstpage is a jsp?, you can put hidden fields (<INPUT type="hidden" .../>) for the values you are getting from the database and get those values in the next page by request.getParameter("name")/request.getParameterValues("name") (this would return an array of values).
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to Javaranch AR REDDY ,
If there's a form on the first page, submitting it will automatically pass the parameters to the next page. If you want to pass some attributes, then depending on the need, they can be placed in one of the three scopes request, session or application.

Hope this helps
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by AR REDDY:
in firstpage i will populate data from the database to get the order at the same time want to get quantity from the user and send all parameters to the next page



I suggest Filter in this scenario . do your preRequest and postRequest stuff.

Hope this helps
 
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

Originally posted by seetharaman venkatasamy:
I suggest Filter in this scenario . do your preRequest and postRequest stuff.

I do not think that this is a good idea. Filters should not be used in place of page controllers.

AR REDDY, please adjust your display name to use mixed case. The all uppercase is rather jarring.
 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my display page looks like this
item name item price quantity
xxxxxxx 19.00 user has to enter qty
yyyyyyy 20.00 user has to enter qty
like i have n no of rows
this is the first page I have to send itemname,itemprice to next page database values and quantity is user value.
For example if user enter qty for 10 items how we will send those items to the next page for further calculations.
Thanks in advance
 
reply
    Bookmark Topic Watch Topic
  • New Topic