You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by RogerV <ro...@googlemail.com> on 2010/11/26 12:28:08 UTC

Struts 2 Testing - odd behaviour

Hi

I guess this is not strictly a Struts problem, but I thought someone here
might have seen this. When I display the jsp page listed below in Firefox,
IE8, Safari and Chrome, pressing "Menu" gives me a no such method menu()
exception which is expected since the underlying action has no menu()
method. Pressing "Next" takes me to the next page as expected. However, in
IE6, I get the the no such method menu() exception whichever button I press.
Any ideas as to why?

<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Edit Ecu Text</title>
</head>
<body>
<h2 id="title">Select Platform</h2>
<div class="formWrapper">
<s:form theme="simple" method="post">
<s:select label="Platform" name="platformId" list="platforms" listKey="id"
listValue="platformName"
		value="{platformName}"/>
<s:submit type="button" label="Next"/>
<s:submit type="button" label="Menu" method="menu"/>
</s:form>

</div>
</body>
</html>
-- 
View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30308915.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Testing - odd behaviour

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Simply, the former renders a <input type="submit"> element, the latter
renders a <button type="submit">. They should be the same thing,
according to html 4.01 specification.
The point is that ie6 doesn't like button tag.

2010/11/29 RogerV <ro...@googlemail.com>:
>
>
>
> Maurizio Cucchiara wrote:
>>
>> You're right... there is something wrong in the way IE6 handles buttons.
>>
>> Why don't you simply use:
>>     <s:submit type="submit" value="Next"/>
>>     <s:submit type="submit" value="Menu" method="menu"/>
>>
>
> Thanks for the confirmation Maurizio, I thought I was going mad. Your
> suggestion works, my app is now behaving itself on IE6 as well. Since your
> solution renders as a button anyway in IE6, IE7, IE8, Firefox and Chrome,
> does anyone know what the point of <s:submit type="button"> is? (It also
> might be worth a mention in the tag reference as well)
>
>
> Regards
> --
> View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30328991.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Testing - odd behaviour

Posted by RogerV <ro...@googlemail.com>.


Maurizio Cucchiara wrote:
> 
> You're right... there is something wrong in the way IE6 handles buttons.
> 
> Why don't you simply use:
>     <s:submit type="submit" value="Next"/>
>     <s:submit type="submit" value="Menu" method="menu"/>
> 

Thanks for the confirmation Maurizio, I thought I was going mad. Your
suggestion works, my app is now behaving itself on IE6 as well. Since your
solution renders as a button anyway in IE6, IE7, IE8, Firefox and Chrome,
does anyone know what the point of <s:submit type="button"> is? (It also
might be worth a mention in the tag reference as well)


Regards
-- 
View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30328991.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Testing - odd behaviour

Posted by Maurizio Cucchiara <ma...@gmail.com>.
You're right... there is something wrong in the way IE6 handles buttons.

Why don't you simply use:
    <s:submit type="submit" value="Next"/>
    <s:submit type="submit" value="Menu" method="menu"/>

2010/11/29 RogerV <ro...@googlemail.com>:
>
>
>
> Maurizio Cucchiara wrote:
>>
>> Could you post the generated html?
>>
>
> Posted below. Thanks for the typo nudge Dave, I hadn't spotted that because
> it actually works! The additional data in the html above what I posted in
> the .jsp file comes from Sitemesh decorators.
>
> Regards
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html>
> <head>
>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> <style type="text/css">@import
> "/FlashFileLoader/resources/css/global.css";</style>
> <script type="text/javascript"
> src="/FlashFileLoader/resources/js/jquery-1.3.2.min.js"></script>
>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> </head>
> <body id=""
>          onload="">
> <div id="container"> <!-- Wrapper for the entire page -->
> <div id="outer-header"> <!--  Wrapper for header elements -->
>                <div id="headerLogo">
> /FlashFileLoader/resources/images/Common-Heading_1.png
> </div>
>
> </div> <!--  End Of Header Wrappers -->
>
> <div id="right-panel-wrapper">
> <div id="navigation-wrapper">
> </div>
>
> <div id="contents-wrapper">
> <h2 id="title">Select Platform</h2>
> <div class="formWrapper">
> <form id="select-platform" name="select-platform"
> action="/FlashFileLoader/select-platform.action" method="post">
> <select name="platformId" id="select-platform_platformId">
>    <option value="9">Defender 2007 on</option>
>    <option value="44">Defender 2011</option>
>    <option value="1">Discovery 3 / LR3</option>
>    <option value="2">Discovery 4 / LR4</option>
>    <option value="10">Freelander 2</option>
>    <option value="5">Range Rover 2004.5 to 2005</option>
>    <option value="6">Range Rover 2006</option>
>    <option value="7">Range Rover 2007 to 2009</option>
>    <option value="8">Range Rover 2010 on</option>
>    <option value="3">Range Rover Sport 2005 to 2009</option>
>    <option value="4">Range Rover Sport 2010 on</option>
>
>
> </select>
>
> <button type="submit" id="select-platform_0" value="Submit">
> Next
> </button>
>
> <button type="submit" id="select-platform__menu" name="method:menu"
> value="Submit">
> Menu
> </button>
>
> </form>
>
> </div>
> </div>
>
> </div>
> <div id="push"></div>
> </div> <!-- End of container -->
>
> <div id="footer-wrapper">
>
> <p>Copyright &copy; 2008-2010 Blackbox Solutions.</p>
>
> </div>
>
> </body>
> </html>
> --
> View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30328168.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Testing - odd behaviour

