Not sure if this is considered a bug, it may be. Certainly the code 
needs a catch-all to fix it.

I was having trouble getting a <html:form> tag to work, the action in 
the generated html, was always ="". Having resorted to using 
<struts:form> which worked (them were days, struts, pre version 
numbers...), I finally put some debug code in html.FormTag.

The problem was, that servlet mapping, that the form tag looks up in 
the application context was not the one that should have been used. I 
have many mappings to the ActionServlet, one is *.do, while the rest 
grab certain specific URL's (legacy JSP's, which get forwardeed to 
actual JSP's having been through the controller for session checks and 
logging). The form tag was finding a specific mapping, which fails ALL 
the tests in getActionMappingURL() (I also have no context path) - 
resulting in action="".

Quick solution: add a catch all (and maybe a warning?) to just use the 
url provided.

(this diff is from the 1.0.1 source, though the latest in cvs has the 
same problem)

*** FormTag.java.orig   Fri Apr  5 19:03:05 2002
--- FormTag.java        Fri Apr  5 19:03:51 2002
***************
*** 721,726 ****
--- 721,728 ----
                  value.append(servletMapping.substring
                               (0, servletMapping.length() - 2));
                  value.append(actionMapping);
+             } else {
+                 value.append(action);
              }
              if (queryString != null)
                  value.append(queryString);

Real solution: erm don't know. I managed to fix this by placing the 
*.do mapping last in web.xml, though this does seem very hacky and not 
particularly stable.

Ken.


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.


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

Reply via email to