2

I have a Servlet in web.xml, as below with URL pattern.

<servlet-name>ApplicationLoader</servlet-name>
<servlet-class>com.test.ApplicationLoaderServlet</servlet-class>

<servlet-mapping>
    <servlet-name>ApplicationLoader</servlet-name>
    <url-pattern>*.loader</url-pattern>
</servlet-mapping>

I have an Action in struts-config.xml as below

<action  path="/settings"   type="com.test.SettingsAction"
 scope="request"    
>
<forward name="successful" path="/SuccessSettings.jsp" />
<forward name="failure" path="/Fail.jsp" />
</action>

Tried below approach for forward, but did not work. got 404 Page

request.getRequestDispatcher("/settings").forward(request, response);

or getServletContext().getRequestDispatcher("/settings").forward(request, response);

How do i forward request from Servlet to Struts action. old version of struts framework is used.

I got a solution below for struts 2 but not for 1.1.

How to forward request from servlet to action of struts2?

Any help on this please???

Community
  • 1
  • 1
user1876040
  • 431
  • 1
  • 7
  • 18

1 Answers1

2

Does it change anything if you add ".do" at the end of the path? I vaguely remember that request paths had to end in ".do" in Struts 1.x, e.g.:

request.getRequestDispatcher("/settings.do").forward(request, response);
David Levesque
  • 22,181
  • 8
  • 67
  • 82