Posted by RogerV <ro...@googlemail.com>.


Maurizio Cucchiara wrote:
> 
> Could you post the generated html?
> 

Posted below. Thanks for the typo nudge Dave, I hadn't spotted that because
it actually works! The additional data in the html above what I posted in
the .jsp file comes from Sitemesh decorators.

Regards

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<style type="text/css">@import
"/FlashFileLoader/resources/css/global.css";</style>
<script type="text/javascript"
src="/FlashFileLoader/resources/js/jquery-1.3.2.min.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body id=""
	  onload="">
<div id="container"> <!-- Wrapper for the entire page -->
<div id="outer-header"> <!--  Wrapper for header elements -->
		<div id="headerLogo">
/FlashFileLoader/resources/images/Common-Heading_1.png 
</div>

</div> <!--  End Of Header Wrappers -->

<div id="right-panel-wrapper">
<div id="navigation-wrapper"> 
</div>

<div id="contents-wrapper">
<h2 id="title">Select Platform</h2>
<div class="formWrapper">
<form id="select-platform" name="select-platform"
action="/FlashFileLoader/select-platform.action" method="post">
<select name="platformId" id="select-platform_platformId">
    <option value="9">Defender 2007 on</option>
    <option value="44">Defender 2011</option>
    <option value="1">Discovery 3 / LR3</option>
    <option value="2">Discovery 4 / LR4</option>
    <option value="10">Freelander 2</option>
    <option value="5">Range Rover 2004.5 to 2005</option>
    <option value="6">Range Rover 2006</option>
    <option value="7">Range Rover 2007 to 2009</option>
    <option value="8">Range Rover 2010 on</option>
    <option value="3">Range Rover Sport 2005 to 2009</option>
    <option value="4">Range Rover Sport 2010 on</option>


</select>

<button type="submit" id="select-platform_0" value="Submit">
Next
</button>

<button type="submit" id="select-platform__menu" name="method:menu"
value="Submit">
Menu
</button>

</form>

</div>
</div>

</div>
<div id="push"></div>
</div> <!-- End of container -->

<div id="footer-wrapper">
		
<p>Copyright &copy; 2008-2010 Blackbox Solutions.</p>
 
</div>

</body>
</html>
-- 
View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30328168.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Testing - odd behaviour

Posted by Dave Newton <da...@gmail.com>.
On Fri, Nov 26, 2010 at 12:09 PM, Ashlon Hill <as...@gmail.com> wrote:

> so there is a typo in  value="{platformName}" ?
>

