[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38078 ] Don Brown commented on STR-2938: --------------------------------
Hubert: Yes and no. Sure, we could throw in a simple struts-config.xml for demos and beginners, but I think it is worth thinking about how zero-configuration could be done right. Michael: Here is an example: say, your action is named "bar" in module "foo" and your execute method returned "success". Struts would try to resolve that String by looking for the following jsp files: "/foo/bar.jsp", "/foo/bar_success.jsp", "/foo/success.jsp", "/bar.jsp", etc. This would happen through, say, a new method on Action such as "createForward", used instead of the traditional mapping.findForward(). It would allow you to be able to explicitly define your forward path, without hardcoding a specific jsp file path. The convention or forward lookup chain could always be modified outside the application to do things like use a new convention or search for other files such as velocity templates. Perhaps even a Chain could be used to create the forward. As with all three suggestions, they aren't critical for getting a simple struts config file in the jar, but they would make it much more useful, IMO. > Use default struts-config.xml stored in classloader path like chain-config.xml > ------------------------------------------------------------------------------ > > Key: STR-2938 > URL: http://issues.apache.org/struts/browse/STR-2938 > Project: Struts 1 > Issue Type: Improvement > Components: Core > Reporter: Michael Jouravlev > Assigned To: Michael Jouravlev > Priority: Minor > > Struts 1.x does not require defining action mapping to obtain an > ActionForward, form beans always have been optional, controller settings are > rarely changed. I suggest to create default struts-config.xml with sensible > settings for controller and resources, so that simple projects could be > started without creating an explicit struts-config.xml file. > Of course, struts-config.xml will be customized more often than > chain-config.xml, but the point is to be able to create a simple Struts > application without getting into details of what struts-config.xml is for and > how it works. This will simplify the learning process. > ActionServlet should not throw UnavailableException if > \WEB-INF\struts-config.xml or a web.xml parameter is not found. Instead it > should use a default version from the classpath just like it uses > chain-config.xml. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
