We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug Browser shows: schema: invalid path "username"schema: invalid path "username"
To Reproduce Steps to reproduce the behavior: codes as follow:
//main.go user := mvc.New(app.Party("/my")) user.Register( userService, sessManager.Start, ) user.Handle(new(controller.MyController)) //my_controller.go type MyController struct { Ctx iris.Context Service service.UserService Session *sessions.Session } func (c *MyController) GetLogin() mvc.Result { return mvc.View{ Name: "my/login.html", } } type loginForm struct { Username string `form:"username"` } func (c *MyController) PostLogin(form loginForm) mvc.Result { fmt.Println(form.Username) return mvc.Response{ Path: "/my/login", } } //my/login.html <form action="/my/login" method="POST" enctype="multipart/form-data"> <div class="container"> <label><b>Username</b></label> <input type="text" placeholder="Enter Username" name="username" required> <button type="submit">Login</button> </div> </form>
After click the login button, the page shows : schema: invalid path "username"schema: invalid path "username"
Desktop (please complete the following information):
iris.Version
The text was updated successfully, but these errors were encountered:
I have found the reason why. It is due to my implementation of the NewUserService function.
userService in main.go is created by : userService := service.NewUserService()
This NewUserService is wrong:
func NewUserService() *UserService { return &UserService{} }
and if * was removed, it will work fine:
func NewUserService() UserService { return UserService{} }
Superficially,the error msg "schema: invalid path" has nothing to do NewUserService. It makes me so confused.
Sorry, something went wrong.
kataras
No branches or pull requests
Describe the bug
Browser shows:
schema: invalid path "username"schema: invalid path "username"
To Reproduce
Steps to reproduce the behavior:
codes as follow:
After click the login button, the page shows :
schema: invalid path "username"schema: invalid path "username"
Desktop (please complete the following information):
iris.Version
The text was updated successfully, but these errors were encountered: