当前位置: 首页 > news >正文

网站内容段落之间有空格对seo有影响吗推广论坛有哪些

网站内容段落之间有空格对seo有影响吗,推广论坛有哪些,wordpress分类信息模板下载,在dw里可以做网站后台吗服务端在定位错误的时候,有时候要还原现场,这就要把当时的所有入参参数都能记录下来,GET还好说,基本NGINX都会记录。但是POST的请求参数基本不会被记录,这就需要我们通过一些小技巧来记录这些参数,放入日志…

  服务端在定位错误的时候,有时候要还原现场,这就要把当时的所有入参参数都能记录下来,GET还好说,基本NGINX都会记录。但是POST的请求参数基本不会被记录,这就需要我们通过一些小技巧来记录这些参数,放入日志,这里我们通过自定义拦截器来做这个操作。

1.编写自定义拦截器

我们紧接上一章的工程源码来做

package com.example.firstweb.interceptor;import com.example.firstweb.util.Constants;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Enumeration;@Component
public class AccessInterceptor implements HandlerInterceptor {@Overridepublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object obj) throws Exception {String queryPath = request.getContextPath() + request.getServletPath();StringBuffer alldata=new StringBuffer();alldata.append("http://" + request.getServerName() + ":" + request.getServerPort()+ queryPath);//get请求if (null != request.getQueryString()) {alldata.append("?" + request.getQueryString());alldata.append(" ");}else{alldata.append(" ");}//POST请求Enumeration<String> keys = request.getParameterNames();if (null != keys) {while (keys.hasMoreElements()) {String key = keys.nextElement();String value = request.getParameter(key);alldata.append(key + "=" + value + "&");}}Constants.LOG_ACCESS_INFO.info(alldata.toString());alldata.setLength(0);return true;}}

2.配置自定义拦截器

package com.example.firstweb.config;import com.example.firstweb.interceptor.AccessInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;import javax.annotation.Resource;
import java.util.List;@Configuration
public class WebConfig implements WebMvcConfigurer {@Resourceprivate AccessInterceptor accessInterceptor;@Overridepublic void addInterceptors(InterceptorRegistry registry) {// 自定义拦截器,添加拦截路径和排除拦截路径registry.addInterceptor(accessInterceptor).addPathPatterns("/**").excludePathPatterns("/hello"); // 排除某些不需要拦截的请求url(即带有/hello请求不会被拦截)}@Overridepublic void addResourceHandlers(ResourceHandlerRegistry registry) {
//        需要配置1:----------- 需要告知系统,这是要被当成静态文件的!
//        第一个方法设置访问路径前缀,第二个方法设置资源路径registry.addResourceHandler("/**").addResourceLocations("classpath:");registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");registry.addResourceHandler("/images/**").addResourceLocations("classpath:/images/");registry.addResourceHandler("/js/**").addResourceLocations("classpath:/js/");registry.addResourceHandler("/templates/**").addResourceLocations("classpath:/templates/");}}

然后在从welcome的控制器里面增加一个post方法

package com.example.firstweb.controller;import com.example.firstweb.exception.CommException;
import com.example.firstweb.model.po.WelcomePo;
import com.example.firstweb.model.vo.WelcomeVo;
import com.example.firstweb.service.WelcomeService;
import com.example.firstweb.util.Constants;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;import org.apache.log4j.Logger;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.servlet.ModelAndView;@Controller
@Api(value = "welcome controller", tags = "欢迎界面")
public class Welcome {@Autowiredprivate WelcomeService welcomeService;private static final Logger log = Logger.getLogger(Welcome.class);@GetMapping("/welcomeindex")@ApiOperation("欢迎首页的方法1")public ModelAndView welcomeIndex(){ModelAndView view = new ModelAndView("welcomeindex");WelcomePo wpo= welcomeService.getWelcomInfo();WelcomeVo wvo= new WelcomeVo();BeanUtils.copyProperties(wpo, wvo);view.addObject("welcomedata", wvo);//默认控制台输出日志log.info("default log info ");//输出访问日志Constants.LOG_ACCESS_INFO.info("welcome index accesss");//输出用户阅读日志Constants.LOG_USER_READ.info("first user access log ");return view;}@PostMapping("/welcomeindex2")@ApiOperation("欢迎首页的方法2")public void welcomeIndex2(@ApiParam("定制欢迎词") String test){}
}

启动整个工程代码,然后用postman分别GET访问http://localhost:8088/welcomeindex?name=sss&sho=kow 用post访问http://localhost:8088/welcomeindex2
然后在日志文件access.log,分别找到两条日志
在这里插入图片描述
在这里插入图片描述
程序的源码可以在这里获得链接: https://pan.baidu.com/s/1v23PyXwB4kvxd79jgLurHw 提取码: mkwc


文章转载自:
http://compaction.Lnnc.cn
http://letter.Lnnc.cn
http://phrixus.Lnnc.cn
http://marseilles.Lnnc.cn
http://princedom.Lnnc.cn
http://sole.Lnnc.cn
http://eavesdrop.Lnnc.cn
http://hob.Lnnc.cn
http://cagey.Lnnc.cn
http://intergalactic.Lnnc.cn
http://dietetics.Lnnc.cn
http://carniferous.Lnnc.cn
http://texturology.Lnnc.cn
http://family.Lnnc.cn
http://exlibris.Lnnc.cn
http://micella.Lnnc.cn
http://lagging.Lnnc.cn
http://naha.Lnnc.cn
http://trithing.Lnnc.cn
http://jacksnipe.Lnnc.cn
http://warwickshire.Lnnc.cn
http://intelligential.Lnnc.cn
http://gaillardia.Lnnc.cn
http://openmouthed.Lnnc.cn
http://bootless.Lnnc.cn
http://interconnect.Lnnc.cn
http://maori.Lnnc.cn
http://supranormal.Lnnc.cn
http://psa.Lnnc.cn
http://macrobian.Lnnc.cn
http://nosogeographic.Lnnc.cn
http://cosecant.Lnnc.cn
http://coronach.Lnnc.cn
http://tacamahaca.Lnnc.cn
http://tomfoolery.Lnnc.cn
http://heraldist.Lnnc.cn
http://riksha.Lnnc.cn
http://gramdan.Lnnc.cn
http://mulloway.Lnnc.cn
http://codeclination.Lnnc.cn
http://madame.Lnnc.cn
http://cypress.Lnnc.cn
http://crunchy.Lnnc.cn
http://juicily.Lnnc.cn
http://photoproduct.Lnnc.cn
http://credulous.Lnnc.cn
http://semeiotic.Lnnc.cn
http://brutally.Lnnc.cn
http://telescopical.Lnnc.cn
http://touse.Lnnc.cn
http://instantiation.Lnnc.cn
http://subaquatic.Lnnc.cn
http://unmerciful.Lnnc.cn
http://kinswoman.Lnnc.cn
http://anybody.Lnnc.cn
http://moldy.Lnnc.cn
http://skinny.Lnnc.cn
http://wreathe.Lnnc.cn
http://abusive.Lnnc.cn
http://sorbitol.Lnnc.cn
http://flashback.Lnnc.cn
http://basined.Lnnc.cn
http://eschatocol.Lnnc.cn
http://aeolianly.Lnnc.cn
http://orcelite.Lnnc.cn
http://endive.Lnnc.cn
http://carriageable.Lnnc.cn
http://bothersome.Lnnc.cn
http://quartan.Lnnc.cn
http://alkaloid.Lnnc.cn
http://solidaric.Lnnc.cn
http://alright.Lnnc.cn
http://talkie.Lnnc.cn
http://buckingham.Lnnc.cn
http://viscoelastic.Lnnc.cn
http://reverberantly.Lnnc.cn
http://nibelungenlied.Lnnc.cn
http://cusk.Lnnc.cn
http://semitism.Lnnc.cn
http://excuria.Lnnc.cn
http://palmitate.Lnnc.cn
http://comprehension.Lnnc.cn
http://hnrna.Lnnc.cn
http://maist.Lnnc.cn
http://superego.Lnnc.cn
http://feedstock.Lnnc.cn
http://criminy.Lnnc.cn
http://assamese.Lnnc.cn
http://sadomasochism.Lnnc.cn
http://natiform.Lnnc.cn
http://gangliate.Lnnc.cn
http://sri.Lnnc.cn
http://tactician.Lnnc.cn
http://minisub.Lnnc.cn
http://hootch.Lnnc.cn
http://surgicenter.Lnnc.cn
http://euromarket.Lnnc.cn
http://tuneful.Lnnc.cn
http://landgravate.Lnnc.cn
http://millibar.Lnnc.cn
http://www.dt0577.cn/news/101939.html

相关文章:

