You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Michael Jouravlev (JIRA)" <ji...@apache.org> on 2006/08/29 02:29:31 UTC
[jira] Created: (STR-2938) Use default struts-config.xml stored in
classloader path like chain-config.xml
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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38079 ]
Michael Jouravlev commented on STR-2938:
----------------------------------------
Don, your suggestion still looks like "magical convention" to me. As a user I think it might be confusing if I have both bar.jsp and success.jsp, I will have to remember about the lookup order. Also, an action returns either explicit URL to a JSP or another action like in Stripes, or it generates a result value, a state, and config file helps to find the destination based on state. You suggest to return a state and then to deduct where to go using some fuzzy logic. This does not make Struts configuration easier if you ask me :) Since you do not insist on implementing this, I would rather not :)
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38059 ]
Paul Benedict commented on STR-2938:
------------------------------------
I think this is a good idea. It surely be a minimal configuration, but give it a shot.
> 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
[jira] Reopened: (STR-2938) Use default struts-config.xml stored in
classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=all ]
Michael Jouravlev reopened STR-2938:
------------------------------------
Reopening, thanks Wendy for the tip on wildcards.
Here is my idea of simple zero-configuration: one of the reasons is simpler learning process for new Struts users. As such, I want to limit the number of Struts artefacts to bare minimum: just an Action class to process input and a JSP file as a view. This will allow to build a simple Model 2 application and to illustrate Model 2 (a.k.a. an action framework) ideas.
Considering the requirements for minimizing artefacts, I intend to:
* Not define any form beans (by the way, do form bean definitions support wildcards? If not, they probably should to. Do not forget to open another CR if they not. Even if they do, do not define any formbeans in the base config file.)
* As a concequence, do not use any form beans in an action mapping.
* Define one universal action mapping as a sort of "magic" or "programming by convention" style.
* validate="false" because action forms are not used, to ensure that an Action is always called.
* Do not use "input" attribute (will, obviously since autovalidation is turned off.)
* Do not define any forwards for base action mapping, Action class will build ActionForward object explicitly.
Therefore, the base struts-config.xml will consist mainly from one wildcard mapping like this:
<action path="/*"
type="org.apache.struts.webapp.custom.{1}Action"
validate="false"/>
I am not sure about the class type. The base package name can be either provided in web.xml (configuration again...), or it can always be a predefined package like "org.apache.struts.webapp.custom". Currently Struts uses "org.apache.struts.webapp" for samples, therefore I added "custom". Or both approaches can be used. Better ideas?
Therefore it will be possible to write a simple "Hello, world" application introducing only an Action and a JSP file to a newbie.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Hubert Rabago (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38075 ]
Hubert Rabago commented on STR-2938:
------------------------------------
You two (Michael and Don) are talking about two different things. One wants a quick start and the other wants auto configuration. It might help if we clarify what we want before discussing implementation details.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38073 ]
Michael Jouravlev commented on STR-2938:
----------------------------------------
>>> 1. Implement Action classloader scanning ala Stripes so that Action classes
>>> can be discovered without any configuration
>>
>> Why exactly this should be done? If we agree on convention that, say, for "*.do"
.> we call "*Action" action, then what discovery is for? The base config is not about
>> using annotations. Having base config with an action mapping with wildcards
>> does not change anything in the Struts core, does it?
>
> For starters, your technique requires me to put my Action classes
> in the org.apache.struts.webapp.custom package, which isn't desirable even
> on the most simple of applications. To get around that, I propose that you
> take the code from Stripes (it's APL2 licensed) which scans the classloader
> to find all classes that extend o.a.s.a.Action. No annotations necessary.
Got it, check.
>>> 2. Modify the processForward to lookup multiple jsp's automatically
>>> - "action.jsp", "action-result.jsp", "result.jsp", "module/action-result.jsp", etc.
>>
>> Again, what this is for? My idea is that users will be building ActionForward
>> objects manually, providing URL to JSP page directly in the action code.
>> The idea of base config is not zero-configuration, it is making Struts
>> development as simple and observable as possible, at least for simple
>> applications. I care more about learning process than about zeroconf
>> for a large application created by a seasoned developer.
>
> To be useful for anything bigger than a simple demo app, you'd want to avoid
> having to hard-code jsp paths in your Java code. Providing a lookup for
> convention-based paths, ala Ruby on Rails or Struts 2 (via Able), gives you
> a solution that is useful for real-world apps.
I guess I was thinking about something else when I replied. I was thinking about not specifying <forward> elements inside <action> element. The processForward is about something different, it is about processing the request not by an action, but by another resource where request is directed to if action is not defined for a mapping. In this regards it is not quite clear for me, how this corresponds to "looking up multiple jsp's automatically". What do you mean by this?
Is it like, if an Action class is not found during classloader scanning, Struts should then try to look up for JSPs with some "similar" names based on convention? How does this correspond to Struts idea of requests processed by actions first? This looks like an automatic ForwardAction, but still, this goes against cornerstone Struts concept.
Another thing is that having a base config file with wildcards is not like having "magic" or "convention" defined somewhere in the source code and not visible to an end user. There is no convention, there is the same struts-config.xml file, but it is a default config file. Currently <action> element allows to specify only one of "type", "forward" and "include" attributes, so it is not possible to create a valid mapping that refers both to action classes and to forward locations. Thus, action classes would be defined explicitly and forwards would be processed by "magic convention", this I am not fond of. Or am I not getting your idea?
> As an aside, I don't agree we should get rid of the DispatchAction concept
> when the name is so wide-spread and well-understood by Struts users.
> I find it more intuitive than a "event system for a course-grained" action.
DispatchAction is a name of a specific class. Low case does not really help. I often use "dispatching action" expression but heck, they all are dispatchers after all, check Sun blueprints and pattern descriptions. Also, it the eyes of some users DispatchAction has bad aura. Fine-grained vs. coarse-grained seems natural and simple. This concept the can be extended further, like comparing a coarse-grained action with dot-net's code-behind class. I think it is important to provide a different view of Struts action+form+pages as of collection of independent and self-sustaining resources. Then I can use this idea to introduce a concept of web components.
I don't see why we cannot group all dispatch actions under coarse-grained action umbrella ;) We don't have to mention "event system" explicitly. It is obvious that coarse-grained actions should have some kind of events/commands that trigger the handlers.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38068 ]
Michael Jouravlev commented on STR-2938:
----------------------------------------
> 1. Implement Action classloader scanning ala Stripes so that Action classes
> can be discovered without any configuration
Why exactly this should be done? If we agree on convention that, say, for "*.do" we call "*Action" action, then what discovery is for? The base config is not about using annotations. Having base config with an action mapping with wildcards does not change anything in the Struts core, does it?
> 2. Modify the processForward to lookup multiple jsp's automatically
> - "action.jsp", "action-result.jsp", "result.jsp", "module/action-result.jsp", etc.
Again, what this is for? My idea is that users will be building ActionForward objects manually, providing URL to JSP page directly in the action code. The idea of base config is not zero-configuration, it is making Struts development as simple and observable as possible, at least for simple applications. I care more about learning process than about zeroconf for a large application created by a seasoned developer.
> 3. Natively support dispatch actions with a "*/*" mapping, with the second
> wildcard interpreted as the method name
I might agree with that but only as another option for supporting dispatch actions (I suggest switching to "coarse-grained actions" to get rid of DispatchAction connotation). Another option to support coarse-grained actions is sending events as request parameters, functionally identical to EventDispatchAction. I want to implement this functionality in base Action class and add <event> element to <action> element in config file. So, for a base zeroconf file the mapping might look something like this:
<action path="/*" type="org.apache.struts.webapp.custom.{1}Action" validate="false">
<event name="**" handler="{2}Handler">
</action>
See http://issues.apache.org/struts/browse/STR-2940 for details on implementing coarse-grained actions.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38069 ]
Don Brown commented on STR-2938:
--------------------------------
First of all, I think these three things should be done to "do it right", but they certainly don't have to be done at all. Now to the responses:
>> 1. Implement Action classloader scanning ala Stripes so that Action classes
>> can be discovered without any configuration
>
> Why exactly this should be done? If we agree on convention that, say, for "*.do" we call "*Action" action, then what discovery is for? The base config is not about > using annotations. Having base config with an action mapping with wildcards does not change anything in the Struts core, does it?
For starters, your technique requires me to put my Action classes in the org.apache.struts.webapp.custom package, which isn't desirable even on the most simple of applications. To get around that, I propose that you take the code from Stripes (it's APL2 licensed) which scans the classloader to find all classes that extend o.a.s.a.Action. No annotations necessary.
>> 2. Modify the processForward to lookup multiple jsp's automatically
>> - "action.jsp", "action-result.jsp", "result.jsp", "module/action-result.jsp", etc.
>
> Again, what this is for? My idea is that users will be building ActionForward objects manually, providing URL to JSP page directly in the action code. The idea > of base config is not zero-configuration, it is making Struts development as simple and observable as possible, at least for simple applications. I care more
> about learning process than about zeroconf for a large application created by a seasoned developer.
To be useful for anything bigger than a simple demo app, you'd want to avoid having to hard-code jsp paths in your Java code. Providing a lookup for convention-based paths, ala Ruby on Rails or Struts 2 (via Able), gives you a solution that is useful for real-world apps.
As for point three, your snippet wouldn't work because the wildcards have to be in the action path, and furthermore, the '**' matches slashes as well, which wouldn't work as in a method name. As an aside, I don't agree we should get rid of the DispatchAction concept when the name is so wide-spread and well-understood by Struts users. I find it more intuitive than a "event system for a course-grained" action.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38067 ]
Don Brown commented on STR-2938:
--------------------------------
This is a good start. To make this feature really useful, the following should be done:
1. Implement Action classloader scanning ala Stripes so that Action classes can be discovered without any configuration
2. Modify the processForward to lookup multiple jsp's automatically - "action.jsp", "action-result.jsp", "result.jsp", "module/action-result.jsp", etc.
3. Natively support dispatch actions with a "*/*" mapping, with the second wildcard interpreted as the method name
> 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
[jira] Updated: (STR-2938) Use default struts-config.xml stored in
classloader path like chain-config.xml
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/STR-2938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Benedict updated STR-2938:
-------------------------------
Fix Version/s: Future
> Use default struts-config.xml stored in classloader path like chain-config.xml
> ------------------------------------------------------------------------------
>
> Key: STR-2938
> URL: https://issues.apache.org/struts/browse/STR-2938
> Project: Struts 1
> Issue Type: Improvement
> Components: Core
> Reporter: Michael Jouravlev
> Assignee: Michael Jouravlev
> Priority: Minor
> Fix For: Future
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STR-2938) Use default struts-config.xml stored in
classloader path like chain-config.xml
Posted by "Paul Benedict (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/struts/browse/STR-2938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Benedict updated STR-2938:
-------------------------------
Assignee: (was: Michael Jouravlev)
> Use default struts-config.xml stored in classloader path like chain-config.xml
> ------------------------------------------------------------------------------
>
> Key: STR-2938
> URL: https://issues.apache.org/struts/browse/STR-2938
> Project: Struts 1
> Issue Type: Improvement
> Components: Core
> Reporter: Michael Jouravlev
> Priority: Minor
> Fix For: Future
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38077 ]
Michael Jouravlev commented on STR-2938:
----------------------------------------
No, not really. I do not oppose auto configuration if things can be kept simple :-) I agreed with Don's first point after he explained it to me. I may agree with second as well, but currently seems that either I do not understand it right, or Don wants some additional magic. I do oppose the "magical convention" that is not explicitly specified in struts-config.xml file. It would be a hidden default file, but it should contain explicit configuration nonetheless.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Wendy Smoak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38058 ]
Wendy Smoak commented on STR-2938:
----------------------------------
How to resolve a URL to an Action? Wildcards! Let's reopen it. :)
> 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
[jira] Closed: (STR-2938) Use default struts-config.xml stored in
classloader path like chain-config.xml
Posted by "Michael Jouravlev (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=all ]
Michael Jouravlev closed STR-2938.
----------------------------------
Resolution: Not A Problem
Oops. Did not think about how I will be resolving URL to Action class. Closing. Not a problem.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/struts/browse/STR-2938?page=comments#action_38080 ]
Don Brown commented on STR-2938:
--------------------------------
Actually, I implemented something like it several years ago in the Struts Flow project. In that case, I used a defined pattern similar to the one used in the controller element to decide how to resolve paths: http://svn.apache.org/repos/asf/struts/sandbox/trunk/flow/src/java/org/apache/struts/flow/struts-config.xml Perhaps the explicit pattern style might be more to your liking. Either way, it would be nice to be able to use dynamic forwards without hard-coding jsp paths in your Java action code.
> 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
[jira] Commented: (STR-2938) Use default struts-config.xml stored
in classloader path like chain-config.xml
Posted by "Don Brown (JIRA)" <ji...@apache.org>.
[ 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