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

java语言可以做网站吗百度网站大全

java语言可以做网站吗,百度网站大全,环评怎么在网站做公示,岳麓区网站建设如图所示&#xff0c;删除操作可以用按钮实现&#xff0c;也可以用超链接来实现。 1、第一种情况&#xff0c;用按钮实现。 html页面相关&#xff1a; <button type"button" click"deleteId(peot.id)">删除</button> <script>new Vue(…

如图所示,删除操作可以用按钮实现,也可以用超链接来实现。

1、第一种情况,用按钮实现。

html页面相关:

 <button type="button" @click="deleteId(peot.id)">删除</button>

<script>new Vue({el:"#app",data() {return {peotList:[]}},methods:{findAll:function () {var _this = this;axios.post('/findAllJsoon', {}).then(function (response) {_this.peotList = response.data.data;//响应数据给peotList赋值}).catch(function (error) {console.log(error);});},deleteId:function (id) {var _thisd = this;if (window.confirm("确定要删除该条数据吗???")){axios.post('/deletePeot?id='+id).then(function (response) {alert("删除成功")_thisd.findAll();}).catch(function (error) {console.log(error);});}}},created() {// 获得参数id值// this.id = location.href.split("?id=")[1]// 通过id查询详情this.findAll();},})</script>

controller文件相关:

 @RequestMapping("/deletePeot")public void deletePeot(Integer id){peotService.deletePeot(id);}

可以看到,这里的controller文件中没有进行参数传递。这是因为,是在当前页面操作,参数直接传递给js,不需要通过url来传递。

2、第二种情况,通过超链接来删除,并跳转回查询所有的页面。

<a :href="'peot_delete.html?id='+peot.id">删除</a>
peot_delete.html
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>Title</title><script src="./js/vue.js"></script><script src="./js/axios-0.18.0.js"></script></head>
<body>
<h1 align="center">诗人信息列表</h1>
<div id="app" align="center"><a href="peot_insert.html">新增</a><table  border="1"><tr><th>id</th><th>author</th><th>gender</th><th>dynasty</th><th>title</th><th>style</th><th>操作</th></tr><tr v-for="peot in peotList"><td>{{peot.id}}</td><td>{{peot.author}}</td><td>{{peot.gender}}</td><td>{{peot.dynasty}}</td><td>{{peot.title}}</td><td>{{peot.style}}</td><td><button type="button" @click="deleteId(peot.id)">删除</button><a :href="'peot_delete.html?id='+peot.id">删除</a><a :href="'peot_edit.html?id='+peot.id">修改</a></td></tr></table>
</div></body><script>new Vue({el:"#app",data() {return {peotList:[]}},methods:{findAll:function () {var _this = this;axios.post('/findAllJsoon', {}).then(function (response) {_this.peotList = response.data.data;//响应数据给peotList 赋值}).catch(function (error) {console.log(error);});},deleteId:function (id) {var _thisd = this;var url = `deletePeot_url/${this.id}`  //注意这里是反引号if (window.confirm("确定要删除该条数据吗???")){axios.post(url).then(function (response) {alert("删除成功")// _thisd.findAll();location.href = 'peot_listAll.html'}).catch(function (error) {console.log(error);});}}},created() {// 获得参数id值this.id = location.href.split("?id=")[1]// 通过id查询详情this.deleteId();},})</script></html>

controller页面相关:

    @RequestMapping("/deletePeot_url/{id}")public void deletePeot_url(@PathVariable("id") Integer id){peotService.deletePeot(id);}

可以看出,这里的controller是使用标准@PathVariable("id")进行了参数传递。

3、总结

从一个页面到另外一个页面,如果需要传递参数,需要在controller文件中进行相关的操作。

有关参数的传递,参见文章:Springboot之页面参数传递-CSDN博客

http://www.mmbaike.com/news/44766.html

相关文章:

  • 无忧网站建设推荐淘宝付费推广有几种方式
  • 唐山营销型网站建设开源cms建站系统
  • 河南网站备案系统短信百度小说排行榜2021
  • 手机新机价格网站seo外包服务项目
  • 怎么自己做网站地图想做网络推广的公司
  • c2c的网站名称和网址桔子seo网
  • 长春火车站疫情防控咨询电话号码网站排名前十
  • 怎样做网站教程2022年最火文案
  • 平邑网站优化免费发布外链
  • 企业如何宣传推广免费seo网站自动推广软件
  • 网站做友链有什么用seo的优化策略有哪些
  • ecshop 获取网站域名怎么引流推广自己的产品
  • 福田网站建设龙岗网站建设龙岗网站建设能让网络非常流畅的软件
  • 湖南网页设计培训网站建设网站设计制作教程
  • 设计师的网站有哪些外贸定制网站建设电话
  • 常州网站建设方案策划网站seo综合查询
  • 如何自制公司网站推广软文范例
  • 做网站专业服务网站制作公司网站
  • 响应式网站开发设计企业营销网站制作
  • 网站建行接口互联网最赚钱的行业
  • 自己做网站能否赚钱百度刷seo关键词排名
  • 有专门教做儿童美食的网站吗搜索引擎优化简称
  • 开发一个网站做爬虫网络营销推广主要做什么?
  • 怎么建设自己网站(儿童)步骤百度公司招聘条件
  • 开发个网站需要多少钱360营销推广
  • dw做网站如何让用户可编辑优秀营销软文范例300字
  • 网站上怎么做企业推广优化大师电脑版官方
  • 中海建筑建设有限公司网站公众号seo排名软件
  • 织梦如何做淘宝客网站企业宣传方式有哪些
  • 网站推广工具 刷链接搜索词分析工具