Simple download of the source code of the SSH2 development shopping website, and download of the ssh2 source code
Original article: simple download of the source code of the SSH2 development shopping website
Source code: http://www.zuidaima.com/share/1550463431412736.htm
Simple shopping website, using SSH2
How to handle program bugs:
Severe: StandardWrapper. Throwable
Java. lang. IllegalStateException: Cannot initialize context because there is already a root application context present-check whether you have multiple ContextLoader * definitions in your web. xml!
Solution: annotate the web. xml file.
<! -- Spring
<Servlet>
<Servlet-name> context </servlet-name>
<Servlet-class>
Org. springframework. web. context. ContextLoaderServlet
</Servlet-class>
<Load-on-startup> 1 </load-on-startup>
</Servlet>
-->
The jar package is missing:
Http://www.zuidaima.com/jar/search/jstl-1.0.1.htm
Http://www.zuidaima.com/jar/search/servlet-api-2.4.htm
Http://www.zuidaima.com/jar/search/standard-1.0.1.htm
For more information, see: shopping.
Which can be downloaded to the java source code of the SSH2 + JQuery web project. It is not a simple logon function and cannot be complicated. It is suitable for beginners to learn.
You can go to csdn to check whether there are many programs on it.
Code of the ssh2 Project (especially shopping cart, or shopping cart and jsp can also be referenced)
The first storage is stored in the session. in put ("test", test), however, you save it in the second time, So it overwrites the first result and inserts the second result directly,
Solution: 1. Save the information about the shopping cart in the Table. Each time you add a commodity, a piece of data is added to the table,
2: If the shopping cart is saved to the session, a set is saved in the session. Each time a piece of data is added to the set, the set is resaved to the session,
3: Save the shopping cart information in the cookie. The method and session are saved,
We recommend that you use a table for storage, which is much more convenient and saves a lot of trouble. You can check the database directly each time you use it, which is also easier for future maintenance.
OK! Pick up your keyboard.