craigmcc01/02/19 21:20:13
Modified:src/doc struts-html.xml
src/share/org/apache/struts/action Action.java
ActionServlet.java
src/share/org/apache/struts/taglib/html FormTag.java
LocalStrings.properties
web/example logon.jsp registration.jsp subscription.jsp
Log:
Fix the html:form action="xxx" attribute to correctly work for both
extension mapping and path mapping of the controller servlet -- at least
as long as your servlet container correctly allows the following to work:
InputStream is =
getServletContext().getResourceAsStream("/WEB-INF/web.xml");
like it is supposed to.
The new recommended approach is to set the action attribute of html:form
to exactly the path of the Action to which you wish the form to be
submitted. The html:form tag will understand how the action servlet is
being mapped, and will construct an appropriate URL accordingly.
For backwards compatibility, the existence of the extension-mapping
extension on an action attribute still works, so either of the following
tags would work in the Struts example application:
html:form action="/logon.do" ...
html:form action="/logon" ...
The latter path will also work if the controller servlet is path-mapped,
but you will need to adjust the paths for several of the forward
elements in this case.
Submitted by: Marcus Ahnve [EMAIL PROTECTED]
PR: Bugzilla #587
Revision ChangesPath
1.15 +2 -2 jakarta-struts/src/doc/struts-html.xml
Index: struts-html.xml
===
RCS file: /home/cvs/jakarta-struts/src/doc/struts-html.xml,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- struts-html.xml 2001/02/20 02:58:59 1.14
+++ struts-html.xml 2001/02/20 05:20:05 1.15
@@ -1018,8 +1018,8 @@
pIf you are using extension mapping for selecting the
controller servlet, this value should be equal to the
codepath/code attribute of the corresponding
-codelt;actiongt;/code element, plus the correct
-file extension suffix./p
+codelt;actiongt;/code element, optionally
+followed by the correct extension suffix./p
pIf you are using path mapping to select the
controller servlet, this value should be exactly equal
1.17 +14 -4 jakarta-struts/src/share/org/apache/struts/action/Action.java
Index: Action.java
===
RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/Action.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- Action.java 2001/01/11 00:16:56 1.16
+++ Action.java 2001/02/20 05:20:07 1.17
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/Action.java,v 1.16
2001/01/11 00:16:56 craigmcc Exp $
- * $Revision: 1.16 $
- * $Date: 2001/01/11 00:16:56 $
+ * $Header:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/Action.java,v 1.17
2001/02/20 05:20:07 craigmcc Exp $
+ * $Revision: 1.17 $
+ * $Date: 2001/02/20 05:20:07 $
*
*
*
@@ -106,7 +106,7 @@
* by this Action.
*
* @author Craig R. McClanahan
- * @version $Revision: 1.16 $ $Date: 2001/01/11 00:16:56 $
+ * @version $Revision: 1.17 $ $Date: 2001/02/20 05:20:07 $
*/
public class Action {
@@ -207,6 +207,16 @@
*/
public static final String MULTIPART_KEY =
"org.apache.struts.action.mapping.multipartclass";
+
+
+/**
+ * The context attributes key under which we store the mapping defined
+ * for our controller serlet, which will be either a path-mapped pattern
+ * (code/action/*/code) or an extension mapped pattern
+ * (code*.do/code).
+ */
+public static final String SERVLET_KEY =
+"org.apache.struts.action.SERVLET_MAPPING";
/**
1.59 +83 -4
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
Index: ActionServlet.java
===
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- ActionServlet.java2001/02/14 00:19:46 1.58
+++ ActionServlet.java2001/02/20 05:20:07 1.59
@@ -1,7 +1,7 @@
/*
- * $Header: