Re: Validator validates too early (was RE: Validator won't validate single required field)

2003-01-24 Thread Michał Postupalski


because request.getMethod() returns HTTP method and 
request.getMethod().toString() is always uppercase

sorry, my mistake, request.getMethod().toString() is a nonsense because 
request.getMethod() is type of java.lang.String.I'm too sleepy ;-(((

plastic


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Re: Validator validates too early (was RE: Validator won't validate single required field)

2003-01-24 Thread Michał Postupalski
Interesting... would equalsIgnoreCase be more appropriate, or are you sure
it'll always be in upper case?  My jsp currently has:
  
which turns into:
  
so I'm guessing that 'post' will be lowercase.


that's no matter if you write in Your HTML file:



or



because request.getMethod() returns HTTP method and 
request.getMethod().toString() is always uppercase

Thanks!  This is a much better solution, so I can change the name of the
Submit button without breaking it.


that's it !

plastic


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator validates too early (was RE: Validator won't validate single required field)

2003-01-24 Thread Michał Postupalski
On 1/24/2003 11:49 PM, Wendy Smoak wrote:

  /*only validate if the form has actually been submitted.
  We can tell this by checking to see if the Submit
  button is in the request
  */
  
  if (request.getParameter("Submit") != null) {
 return super.validate( mapping, request );
  } else {
return null;
  }

I You are using POST method for sending request (and probably yes) I 
would exchange Your code for this one:

if (request.getMethod().equals("POST")) {
  return super.validate( mapping, request );
} else {
 return null;
}


plastic




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



Validator validates too early (was RE: Validator won't validate single required field)

2003-01-24 Thread Wendy Smoak
> You wouldn't want to hit the JSP first anyways ;-).  

It was suggested by another person here and I just wanted to rule it out in
case it was your next suggestion. :)

> I believe both of your 
> thoughts will work but I would try the separate action mapping idea first.

I did, and it works, but... BLECH!  I have to duplicate every single action
mapping?!  And what am I supposed to call them?  someAction.do is so clean,
and now I have to have someActionFirstTime.do?  Or perhaps I keep the first
one with the clean name and call the others someAction2?

I'm examining the struts-example with JSP's under WEB-INF, and I think the
difference is my use of LookupDispatchAction vs. separate Actions for each
thing: edit/save/create.

This particular form isn't a CRUD form, it's a "Select the person you want
to view read-only info on", so I can't quite make the createSomething,
editSomething, updateSomething pattern fit.

And it kind of defeats the purpose of LookupDispatchAction to have to map it
several times.

I'm still pondering what to do about this.  I'm currently going with
someAction.do and someActionNV.do (for No Validation).  Ideas appreciated!

-- 
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management