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

  • SEARCH
  • Home
  • 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 8218691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:53:18+00:00 2026-06-07T12:53:18+00:00

I am working on an basic Shopping Cart assignment in Springs . The functionalities

  • 0

I am working on an basic Shopping Cart assignment in Springs. The functionalities of the assignment are just to display a given set of products – with info (with an add to cart button). My problem is, integrating the Add button click with the shopping cart display in the JSP page.

How to use application session to obtain and persist information across multiple “Add” button clicks?

Here is the code snippet:

<script type="text/javascript"> 
var noOfClicks = 0; // Used to count the number of Clicks. 
function button_click() { 
  noOfClicks++; // On click of the button the value is incremented.        
  document.getElementById("item").value = noOfClicks; 
} 
</script>

How do I check if the button is clicked and add it to cart with its attributes (Quantity, Price etc) in a separate summary table?

  • 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. Editorial Team
    Editorial Team
    2026-06-07T12:53:21+00:00Added an answer on June 7, 2026 at 12:53 pm

    You can use session scoped spring beans for shopping cart. It means that this bean is created when a new HttpSession is created and preserved as long as the HttpSession is valid. Spring uses AOP to extract the sessionId from the httprequest and manage the lifecycle of the bean.

    http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch04s04.html#beans-factory-scopes-global-session

    [Example] http://web.archive.org/web/20080828160606/http://www.memestorm.com/blog/session-scoped-beans-in-spring-20/

    In the action class of ‘Add’ activity, access the session object and add the selected item to the session cart object.

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

Sidebar

Related Questions

I'm working on an online store in Django (just a basic shopping cart right
I'm working on a very basic shopping cart system. I have a table items
Im working with a shopping cart plugin and that uses a basic form on
I just started learning Zend. I managed to get the basic working (using zf
I'm currently working on a basic form. When you hit the submit button, it
I'm using the basic PayPal shopping cart (Website Payments Standard). I have the following
I am just working with basic level of javascripts. Today I found the below
I have a service, as follows: The most basic (working) CherryPy 3.1 Windows service
Basic summary: Working on a game that generates a 15x15 grid for the player
I am working on a basic encryption program for a school project, and I

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.