struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Jain" <Eric.J...@isb-sib.ch>
Subject Re: html:form action attribute not set correctly
Date Wed, 01 Jan 2003 23:34:24 GMT
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:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message