struts forwarding problem.

Posted on 2006-05-22
Last Modified: 2010-03-31
I have a link on a webpage called customers, this is what the code looks like in the html page

<html:link action="/customer">Customer</html:link>

in struts-config.xml I have the following defined for this
<action path="/customer"
                parameter="" />

where is defined is tiles-def.xml and everything works fine.

I want to achieve the same effect, but in the action class when I do a return. I tried

return mapping.findForward("/customer"); //did not work
return new ActionForward("/customer"); //did not work

how do i see the same page that I could see by clicking on the Customer link.

Thanks in advance.
Question by:muthiahmerchant
    LVL 16

    Accepted Solution


    Try to add .do at the end
    return new ActionForward("/");

    And I do not think that the first one is correct. if you would like to use the first one, you can specify the <forward name
    return mapping.findForward("callCustomer");

    then in your struts-config.xml and within your Action definition
    <forward name="callCustomer" path="/" />

    LVL 1

    Author Comment

    by:muthiahmerchant worked.

    Thanks a lot.


    Expert Comment

    Try this:

    Action mapping in struts-config.xml:

                type="[put Action classpath here]"
                <forward name="success" path="/" redirect="false" />

    In the action class:

    return mapping.findForward("success");
    LVL 16

    Expert Comment


    Glad I could help


    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now