In the SSH framework spring configuration: scope= "Prototype"

Source: Internet
Author: User

" You can use the container's scope=" prototype "to ensure that each request has a separate action to handle, avoiding thread-safety issues with the action in Struts . "
  How do you understand this sentence? What happens if we use a single case?
  
Spring default scope is a  singleton mode .
This will only create an Action object
Each access is the same action object, the data is unsafe
Struts2 is required to have a different action for each visit
Scope= "Prototype" is a prototype mode that ensures that an action object is created when a request is made
Prototype mode: Re-create each time the request is re-created.

Reference: http://www.cnblogs.com/JemBai/archive/2010/11/10/1873954.html


In the SSH framework spring configuration: scope= "Prototype"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.