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

抚州做网站公司哪家好常用的网络推广手段有哪些

抚州做网站公司哪家好,常用的网络推广手段有哪些,php做用户登录网站,flash动画制作软件Restful 1、入门1.1 简介1.2 实例 1、入门 1.1 简介 RESTFul是什么 RESTFul是WEB服务接口的一种设计风格。 RESTFul定义了一组约束条件和规范&#xff0c;可以让WEB服务接口更加简洁、易于理解、易于扩展、安全可靠。 1.2 实例 web.xml <?xml version"1.0"…

Restful

  • 1、入门
    • 1.1 简介
    • 1.2 实例

1、入门

1.1 简介

RESTFul是什么
RESTFul是WEB服务接口的一种设计风格。
RESTFul定义了一组约束条件和规范,可以让WEB服务接口更加简洁、易于理解、易于扩展、安全可靠。
在这里插入图片描述

1.2 实例

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"version="4.0"><!--字符编码过滤器--><filter><filter-name>characterEncodingFilter</filter-name><filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param><init-param><param-name>forceRequestEncoding</param-name><param-value>true</param-value></init-param><init-param><param-name>forceResponseEncoding</param-name><param-value>true</param-value></init-param></filter><filter-mapping><filter-name>characterEncodingFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><!--隐藏的HTTP请求方式过滤器--><filter><filter-name>hiddenHttpMethodFilter</filter-name><filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class></filter><filter-mapping><filter-name>hiddenHttpMethodFilter</filter-name><url-pattern>/*</url-pattern></filter-mapping><servlet><servlet-name>Springmvc</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><init-param><!--            初始化参数时 可以指定springmvc配置文件的位置 以及名称--><!--            其默认是存放在WEB-INF 下 名称默认是<servlet-name>-servlet.xml--><param-name>contextConfigLocation</param-name><!--            表示在根路径下  即放在resources目录下 名称是 springmvc.xml--><param-value>classpath:springmvc.xml</param-value></init-param><!--        这是一个优化策略 表示在服务器启动时就初始化DispatcherServlet 而不是在用户第一次请求时 可以增加用户体验--><load-on-startup>0</load-on-startup></servlet><servlet-mapping><servlet-name>Springmvc</servlet-name><url-pattern>/</url-pattern></servlet-mapping>
</web-app>

springmvc.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="com.cky"></context:component-scan><!--视图解析器--><bean id="thymeleafViewResolver" class="org.thymeleaf.spring6.view.ThymeleafViewResolver"><!--作用于视图渲染的过程中,可以设置视图渲染后输出时采用的编码字符集--><property name="characterEncoding" value="UTF-8"/><!--如果配置多个视图解析器,它来决定优先使用哪个视图解析器,它的值越小优先级越高--><property name="order" value="1"/><!--当 ThymeleafViewResolver 渲染模板时,会使用该模板引擎来解析、编译和渲染模板--><property name="templateEngine"><bean class="org.thymeleaf.spring6.SpringTemplateEngine"><!--用于指定 Thymeleaf 模板引擎使用的模板解析器。模板解析器负责根据模板位置、模板资源名称、文件编码等信息,加载模板并对其进行解析--><property name="templateResolver"><bean class="org.thymeleaf.spring6.templateresolver.SpringResourceTemplateResolver"><!--设置模板文件的位置(前缀)--><property name="prefix" value="/WEB-INF/templates/"/><!--设置模板文件后缀(后缀),Thymeleaf文件扩展名不一定是html,也可以是其他,例如txt,大部分都是html--><property name="suffix" value=".html"/><!--设置模板类型,例如:HTML,TEXT,JAVASCRIPT,CSS等--><property name="templateMode" value="HTML"/><!--用于模板文件在读取和解析过程中采用的编码字符集--><property name="characterEncoding" value="UTF-8"/></bean></property></bean></property></bean><!--配置视图控制器--><mvc:view-controller path="/c" view-name="c"/><!--开启注解驱动--><mvc:annotation-driven></mvc:annotation-driven><!--静态资源访问配置--><mvc:resources mapping="/static/**" location="/static/"/>
<!--   或者 <mvc:default-servlet-handler></mvc:default-servlet-handler>-->
</beans>

