facebook

can’t call action in a module from HTML:LINK or FORM

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #251455 Reply

    Kevin Hayes
    Member

    I 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”&gt;
    <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>

    #251492

    Riyad Kalla
    Member

    Moving 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.

    #252223

    thp
    Member

    @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

    #252283

    Riyad Kalla
    Member

    MyEclipse 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?

    #252324

    thp
    Member

    On 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)

    #252345

    Riyad Kalla
    Member

    Ok 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.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: can’t call action in a module from HTML:LINK or FORM

You must be logged in to post in the forum log in