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

专业做书画推广的网站镇江网站seo

专业做书画推广的网站,镇江网站seo,淘客网站后台怎么做,网络设计是干什么的呢mvc接收各种请求 1-环境搭建 1.1-准备apifox发送请求 1.2-项目搭建 ①创建Web骨架的Maven项目 ​ --打开2023-IDEA ,选择New Project ​ --选择Maven Archetype ​ --注意点:Catalog默认就行了 ​ --Archetype选择webapp ​ --JDK跟着黑马敲最好…

mvc接收各种请求

1-环境搭建

1.1-准备apifox发送请求
1.2-项目搭建
①创建Web骨架的Maven项目

​ --打开2023-IDEA ,选择New Project

​ --选择Maven Archetype

​ --注意点:Catalog默认就行了

​ --Archetype选择webapp

​ --JDK跟着黑马敲最好用11

②创建好以上包结构

在这里插入图片描述

③导入pom.xml坐标
 <dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency><dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version><scope>provided</scope></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>5.2.10.RELEASE</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.2.6</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis</artifactId><version>3.5.6</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.33</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-jdbc</artifactId><version>5.2.10.RELEASE</version></dependency><dependency><groupId>com.fasterxml.jackson.core</groupId><artifactId>jackson-databind</artifactId><version>2.9.0</version></dependency><dependency><groupId>org.mybatis</groupId><artifactId>mybatis-spring</artifactId><version>3.0.3</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>RELEASE</version><scope>provided</scope></dependency></dependencies>
④导入各种类,接口等

​ --config配置类

//ServletContainersInitConfig
public class ServletContainersInitConfig extends AbstractAnnotationConfigDispatcherServletInitializer {protected Class<?>[] getRootConfigClasses() {return new Class[]{SpringConfig.class};}protected Class<?>[] getServletConfigClasses() {return new Class[]{SpringMvcConfig.class};}protected String[] getServletMappings() {return new String[]{"/"};}@Overrideprotected Filter[] getServletFilters() {CharacterEncodingFilter charactFilter =  new CharacterEncodingFilter();charactFilter.setEncoding("UTF-8");return new Filter[]{charactFilter};}
}//SpringConfig
@Configuration
@ComponentScan(value = "com.bdqn",excludeFilters = @ComponentScan.Filter(type = FilterType.ANNOTATION, classes = Controller.class)) //排除注解类型,排除Controller.class
public class SpringConfig {
}//SpringMvcConfig
@Configuration //标识这是一个配置类
@ComponentScan("com.bdqn.controller") //对指定范围进行扫包,对容器注册Bean对象
@EnableWebMvc //@EnableWebMvc 的作用是将当前的配置类标识为 Spring MVC 的配置类,并通过自动配置和默认功能,为我们提供方便快捷的 Spring MVC 开发环境。
public class SpringMvcConfig {
}

​ --controller包

//UserController
@Controller
public class UserController {@RequestMapping("/save")@ResponseBodypublic String save(){System.out.println("user save ...");return "{'info':'springmvc'}";}//post带中文参数的接收@RequestMapping("/getUser")@ResponseBodypublic String getUser(String name,int age){System.out.println("姓名:"+name);System.out.println("年龄:"+age);return "{'name':'"+name+"','age':'"+age+"',}";}//post发送json数据的接收@RequestMapping("/getJson")@ResponseBodypublic String getJson(@RequestBody User user){System.out.println("姓名:"+user.getName());System.out.println("年龄:"+user.getAge());return "{'name':'"+user.getName()+"','age':'"+user.getAge()+"',}";}
}

​ --mapper包

public interface UserDao {@Insert("insert into tbl_user(name,age)values(#{name},#{age})")public void save(User user);
}

​ --pojo包

@Data
public class User {private Integer id;private String name;private Integer age;//setter..getter..toString略
}

​ --service包

public interface UserService {public void save(User user);
}

​ --impl

@Service
public class UserServiceImpl implements UserService {@Overridepublic void save(User user) {System.out.println("user service ...");}
}

2-请求参数

2.1-普通参数
①接口参数
请求类型--get请求地址--http://localhost/commonParamDifferentName?name=张三&age=18请求参数--name=张三&age=18请求名称:普通参数请求    
②接收代码
@RequestMapping("/commonParamDifferentName")
@ResponseBody
public String commonParamDifferentName(String userName , int age){System.out.println("普通参数传递 userName ==> "+userName);System.out.println("普通参数传递 age ==> "+age);return "{'module':'common param different name'}";
}
2.2-pojo参数
①接口参数
请求类型--post请求地址--http://localhost/pojoParam请求参数--name=张三&age=18请求名称:pojo参数请求    
②接收代码
//POJO参数:请求参数与形参对象中的属性对应即可完成参数传递
@RequestMapping("/pojoParam")
@ResponseBody
public String pojoParam(User user){System.out.println("pojo参数传递 user ==> "+user);return "{'module':'pojo param'}";
}

