You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dan Allen <da...@mojavelinux.com> on 2003/07/18 09:19:36 UTC
template theme idea
I have an idea which I think would help to make struts more flexible
when it comes to "skinning" an application. I might get shot down
for this, but it makes a lot of sense to be, so here goes.
Currently in struts, the paths in the configuration file (and
taglibs) can follow a forwardPattern and pagePattern which in
turn can currently use two variables, $M for the module directory
and $P for the path value. I propose to add a third variable named
$T which would be replaced with the "theme name." The theme can be
specified as an init parameter for the servlet in web.xml and
possibly overridden by a BaseAction if a certain cookie is read in.
It looks as though the best place for the getter/setter would be in
the ActionServlet since it needs to be available to all Actions that
are created. Better I guess would be to place it in a
THEME_NAME_KEY in the servletContext and then use put the get/set
method in the Action.
Before I make a patch I need to know where one would place this
information in order to modify. The other issue I forsee is that
using WEB-INF for the jsp pages no longer becomes a viable option
since the path element would be
/WEB-INF/jsp/example.jsp
doing
$M$T$P
would leave behind (in the default module configuration)
/default/WEB-INF/jsp/example.jsp
...so container security can be used instead.
The only issue I see with this in the taglibs is if you wanted to
include a "common" file to all themes. Is there already a way to
change the pattern for creating the path in the taglibs...or is the
pattern sticky once it is set?
Dan
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Daniel Allen, <da...@mojavelinux.com>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"When you're raised by the Jesuits, you become either obedient
or impertinent"
-- Jack McCoy, "Law and Order"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org