For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 5 replies, 3 voices, and was last updated 19 years, 4 months ago by
Riyad Kalla.
-
AuthorPosts
-
Kevin HayesMemberI have a web application that I am looking to have several modules. I move the action mappings into the module, I update the web.xml to include those and I get and error saying “Cannot create rewrite URL: java.net.MalformedURLException: Cannot retrieve ActionForward named loginPage’ “
so here is the code
web.xml
<init-param id=”ParamValue_1141856375123″>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375124″>
<param-name>config/air</param-name>
<param-value>/WEB-INF/air-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375125″>
<param-name>config/car</param-name>
<param-value>/WEB-INF/car-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375126″>
<param-name>config/hotel</param-name>
<param-value>/WEB-INF/hotel-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375127″>
<param-name>config/booking</param-name>
<param-value>/WEB-INF/booking-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375128″>
<param-name>config/trips</param-name>
<param-value>/WEB-INF/trips-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375129″>
<param-name>config/myaccount</param-name>
<param-value>/WEB-INF/myaccount-struts-config.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375130″>
<param-name>config/global</param-name>
<param-value>/WEB-INF/struts-config-global.xml</param-value>
</init-param>
<init-param id=”ParamValue_1141856375131″>
<param-name>config/admin</param-name>
<param-value>/WEB-INF/admin-tool-struts-config.xml</param-value>
</init-param>here is the config file under WEB-INF/ (not under global)
<?xml version=”1.0″ encoding=”UTF-8″?>
<!DOCTYPE struts-config PUBLIC “-//Apache Software Foundation//DTD Struts Configuration 1.1//EN” “http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”>
<struts-config><!– Form Beans –>
<form-beans><form-bean name=”loginForm” type=”com.galileo.global.forms.LoginForm”>
</form-bean></form-beans>
<!– Global Exceptions –>
<global-exceptions>
</global-exceptions><!– Global Forwards –>
<global-forwards>
<forward name=”welcomePage” path=”/welcomePage.do” contextRelative=”true”>
</forward>
<forward name=”loginPage” path=”/loginPage.do” contextRelative=”true”>
</forward></global-forwards>
<!– Action Mappings –>
<action-mappings><action path=”/login” type=”com.galileo.global.actions.LoginAction” name=”loginForm” attribute=”loginForm” input=”/webapp/pagedef/global/login.jsp” scope=”request”>
<forward contextRelative=”true” name=”success” path=”/webapp/pagedef/search/air/flightSearch.jsp”>
</forward>
</action>
<action path=”/Welcome” forward=”/webapp/pagedef/global/index.jsp” /><action path=”/checkResultsStatus” type=”com.galileo.search.CheckResultsStatusAction” name=”flightSelectionForm” input=”/webapp/pagedef/global/interstitial.jsp”>
<forward name=”success” path=”/webapp/pagedef/search/air/flightResults.jsp” contextRelative=”false” redirect=”true”>
</forward>
<forward name=”flightSearchPage” path=”/webapp/pagedef/search/air/flightSearch.jsp” redirect=”false” contextRelative=”true”>
</forward>
</action>
<action path=”/loginPage” type=”org.apache.struts.actions.ForwardAction” parameter=”/webapp/pagedef/global/login.jsp”>
</action>
<action path=”/welcomePage” type=”org.apache.struts.actions.ForwardAction” parameter=”/webapp/pagedef/global/welcome.jsp”>
</action></action-mappings>
</struts-config>and here is the jsp
<p class=”signOut”><html:link forward=”loginPage”>Sign in</html:link>May 2, 2006 at 2:30 pm #251492
Riyad KallaMemberMoving to OT > Soft Dev
Aren’t individual struts modules listed in a comma separate list and not all individually? DOuble check with the Struts docs, but I think that’s how to do it.
May 19, 2006 at 8:31 am #252223
thpMember@support-rkalla wrote:
Aren’t individual struts modules listed in a comma separate list and not all individually? DOuble check with the Struts docs, but I think that’s how to do it.
MyEclipse creates single entries for each new module :o)
Btw: I’d tried hard, but I’m not able to make a primitive, woking web app with modules. It seems that modules will not work properly whith Struts 1.2.7
May 20, 2006 at 10:07 am #252283
Riyad KallaMemberMyEclipse creates single entries for each new module :o)
I’m not sure I follow, when you add struts capabilities MyEclipse only adds a single struts-config reference, how are you adding additional modules using MyEclipse’s wizards?
May 22, 2006 at 2:16 am #252324
thpMemberOn project level:
New|Other|myEclipse|Web-Struts|Struts1.2|Struts1.2 Module?
Similar path for Struts 1.1.
Putting configs in a comma separated list only combine them to a large new single config.
http://struts.apache.org/struts-doc-1.2.7/userGuide/configuration.html:
# config – Context-relative path to the XML resource containing the configuration information for the default module. This may also be a comma-delimited list of configuration files. Each file is loaded in turn, and its objects are appended to the internal data structure. [/WEB-INF/struts-config.xml].
WARNING – If you define an object of the same name in more than one configuration file, the last one loaded quietly wins.
# config/${module} – Context-relative path to the XML resource containing the configuration information for the application module that will use the specified prefix (/${module}). This can be repeated as many times as required for multiple application modules. (Since Struts 1.1)May 22, 2006 at 9:14 am #252345
Riyad KallaMemberOk so I sat down and created a project but had to read through the doc you reference above pretty closely. I think you actually have to specify the module as the first part of the path, atleast I had to. I created a module called “admin” and to reference any of it’s resources I had to use /admin/<resource> as the path. See if that works.
-
AuthorPosts