NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

wicket 1.2.7 login error checking and reporting

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Burton, Tom F (DOR)
Posted via mailing list.





PostPosted: Fri Aug 07, 2009 6:47 pm    Post subject: wicket 1.2.7 login error checking and reporting Reply with quote

It works for Login Failures, and blank usernames. It just doesn't
work for blank passwords or blank username and password.

Why would the error() function work for user==null but not password==null?
My embarrassing log.debug line doesn't even fire, when there is no password.
Which is why I'm not sure whatever code the server runs once I hit submit doesn't get as far is this code without a password to verify.

Here is a code snippet:

form.add(new IndicatingAjaxSubmitButton("login", form)
{
private static final long serialVersionUID = 1L;
public void onSubmit(AjaxRequestTarget target, Form form)
{
//set user as a non myalaska user so it will log out to this page...
((QuickStartSession)getSession()).setMyAkUser(false);
User userLoggingIn = null;

target.addComponent(feedbackpanel);
target.addComponent(form);

String user_error = "'User Name' is a requied field";
String passwd_error = "'Password' is a required field";

//TODO: Delete this line once blank/empty passwd format verified
log.debug("Login AS: " + user + " : " + password);

if ( user == null && ( password == null ||
password.trim().equals("") ) )
{
error( user_error + "<br/>\n" + passwd_error );
}

else if (user == null)
{
//log.error("'User Name' is a requied field");
error( user_error );
//return;
}

else if (password == null || password.trim().equals("") )
{
log.error("'Passwd' is a requied field");
error( passwd_error );
//return;
}
//else { log.info("username and password entered."); }
//end the if else if block;

//end processing if username or password errors
if ( user == null || password == null
|| password.trim().equals("") )
{ return; }


Thanks for the help and patience,
Tom B.

-----Original Message-----
From: Igor Vaynberg [mailto:address-removed]
Sent: Friday, August 07, 2009 10:23 AM
To: Burton, Tom F (DOR)
Subject: Re: wicket 1.2.7 login error checking and reporting

right, there is no wicketfilter in 1.2.x, only wicketservlet.

if you get empty <ajaxresponse> back then maybe you are forgetting to
update the feedback panel using ajaxrequesttarget.

-igor

On Fri, Aug 7, 2009 at 11:08 AM, Burton, Tom F
(DOR)<address-removed> wrote:
Quote:
I found wicketSessionFilter but not wicketFilter.
Back to top
Melongo Annabel
Posted via mailing list.





PostPosted: Sat Aug 08, 2009 9:26 pm    Post subject: wicket 1.2.7 login error checking and reporting Reply with quote

I don't know if this will be of any help, but instead of comparing if it's null or empty, try to use StringUtils.isEmpty( password ) ( same for username ) and see what you get. Here's an explanation of that method: http://commons.apache.org/lang/apidocs/org/apache/commons/lang/StringUtils.html#isEmpty(java.lang.String)


From: "Burton, Tom F (DOR)" <address-removed>
To: Igor Vaynberg <address-removed>
Cc: address-removed
Sent: Friday, August 7, 2009 1:47:03 PM
Subject: [nbusers] RE: wicket 1.2.7 login error checking and reporting

It works for Login Failures, and blank usernames. It just doesn't
work for blank passwords or blank username and password.

Why would the error() function work for user==null but not password==null?
My embarrassing log.debug line doesn't even fire, when there is no password.
Which is why I'm not sure whatever code the server runs once I hit submit doesn't get as far is this code without a password to verify.

Here is a code snippet:

form.add(new IndicatingAjaxSubmitButton("login", form)
{
private static final long serialVersionUID = 1L;
public void onSubmit(AjaxRequestTarget target, Form form)
{
//set user as a non myalaska user so it will log out to this page...
((QuickStartSession)getSession()).setMyAkUser(false);
User userLoggingIn = null;

target.addComponent(feedbackpanel);
target.addComponent(form);

String user_error = "'User Name' is a requied field";
String passwd_error = "'Password' is a required field";

//TODO: Delete this line once blank/empty passwd format verified
log.debug("Login AS: " + user + " : " + password);

if ( user == null && ( password == null ||
password.trim().equals("") ) )
{
error( user_error + "<br/>\n" + passwd_error );
}

else if (user == null)
{
//log.error("'User Name' is a requied field");
error( user_error );
//return;
}

else if (password == null || password.trim().equals("") )
{
log.error("'Passwd' is a requied field");
error( passwd_error );
//return;
}
//else { log.info("username and password entered."); }
//end the if else if block;

//end processing if username or password errors
if ( user == null || password == null
|| password.trim().equals("") )
{ return; }


Thanks for the help and patience,
Tom B.

-----Original Message-----
From: Igor Vaynberg [mailto:address-removed ([email]address-removed[/email])]
Sent: Friday, August 07, 2009 10:23 AM
To: Burton, Tom F (DOR)
Subject: Re: wicket 1.2.7 login error checking and reporting

right, there is no wicketfilter in 1.2.x, only wicketservlet.

if you get empty <ajaxresponse> back then maybe you are forgetting to
update the feedback panel using ajaxrequesttarget.

-igor

On Fri, Aug 7, 2009 at 11:08 AM, Burton, Tom F
(DOR)<address-removed ([email]address-removed[/email])> wrote:
Quote:
I found wicketSessionFilter but not wicketFilter. How would using
A regular submit button make a difference. I know submit request goes to the "server" I just get an empty pair of <ajaxresponse> tags back from the server. (Firebug is really usefull, and I'm able to look at the post request I send thanks to TamperData).

Thanks Again,
Tom

-----Original Message-----
From: Igor Vaynberg [mailto:address-removed ([email]address-removed[/email])]
Sent: Thursday, August 06, 2009 11:57 AM
To: address-removed ([email]address-removed[/email])
Subject: Re: wicket 1.2.7 login error checking and reporting

set a breakpoint in wicketfilter and see what its doing. does it work
properly when using a regular submit button?

-igor

On Thu, Aug 6, 2009 at 12:49 PM, Burton, Tom F
(DOR)<address-removed ([email]address-removed[/email])> wrote:
Quote:
Hello,

I realize 1.2.7 is no longer "officially" supported.
However, I'm hoping someone will help me anyway. Here goes nothing......




I have a login page that is supposed to make sure a username
and password were actually entered before validating against the auth
source.

If the name and/or password aren't entered it's supposed to spit out an
error message to the user. It works when a password is entered but no
username.

If I enter a username and no password, or don't enter anything at all,
nothing seems to happen. The spinning indicator next to the
IndicatingAjaxSubmitButton

goes by so fast I can't see it, if it goes by at all. My error log
statements that tell me where its at in the execution don't seem to
write out either. I've tested this

in both Firefox and IE. I also tested by entering a password in the form
and then using the Tamper Data extension for Firefox to remove the
password. Still no joy.

It seems that it's somewhere in the server side code that's terminating
the request early but for the life of me I can't figure out where.



Thanks for any help/assistance in this matter,

Tom Burton








Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo