The problem seems to be with
org.apache.struts.util.RequestUtils.getActionMapping, as the following
simply prints '/application' instead of '/application/search'.

    <%-- RequestUtils.getActionMappingURL("/search", pageContext) --%>


Looking through the code of this method, I see:

  if (servletMapping.startsWith("*.")) {
    value.append(actionMapping);
    value.append(servletMapping.substring(1));
  } else if (servletMapping.endsWith("/*")) {
    value.append(servletMapping.substring(0, servletMapping.length() - 2));
    value.append(actionMapping);
  } else if (servletMapping.equals("/")) {
    value.append(actionMapping);
  }

This will of course not work if the servlet mapping is done in the following
way:

  <servlet-mapping>
    <servlet-name>actionServlet</servlet-name>
    <url-pattern>/search</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>actionServlet</servlet-name>
    <url-pattern>/browse</url-pattern>
  </servlet-mapping>
  ...

Is there any problem with adding something like the following line of code?

  else value.append(actionMapping);


--
Eric Jain


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to