If not in functionality (I'm not sure what that would do) then in clarity:
either use an OGNL escape, or don't, but don't go 50%.

Dave

Re: Struts 2 Testing - odd behaviour

Posted by Ashlon Hill <as...@gmail.com>.
Dave,

I'm just following,  so there is a typo in  value="{platformName}" ?


On Fri, Nov 26, 2010 at 7:05 AM, Dave Newton <da...@gmail.com> wrote:

> After fixing the typo in the "value" attribute.
>
> On Fri, Nov 26, 2010 at 6:55 AM, Maurizio Cucchiara <
> maurizio.cucchiara@gmail.com> wrote:
>
> > Could you post the generated html?
> >
> > 2010/11/26 RogerV <ro...@googlemail.com>:
> > >
> > > Hi
> > >
> > > I guess this is not strictly a Struts problem, but I thought someone
> here
> > > might have seen this. When I display the jsp page listed below in
> > Firefox,
> > > IE8, Safari and Chrome, pressing "Menu" gives me a no such method
> menu()
> > > exception which is expected since the underlying action has no menu()
> > > method. Pressing "Next" takes me to the next page as expected. However,
> > in
> > > IE6, I get the the no such method menu() exception whichever button I
> > press.
> > > Any ideas as to why?
> > >
> > > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> > >    pageEncoding="ISO-8859-1"%>
> > > <%@ taglib prefix="s" uri="/struts-tags" %>
> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> > > <html>
> > > <head>
> > > <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
> > />
> > > <title>Edit Ecu Text</title>
> > > </head>
> > > <body>
> > > <h2 id="title">Select Platform</h2>
> > > <div class="formWrapper">
> > > <s:form theme="simple" method="post">
> > > <s:select label="Platform" name="platformId" list="platforms"
> > listKey="id"
> > > listValue="platformName"
> > >                value="{platformName}"/>
> > > <s:submit type="button" label="Next"/>
> > > <s:submit type="button" label="Menu" method="menu"/>
> > > </s:form>
> > >
> > > </div>
> > > </body>
> > > </html>
> > > --
> > > View this message in context:
> >
> http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30308915.html
> > > Sent from the Struts - User mailing list archive at Nabble.com.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> >
> > --
> > Maurizio Cucchiara
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>

Re: Struts 2 Testing - odd behaviour

Posted by Dave Newton <da...@gmail.com>.
After fixing the typo in the "value" attribute.

On Fri, Nov 26, 2010 at 6:55 AM, Maurizio Cucchiara <
maurizio.cucchiara@gmail.com> wrote:

> Could you post the generated html?
>
> 2010/11/26 RogerV <ro...@googlemail.com>:
> >
> > Hi
> >
> > I guess this is not strictly a Struts problem, but I thought someone here
> > might have seen this. When I display the jsp page listed below in
> Firefox,
> > IE8, Safari and Chrome, pressing "Menu" gives me a no such method menu()
> > exception which is expected since the underlying action has no menu()
> > method. Pressing "Next" takes me to the next page as expected. However,
> in
> > IE6, I get the the no such method menu() exception whichever button I
> press.
> > Any ideas as to why?
> >
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
> >    pageEncoding="ISO-8859-1"%>
> > <%@ taglib prefix="s" uri="/struts-tags" %>
> > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> > <html>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"
> />
> > <title>Edit Ecu Text</title>
> > </head>
> > <body>
> > <h2 id="title">Select Platform</h2>
> > <div class="formWrapper">
> > <s:form theme="simple" method="post">
> > <s:select label="Platform" name="platformId" list="platforms"
> listKey="id"
> > listValue="platformName"
> >                value="{platformName}"/>
> > <s:submit type="button" label="Next"/>
> > <s:submit type="button" label="Menu" method="menu"/>
> > </s:form>
> >
> > </div>
> > </body>
> > </html>
> > --
> > View this message in context:
> http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30308915.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
>
> --
> Maurizio Cucchiara
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts 2 Testing - odd behaviour

Posted by Maurizio Cucchiara <ma...@gmail.com>.
Could you post the generated html?

2010/11/26 RogerV <ro...@googlemail.com>:
>
> Hi
>
> I guess this is not strictly a Struts problem, but I thought someone here
> might have seen this. When I display the jsp page listed below in Firefox,
> IE8, Safari and Chrome, pressing "Menu" gives me a no such method menu()
> exception which is expected since the underlying action has no menu()
> method. Pressing "Next" takes me to the next page as expected. However, in
> IE6, I get the the no such method menu() exception whichever button I press.
> Any ideas as to why?
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>    pageEncoding="ISO-8859-1"%>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> <title>Edit Ecu Text</title>
> </head>
> <body>
> <h2 id="title">Select Platform</h2>
> <div class="formWrapper">
> <s:form theme="simple" method="post">
> <s:select label="Platform" name="platformId" list="platforms" listKey="id"
> listValue="platformName"
>                value="{platformName}"/>
> <s:submit type="button" label="Next"/>
> <s:submit type="button" label="Menu" method="menu"/>
> </s:form>
>
> </div>
> </body>
> </html>
> --
> View this message in context: http://old.nabble.com/Struts-2-Testing---odd-behaviour-tp30308915p30308915.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Maurizio Cucchiara

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org