项目目录
在这里插入图片描述

Mycontroller.java

package com.cky.controller;import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;@Controller
public class Mycontroller {
@RequestMapping(value = "/users",method = RequestMethod.GET)
public String a(){System.out.println("查询所有");return "ok";
}
@RequestMapping("/")
public String index(){return "index";
}
@RequestMapping(value = "/users/{id}",method = RequestMethod.GET)
public  String getone(@PathVariable("id") int id){System.out.println("查询1号");return "ok";
}
@RequestMapping(value = "/users/{id}",method = RequestMethod.POST)
public String addusers(@PathVariable("id") int id){System.out.println("新增用户");return "ok";
}@RequestMapping(value = "/users/{id}",method = RequestMethod.PUT)
public String modify(@PathVariable("id") int id){System.out.println("修改用户");return "ok";
}@RequestMapping(value = "/users/{id}",method = RequestMethod.DELETE)public String delete(@PathVariable("id") int id){System.out.println("删除用户");return "ok";}
}

index.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head><meta charset="UTF-8"><title>restful</title>
</head>
<body>
<!--默认get-->
<a th:href="@{/users}">查询所有</a>
<a th:href="@{/users/1}">查询1号</a>
<!--新增-->
<form th:action="@{/users/100}" method="post"><input type="text" placeholder="用户名"><input type="submit" value="提交">
</form>
<!--修改-->
<form th:action="@{/users/100}" method="post"><input type="hidden" name="_method" value="put"><input type="text" placeholder="用户名"><input type="submit" value="修改">
</form><a th:href="@{/users/1}" onclick="del(event)">删除1号用户</a>
<form id="delForm" method="post"><input type="hidden" name="_method" value="delete">
</form>
<script>function del(event){//获取表单let delForm=document.getElementById("delForm");//给表单赋值delForm.action=event.target.href;//发送post请求delForm.submit();//阻止超链接默认行为event.preventDefault();}
</script>
</body>
</html>
http://www.hyszgw.com/news/23835.html

相关文章:

  • 上海市建设党工委网站重庆百度推广优化排名
  • 化妆品网站建设计划书关键词优化 搜索引擎
  • 搜款网站一起做网店登录百度
  • 温岭市建设工程质量安全网站cba最新消息
  • 男男床做视频网站西安网络推广
  • 珠海高端网站建设建网站的软件
  • 大连微信网站制作百度推广退款电话
  • 郑州做网站建设公司搜索引擎优化的英文缩写
  • 网站建设中 图片成品短视频app源码的优点
  • 大学生网站建设日程表快速收录工具
  • 保山网站开发服务新手做外贸怎么入门
  • vs2008怎么做网站百度seo怎么样优化
  • 中国做的比较好的网站有哪些重庆百度推广优化
  • 网站全屏轮播怎么做百度站长工具怎么关闭
  • 电子商务网站建设 ppt免费的网站推广
  • 网站建设品牌策seo价格是多少
  • ubuntu wordpress cms温州网站建设优化
  • 网站开发的人开封网络推广公司
  • 营销型网站建设案例每日鲜怎么开通网站平台
  • 织梦可以仿所有网站吗国内免费发布产品的平台
  • 58同城深圳网站建设百度学术论文官网入口
  • 什么网站是用php做的自媒体发布软件app
  • 软件最全的软件商店一点优化
  • 网站登录模板如何在百度上添加店铺的位置
  • 专做眼镜批发的网站今日疫情最新消息全国31个省
  • 网站推广公司简介网站内容如何优化
  • 在建设政府门户网站时要充分考虑到疫情最严重的三个省
  • 品牌网站解决方案手机网站百度关键词排名查询
  • 小码王少儿编程官网暴疯团队seo课程
  • ppt现成作品下载seo 推广服务