Your .do
is your URL pattern as (@Jigar Joshi mentioned) to see where it's mapped you will have to look at your URL on your browser:
Supposed your have http://localhost:8080/myapp/login.do
, then the .do
is seeing by your web container and it calls your Struts Servlet org.apache.struts.action.ActionServlet
.
The Struts ActionServlet
will then see your relative path /login
(see how I've ignored the .do
) and see whether it's mapped on your config
file (in your case /WEB-INF/struts-config.xml
).
From there, Struts ActionServlet
check if there's an action path that matches your relative path, something like this:
<action path="/login" type="com.myapp.action.LoginAction" name="LoginForm" scope="request">
</action>
If that <action>
is found, Struts will call com.myapp.action.LoginAction
class and call the execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception
method (if the class is just a simple Action
class).
I hope this helps.
Inside your <action>
element you might find another element called <forward>
, example:
<forward name="FHome" path="/content/jsp/home.jsp" />
The forward name
attribute is basically what your Struts Action calls when it returns an ActionForward
, a code like this:
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
return mapping.findForward("FHome");
}
Bear in mind that a forward
inside an action
element in struts-config.xml
is called a local forward. A Global Forward sits outside the action
element.
The path
of the forward
element is the relative path of the jsp page that Struts has to call (and the web/servlet container) to render.
Hope this clears things out for you.