473,473 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Best way to store user's choices in JSP site

6 New Member
Hello everybody

I am working on a Website built on JSP and Servlets . one of the features of the site is to give user the chance to subscribe to different newsletters under different categories.

So for example, user1 surfs to the page which displays category sport and under that some options (check boxes) and he can choose zero or more, and he clicks to add the next catetory options , for example entertainement.


I am new at Java and I'd be grateful if you help me with my questions:

1. What is the best way to keep user's choices as he surfs and adds options under each category ? I thought of using session vars , in form of arrays, but I wonder if there is a better more efficient way ?

2. At the last page, user is shown the category names with two links beside them , edit and remove (he will not see the individual choices under each category) ... could you also advise what is the best way to implement this as well? For example if I use array session vars, I am not sure how to display that particular page again ...


The categories and options under each are stored in database. User's choices are not commited to DB until he reviews the summary and clicks confirm button at the last stage.

Thank you in advance
Vajra
Oct 4 '07 #1
5 2034
r035198x
13,262 MVP
Hello everybody

I am working on a Website built on JSP and Servlets . one of the features of the site is to give user the chance to subscribe to different newsletters under different categories.

So for example, user1 surfs to the page which displays category sport and under that some options (check boxes) and he can choose zero or more, and he clicks to add the next catetory options , for example entertainement.


I am new at Java and I'd be grateful if you help me with my questions:

1. What is the best way to keep user's choices as he surfs and adds options under each category ? I thought of using session vars , in form of arrays, but I wonder if there is a better more efficient way ?

2. At the last page, user is shown the category names with two links beside them , edit and remove (he will not see the individual choices under each category) ... could you also advise what is the best way to implement this as well? For example if I use array session vars, I am not sure how to display that particular page again ...


The categories and options under each are stored in database. User's choices are not commited to DB until he reviews the summary and clicks confirm button at the last stage.

Thank you in advance
Vajra
Tha values that your user enters are automatically passed to the next page as parameters if you include them in a form.
You can get them in the next JSP page using request.getParameter or request.getParameterValues (if the values are array type).
Oct 4 '07 #2
vajra1987
6 New Member
Tha values that your user enters are automatically passed to the next page as parameters if you include them in a form.
You can get them in the next JSP page using request.getParameter or request.getParameterValues (if the values are array type).

Thank you for your reply. There are two things to consider :

1. There are around 6,7 categories. So each time user selects options from each , this should be kept until end of the process. If I use request parameters they will only last from one page to next.

2. From the summary page , something like this is displayed to user if he has choices from 3 categoires of Sport , Social, Home ; but he did not choose anything from Movies and other categories:

Sport : edit (hyperlink) , remove (hyperlink)
Social : edit (hyperlink) , remove (hyperlink)
Home edit (hyperlink) , remove (hyperlink)


The user should have a choice to go back to each category page and edit it (he will see his previous choices in check boxes), or just by clicking a link in the final summary page, to remove it. I don't think this can be done using request parameters.

Could you please help?
Thank you
Oct 4 '07 #3
r035198x
13,262 MVP
Thank you for your reply. There are two things to consider :

1. There are around 6,7 categories. So each time user selects options from each , this should be kept until end of the process. If I use request parameters they will only last from one page to next.

2. From the summary page , something like this is displayed to user if he has choices from 3 categoires of Sport , Social, Home ; but he did not choose anything from Movies and other categories:

Sport : edit (hyperlink) , remove (hyperlink)
Social : edit (hyperlink) , remove (hyperlink)
Home edit (hyperlink) , remove (hyperlink)


The user should have a choice to go back to each category page and edit it (he will see his previous choices in check boxes), or just by clicking a link in the final summary page, to remove it. I don't think this can be done using request parameters.

Could you please help?
Thank you
Store the values in the session then.
Oct 4 '07 #4
vajra1987
6 New Member
Store the values in the session then.
Is array the only way to do this ? Are there any kind of table structures available fit for this purpose ?

Thanks
Oct 4 '07 #5
r035198x
13,262 MVP
Is array the only way to do this ? Are there any kind of table structures available fit for this purpose ?

Thanks
You mentioned options in your problem description so I thought you were using selects which are really just Javascript arrays.
Oct 4 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Joshua Beall | last post by:
Hi All, What is the best way to use a cookie to remember a logged in user? Would you store the username and password in two separate cookies? Should the password be plain text? Hashed? Not...
10
by: Bob Bedford | last post by:
Sorry if I post here, but I don't have access to any valuable mysql ng for this question, ans since 99% or php programmers deal with mysql, I'm sure I'll get an answer here. Look at the...
131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
14
by: 42 | last post by:
Hi, Stupid question: I keep bumping into the desire to create classes and properties with the same name and the current favored naming conventions aren't automatically differentiating them......
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
6
by: Sandy | last post by:
Hello - I have a book that illustrates pulling menu items from a Sql Server table into an ascx via a stored procedure. Is this something that is done in the real world? I do like the effect...
12
by: dbuchanan | last post by:
I am designing a table to contain a field to stores a value that must indicate none, one, or many choices. The form will have a group box with checkboxes (multi-choice) You see the records in...
13
by: processoriented | last post by:
I am trying to find the best approach to do something here... situation is this... One of the tables in my dataset is a "Work Order" table with information about what needs to be done and where. ...
3
by: gordon | last post by:
Hi I am looking to store some details about a user's configuration choices, in particular the place where they have installed some data files, the OS that they use, and their Windows user name. ...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.