File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing parameters

 
Ar Reddy
Greenhorn
Posts: 20
  • 0
  • Mark post as helpful
  • send pies
  • 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 .
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • 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).
 
Amit Ghorpade
Bartender
Posts: 2851
10
Fedora Firefox Browser Java
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64181
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic