What if any design patterns should you utilize when programming in Struts and dealing with Actions?
One must never lose sight of the fact that a Struts application is a
J2EE (I guess the correct term now is "Java EE") web application. It's got a few utilities and cool tricks, but it remains a J2EE application. As such, the entire list of J2EE patterns applies to a Struts application. Here is the URL to the J2EE Patterns developed by Sun Microsystems:
http://java.sun.com/blueprints/corej2eepatterns/index.html The "Front Controller" pattern is already implemented for you by Struts, but all the others are good candidates for a you to use in your applications.
Although Struts is indeed an MVC (Model/View/Controller) framework, the assets it provides really only cover the view and the controller. Building the model and accessing the model through the controller is up to you. To do this, you can definitely benefit from the patterns mentioned in the link above.
Why is it that you cannot you access constants from EL (Expression Language)?
That's the $10,000 question. Many of us wish EL had better support for constants, and are pushing for it in the next release. Without being able to speak for the developers of JSTL and EL, my guess is that the answer has to do with the fact that EL was developed to work exclusively with JavaBeans. It was not designed as a substitute for
Java code, but a way to easily and conveniently access JavaBeans from within a
JSP. Constants are not part of the JavaBean spec, and I suppose this is one reason they were left out. The reality is, most of us rely heavily on constants, and it's not at all convenient to have to jump through hoops in order to use them in EL.
I hope you're clear on the fact that Struts and EL are entirely separate. EL and JSTL are part of the JSP spec, while Struts is a web framework built over the
Servlet and JSP specs.