File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes passing parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing parameters" Watch "passing parameters" New topic
Author

passing parameters

Ar Reddy
Greenhorn

Joined: Nov 03, 2008
Posts: 20
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

Joined: Mar 24, 2008
Posts: 3855

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).


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Jan 10, 2002
Posts: 61610
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ar Reddy
Greenhorn

Joined: Nov 03, 2008
Posts: 20
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing parameters