1. 提交表单时 进行 两次 提交html
答: 缘由: 将 按钮 type设置 为 submit ,若将type 设置为 button 才正确。nginx
2. 使用 mybatis 自动 生成代码时,数据表中外键需不须要 在 数据库中指定出来,若是不指定出来,那么须要怎么查询?数据库
例如: 商品中 分类 是 外键,当须要根据类型进行查询时应该怎么查?
答: 表中不使用外键,先查出分类id,再根据 id 查出 商品 id.json
3. jsp 中 if标签中运算:跨域
<input class="switch switch-anim" name="haschoice" type="checkbox" <c:if test="${haschoice==1}">checked</c:if> id="haschoice" >
4. 使用video.js进行视频播放时,一直没法下载视频,mybatis
解决办法:在nginx中配置跨域访问 例子: xc-ui-pc-static-portal下video.htmlscors
#学成网媒体服务代理 server { listen 80; server_name video.xuecheng.com; location /video{ proxy_pass http://video_server_pool; add_header Access-Control-Allow-Origin $origin_list; add_header Access-Control-Allow-Credentials true; add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS'; } } #学成网媒体服务代理 map $http_origin $origin_list{ default http://www.xuecheng.com ; "~http://www.xuecheng.com" http://www.xuecheng.com ; "~http://ucenter.xuecheng.com" http://ucenter.xuecheng.com ; "~http://video.xuecheng.com" http://video.xuecheng.com ; }