网站创建_前期知识准备
- 相关技术
- 常见问题
相关技术
idea、vue、springmvc、springboot,ajax,redis
常见问题
- 打开域名直接跳转对应的请求或者页面,pom文件中配置
<welcome-file-list>
<welcome-file>/smile/</welcome-file>
- idea清除缓存
file-》Invalidate caches/Restart
- 打包
maven clean package
maven clean package -Dmaven.test.skip=true 测试文件不打包
- 有些jar包用maven下载后没有下载下jar文件
例如ojdbc14,直接使用maven下载,只能下载下文件夹,真正有用的ojdbc14-10.2.0.4.0.jar没有
我们可以自行下载jar 上传到本地的maven仓库使用
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc14</artifactId>
<version>10.2.0.4.0</version>
</dependency>
下载ojdbc14-10.2.0.4.0.jar 到maven本地仓库,在idea左下角的的Terminal中执行
- 使用Vue.js 报错 Cannot find element: #app
主要是操作的js要写在div的定义下面
- 页面的嵌套:嵌套界面不起作用
写一个外层的页面webModel.html,每次返回页面用webModel对返回的页面做封装(添加上头部,尾部,保证界面的一致性),thymeleaf以pom的形式引入,但是thymeleaf的版本不同,有的包含layout,有的版本不含有layout,所以如果失效要查看一下包中是否含有layout,如果不包含添加
<dependency>
<groupId>nz.net.ultraq.thymeleaf</groupId>
<artifactId>thymeleaf-layout-dialect</artifactId>
</dependency>
- json数据的返回类型json需封装下:
原先写json的返回需要封装一下,在创建springboot的项目时,应添加包,使用goog的gson也可以
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
或者
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
这个包会进行json的转换,所以我们只要正常返回值即可
- vue单页面多函数
-
vue.一个js里面仅仅允许写一个new Vue({,多写会覆盖,一般vue都是单页面的不需要多页面,一般一个实例就够了
-
注意 写循环的时候,js页面在写v-for那一行就开始循环了
-
要注意实例不可以嵌套,嵌套了实例,内层的实例是不显示的,其实可能还是自己使用的有问题
Vue 的好处,我看到数据的双向绑定,非常的有用并且大量的减少了原先使用jquery写的代码
- git 在内网的安装连接github:ssh: connect to host github.com port 22: Connection timed out
执行 ssh -T git@github.com连接不上github
ssh: connect to host github.com port 22: Connection timed out或者不知道 github.com 等等信息
首先要排查你是不是在内网,内网要设置代理:
$ git config --global http.proxy 代理ip:8080也不行
解决方案;
vim ~/.ssh/config
Host github.com *.github.com
ProxyCommand connect -H 代理ip:8080 %h %p
IdentityFile ~/.ssh/id_rsa
User git
- 内网安装组件遇见的问题
1.idea安装插件
settings-》plugins-》输入要下载的插件名例如scala-》install jetBrains plugin-》在下方有http proxy settings-》
maven在局域网的配置
修改配置文件settings.xml
<proxies>
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>gbicc_o</username>
<password>12348765</password>
<host>代理ip</host>
<port>8080</port>
<nonProxyHosts>10.*;ods.*</nonProxyHosts>
</proxy>
</proxies>
扩展:现在很多公司前后台分离,发现测试后台的工具postMan
- 一些解决问题的网址:
Thymeleaf:http://www.zslin.com/web/article/detail/31
Json和字符串之间的转换,测试json的数据应该常用到
https://www.cnblogs.com/longailong/p/7344567.html
Vue的生命周期:
https://segmentfault.com/a/1190000008570622
Elasticsearch例子:
https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-search.htm
git的安装使用的:
https://blog.csdn.net/laozitianxia/article/details/50682100
内网安装git需要设置代理:
http://www.chenyudong.com/archives/use-git-or-github-in-company-local-net.html