I tend to use the same Action class for doing any preprocessing prior to
displaying the form (e.g. for populating any beans used by the form) and
also for processing the form input.
I distinguish between a fresh request to display the form and a form
submission, by putting a hidden field in the form (I call it 'fromForm').
That way, my action class can determine whether a request came from the form
or not.
Not sure if this is best practice, but I know of no other way.  Hopefully
someone else has a better solution...?

Lindsay

-----Original Message-----
From:   adam kramer [mailto:[EMAIL PROTECTED]] 
Sent:   19 August 2002 21:43
To:     [EMAIL PROTECTED]
Subject:        [MVC-Programmers] Action Redirection


I'm programming a tomcat-struts application and trying to follow a true MVC
architecture.
I'd like some suggestions on best practices or standards for calling
up/naming actions for are passthroughs for blank html forms for adding
business entities (e.g. adding a application user).
In the Struts catalog (http://www.husted.com/struts/catalog.htm) the 'Link
only to Actions' item says "If a JSP ends up on your browser's address bar
after the initial index page, then you're missing an Action ;-)"
If I want to link to a blank form (not populated) for adding a user to my
web application, what are some best practices/standards for setting this up
in my struts-config.xml action mappings?
1)      I don't want to validate the form yet, just show the jsp page so
they can fill it out and then submit.
2)      I can't call this action something like /user/Add because that will
be the submit action for this form. (this is a naming problem)
3)      I can't just link to addUser.jsp because that would be breaking my
MVC purity.

My issue is basically with configuration organization.
Any help is greatly appreciated.
Thanks,
Adam

_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.netbean.net/mailman/listinfo/mvc-programmers
_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.netbean.net/mailman/listinfo/mvc-programmers

Reply via email to