struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jaunius Belickas (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-1919) submit tag's 'action' property is ignored if enclosing form uses 'ajax' theme (form serialization/dojo problem)
Date Thu, 10 May 2007 09:24:42 GMT
submit tag's 'action' property is ignored if enclosing form uses 'ajax' theme (form serialization/dojo
problem)
---------------------------------------------------------------------------------------------------------------

                 Key: WW-1919
                 URL: https://issues.apache.org/struts/browse/WW-1919
             Project: Struts 2
          Issue Type: Bug
          Components: Views
    Affects Versions: 2.0.6
         Environment: Reproduceable on: Firefox 2.0.0.3, Opera 9.20, Internet Explorer 7.0.5730.11
            Reporter: Jaunius Belickas


When using <s:form with 'ajax' theme, <input type="submit" ../> fields are not submitted
(not serialized), so "action" attribute of "<s:submit ..>" tag is not effective and
default form action is used.
query string extracted from HTTP headers: someHiddenFldName=val&
After removing "theme" attribute from "<s:form ..>" tag, HTML input tag's are submitted
as expected. Query string from HTTP headers:  someHiddenFldName=val&action%3Afirst=first
------------------------------------------------------------------------
test.jsp:

<%@ taglib prefix="s" uri="/struts-tags" %>

<html>
    <head>
        <title>Hello World!</title>
        <s:head theme="ajax"/>
    </head>
    <body>
        <s:form method="post" id="someForm" action="test" theme="ajax">
        	<s:hidden name="someHiddenFldName" value="val"></s:hidden>
        	<s:submit 
        		value="first"
        		action="first" />
        	<s:submit 
        		value="second"
        		action="second" />
        </s:form>
    </body>
</html>


struts.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
	<include file="struts-default.xml" />
   
    <package name="default" extends="struts-default">
       
        <action name="test" class="test.TestAction" method="test">
        	<result name="SHOW">jsp/test.jsp</result>
        </action>
		<action name="first" class="test.TestAction" method="first">
        	<result name="SHOW">jsp/test.jsp</result>
        </action>
		<action name="second" class="test.TestAction" method="second">
        	<result name="SHOW">jsp/test.jsp</result>
        </action>
 </package>
</struts>


TestAction.java:
package test;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class TestAction  {
	private static final long serialVersionUID = -1918535468057675686L;
	private static final Log log = LogFactory.getLog(TestAction.class);
	
	public String test()
	{
		log.debug("=============");
		log.debug("[ DEFAULT ] ACTION");
		log.debug("=============");
		return "SHOW";
	}
	public void first()
	{
		log.debug("=============");
		log.debug("FIRST ACTION");
		log.debug("=============");
		
	}
	public void second()
	{
		log.debug("=============");
		log.debug("SECOND ACTION");
		log.debug("=============");
	}
	
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message