Cannot find the template file in the path:logincontroller/login.tpl

471 views
Skip to first unread message

jagadeesh mn

unread,
Oct 30, 2014, 1:28:11 AM10/30/14
to golan...@googlegroups.com
Hi all,


I am trying a web application.Build is successful but im getting a run-time error saying

 "Cannot find the template file in the path:logincontroller/login.tpl"
Request Method: POST
Request URL: /login
RemoteAddr: [::1]:56744
Stack
c:/go/src/pkg/runtime/panic.c:248
D:/Project/Go_programs/src/github.com/astaxie/beego/controller.go:253
D:/Project/Go_programs/src/github.com/astaxie/beego/controller.go:179
D:/Project/Go_programs/src/github.com/astaxie/beego/router.go:743
c:/go/src/pkg/net/http/server.go:1673
c:/go/src/pkg/net/http/server.go:1174
c:/go/src/pkg/runtime/proc.c:1445


In command prompt im getting this error 


2014/10/30 10:50:48 [C] the request url is  /login
2014/10/30 10:50:48 [C] Handler crashed with error can't find templatefile in th
e path:logincontroller/login.tpl
2014/10/30 10:50:48 [C] c:/go/src/pkg/runtime/panic.c:248
2014/10/30 10:50:48 [C] D:/Project/Go_programs/src/github.com/astaxie/beego/cont
roller.go:253
2014/10/30 10:50:48 [C] D:/Project/Go_programs/src/github.com/astaxie/beego/cont
roller.go:179
2014/10/30 10:50:48 [C] D:/Project/Go_programs/src/github.com/astaxie/beego/rout
er.go:743
2014/10/30 10:50:48 [C] c:/go/src/pkg/net/http/server.go:1673
2014/10/30 10:50:48 [C] c:/go/src/pkg/net/http/server.go:1174
2014/10/30 10:50:48 [C] c:/go/src/pkg/runtime/proc.c:1445

In the controller, i have used the following code:

func (this *LoginController) LoginView() { 
  this.TplNames = "login.html" 
 } 

Please help me out with this.

Thanking You
login.html
Message has been deleted

egon

unread,
Oct 31, 2014, 5:01:43 AM10/31/14
to golan...@googlegroups.com
I don't have experience in using beego, but it seems that it just isn't finding the template.

2014/10/30 10:50:48 [C] Handler crashed with error can't find templatefile in th
e path:logincontroller/login.tpl

It's probably because the file is in the wrong directory or the template files must have the extension ".tpl"... See the beego tutorials / examples on how to properly structure your files / data.

+ egon
Reply all
Reply to author
Forward
0 new messages