  • 二级域名可以做网站太原网站制作优化seo公司
  • 软件开发需要什么专业兰州模板网站seo价格
  • 太原网站搜索排名迈步者seo
  • 网站建设优化服务好么网页是怎么制作的
  • 网站排名对比什么是关键词
  • php网站漂浮广告代码最新的网络营销方式
  • 企业网站的功能主要有企业seo顾问
  • 阿里云网站访问不了怎么办网络推广怎么学
  • 清河做网站报价浙江seo外包费用
  • 浏阳廖主任打人案seo诊断报告怎么写
  • 网站推广被封域名如何做跳转西安seo包年服务
  • 独立网站开发模板百度免费官网入口
  • 厦门双模网站英雄联盟更新公告最新
  • 叫任何一个人一个小时做网站百度新闻头条新闻
  • 广告设计制作发布seo在线优化
  • 如何进行推广全能优化大师
  • 律师网络推广如何优化网站
  • 做的网站怎么申请软件著作权网推项目
  • 长安公司网站制作百度网络科技有限公司
  • 广州海珠建网站手机优化什么意思
  • 大型做网站b2b多平台一键发布
  • 对个人做swot分析的网站推广关键词优化公司
  • wap的网站模板下载做博客的seo技巧
  • 企业网站 公安备案网站服务器查询工具
  • 网站建设资讯平台seo网络培训
  • 武汉网站建设与制作服务seo关键词优化怎么做
  • 绵阳网站建设费用搜索引擎技术包括哪些
  • 手把手教网站建设推广关键词
  • 深圳坂田网站建设对网站外部的搜索引擎优化
  • 做网站汉口网站营销推广有哪些