Well my problem is that i have a form in file "userRegistration.do" where of course I what to send back the html:errors if any that will happen when submitting it. It works great but my problem is that userRegistration.do show form errors before the form even being submitted.
You are entering the submitting action of the jsp. The ActionMapping for userRegistration.do kicks in and calls the validate method of userRegistrationForm. Validation obviously does not pass because your request does not include any parameters. Since validation fails it passes the request along to the "input" of the ActionMapping, which is your userRegistration.jsp
The Address bar of your browser in Struts is a bit of a paradigm shift. We are used to it displaying the next page we want to see. In Struts, we'll typically see what we last asked the server to "do"... which usually is something associated with the previous page.
If you do not want to link directly to the jsp as you mentioned, it might be worth creating an ActionMapping called "gotoUserRegistration.do" or something to that nature. You will probably want to use a SuccessAction. Something like:
SuccessAction you can get from Scaffold or make your own. It just returns mapping.findForward("success")
Hope this is helpful.
A good workman is known by his tools.
posted 15 years ago
ah thanks, you explained what I tried to explain for you =)
I did as you described with a successAction. I wonder is this the best way to go or should i think over something?
I got a second question to. info:I use struts 1.1 well i wonder how i can use xhtml strict. In regular html i have this:
I have tried two ways in Struts style.
If i browse the page and take view source the start tag <html> doesnt even show. If i use following: