在使用beego框架时,出现类似于panic: 'GetSecurityInf' method doesn't exist in the controller CorporateInfcontroller的错误时,问题出在相应的路由设置routers里或是controllers里。

1.错误在routers中

正确代码如下:

beego.Router("/getsecurityinf", &controllers.SecurityInfcontroller{}, "*:GetSecurityInf")

若在编程时错误输入以下代码,则会报以上错误:

beego.Router("/getsecurityinf", &controllers.CorporateInfcontroller{}, "*:GetSecurityInf")

2.错误在controllers中

func (this *SecurityInfcontroller)GetSecurityInf() 

一般是这句中的结构名称与结构体不对应。

出现此错误的原因大部分是因为复制粘贴时没有修改相应的controller.

beego框架panic: 'GetSecurityInf' method doesn't exist in the controller CorporateInfcontroller问题解决的更多相关文章

  1. golang学习之beego框架配合easyui实现增删改查及图片上传

    golang学习之beego框架配合easyui实现增删改查及图片上传 demo目录: upload文件夹主要放置上传的头像文件,main是主文件,所有效果如下: 主页面: 具体代码: <!DO ...

  2. Beego 框架学习(一)

    Beego官网本身已经整理的非常详细了,但是作为一个学习者,我还是决定自己好好整理一下,这样在后面使用的时候自己对每部分才能非常熟悉,及时忘记了,也可以迅速定位自己要用的知识在哪里.当然也是对官网的一 ...

  3. beego 框架基本使用 && 知识点整理

    beego 官网的教程已经整理的非常详细了,但作为一个刚接触的学习者,还是有必要做一下整理,这样在后面使用的时候遇到了不太熟悉的地方,还能反过头来看下自己整理的内容,快速的把知识再捞回来,下面是对官网 ...

  4. Beego框架学习--(核心:数据交互)

    Beego框架学习记录 1.beego简介 beego 是一个快速开发 Go 应用的 HTTP 框架,他可以用来快速开发 API.Web 及后端服务等各种应用,是一个 RESTful 的框架,主要设计 ...

  5. 初次使用beego框架

    安装beego框架以及bee工具 go get -u github.com/astaxie/beego go get github.com/beego/bee 创建一个新项目 bee new weba ...

  6. Golang通过git clone beego框架报错 error: while accessing https://github.com/astaxie/beego/info/refs fatal: HTTP request failed package github.com/astaxie/beego: exit status 128

    在Centos6.4尝试搭建beego框架,使用git命令clone时报错 # cd .; git clone https://github.com/astaxie/beego /www/projec ...

  7. Go语言之高级篇beego框架安装与使用

    一.beego框架 1.beego框架简介 beego 是一个快速开发 Go 应用的 HTTP 框架,他可以用来快速开发 API.Web 及后端服务等各种应用,是一个 RESTful 的框架,主要设计 ...

  8. golang的beego框架开发时出现的问题纪录

    golang的beego框架开发时出现的问题纪录1.数据库并发时问题:[ORM]2017/02/20 23:44:05 -[Queries/default] - [FAIL / db.Query / ...

  9. Go beego框架使用笔记(一)

    Beego介绍 beego我认为是go初学者比较容易上手的一门MVC Web框架.简单易懂,最重要的一点就是提供了中文文档,这对于我这种英语能力比较差的人来说就是福音. beego的官网上是这么介绍b ...

随机推荐

  1. 排序算法 以及HKU的一些数据结构 相关题目 以及 K叉树,二叉树 排列

    冒泡排序.选择排序.快速排序.插入排序.希尔排序.归并排序.基数排序以及堆排序,桶排序 https://www.cnblogs.com/Glory-D/p/7884525.html https://b ...

  2. u-boot 移植 --->7、u-bootl流程粗线条梳理

    通过前面的调试了解到s5pv210这个芯片的启动流程是需要将u-boot分为两部分的分别为SPL和u-boot.这里我使用网上的方式不直接使用u-boot的SPL连接脚本单独生成SPL的image而是 ...

  3. Winter Bash & Stack Overflow

    Winter Bash & Stack Overflow https://stackoverflow.com/users/5934465/xgqfrms#winter-bash https:/ ...

  4. Google Chrome All In One

    Google Chrome All In One Chrome Experiments Chrome 测试版 Chrome 开发者版 Chrome Canary 版 chrome://welcome/ ...

  5. GitHub new features 2020 All In One

    GitHub new features 2020 All In One Discussions Discussions is the space for your community to have ...

  6. React Hooks: useContext All In One

    React Hooks: useContext All In One useContext https://reactjs.org/docs/hooks-reference.html#useconte ...

  7. Swift Playground All In One

    Swift Playground All In One Swift 5.3 Playgrounds in Xcode Xcode 11.5 https://developer.apple.com/vi ...

  8. Node.js & process.env & OS Platform checker

    Node.js & process.env & OS Platform checker Window 10 Windows 7 ia32 CentOS $ node # process ...

  9. 5G & 音频,视频

    5G & 音频,视频 直播,webtrtc 音频,视频 基础知识 基本概念.播放流程.封装格式.编解码.传输协议 音视频播放流程 主要流程:采集 -> 前处理 -> 编码 -> ...

  10. Sketch & UI & PS

    Sketch & UI & PS app ui https://sketchapp.com/learn https://www.sketch.com/docs/ https://ske ...