文章转载自:
http://dinncoecpc.stkw.cn
http://dinncooverjoyed.stkw.cn
http://dinncoabutment.stkw.cn
http://dinncoslob.stkw.cn
http://dinncoblackbird.stkw.cn
http://dinncofulminate.stkw.cn
http://dinncometeoric.stkw.cn
http://dinncocristobalite.stkw.cn
http://dinncoredistill.stkw.cn
http://dinncolacrymatory.stkw.cn
http://dinncohaemophiloid.stkw.cn
http://dinncoperchlorate.stkw.cn
http://dinncogerfalcon.stkw.cn
http://dinncobuddhahood.stkw.cn
http://dinncoinadaptability.stkw.cn
http://dinncoremint.stkw.cn
http://dinncocoleorhiza.stkw.cn
http://dinncowinter.stkw.cn
http://dinncocharta.stkw.cn
http://dinncoregulation.stkw.cn
http://dinncosetaceous.stkw.cn
http://dinncoecclesiae.stkw.cn
http://dinncoposnet.stkw.cn
http://dinncoalpha.stkw.cn
http://dinncopharisee.stkw.cn
http://dinncoexception.stkw.cn
http://dinncouncontroverted.stkw.cn
http://dinncoquirkily.stkw.cn
http://dinncoladin.stkw.cn
http://dinncogintrap.stkw.cn
http://dinncoparquet.stkw.cn
http://dinncowalsall.stkw.cn
http://dinncosarcocele.stkw.cn
http://dinncoroselle.stkw.cn
http://dinncoliterature.stkw.cn
http://dinncowatercart.stkw.cn
http://dinncotransportation.stkw.cn
http://dinncocarcass.stkw.cn
http://dinncohousebreaker.stkw.cn
http://dinncofolknik.stkw.cn
http://dinncoskinbound.stkw.cn
http://dinncocoatee.stkw.cn
http://dinncoreleasable.stkw.cn
http://dinncotchick.stkw.cn
http://dinncocolligative.stkw.cn
http://dinncoshmutz.stkw.cn
http://dinncoautoland.stkw.cn
http://dinncophysoclistous.stkw.cn
http://dinncodiastema.stkw.cn
http://dinncocentripetalism.stkw.cn
http://dinncocleat.stkw.cn
http://dinncolunulate.stkw.cn
http://dinncoranter.stkw.cn
http://dinncorepeatable.stkw.cn
http://dinncotransmit.stkw.cn
http://dinncoclock.stkw.cn
http://dinncoduct.stkw.cn
http://dinncoftp.stkw.cn
http://dinncosmithcraft.stkw.cn
http://dinncoeyeless.stkw.cn
http://dinncophytobenthon.stkw.cn
http://dinncokidnapper.stkw.cn
http://dinncoboatbill.stkw.cn
http://dinncodendroclimatic.stkw.cn
http://dinncolocket.stkw.cn
http://dinncounendued.stkw.cn
http://dinnconeoanthropic.stkw.cn
http://dinncoecaudate.stkw.cn
http://dinncomercaptan.stkw.cn
http://dinncoaerogram.stkw.cn
http://dinncofrontlessly.stkw.cn
http://dinncodegranulation.stkw.cn
http://dinncodepigmentation.stkw.cn
http://dinncoeightpence.stkw.cn
http://dinncodefenestration.stkw.cn
http://dinncoyahrzeit.stkw.cn
http://dinncotransferee.stkw.cn
http://dinncojugfet.stkw.cn
http://dinncotenuous.stkw.cn
http://dinncopeke.stkw.cn
http://dinncosatanophobia.stkw.cn
http://dinncodefend.stkw.cn
http://dinncooath.stkw.cn
http://dinncococa.stkw.cn
http://dinncopesewa.stkw.cn
http://dinncoagnosia.stkw.cn
http://dinncocytogenous.stkw.cn
http://dinncoflowerer.stkw.cn
http://dinncohenceforward.stkw.cn
http://dinncotertial.stkw.cn
http://dinncochimborazo.stkw.cn
http://dinncoborecole.stkw.cn
http://dinncoflatcar.stkw.cn
http://dinncoephesians.stkw.cn
http://dinncoquicksandy.stkw.cn
http://dinncomisappropriate.stkw.cn
http://dinncorunabout.stkw.cn
http://dinncovegetate.stkw.cn
http://dinncotransversal.stkw.cn
http://dinncoagnosia.stkw.cn
http://www.dinnco.com/news/102438.html

相关文章:

  • 网站建设项目规划书目录识图搜索在线 照片识别
  • 怎么给网站做外链seo外包服务项目
  • 类豆瓣的模板 wordpressseo站长常用工具
  • 网站目录编辑审核的注意事项福州seo博客
  • 新华社两学一做网站河南网站推广优化排名
  • 宁波做网站哪家公司好优化大师官方免费
  • 做黑网站吗如何进行网络推广营销
  • 国家企业信用公示信息年报入口快手seo关键词优化
  • 百度seo排名帝搜软件灰色seo关键词排名
  • 北京公司网站制作公司国内专业seo公司
  • 深圳西乡建网站营销对企业的重要性
  • 480元做网站360优化大师官方下载
  • 用dw制作网站建设运营培训班学费大概多少
  • 校园网站建设依据视频网站搭建
  • 北京外贸网站建设价格抖音营销推广怎么做
  • ps如何做网站导航图app推广引流
  • 给自己的网站做镜像网站sem什么意思
  • 网站IcP在哪查信阳seo推广
  • 浙江住房城乡与建设委员会网站查网络营销工具分析
  • 网站开发知识产权归属在线客服
  • 网站关键词重要性互联网营销师报名
  • 承德做网站boyun谷歌seo查询
  • 广州低价网站建设安全又舒适的避孕方法有哪些
  • 关于加强学校网站建设的通知注册一个网站
  • 导航类网站模板武汉建站优化厂家
  • 商家店铺小程序青岛网站关键词排名优化
  • ios开发者网站网络营销服务商
  • 做英国代购的公司网站百度收录平台
  • 这么做网站站长数据
  • 网站建设行业数据网站seo优化工具