Discussion:
Sorting question
Erik Pragt
2014-05-18 20:48:04 UTC
Permalink
Hi guys,

A small question on the mailing list, while it’s still possible:

I’m building a small application, and in part of the UI you can sort some objects (persons). So when I call this url:
http://localhost:8080/addressbook/person/list?sort=name

All works nicely. However, when I change the URL to the following, my application is throwing exceptions:
http://localhost:8080/addressbook/person/list?sort=thisisanunknowproperty

I get errors like:

Class
org.hibernate.QueryException
Message
could not resolve property: thisisanunknownproperty of: persons.Person



This is really not what I want, of course. The application should just not sort, and not throw exceptions like this. But how do I prevent this stuff from happening? Should I build something in which checks if the property is a member of the allowed properties to sort on? Is there anything out of the box for this?

Any advice more than welcome!

Thanks,

Erik
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email
Silvio Wangler
2014-05-19 06:39:30 UTC
Permalink
Please see http://grails.1312388.n4.nabble.com/Deprecating
-The-Grails-Mailing-Lists-td4656735.html.

Thanks for your cooperation.
Post by Erik Pragt
Hi guys,
I’m building a small application, and in part of the UI you can sort some
http://localhost:8080/addressbook/person/list?sort=name
All works nicely. However, when I change the URL to the following, my
http://localhost:8080/addressbook/person/list?sort=thisisanunknowproperty
Class
org.hibernate.QueryException
Message
could not resolve property: thisisanunknownproperty of: persons.Person
This is really not what I want, of course. The application should just not
sort, and not throw exceptions like this. But how do I prevent this stuff
from happening? Should I build something in which checks if the property is
a member of the allowed properties to sort on? Is there anything out of the
box for this?
Any advice more than welcome!
Thanks,
Erik
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Erik Pragt
2014-05-19 07:21:19 UTC
Permalink
Thanks, but where should I post this?
Post by Silvio Wangler
Please see http://grails.1312388.n4.nabble.com/Deprecating
-The-Grails-Mailing-Lists-td4656735.html.
Thanks for your cooperation.
Post by Erik Pragt
Hi guys,
I’m building a small application, and in part of the UI you can sort some
http://localhost:8080/addressbook/person/list?sort=name
All works nicely. However, when I change the URL to the following, my
http://localhost:8080/addressbook/person/list?sort=thisisanunknowproperty
Class
org.hibernate.QueryException
Message
could not resolve property: thisisanunknownproperty of: persons.Person
This is really not what I want, of course. The application should just
not sort, and not throw exceptions like this. But how do I prevent this
stuff from happening? Should I build something in which checks if the
property is a member of the allowed properties to sort on? Is there
anything out of the box for this?
Any advice more than welcome!
Thanks,
Erik
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Silvio Wangler
2014-05-19 07:41:51 UTC
Permalink
I'd post it on Stackoverflow
Post by Erik Pragt
Thanks, but where should I post this?
Post by Silvio Wangler
Please see http://grails.1312388.n4.nabble.com/Deprecating
-The-Grails-Mailing-Lists-td4656735.html.
Thanks for your cooperation.
Post by Erik Pragt
Hi guys,
I’m building a small application, and in part of the UI you can sort
http://localhost:8080/addressbook/person/list?sort=name
All works nicely. However, when I change the URL to the following, my
http://localhost:8080/addressbook/person/list?sort=thisisanunknowproperty
Class
org.hibernate.QueryException
Message
could not resolve property: thisisanunknownproperty of: persons.Person
This is really not what I want, of course. The application should just
not sort, and not throw exceptions like this. But how do I prevent this
stuff from happening? Should I build something in which checks if the
property is a member of the allowed properties to sort on? Is there
anything out of the box for this?
Any advice more than welcome!
Thanks,
Erik
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Erik Pragt
2014-05-19 09:32:52 UTC
Permalink
Done, thanks!
http://stackoverflow.com/questions/23734289/sorting-on-a-unknown-property
Post by Silvio Wangler
I'd post it on Stackoverflow
Post by Erik Pragt
Thanks, but where should I post this?
Post by Silvio Wangler
Please see http://grails.1312388.n4.nabble.com/Deprecating
-The-Grails-Mailing-Lists-td4656735.html.
Thanks for your cooperation.
Post by Erik Pragt
Hi guys,
I’m building a small application, and in part of the UI you can sort
http://localhost:8080/addressbook/person/list?sort=name
All works nicely. However, when I change the URL to the following, my
http://localhost:8080/addressbook/person/list?sort=thisisanunknowproperty
Class
org.hibernate.QueryException
Message
could not resolve property: thisisanunknownproperty of: persons.Person
This is really not what I want, of course. The application should just
not sort, and not throw exceptions like this. But how do I prevent this
stuff from happening? Should I build something in which checks if the
property is a member of the allowed properties to sort on? Is there
anything out of the box for this?
Any advice more than welcome!
Thanks,
Erik
---------------------------------------------------------------------
http://xircles.codehaus.org/manage_email
Continue reading on narkive:
Loading...