jaceyrx / examination_system Goto Github PK
View Code? Open in Web Editor NEW一个简单的教务查询系统(主要技术SpringMVC + Spring + Mybatis + Shiro + Bootstrap)
一个简单的教务查询系统(主要技术SpringMVC + Spring + Mybatis + Shiro + Bootstrap)
1.--若提示登录超时、无此用户,先看自己mysql的版本,
注意8.0后版本的驱动为com.mysql.cj.jdbc.Driver
url后需要加?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT&nullCatalogMeansCurrent = true
来设置编码集,所在时区,避免报错。
我的工程中使用的是MySQL8.0.19,再使用相同版本jar包,添加到pom.xml中
mysql
mysql-connector-java
8.0.19
2.若web.xml下的contextConfigLocation爆红
先改为classpath:spring/springmvc.xml
再在pom.xml里把下的整个修改:
src/main/java
/*.properties
/.xml
false
src/main/resources
**/.properties
**/*.xml
false
作者的数据库搭建没有设置外键随父级更新,所以删除操作会有外键冲突问题
这里举例学生页面的删除操作问题修改
在数据库执行以下语句
alter table selectedcourse add constraint FK_selectedcourse_student foreign key(studentID) references student(userID) on delete cascade on update cascade;
我使用的是eclipse最新的版本,解决了项目的导入问题,但是将项目部署到Tomcat中的时候,总是报错,其中的报错都是和tomcat相关的,我已经去掉了servlet-api的引用。你能将项目布置成 在eclipse中的么?我感觉是包的问题,但是有找不到哪里出了问题。谢谢!
404 /login资源找不到
Originally posted by @wanggl617 in #36 (comment)
这个是Mybatis的编码问题,配置jdbc.properties时在jdbcURL后增加参数useUnicode=true&characterEncoding=UTF-8来指定编码格式即可
在admin文件夹中增加了showNotice,jsp文件 但是总是提示404 The requested resource is not available.,请问还有哪里需要改的吗
<plugins> <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>9.4.20.v20190813</version> <configuration> <scanIntervalSeconds>5</scanIntervalSeconds> <webApp> <contextPath>/</contextPath> </webApp> </configuration> </plugin> </plugins>
`pom.xml的build里面加上上面的的内容,然后用mvn`` jetty:run 启动,不要用Tomcat。然后自己在浏览器输入网址。
这个项目我直接导入没问题,但是我一个一个抄下来过一遍出了Bug,于是我又直接复制粘贴文件夹试试,发现还是一样的问题,输入用户名密码之后没反应,没有进入controller,我直接把你那个项目部署到服务器,输入用户名密码直接报404错误,找了好久不知道为什么。也就是但是你那个直接导入本地没问题,部署到服务器出问题,还有复制粘贴重新弄一个项目也出问题。
将一些问题写在这里,希望对后面的同学有所帮助, 我是先看了issues后才搞的项目.
1,代码上没有问题,除了issues中有位同学提到的login.jsp中提到的action路径问题,我偷懒直接按照那位同学修改的(主要是我不考虑登录功能), 修改后可正常运行,刚兴趣的同学去验证这个到底有没有问题吧!
2,代码的xml配置文件也没有问题, 至于contextConfigLocation配置, 本身默认加载web-info下的配置文件,可以改为使用classpath,根据自身情况来,这个是回复issues中的一个同学提出的问题.之所以加载不到文件是因为编译后的本地包中根本没有这些文件.
3,不明白pom中的build标签的配置是为啥?这里的配置没有指定spring相关配置文件路径, 所以我将resources指定为资源文(idea下必须对文件夹指定)件后,又添加了配置,如下:
<resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource>
如果不加这个配置,在idea中对项目install本地部署后, 文件目录中不存在spring相关的xml配置文件.
可能同开发工具有关.这个配置可以更加的细化,最终看自身情况吧.
4,这个项目的mysql驱动使用的包是5.1.41版本,但是目前mysql已经更新到8点多了,需要ssl链接校验一类的要求;可将自己的mysql回退到低版本或者将自己的url设置下,如下:
jdbc.url = jdbc:mysql://localhost:3306/examination_system?characterEncoding=utf8&useSSL=false&serverTimezone=UTC&rewriteBatchedStatements=true
然后更改pom文件中的mysql驱动版本为8点几,如下:
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.11</version> </dependency>
这个项目缺少removeCourse、removeStudent、removeTeacher的jsp页面
eclipse调试成功版本:https://github.com/Zoutao6/examination_system-
自己下载。别发邮件给我了。
你好,这个配置配置generatorConfig.xml没有见相应的配置,请问如何处理呢?
[Suggested description]
Cross SIte Scripting (XSS) vulnerability exists in Examination_System.As of March 14, 2022, there was a cross site scripting vulnerability in the master branch.
[Vulnerability Type]
Cross Site Scripting (XSS)
[Vendor of Product]
https://github.com/JaceyRx/Examination_System
[Affected Product Code Base]
v1.0
[Affected Component]
POST /admin/editCourse HTTP/1.1
Host: localhost:7000
Content-Length: 265
Cache-Control: max-age=0
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: http://localhost:7000/
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: http://localhost:7000/admin/editCourse?id=1
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Cookie: locale=zh-cn; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1645520663,1645696647; JSESSIONID=D01E67ABDC192BABF6A2179D70244246
Connection: close
courseid=1&coursename=C%E8%AF%AD%E8%A8%80%E7%A8%8B%E5%BA%8F%E8%AE%BE%E8%AE%A1%3Cscript%3Ealert%28%22xss%22%29%3C%2Fscript%3E&teacherid=1001&coursetime=%E5%91%A8%E4%BA%8C&classroom=%E7%A7%91401&courseweek=18&coursetype=%E5%BF%85%E4%BF%AE%E8%AF%BE&collegeid=1&score=3
[Attack Type]
Remote
[Impact Code execution]
true
请问一下po包和mapper包下的类怎么生成的呢,MyBatisGeneratorConfig.xml相应的配置工具类在哪里,可以提供一下吗,感激不尽,我的qq1396766036
有问题,可关注公众号:国企程序锅,即可解答。
作者你login.jsp表单中的action路劲写错了,/login应该改为login,花了一个礼拜调试终于给调式出来了,真不容易,就出在了一个不起眼的地方
作者的前端jsp的跳转url写错了,请找到对应的按钮,把onclick里面的地址,比如"/admin/xxx"最前面加上${pageContext.request.contextPath}
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.yml</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
<form class="form-horizontal" role="form" action="login" id="from1" method="post">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/applicationContext-*.xml</param-value>
</context-param>
/
idea先配置好maven,然后用maven导入项目,进去后等它慢慢下载,我用的mysql5.6所以之后只用修改mysql.properties的密码。
然后项目设置添加下资源文件夹,再修改下web.xml中contextConfigLocation,原为/WEB-INF/classes/spring/applicationContext-*.xml,替换/WEB-INF/classes/为classpath:。
然后用tomcat启动这个项目,但是重要的是这个项目启动的Deployment中Artifity:war exploded中Application context为 / 即可成功启动。
导入发现路径都错了,搞得我把jsp的路径全改了一遍,不过最终跑起来了,谢谢楼主,学习一下shiro。
有人提供下么 po下的文件哪里生成的?
我QQ :381558588
作者您好,项目我已经成功跑起来了,代码有一部分不太理解,想和您探讨下,能麻烦留个联系方式吗?微信QQ都可以
qq254777938
你好,我把你的项目maven方式导入到eclipse中,加载不到tomcat里面,你可以吧本地工程发给我一下吗[email protected],谢谢
对这个内容所知甚少,希望有人能告知实现的大概过程。这样方便理解这个程序。
你好,我最近在学习你这个项目,仿照你的项目做系统。现在有一些不懂的问题,希望能够获得你的联系方式
作者你好,我想问下项目中的StudentExample、CourseExample等以example结尾的累是做什么的?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.