为了账号安全,请及时绑定邮箱和手机立即绑定

毕设经典-超市进销存管理系统(SSM)-分类设计以及视图解析器分析

标签:
SSM

前言

老生常谈的进销存系统,运用SSM框架,结合简洁的UI界面,看起来还是蛮舒服的。这款进销存系统我设计了3天吧,由于很赶工,所以很多小的细节都没有设计的很完美,但是有了基本的雏形,而且给我感觉,其实和之前设计的其他SSM框架真的大同小异的,所以,我做这种项目真的是越做越快,也越来越熟练。

项目展示

首页
销售管理
出货单
用户管理

设计思路

根据需求,我分析出,这里需要管理的只有商品和人员,然后设计数据库,需要商品信息表,进货单,出货单,人员信息表,商品类别表,登录账户表,一共这6个表就够了,然后根据各个功能点设计接口,功能分析如下:
功能分析
这里需要注意的是,在商品分类的时候,我默认设计的二级的分类管理,由于之前有参考过其他分类分级的方法,我这里并非写死的二级分类表,而是可以无限级的扩展,虽然无限级的扩展没什么用,但是我我觉得比写死的要好的多。
商品种类表:
商品种类表
设计思路就是利用三位数字表示三个种类例如1、2、3分别表示三个初始大类,101,201,301,则表示三个大类下的二级小类
商品种类项

视图解析器

 <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/html/"></property>
        <property name="suffix" value=".html"></property>
    </bean>

API 文档

public class InternalResourceViewResolver
extends UrlBasedViewResolver
Convenient subclass of UrlBasedViewResolver that supports InternalResourceView (i.e. Servlets and JSPs) and subclasses such as JstlView.
The view class for all views generated by this resolver can be specified via UrlBasedViewResolver.setViewClass(java.lang.Class<?>). See UrlBasedViewResolver’s javadoc for details. The default is InternalResourceView, or JstlView if the JSTL API is present.
BTW, it’s good practice to put JSP files that just serve as views under WEB-INF, to hide them from direct access (e.g. via a manually entered URL). Only controllers will be able to access them then.
Note: When chaining ViewResolvers, an InternalResourceViewResolver always needs to be last, as it will attempt to resolve any view name, no matter whether the underlying resource actually exists.
Since:
17.02.2003
Author:
Juergen Hoeller

释义

UrlBasedViewResolver的子集支持InternalResourceView.
这个解析器生成的所有视图的视图类都可以通过UrlBasedViewResolver.setViewClass(java.lang.Class<?>)指定。有关详细信息,请参见UrlBasedViewResolver的javadoc。默认值是InternalResourceView,如果存在JSTL API,则为JstlView
顺便说一下,将仅作为WEB-INF视图的JSP文件放在WEB-INF下是一个很好的实践,这样可以避免直接访问(例如通过手动输入URL)。只有控制器才能访问它们。

API 文档

public InternalResourceViewResolver(String prefix,
String suffix)
A convenience constructor that allows for specifying prefix and suffix as constructor arguments.
Parameters:
prefix - the prefix that gets prepended to view names when building a URL
suffix - the suffix that gets appended to view names when building a URL
Since:
4.3

释义

公共InternalResourceViewResolver(字符串前缀,
字符串后缀)
一个方便的构造函数,允许将前缀和后缀指定为构造函数参数。
参数:
前缀——在构建URL时,用于查看名称的前缀
后缀——在构建URL时附加到视图名称的后缀
开始于:
4.3

解析结果

当我在地址栏输入:http://localhost:8080/pssmsys/front/index 其实是访问的 WEB-INF/html/index.html

点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
JAVA开发工程师
手记
粉丝
30
获赞与收藏
154

关注作者,订阅最新文章

阅读免费教程

  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消