Thread: [smartweb-devel] Static sign on auth module less understandable
Brought to you by:
rlogiacco
From: Pino C. <gco...@gm...> - 2007-11-08 23:59:06
|
Uhmm ... Hi Stephen,I start to use the form auth and I have noticed that the signature of static method User.get () is a little understandable. It would be more understandable User.getCurrent ()? I expect a response from everyone on .. -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13658668 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@us...> - 2007-11-09 10:05:15
|
Do you mean auth module with the statement form auth? In case I understood correctly I think this could be a minor change into the auth module API but I'm not sure what the advantages will be... can you provide any reason for the change? Pino Contartese wrote: > > Uhmm ... > Hi Stephen,I start to use the form auth and I have noticed that the > signature of static method User.get () is a little understandable. It > would be more understandable User.getCurrent ()? > I expect a response from everyone on .. > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13664231 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Pino C. <gco...@gm...> - 2007-11-09 14:17:00
|
Ok better express the proposal reproposing a real case I have to check that the user is logged in or not and I write: If (net.smartlab.web.auth.User.get ()! = null) ( ... It doesn't seem so friendly ..it was better for me to use it with antoher sign like I suggest before net.smartlab.web.auth.User.getCurrent() !=null Do you agree with me ? Roberto Lo Giacco wrote: > > Do you mean auth module with the statement form auth? > In case I understood correctly I think this could be a minor change into > the auth module API but I'm not sure what the advantages will be... can > you provide any reason for the change? > > > Pino Contartese wrote: >> >> Uhmm ... >> Hi Stephen,I start to use the form auth and I have noticed that the >> signature of static method User.get () is a little understandable. It >> would be more understandable User.getCurrent ()? >> I expect a response from everyone on .. >> > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-09 14:25:56
|
Ok, I understood your point, but I hope you agree with me if I state the difference between the two examples is not on API powerness or flexibility but on ease of comprehension.... 2007/11/9, Pino Contartese <gco...@gm...>: > > Ok better express the proposal reproposing a real case > I have to check that the user is logged in or not and I write: > If (net.smartlab.web.auth.User.get ()! = null) ( > ... > It doesn't seem so friendly ..it was better for me to use it with antoher > sign like I suggest before > net.smartlab.web.auth.User.getCurrent() !=null > > Do you agree with me ? > > > Roberto Lo Giacco wrote: > > > > Do you mean auth module with the statement form auth? > > In case I understood correctly I think this could be a minor change into > > the auth module API but I'm not sure what the advantages will be... can > > you provide any reason for the change? > > > > > > Pino Contartese wrote: > >> > >> Uhmm ... > >> Hi Stephen,I start to use the form auth and I have noticed that the > >> signature of static method User.get () is a little understandable. It > >> would be more understandable User.getCurrent ()? > >> I expect a response from everyone on .. > >> > > > > > > -- > View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-09 15:47:26
|
By the way: if you need to check if there is a user logged in you should use the User.isGuest() method as User.get() always returns a not null object.... ;) 2007/11/9, Pino Contartese <gco...@gm...>: > > Ok better express the proposal reproposing a real case > I have to check that the user is logged in or not and I write: > If (net.smartlab.web.auth.User.get ()! = null) ( > ... > It doesn't seem so friendly ..it was better for me to use it with antoher > sign like I suggest before > net.smartlab.web.auth.User.getCurrent() !=null > > Do you agree with me ? > > > Roberto Lo Giacco wrote: > > > > Do you mean auth module with the statement form auth? > > In case I understood correctly I think this could be a minor change into > > the auth module API but I'm not sure what the advantages will be... can > > you provide any reason for the change? > > > > > > Pino Contartese wrote: > >> > >> Uhmm ... > >> Hi Stephen,I start to use the form auth and I have noticed that the > >> signature of static method User.get () is a little understandable. It > >> would be more understandable User.getCurrent ()? > >> I expect a response from everyone on .. > >> > > > > > > -- > View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Pino C. <gco...@gm...> - 2007-11-09 16:58:21
|
Thank you so much .. It works! :-) Today I learned another thing .. We write a good guide so that nobody can do tomorrow these basic questions. See you soon..:super: Roberto Lo Giacco-4 wrote: > > By the way: if you need to check if there is a user logged in you > should use the User.isGuest() method as User.get() always returns a > not null object.... ;) > > 2007/11/9, Pino Contartese <gco...@gm...>: >> >> Ok better express the proposal reproposing a real case >> I have to check that the user is logged in or not and I write: >> If (net.smartlab.web.auth.User.get ()! = null) ( >> ... >> It doesn't seem so friendly ..it was better for me to use it with antoher >> sign like I suggest before >> net.smartlab.web.auth.User.getCurrent() !=null >> >> Do you agree with me ? >> >> >> Roberto Lo Giacco wrote: >> > >> > Do you mean auth module with the statement form auth? >> > In case I understood correctly I think this could be a minor change >> into >> > the auth module API but I'm not sure what the advantages will be... can >> > you provide any reason for the change? >> > >> > >> > Pino Contartese wrote: >> >> >> >> Uhmm ... >> >> Hi Stephen,I start to use the form auth and I have noticed that the >> >> signature of static method User.get () is a little understandable. It >> >> would be more understandable User.getCurrent ()? >> >> I expect a response from everyone on .. >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> smartweb-devel mailing list >> sma...@li... >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13670715 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Pino C. <gco...@gm...> - 2007-11-09 15:53:09
|
Where can I find an auth guide? Roberto Lo Giacco-4 wrote: > > By the way: if you need to check if there is a user logged in you > should use the User.isGuest() method as User.get() always returns a > not null object.... ;) > > 2007/11/9, Pino Contartese <gco...@gm...>: >> >> Ok better express the proposal reproposing a real case >> I have to check that the user is logged in or not and I write: >> If (net.smartlab.web.auth.User.get ()! = null) ( >> ... >> It doesn't seem so friendly ..it was better for me to use it with antoher >> sign like I suggest before >> net.smartlab.web.auth.User.getCurrent() !=null >> >> Do you agree with me ? >> >> >> Roberto Lo Giacco wrote: >> > >> > Do you mean auth module with the statement form auth? >> > In case I understood correctly I think this could be a minor change >> into >> > the auth module API but I'm not sure what the advantages will be... can >> > you provide any reason for the change? >> > >> > >> > Pino Contartese wrote: >> >> >> >> Uhmm ... >> >> Hi Stephen,I start to use the form auth and I have noticed that the >> >> signature of static method User.get () is a little understandable. It >> >> would be more understandable User.getCurrent ()? >> >> I expect a response from everyone on .. >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> smartweb-devel mailing list >> sma...@li... >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13669580 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-09 15:59:59
|
We are trying to write down a user guide, but we welcome any contribution as it seems we all are not very capable on documentation ;) 2007/11/9, Pino Contartese <gco...@gm...>: > > Where can I find an auth guide? > > > Roberto Lo Giacco-4 wrote: > > > > By the way: if you need to check if there is a user logged in you > > should use the User.isGuest() method as User.get() always returns a > > not null object.... ;) > > > > 2007/11/9, Pino Contartese <gco...@gm...>: > >> > >> Ok better express the proposal reproposing a real case > >> I have to check that the user is logged in or not and I write: > >> If (net.smartlab.web.auth.User.get ()! = null) ( > >> ... > >> It doesn't seem so friendly ..it was better for me to use it with antoher > >> sign like I suggest before > >> net.smartlab.web.auth.User.getCurrent() !=null > >> > >> Do you agree with me ? > >> > >> > >> Roberto Lo Giacco wrote: > >> > > >> > Do you mean auth module with the statement form auth? > >> > In case I understood correctly I think this could be a minor change > >> into > >> > the auth module API but I'm not sure what the advantages will be... can > >> > you provide any reason for the change? > >> > > >> > > >> > Pino Contartese wrote: > >> >> > >> >> Uhmm ... > >> >> Hi Stephen,I start to use the form auth and I have noticed that the > >> >> signature of static method User.get () is a little understandable. It > >> >> would be more understandable User.getCurrent ()? > >> >> I expect a response from everyone on .. > >> >> > >> > > >> > > >> > >> -- > >> View this message in context: > >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > >> Sent from the SmartWeb Developers mailing list archive at Nabble.com. > >> > >> > >> ------------------------------------------------------------------------- > >> This SF.net email is sponsored by: Splunk Inc. > >> Still grepping through log files to find problems? Stop. > >> Now Search log events and configuration files using AJAX and a browser. > >> Download your FREE copy of Splunk now >> http://get.splunk.com/ > >> _______________________________________________ > >> smartweb-devel mailing list > >> sma...@li... > >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel > >> > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > smartweb-devel mailing list > > sma...@li... > > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > > > > > -- > View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13669580 > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Stefano V <st...@gm...> - 2007-11-09 19:07:52
|
I don't agree :-) This is a wrong way to check if the user is logged in, becuse when you are not logged in User.get() return Guest User ! You have to use the Valid tag in jsp or in other place i suggest you to use code similar to this: User user = User.get(); boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); 2007/11/9, Pino Contartese <gco...@gm...>: > > > Ok better express the proposal reproposing a real case > I have to check that the user is logged in or not and I write: > If (net.smartlab.web.auth.User.get ()! = null) ( > ... > It doesn't seem so friendly ..it was better for me to use it with antoher > sign like I suggest before > net.smartlab.web.auth.User.getCurrent() !=null > > Do you agree with me ? > > > Roberto Lo Giacco wrote: > > > > Do you mean auth module with the statement form auth? > > In case I understood correctly I think this could be a minor change into > > the auth module API but I'm not sure what the advantages will be... can > > you provide any reason for the change? > > > > > > Pino Contartese wrote: > >> > >> Uhmm ... > >> Hi Stephen,I start to use the form auth and I have noticed that the > >> signature of static method User.get () is a little understandable. It > >> would be more understandable User.getCurrent ()? > >> I expect a response from everyone on .. > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-09 19:39:24
|
Just a note to the Valid tag statement: you are right, but I supposed he wanted to check the user inside an Action or something like that as we strongly suggest not to use java code inside pages :-> Am I right or have you repeated, with another example, my same statement? 2007/11/9, Stefano V <st...@gm...>: > I don't agree :-) > This is a wrong way to check if the user is logged in, > becuse when you are not logged in User.get() return Guest User ! > You have to use the Valid tag in jsp or in other place i suggest you to use > code similar to this: > > User user = User.get(); > boolean loggedin = > !net.smartlab.web.auth.User.isGuest(user); > > > > 2007/11/9, Pino Contartese <gco...@gm... >: > > > > > > Ok better express the proposal reproposing a real case > > I have to check that the user is logged in or not and I write: > > If (net.smartlab.web.auth.User.get ()! = null) ( > > ... > > It doesn't seem so friendly ..it was better for me to use it with antoher > > sign like I suggest before > > net.smartlab.web.auth.User.getCurrent() !=null > > > > Do you agree with me ? > > > > > > Roberto Lo Giacco wrote: > > > > > > Do you mean auth module with the statement form auth? > > > In case I understood correctly I think this could be a minor change into > > > the auth module API but I'm not sure what the advantages will be... can > > > you provide any reason for the change? > > > > > > > > > Pino Contartese wrote: > > >> > > >> Uhmm ... > > >> Hi Stephen,I start to use the form auth and I have noticed that the > > >> signature of static method User.get () is a little understandable. It > > >> would be more understandable User.getCurrent ()? > > >> I expect a response from everyone on .. > > >> > > > > > > > > > > -- > > View this message in context: > http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > smartweb-devel mailing list > > sma...@li... > > > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > |
From: Stefano V <st...@gm...> - 2007-11-09 21:05:16
|
You are right! i didn't read what you had said... Sorry :-) 2007/11/9, Roberto Lo Giacco <rlo...@sm...>: > > Just a note to the Valid tag statement: you are right, but I supposed > he wanted to check the user inside an Action or something like that as > we strongly suggest not to use java code inside pages :-> > > Am I right or have you repeated, with another example, my same statement? > > 2007/11/9, Stefano V <st...@gm...>: > > I don't agree :-) > > This is a wrong way to check if the user is logged in, > > becuse when you are not logged in User.get() return Guest User ! > > You have to use the Valid tag in jsp or in other place i suggest you to > use > > code similar to this: > > > > User user = User.get(); > > boolean loggedin = > > !net.smartlab.web.auth.User.isGuest(user); > > > > > > > > 2007/11/9, Pino Contartese <gco...@gm... >: > > > > > > > > > Ok better express the proposal reproposing a real case > > > I have to check that the user is logged in or not and I write: > > > If (net.smartlab.web.auth.User.get ()! = null) ( > > > ... > > > It doesn't seem so friendly ..it was better for me to use it with > antoher > > > sign like I suggest before > > > net.smartlab.web.auth.User.getCurrent() !=null > > > > > > Do you agree with me ? > > > > > > > > > Roberto Lo Giacco wrote: > > > > > > > > Do you mean auth module with the statement form auth? > > > > In case I understood correctly I think this could be a minor change > into > > > > the auth module API but I'm not sure what the advantages will be... > can > > > > you provide any reason for the change? > > > > > > > > > > > > Pino Contartese wrote: > > > >> > > > >> Uhmm ... > > > >> Hi Stephen,I start to use the form auth and I have noticed that > the > > > >> signature of static method User.get () is a little understandable. > It > > > >> would be more understandable User.getCurrent ()? > > > >> I expect a response from everyone on .. > > > >> > > > > > > > > > > > > > > -- > > > View this message in context: > > > http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > > > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > > > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a > browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > smartweb-devel mailing list > > > sma...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > smartweb-devel mailing list > > sma...@li... > > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Pino C. <gco...@gm...> - 2007-11-13 23:54:02
|
Ok I received the message... But don't you think it's better to use User.getCurrent() rather than use User.get()? get what? For the moment i don't need to use it in a jsp page cause I've to filter a request for a specific resource. and so I use it in the java code.. Happy to know your answer..see soon svetrini wrote: > > I don't agree :-) > This is a wrong way to check if the user is logged in, > becuse when you are not logged in User.get() return Guest User ! > You have to use the Valid tag in jsp or in other place i suggest you to > use > code similar to this: > > User user = User.get(); > boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); > > > > 2007/11/9, Pino Contartese <gco...@gm...>: >> >> >> Ok better express the proposal reproposing a real case >> I have to check that the user is logged in or not and I write: >> If (net.smartlab.web.auth.User.get ()! = null) ( >> ... >> It doesn't seem so friendly ..it was better for me to use it with antoher >> sign like I suggest before >> net.smartlab.web.auth.User.getCurrent() !=null >> >> Do you agree with me ? >> >> >> Roberto Lo Giacco wrote: >> > >> > Do you mean auth module with the statement form auth? >> > In case I understood correctly I think this could be a minor change >> into >> > the auth module API but I'm not sure what the advantages will be... can >> > you provide any reason for the change? >> > >> > >> > Pino Contartese wrote: >> >> >> >> Uhmm ... >> >> Hi Stephen,I start to use the form auth and I have noticed that the >> >> signature of static method User.get () is a little understandable. It >> >> would be more understandable User.getCurrent ()? >> >> I expect a response from everyone on .. >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> smartweb-devel mailing list >> sma...@li... >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13737311 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Gaetano P. <gpe...@sm...> - 2007-11-14 11:24:35
|
Rather then refactoring the static User.get() method, that anyway is the only one static getter method on User class and an eclipse ctrl+space is more then enough to understand it, I'm doubtful about the static isGuest() method in User class: In my opinion a more elegant solution is a not static method declaration: User user = User.get(); boolean loggedin =!user.isGuest(); I'm waiting for your opinion... Pino Contartese wrote: > > Ok I received the message... > But don't you think it's better to use User.getCurrent() rather than use > User.get()? > get what? > > For the moment i don't need to use it in a jsp page cause I've to filter a > request for a specific resource. > and so I use it in the java code.. > Happy to know your answer..see soon > > svetrini wrote: >> >> I don't agree :-) >> This is a wrong way to check if the user is logged in, >> becuse when you are not logged in User.get() return Guest User ! >> You have to use the Valid tag in jsp or in other place i suggest you to >> use >> code similar to this: >> >> User user = User.get(); >> boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); >> >> >> >> 2007/11/9, Pino Contartese <gco...@gm...>: >>> >>> >>> Ok better express the proposal reproposing a real case >>> I have to check that the user is logged in or not and I write: >>> If (net.smartlab.web.auth.User.get ()! = null) ( >>> ... >>> It doesn't seem so friendly ..it was better for me to use it with >>> antoher >>> sign like I suggest before >>> net.smartlab.web.auth.User.getCurrent() !=null >>> >>> Do you agree with me ? >>> >>> >>> Roberto Lo Giacco wrote: >>> > >>> > Do you mean auth module with the statement form auth? >>> > In case I understood correctly I think this could be a minor change >>> into >>> > the auth module API but I'm not sure what the advantages will be... >>> can >>> > you provide any reason for the change? >>> > >>> > >>> > Pino Contartese wrote: >>> >> >>> >> Uhmm ... >>> >> Hi Stephen,I start to use the form auth and I have noticed that the >>> >> signature of static method User.get () is a little understandable. It >>> >> would be more understandable User.getCurrent ()? >>> >> I expect a response from everyone on .. >>> >> >>> > >>> > >>> >>> -- >>> View this message in context: >>> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >>> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> smartweb-devel mailing list >>> sma...@li... >>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >>> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> smartweb-devel mailing list >> sma...@li... >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> >> > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13744574 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Pino C. <gco...@gm...> - 2007-11-14 12:16:11
|
Hy.. (:-) I prefer to use it User.isGuest() in static way . I consider it simpler and more elegant.. But it's only my opinion... Rather it's never enough an eclipse ctrl+space to understand anything . I never found a method .get() without any friendly attribute reference as Name() or Instance() ..and I propose it for a more elegant sign (not more!) :-{ Gaetano Perrone wrote: > > Rather then refactoring the static User.get() method, that anyway is the > only one static getter method on User class and an eclipse ctrl+space is > more then enough to understand it, > I'm doubtful about the static isGuest() method in User class: > In my opinion a more elegant solution is a not static method declaration: > > User user = User.get(); > boolean loggedin =!user.isGuest(); > I'm waiting for your opinion... > > > > > > Pino Contartese wrote: >> >> Ok I received the message... >> But don't you think it's better to use User.getCurrent() rather than use >> User.get()? >> get what? >> >> For the moment i don't need to use it in a jsp page cause I've to filter >> a request for a specific resource. >> and so I use it in the java code.. >> Happy to know your answer..see soon >> >> svetrini wrote: >>> >>> I don't agree :-) >>> This is a wrong way to check if the user is logged in, >>> becuse when you are not logged in User.get() return Guest User ! >>> You have to use the Valid tag in jsp or in other place i suggest you to >>> use >>> code similar to this: >>> >>> User user = User.get(); >>> boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); >>> >>> >>> >>> 2007/11/9, Pino Contartese <gco...@gm...>: >>>> >>>> >>>> Ok better express the proposal reproposing a real case >>>> I have to check that the user is logged in or not and I write: >>>> If (net.smartlab.web.auth.User.get ()! = null) ( >>>> ... >>>> It doesn't seem so friendly ..it was better for me to use it with >>>> antoher >>>> sign like I suggest before >>>> net.smartlab.web.auth.User.getCurrent() !=null >>>> >>>> Do you agree with me ? >>>> >>>> >>>> Roberto Lo Giacco wrote: >>>> > >>>> > Do you mean auth module with the statement form auth? >>>> > In case I understood correctly I think this could be a minor change >>>> into >>>> > the auth module API but I'm not sure what the advantages will be... >>>> can >>>> > you provide any reason for the change? >>>> > >>>> > >>>> > Pino Contartese wrote: >>>> >> >>>> >> Uhmm ... >>>> >> Hi Stephen,I start to use the form auth and I have noticed that the >>>> >> signature of static method User.get () is a little understandable. >>>> It >>>> >> would be more understandable User.getCurrent ()? >>>> >> I expect a response from everyone on .. >>>> >> >>>> > >>>> > >>>> >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >>>> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Splunk Inc. >>>> Still grepping through log files to find problems? Stop. >>>> Now Search log events and configuration files using AJAX and a browser. >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>> _______________________________________________ >>>> smartweb-devel mailing list >>>> sma...@li... >>>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >>>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> smartweb-devel mailing list >>> sma...@li... >>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >>> >>> >> >> > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13745652 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-14 12:47:56
|
Hi Pino, the simple get() method mimics the ThreadLocal.get() method which is used inside the method you are proposing to rename. So a get() method exists in the standard Java libraries and we named it in the same way to reflect the kind of User instance we are returning: the current user for the current thread. I'm worried about the possibility a getCurrent() method can confuse about which kind of "current" we refer: it may refer to the global user (not existing at all) or the current system user (not obtainable through the module) or anything else you can imagine. A fully explainable signature (not sign!) would be getCurrentThreadUser() but it can be hard to find out for lazy people. About the kind of data the simple get() method is about it should be easily understandable by giving an eye to the return type.... I'm still open to discussion, but for now a refactorying is not as needed as you depict in my opinion. 2007/11/14, Pino Contartese <gco...@gm...>: > > Hy.. (:-) > I prefer to use it User.isGuest() in static way . > I consider it simpler and more elegant.. > But it's only my opinion... > Rather it's never enough an eclipse ctrl+space to understand anything . I > never found a method .get() without any friendly attribute reference as > Name() or Instance() ..and I propose it for a more elegant sign (not more!) > :-{ > > > Gaetano Perrone wrote: > > > > Rather then refactoring the static User.get() method, that anyway is the > > only one static getter method on User class and an eclipse ctrl+space is > > more then enough to understand it, > > I'm doubtful about the static isGuest() method in User class: > > In my opinion a more elegant solution is a not static method declaration: > > > > User user = User.get(); > > boolean loggedin =!user.isGuest(); > > I'm waiting for your opinion... > > > > > > > > > > > > Pino Contartese wrote: > >> > >> Ok I received the message... > >> But don't you think it's better to use User.getCurrent() rather than use > >> User.get()? > >> get what? > >> > >> For the moment i don't need to use it in a jsp page cause I've to filter > >> a request for a specific resource. > >> and so I use it in the java code.. > >> Happy to know your answer..see soon > >> > >> svetrini wrote: > >>> > >>> I don't agree :-) > >>> This is a wrong way to check if the user is logged in, > >>> becuse when you are not logged in User.get() return Guest User ! > >>> You have to use the Valid tag in jsp or in other place i suggest you to > >>> use > >>> code similar to this: > >>> > >>> User user = User.get(); > >>> boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); > >>> > >>> > >>> > >>> 2007/11/9, Pino Contartese <gco...@gm...>: > >>>> > >>>> > >>>> Ok better express the proposal reproposing a real case > >>>> I have to check that the user is logged in or not and I write: > >>>> If (net.smartlab.web.auth.User.get ()! = null) ( > >>>> ... > >>>> It doesn't seem so friendly ..it was better for me to use it with > >>>> antoher > >>>> sign like I suggest before > >>>> net.smartlab.web.auth.User.getCurrent() !=null > >>>> > >>>> Do you agree with me ? > >>>> > >>>> > >>>> Roberto Lo Giacco wrote: > >>>> > > >>>> > Do you mean auth module with the statement form auth? > >>>> > In case I understood correctly I think this could be a minor change > >>>> into > >>>> > the auth module API but I'm not sure what the advantages will be... > >>>> can > >>>> > you provide any reason for the change? > >>>> > > >>>> > > >>>> > Pino Contartese wrote: > >>>> >> > >>>> >> Uhmm ... > >>>> >> Hi Stephen,I start to use the form auth and I have noticed that the > >>>> >> signature of static method User.get () is a little understandable. > >>>> It > >>>> >> would be more understandable User.getCurrent ()? > >>>> >> I expect a response from everyone on .. > >>>> >> > >>>> > > >>>> > > >>>> > >>>> -- > >>>> View this message in context: > >>>> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 > >>>> Sent from the SmartWeb Developers mailing list archive at Nabble.com. > >>>> > >>>> > >>>> ------------------------------------------------------------------------- > >>>> This SF.net email is sponsored by: Splunk Inc. > >>>> Still grepping through log files to find problems? Stop. > >>>> Now Search log events and configuration files using AJAX and a browser. > >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ > >>>> _______________________________________________ > >>>> smartweb-devel mailing list > >>>> sma...@li... > >>>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel > >>>> > >>> > >>> ------------------------------------------------------------------------- > >>> This SF.net email is sponsored by: Splunk Inc. > >>> Still grepping through log files to find problems? Stop. > >>> Now Search log events and configuration files using AJAX and a browser. > >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ > >>> _______________________________________________ > >>> smartweb-devel mailing list > >>> sma...@li... > >>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel > >>> > >>> > >> > >> > > > > > > -- > View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13745652 > Sent from the SmartWeb Developers mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > |
From: Pino C. <gco...@gm...> - 2007-11-14 14:02:18
|
Ok ..now I really understand your worries about it and accept the current signature .. Thanks for your explanation ..See soon Roberto Lo Giacco-4 wrote: > > Hi Pino, > the simple get() method mimics the ThreadLocal.get() method which is > used inside the method you are proposing to rename. > > So a get() method exists in the standard Java libraries and we named > it in the same way to reflect the kind of User instance we are > returning: the current user for the current thread. > > I'm worried about the possibility a getCurrent() method can confuse > about which kind of "current" we refer: it may refer to the global > user (not existing at all) or the current system user (not obtainable > through the module) or anything else you can imagine. A fully > explainable signature (not sign!) would be getCurrentThreadUser() but > it can be hard to find out for lazy people. > > About the kind of data the simple get() method is about it should be > easily understandable by giving an eye to the return type.... > > I'm still open to discussion, but for now a refactorying is not as > needed as you depict in my opinion. > > 2007/11/14, Pino Contartese <gco...@gm...>: >> >> Hy.. (:-) >> I prefer to use it User.isGuest() in static way . >> I consider it simpler and more elegant.. >> But it's only my opinion... >> Rather it's never enough an eclipse ctrl+space to understand anything . I >> never found a method .get() without any friendly attribute reference as >> Name() or Instance() ..and I propose it for a more elegant sign (not >> more!) >> :-{ >> >> >> Gaetano Perrone wrote: >> > >> > Rather then refactoring the static User.get() method, that anyway is >> the >> > only one static getter method on User class and an eclipse ctrl+space >> is >> > more then enough to understand it, >> > I'm doubtful about the static isGuest() method in User class: >> > In my opinion a more elegant solution is a not static method >> declaration: >> > >> > User user = User.get(); >> > boolean loggedin =!user.isGuest(); >> > I'm waiting for your opinion... >> > >> > >> > >> > >> > >> > Pino Contartese wrote: >> >> >> >> Ok I received the message... >> >> But don't you think it's better to use User.getCurrent() rather than >> use >> >> User.get()? >> >> get what? >> >> >> >> For the moment i don't need to use it in a jsp page cause I've to >> filter >> >> a request for a specific resource. >> >> and so I use it in the java code.. >> >> Happy to know your answer..see soon >> >> >> >> svetrini wrote: >> >>> >> >>> I don't agree :-) >> >>> This is a wrong way to check if the user is logged in, >> >>> becuse when you are not logged in User.get() return Guest User ! >> >>> You have to use the Valid tag in jsp or in other place i suggest you >> to >> >>> use >> >>> code similar to this: >> >>> >> >>> User user = User.get(); >> >>> boolean loggedin = !net.smartlab.web.auth.User.isGuest(user); >> >>> >> >>> >> >>> >> >>> 2007/11/9, Pino Contartese <gco...@gm...>: >> >>>> >> >>>> >> >>>> Ok better express the proposal reproposing a real case >> >>>> I have to check that the user is logged in or not and I write: >> >>>> If (net.smartlab.web.auth.User.get ()! = null) ( >> >>>> ... >> >>>> It doesn't seem so friendly ..it was better for me to use it with >> >>>> antoher >> >>>> sign like I suggest before >> >>>> net.smartlab.web.auth.User.getCurrent() !=null >> >>>> >> >>>> Do you agree with me ? >> >>>> >> >>>> >> >>>> Roberto Lo Giacco wrote: >> >>>> > >> >>>> > Do you mean auth module with the statement form auth? >> >>>> > In case I understood correctly I think this could be a minor >> change >> >>>> into >> >>>> > the auth module API but I'm not sure what the advantages will >> be... >> >>>> can >> >>>> > you provide any reason for the change? >> >>>> > >> >>>> > >> >>>> > Pino Contartese wrote: >> >>>> >> >> >>>> >> Uhmm ... >> >>>> >> Hi Stephen,I start to use the form auth and I have noticed that >> the >> >>>> >> signature of static method User.get () is a little >> understandable. >> >>>> It >> >>>> >> would be more understandable User.getCurrent ()? >> >>>> >> I expect a response from everyone on .. >> >>>> >> >> >>>> > >> >>>> > >> >>>> >> >>>> -- >> >>>> View this message in context: >> >>>> >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13667696 >> >>>> Sent from the SmartWeb Developers mailing list archive at >> Nabble.com. >> >>>> >> >>>> >> >>>> >> ------------------------------------------------------------------------- >> >>>> This SF.net email is sponsored by: Splunk Inc. >> >>>> Still grepping through log files to find problems? Stop. >> >>>> Now Search log events and configuration files using AJAX and a >> browser. >> >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> >>>> _______________________________________________ >> >>>> smartweb-devel mailing list >> >>>> sma...@li... >> >>>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> >>>> >> >>> >> >>> >> ------------------------------------------------------------------------- >> >>> This SF.net email is sponsored by: Splunk Inc. >> >>> Still grepping through log files to find problems? Stop. >> >>> Now Search log events and configuration files using AJAX and a >> browser. >> >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> >>> _______________________________________________ >> >>> smartweb-devel mailing list >> >>> sma...@li... >> >>> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> >>> >> >>> >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13745652 >> Sent from the SmartWeb Developers mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> smartweb-devel mailing list >> sma...@li... >> https://lists.sourceforge.net/lists/listinfo/smartweb-devel >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13747047 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-14 12:51:29
|
2007/11/14, Gaetano Perrone <gpe...@sm...>: > I'm doubtful about the static isGuest() method in User class: > In my opinion a more elegant solution is a not static method declaration: > > User user = User.get(); > boolean loggedin =!user.isGuest(); > I'm waiting for your opinion... I think an additional non-static method could be added but I don't see the need for it: if you want to know if a user is a guest you could simply boolean loggedin = (User.get() != User.GUEST); but in my honest opinion the following is the easyest thing boolean loggedin = !User.isGuest(); as this form shortens the statement a lot and is a bit less error prone |
From: Gaetano P. <gpe...@sm...> - 2007-11-14 14:02:30
|
I disagree to your sentence "the following is the easyest thing boolean loggedin = !User.isGuest();" becuase it presumes u uses the auth module to know that this static method works with the current method executing user. If anyone retrieves a User object instance why he must ask to a static method if this User instance is Guest and not simply to the object ifself. And thermore why i must ask statically something that changes dinamically??? I'm so confused...as new deveoper approching smartweb framework... User user= ....retrieve a User instance... boolean logged = user.isGuest(); Roberto Lo Giacco-4 wrote: > > 2007/11/14, Gaetano Perrone <gpe...@sm...>: >> I'm doubtful about the static isGuest() method in User class: >> In my opinion a more elegant solution is a not static method declaration: >> >> User user = User.get(); >> boolean loggedin =!user.isGuest(); >> I'm waiting for your opinion... > > I think an additional non-static method could be added but I don't see > the need for it: if you want to know if a user is a guest you could > simply > > boolean loggedin = (User.get() != User.GUEST); > > but in my honest opinion the following is the easyest thing > > boolean loggedin = !User.isGuest(); > > as this form shortens the statement a lot and is a bit less error prone > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > smartweb-devel mailing list > sma...@li... > https://lists.sourceforge.net/lists/listinfo/smartweb-devel > > -- View this message in context: http://www.nabble.com/Static-sign-on-auth-module-less-understandable-tf4774615s17546.html#a13746936 Sent from the SmartWeb Developers mailing list archive at Nabble.com. |
From: Roberto Lo G. <rlo...@sm...> - 2007-11-14 19:56:41
|
2007/11/14, Gaetano Perrone <gpe...@sm...>: > > I disagree to your sentence > > "the following is the easyest thing boolean loggedin = !User.isGuest();" > > becuase it presumes u uses the auth module to know that this static method > works with the current method executing user. > If anyone retrieves a User object instance why he must ask to a static > method if this User instance is Guest and not simply to the object ifself. > And thermore why i must ask statically something that changes dinamically??? > I'm so confused...as new deveoper approching smartweb framework... > > User user= ....retrieve a User instance... > boolean logged = user.isGuest(); I think you are having the same problem many people has with ThreadLocal concepts. In brief: you are "statically" accessing something stored into the current thread, which is usually thought as "dynamc" but we are talking about two different things as objects are stored into the heap and you are accessing something stored into the stack. So "static" and "dynamic" are non-sense while mixing up two different scopes. Anyway I understand your worries and I had the same problems in the first place, but here we are simply copying the same approach used inside the core Java libraries to make everything easier to understand. I suggest to write down documentation instead to refactor as the problem seems to be on understatement and not on interface fringment or rigidity. |