- This topic has 5 replies, 4 voices, and was last updated 19 years, 11 months ago by Brian Fernandes.
-
AuthorPosts
-
maslovskyMemberStruts 1.1 allows to have several configuration fiels per each application module, for example:
<servlet> <servlet-name>action</servlet-name> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/default-struts-config-1.xml, /WEB-INF/default-struts-config-2.xml</param-value> </init-param> <init-param> <param-name>config/mymodule</param-name> <param-value>/WEB-INF/mymodule-struts-config-1.xml, mymodule-struts-config-2.xml</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet>
MyEclipse should support such configuration too to be struts 1.1 compliant.
Riyad KallaMemberActually it does… to add a new module check out the File > New > J2EE > Struts > Struts Module wizard. Also note that if you open that XML file you will have the full Struts development tols at your disposal.
If you are talking about the “XML File” icon that is shown, this is a limitation with Eclipse in that it doesn’t allow us to map “struts-config*.xml” to a certain editor, only file extensions and concrete file names, that it why the icon looks different. You are free of course to add these files to your Eclipse File Associations with the Struts Editor.
maslovskyMemberNo, this is not what I meant – although myeclipse supports multiple modules, I cannot specify multiple struts configuration files when creating it – I get an error message.
Also, when adding struts capabilites to the project, I canot specify multiple configuration files either.
Riyad KallaMemberalthough myeclipse supports multiple modules, I cannot specify multiple struts configuration files when creating it – I get an error message.
What is “it”? what is the error message? What are you doing when this error message occurs?
Also, when adding struts capabilites to the project, I canot specify multiple configuration files either.
I am checking with the developer of the struts support on this.
jamesmayMemberI am also having trouble using MyEclipse struts editor with multiple config files. I have a single module that is defined in two config files. My web.xml contains the following entry for my action servlet:
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config.xml,
/WEB-INF/struts-config-manage.xml
</param-value>
</init-param>I have all global definitions and some actions in struts-config.xml and only actions and forwards in struts-config-manage.xml. When I open struts-config.xml in design view I do not see any actions defined in the other file. Also, I cannot open struts-config-manage.xml with MyEclipse struts editor at all. Right click – open with does not give me the MyEclipse struts editor option.
I assume the editor does not support a single module using multiple config files?? Should I be able to open alternate struts config files (other than struts-config.xml) with the myEclipse editor?
Brian FernandesModeratorA Struts project can have multiple config modules. But, the config editor operates on only a single module. ie. You would have to open two Struts Config Editors to open both struts-config.xml and struts-config-manage.xml
By default – only struts-config.xml is associated with the MyEclipse struts editor. To open the other file, do the following
Window > Preferences > Workbench > File Associations
add the “MyEclipse Struts Editor” to the “*.xml” file type. That will allow you to open the struts-config-manage.xml with the Struts editor using the context menu.Brian.
-
AuthorPosts