You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Milan Milanovic <mi...@yahoo.com> on 2008/11/19 18:32:35 UTC

Form submitted twice (no AJAX!)

Hi,

I have a simple jsp form:

<head>
	<s:head theme="ajax" debug="true" />
</head>
<s:form action="showReport" namespace="/reports" validate="true">
		
		From date: <s:datetimepicker id="fromDate" displayFormat="dd.MM.yyyy"
type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
 		To date: <s:datetimepicker id="toDate" displayFormat="dd.MM.yyyy"
atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2"><s:select id="user" label="User"
				list="users" name = "user.id" emptyOption="false"
				listKey = "id" value = "user.id"
				headerKey="None" multiple="false" theme="simple"/>
		        </td>
		</tr>
		<tr>
			<td colspan="2"><s:submit value="Show report" theme="simple" /></td>
		</tr>
</s:form>

And when user click submit button, this form get submitted twice, i.e.
showReport form action method is called twice! I'm NOT USING AJAX here, I
DON'T HAVE ANY Javascript functions in this page.

In my struts.xml I have:

<action name="showReport" method="showReport" class="ReportAction">
  		 <result>/pages/reports/report.jsp</result>
  		 <result name="input">/pages/reports/chooseReport.jsp</result>
</action>

What is the problem here ?
-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
I solved with two lists..it is not so elegant solution, but there is
obviously no better solution.

--
Milan


Milan Milanovic wrote:
> 
> Dave,
> 
> actually my form isn't submitted twice :-(. I found now what was the
> problem. I set one multiple option select in jsp like this:
> 
> <s:select label="Users" list="users" listKey="id" listValue="name"
> 				name="users.id" emptyOption="false" value="%{users.{id}}"
> 				headerKey="None" theme="simple" multiple="true" />
> 
> The problem is because my users list contain e.g. three users: Mike, John,
> Paul. And when user select for example one of them in jsp page, I just got
> added that user(s) at the end of users list. How can I set that this list
> later contain just selected users ?
> 
> --
> Milan
> 
> 
> 
> newton.dave wrote:
>> 
>> Those aren't links. They're text. That's why I asked if everything came
>> through okay.
>> 
>> 
>> --- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:
>> 
>>> From: Milan Milanovic <mi...@yahoo.com>
>>> Subject: Re: Form submitted twice (no AJAX!)
>>> To: user@struts.apache.org
>>> Date: Friday, November 21, 2008, 10:19 AM
>>> There is no menu code, just those two links.
>>> 
>>> Milan
>>> 
>>> 
>>> newton.dave wrote:
>>> > 
>>> >>> > <div id="menu">
>>> /myApp/index.jsp Main
>>> >>> &nbsp; |&nbsp;
>>> >>> > /myApp/j_acegi_logout Logout </div>
>>> > 
>>> > Is your menu not implemented yet?
>>> > 
>>> > 
>>> > --- On Fri, 11/21/08, Milan Milanovic
>>> <mi...@yahoo.com> wrote:
>>> > 
>>> >> From: Milan Milanovic
>>> <mi...@yahoo.com>
>>> >> Subject: Re: Form submitted twice (no AJAX!)
>>> >> To: user@struts.apache.org
>>> >> Date: Friday, November 21, 2008, 9:39 AM
>>> >> Dear Dave,
>>> >> 
>>> >> I don't understand. That is exactly what I get
>>> when
>>> >> page is generated. I
>>> >> omited some plain html code.
>>> >> 
>>> >> 
>>> >> --
>>> >> Milan
>>> >> 
>>> >> 
>>> >> newton.dave wrote:
>>> >> > 
>>> >> > I don't think that came through properly;
>>> perhaps
>>> >> try pastebin or similar.
>>> >> > 
>>> >> > Dave
>>> >> > 
>>> >> > 
>>> >> > --- On Thu, 11/20/08, Milan Milanovic
>>> >> <mi...@yahoo.com> wrote:
>>> >> > 
>>> >> >> From: Milan Milanovic
>>> >> <mi...@yahoo.com>
>>> >> >> Subject: Re: Form submitted twice (no
>>> AJAX!)
>>> >> >> To: user@struts.apache.org
>>> >> >> Date: Thursday, November 20, 2008, 3:33
>>> PM
>>> >> >> Why is this form submitte twice ?
>>> >> >> 
>>> >> >> 
>>> >> >> Milan Milanovic wrote:
>>> >> >> > 
>>> >> >> > Yes, but it is the same when I
>>> remove ajax
>>> >> with
>>> >> >> simple. Here is my jsp
>>> >> >> > page, there is no AJAX word there
>>> and I still
>>> >> get
>>> >> >> submited twice:
>>> >> >> > 
>>> >> >> > <html
>>> >> >>
>>> xmlns="http://www.w3.org/1999/xhtml"
>>> >> >> xml:lang="en">
>>> >> >> > <head>
>>> >> >> > <script
>>> >> type="text/javascript">
>>> >> >> >     // Dojo configuration
>>> >> >> >     djConfig = {
>>> >> >> >         baseRelativePath:
>>> >> >> "/myApp/struts/dojo",
>>> >> >> >         isDebug: true,
>>> >> >> >         bindEncoding:
>>> "UTF-8",
>>> >> >> >         debugAtAllCosts: true // not
>>> needed,
>>> >> but
>>> >> >> allows the Venkman
>>> >> >> > debugger to work with the includes
>>> >> >> >     };
>>> >> >> > </script>
>>> >> >> > <script
>>> type="text/javascript"
>>> >> >> >        
>>> >> >>
>>> >>
>>> src="/myApp/struts/dojo/dojo.js"></script>
>>> >> >> > <script
>>> type="text/javascript"
>>> >> >> >        
>>> >> >>
>>> >>
>>> src="/myApp/struts/simple/dojoRequire.js"></script>
>>> >> >> > </head>
>>> >> >> > <body onload="">
>>> >> >> > 
>>> >> >> > 
>>> >> >> > <div id="menu">
>>> >> /myApp/index.jsp Main 
>>> >> >> &nbsp; |&nbsp; 
>>> >> >> > /myApp/j_acegi_logout Logout
>>> </div>
>>> >> >> > 
>>> >> >> > <div id="sidebar">
>>> >> >> > <h1>Menu</h1>
>>> >> >> > <div
>>> class="project">
>>> >> >> > <p> /myApp/index.jsp Main page
>>> >> </p>
>>> >> >> > <p>&nbsp;</p>
>>> >> >> > <p>&nbsp;</p>
>>> >> >> > <p> # <br />
>>> >> >> >  </p>
>>> >> >> > </div>
>>> >> >> > </div>
>>> >> >> > 
>>> >> >> > <div>
>>> >> >> > <h2>Choose report</h2>
>>> >> >> > <br>
>>> >> >> >  <div align="left"
>>> >> style="width:
>>> >> >> 600px; border-width:thin;
>>> >> >> > border-style:solid;
>>> >> border-color:threedlightshadow;
>>> >> >> text-align: left;">
>>> >> >> > 
>>> >> >> > 			
>>> >> >> > <form namespace="/reports
>>> >> >> id="showReport"
>>> >> name="showReport"
>>> >> >> > onsubmit="return true;"
>>> >> >>
>>> >>
>>> action="/myApp/reports/showReport.action"
>>> >> >> > method="post">
>>> >> >> >    <table
>>> >> class="wwFormTable">
>>> >> >> > 		
>>> >> >> > 		From date: <script
>>> >> >> type="text/javascript">
>>> >> >> >    
>>> >> dojo.require("dojo.widget.DatePicker");
>>> >> >> > </script>
>>> >> >> > <div
>>> >> >> >     
>>> dojoType="dropdowndatepicker" 
>>> >>  
>>> >> >> id="fromDate"   
>>> >> >> >
>>> value="2008-11-11T00:00:00"   
>>> >> >> name="dojo.fromDate"   
>>> >> >> > inputName="fromDate"    
>>> >> >> displayFormat="dd.MM.yyyy" 
>>> >> >> >
>>> >>
>>> saveFormat="rfc"></div><br/>
>>> >> >> >  		Do datuma: <script
>>> >> >> type="text/javascript">
>>> >> >> >    
>>> >> dojo.require("dojo.widget.DatePicker");
>>> >> >> > </script>
>>> >> >> > 
>>> >> >> > 		<tr>
>>> >> >> > 			<td
>>> >> align="right"><label
>>> >> >> for="users"
>>> >> >>
>>> >>
>>> class="label">User:</label></td>
>>> >> >> > 			<td><select
>>> >> name="user.id"
>>> >> >> id="user">
>>> >> >> >     <option
>>> >> >>
>>> value="1">Mike</option>
>>> >> >> >     <option
>>> >> >>
>>> value="2">John</option>
>>> >> >> >     <option
>>> >> >>
>>> value="3">Peter</option>
>>> >> >> > </select></td>
>>> >> >> > 		</tr>
>>> >> >> > 		<tr>
>>> >> >> > 			<td
>>> colspan="2"><input
>>> >> >> type="submit"
>>> >> id="showReport_0"
>>> >> >> value="Show
>>> >> >> > report"
>>> class="submit"
>>> >> >> style="submit"/>
>>> >> >> > </td>
>>> >> >> > 		</tr>
>>> >> >> > </table></form>
>>> >> >> > 
>>> >> >> > </div>
>>> >> >> > </body>
>>> >> >> > </html>
>>> >> >> > 
>>> >> >> > 
>>> >> >> > 
>>> >> >> > 
>>> >> >> > Jeromy Evans - Blue Sky Minds wrote:
>>> >> >> >> 
>>> >> >> >> Milan Milanovic wrote:
>>> >> >> >>> Hi,
>>> >> >> >>>
>>> >> >> >>> I have a simple jsp form:
>>> >> >> >>>
>>> >> >> >>> <head>
>>> >> >> >>> 	<s:head
>>> theme="ajax"
>>> >> >> debug="true" />
>>> >> >> >>> </head>
>>> >> >> >>> <s:form
>>> >> action="showReport"
>>> >> >> namespace="/reports"
>>> >> validate="true">
>>> >> >> >>>   
>>> >> >> >> <snip>
>>> >> >> >> 
>>> >> >> >>> 		And when user click submit
>>> button,
>>> >> this form
>>> >> >> get submitted twice, i.e.
>>> >> >> >>> showReport form action
>>> method is
>>> >> called twice!
>>> >> >> I'm NOT USING AJAX here,
>>> >> >> >>> I
>>> >> >> >>> DON'T HAVE ANY
>>> Javascript
>>> >> functions in
>>> >> >> this page.
>>> >> >> >>>
>>> >> >> >>>   
>>> >> >> >> 
>>> >> >> >> You DO have javascript in your
>>> page and
>>> >> you ARE
>>> >> >> using ajax.
>>> >> >> >> 
>>> >> >> >> <s:head
>>> theme="ajax">
>>> >> instructs
>>> >> >> struts to include the dojo javascripts, 
>>> >> >> >> and sets the default theme to
>>> ajax.
>>> >> >> >> <s:form
>>> >> ...valudate="true">
>>> >> >> instructs struts to include client-side 
>>> >> >> >> javascript validation (or
>>> possibly ajax
>>> >> >> validation; I can't recall if 
>>> >> >> >> that requires the theme on the
>>> form
>>> >> itself or
>>> >> >> not).
>>> >> >> >> 
>>> >> >> >> Viewing the source of your page
>>> would
>>> >> tell you
>>> >> >> this.  Firefox with 
>>> >> >> >> Firebug will tell you what's
>>> >> happening.
>>> >> >> >> 
>>> >> >> >> Clean it up and see how you go.
>>> >> >> >> 
>>> >> >> >> 
>>> >> >> >>
>>> >> >>
>>> >>
>>> ---------------------------------------------------------------------
>>> >> >> >> To unsubscribe, e-mail:
>>> >> >> user-unsubscribe@struts.apache.org
>>> >> >> >> For additional commands, e-mail:
>>> >> >> user-help@struts.apache.org
>>> >> >> >> 
>>> >> >> >> 
>>> >> >> >> 
>>> >> >> > 
>>> >> >> > 
>>> >> >> 
>>> >> >> -- 
>>> >> >> View this message in context:
>>> >> >>
>>> >>
>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
>>> >> > 
>>> >> >
>>> >>
>>> ---------------------------------------------------------------------
>>> >> > To unsubscribe, e-mail:
>>> >> user-unsubscribe@struts.apache.org
>>> >> > For additional commands, e-mail:
>>> >> user-help@struts.apache.org
>>> >> > 
>>> >> > 
>>> >> > 
>>> >> 
>>> >> -- 
>>> >> View this message in context:
>>> >>
>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
>>> > 
>>> >
>>> ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail:
>>> user-unsubscribe@struts.apache.org
>>> > For additional commands, e-mail:
>>> user-help@struts.apache.org
>>> > 
>>> > 
>>> > 
>>> 
>>> -- 
>>> View this message in context:
>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20623212.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
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20628242.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: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Dave,

actually my form isn't submitted twice :-(. I found now what was the
problem. I set one multiple option select in jsp like this:

<s:select label="Users" list="users" listKey="id" listValue="name"
				name="users.id" emptyOption="false" value="%{users.{id}}"
				headerKey="None" theme="simple" multiple="true" />

The problem is because my users list contain e.g. three users: Mike, John,
Paul. And when user select for example one of them in jsp page, I just got
added that user(s) at the end of users list. How can I set that this list
later contain just selected users ?

--
Milan



newton.dave wrote:
> 
> Those aren't links. They're text. That's why I asked if everything came
> through okay.
> 
> 
> --- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:
> 
>> From: Milan Milanovic <mi...@yahoo.com>
>> Subject: Re: Form submitted twice (no AJAX!)
>> To: user@struts.apache.org
>> Date: Friday, November 21, 2008, 10:19 AM
>> There is no menu code, just those two links.
>> 
>> Milan
>> 
>> 
>> newton.dave wrote:
>> > 
>> >>> > <div id="menu">
>> /myApp/index.jsp Main
>> >>> &nbsp; |&nbsp;
>> >>> > /myApp/j_acegi_logout Logout </div>
>> > 
>> > Is your menu not implemented yet?
>> > 
>> > 
>> > --- On Fri, 11/21/08, Milan Milanovic
>> <mi...@yahoo.com> wrote:
>> > 
>> >> From: Milan Milanovic
>> <mi...@yahoo.com>
>> >> Subject: Re: Form submitted twice (no AJAX!)
>> >> To: user@struts.apache.org
>> >> Date: Friday, November 21, 2008, 9:39 AM
>> >> Dear Dave,
>> >> 
>> >> I don't understand. That is exactly what I get
>> when
>> >> page is generated. I
>> >> omited some plain html code.
>> >> 
>> >> 
>> >> --
>> >> Milan
>> >> 
>> >> 
>> >> newton.dave wrote:
>> >> > 
>> >> > I don't think that came through properly;
>> perhaps
>> >> try pastebin or similar.
>> >> > 
>> >> > Dave
>> >> > 
>> >> > 
>> >> > --- On Thu, 11/20/08, Milan Milanovic
>> >> <mi...@yahoo.com> wrote:
>> >> > 
>> >> >> From: Milan Milanovic
>> >> <mi...@yahoo.com>
>> >> >> Subject: Re: Form submitted twice (no
>> AJAX!)
>> >> >> To: user@struts.apache.org
>> >> >> Date: Thursday, November 20, 2008, 3:33
>> PM
>> >> >> Why is this form submitte twice ?
>> >> >> 
>> >> >> 
>> >> >> Milan Milanovic wrote:
>> >> >> > 
>> >> >> > Yes, but it is the same when I
>> remove ajax
>> >> with
>> >> >> simple. Here is my jsp
>> >> >> > page, there is no AJAX word there
>> and I still
>> >> get
>> >> >> submited twice:
>> >> >> > 
>> >> >> > <html
>> >> >>
>> xmlns="http://www.w3.org/1999/xhtml"
>> >> >> xml:lang="en">
>> >> >> > <head>
>> >> >> > <script
>> >> type="text/javascript">
>> >> >> >     // Dojo configuration
>> >> >> >     djConfig = {
>> >> >> >         baseRelativePath:
>> >> >> "/myApp/struts/dojo",
>> >> >> >         isDebug: true,
>> >> >> >         bindEncoding:
>> "UTF-8",
>> >> >> >         debugAtAllCosts: true // not
>> needed,
>> >> but
>> >> >> allows the Venkman
>> >> >> > debugger to work with the includes
>> >> >> >     };
>> >> >> > </script>
>> >> >> > <script
>> type="text/javascript"
>> >> >> >        
>> >> >>
>> >>
>> src="/myApp/struts/dojo/dojo.js"></script>
>> >> >> > <script
>> type="text/javascript"
>> >> >> >        
>> >> >>
>> >>
>> src="/myApp/struts/simple/dojoRequire.js"></script>
>> >> >> > </head>
>> >> >> > <body onload="">
>> >> >> > 
>> >> >> > 
>> >> >> > <div id="menu">
>> >> /myApp/index.jsp Main 
>> >> >> &nbsp; |&nbsp; 
>> >> >> > /myApp/j_acegi_logout Logout
>> </div>
>> >> >> > 
>> >> >> > <div id="sidebar">
>> >> >> > <h1>Menu</h1>
>> >> >> > <div
>> class="project">
>> >> >> > <p> /myApp/index.jsp Main page
>> >> </p>
>> >> >> > <p>&nbsp;</p>
>> >> >> > <p>&nbsp;</p>
>> >> >> > <p> # <br />
>> >> >> >  </p>
>> >> >> > </div>
>> >> >> > </div>
>> >> >> > 
>> >> >> > <div>
>> >> >> > <h2>Choose report</h2>
>> >> >> > <br>
>> >> >> >  <div align="left"
>> >> style="width:
>> >> >> 600px; border-width:thin;
>> >> >> > border-style:solid;
>> >> border-color:threedlightshadow;
>> >> >> text-align: left;">
>> >> >> > 
>> >> >> > 			
>> >> >> > <form namespace="/reports
>> >> >> id="showReport"
>> >> name="showReport"
>> >> >> > onsubmit="return true;"
>> >> >>
>> >>
>> action="/myApp/reports/showReport.action"
>> >> >> > method="post">
>> >> >> >    <table
>> >> class="wwFormTable">
>> >> >> > 		
>> >> >> > 		From date: <script
>> >> >> type="text/javascript">
>> >> >> >    
>> >> dojo.require("dojo.widget.DatePicker");
>> >> >> > </script>
>> >> >> > <div
>> >> >> >     
>> dojoType="dropdowndatepicker" 
>> >>  
>> >> >> id="fromDate"   
>> >> >> >
>> value="2008-11-11T00:00:00"   
>> >> >> name="dojo.fromDate"   
>> >> >> > inputName="fromDate"    
>> >> >> displayFormat="dd.MM.yyyy" 
>> >> >> >
>> >>
>> saveFormat="rfc"></div><br/>
>> >> >> >  		Do datuma: <script
>> >> >> type="text/javascript">
>> >> >> >    
>> >> dojo.require("dojo.widget.DatePicker");
>> >> >> > </script>
>> >> >> > 
>> >> >> > 		<tr>
>> >> >> > 			<td
>> >> align="right"><label
>> >> >> for="users"
>> >> >>
>> >>
>> class="label">User:</label></td>
>> >> >> > 			<td><select
>> >> name="user.id"
>> >> >> id="user">
>> >> >> >     <option
>> >> >>
>> value="1">Mike</option>
>> >> >> >     <option
>> >> >>
>> value="2">John</option>
>> >> >> >     <option
>> >> >>
>> value="3">Peter</option>
>> >> >> > </select></td>
>> >> >> > 		</tr>
>> >> >> > 		<tr>
>> >> >> > 			<td
>> colspan="2"><input
>> >> >> type="submit"
>> >> id="showReport_0"
>> >> >> value="Show
>> >> >> > report"
>> class="submit"
>> >> >> style="submit"/>
>> >> >> > </td>
>> >> >> > 		</tr>
>> >> >> > </table></form>
>> >> >> > 
>> >> >> > </div>
>> >> >> > </body>
>> >> >> > </html>
>> >> >> > 
>> >> >> > 
>> >> >> > 
>> >> >> > 
>> >> >> > Jeromy Evans - Blue Sky Minds wrote:
>> >> >> >> 
>> >> >> >> Milan Milanovic wrote:
>> >> >> >>> Hi,
>> >> >> >>>
>> >> >> >>> I have a simple jsp form:
>> >> >> >>>
>> >> >> >>> <head>
>> >> >> >>> 	<s:head
>> theme="ajax"
>> >> >> debug="true" />
>> >> >> >>> </head>
>> >> >> >>> <s:form
>> >> action="showReport"
>> >> >> namespace="/reports"
>> >> validate="true">
>> >> >> >>>   
>> >> >> >> <snip>
>> >> >> >> 
>> >> >> >>> 		And when user click submit
>> button,
>> >> this form
>> >> >> get submitted twice, i.e.
>> >> >> >>> showReport form action
>> method is
>> >> called twice!
>> >> >> I'm NOT USING AJAX here,
>> >> >> >>> I
>> >> >> >>> DON'T HAVE ANY
>> Javascript
>> >> functions in
>> >> >> this page.
>> >> >> >>>
>> >> >> >>>   
>> >> >> >> 
>> >> >> >> You DO have javascript in your
>> page and
>> >> you ARE
>> >> >> using ajax.
>> >> >> >> 
>> >> >> >> <s:head
>> theme="ajax">
>> >> instructs
>> >> >> struts to include the dojo javascripts, 
>> >> >> >> and sets the default theme to
>> ajax.
>> >> >> >> <s:form
>> >> ...valudate="true">
>> >> >> instructs struts to include client-side 
>> >> >> >> javascript validation (or
>> possibly ajax
>> >> >> validation; I can't recall if 
>> >> >> >> that requires the theme on the
>> form
>> >> itself or
>> >> >> not).
>> >> >> >> 
>> >> >> >> Viewing the source of your page
>> would
>> >> tell you
>> >> >> this.  Firefox with 
>> >> >> >> Firebug will tell you what's
>> >> happening.
>> >> >> >> 
>> >> >> >> Clean it up and see how you go.
>> >> >> >> 
>> >> >> >> 
>> >> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail:
>> >> >> user-unsubscribe@struts.apache.org
>> >> >> >> For additional commands, e-mail:
>> >> >> user-help@struts.apache.org
>> >> >> >> 
>> >> >> >> 
>> >> >> >> 
>> >> >> > 
>> >> >> > 
>> >> >> 
>> >> >> -- 
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
>> >> > 
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail:
>> >> user-unsubscribe@struts.apache.org
>> >> > For additional commands, e-mail:
>> >> user-help@struts.apache.org
>> >> > 
>> >> > 
>> >> > 
>> >> 
>> >> -- 
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
>> > 
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail:
>> user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20623212.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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20624523.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: Form submitted twice (no AJAX!)

Posted by Dave Newton <ne...@yahoo.com>.
The point is that I didn't (and still don't) believe the text is being rendered appropriately, which is why I said try using pastebin or a similar service.

--- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:
> Yes, you are right. They are not copied well. This is exact code:
> 
> <div id="menu"> /myApp/index.jsp Main 
> &nbsp; |&nbsp;  /myApp/j_acegi_logout
> Logout </div>

This is what I see. There are still no links. That's why I'm asking you to use a different mechanism to show us the source code.

Dave


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


Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Yes, you are right. They are not copied well. This is exact code:

<div id="menu"> /myApp/index.jsp Main  &nbsp; |&nbsp;  /myApp/j_acegi_logout
Logout </div>

But this has no implication on form submiting ? It is not part of the form.
I don't have AJAX code on the page except datetimepickers.

--
Milan


newton.dave wrote:
> 
> Those aren't links. They're text. That's why I asked if everything came
> through okay.
> 
> 
> --- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:
> 
>> From: Milan Milanovic <mi...@yahoo.com>
>> Subject: Re: Form submitted twice (no AJAX!)
>> To: user@struts.apache.org
>> Date: Friday, November 21, 2008, 10:19 AM
>> There is no menu code, just those two links.
>> 
>> Milan
>> 
>> 
>> newton.dave wrote:
>> > 
>> >>> > <div id="menu">
>> /myApp/index.jsp Main
>> >>> &nbsp; |&nbsp;
>> >>> > /myApp/j_acegi_logout Logout </div>
>> > 
>> > Is your menu not implemented yet?
>> > 
>> > 
>> > --- On Fri, 11/21/08, Milan Milanovic
>> <mi...@yahoo.com> wrote:
>> > 
>> >> From: Milan Milanovic
>> <mi...@yahoo.com>
>> >> Subject: Re: Form submitted twice (no AJAX!)
>> >> To: user@struts.apache.org
>> >> Date: Friday, November 21, 2008, 9:39 AM
>> >> Dear Dave,
>> >> 
>> >> I don't understand. That is exactly what I get
>> when
>> >> page is generated. I
>> >> omited some plain html code.
>> >> 
>> >> 
>> >> --
>> >> Milan
>> >> 
>> >> 
>> >> newton.dave wrote:
>> >> > 
>> >> > I don't think that came through properly;
>> perhaps
>> >> try pastebin or similar.
>> >> > 
>> >> > Dave
>> >> > 
>> >> > 
>> >> > --- On Thu, 11/20/08, Milan Milanovic
>> >> <mi...@yahoo.com> wrote:
>> >> > 
>> >> >> From: Milan Milanovic
>> >> <mi...@yahoo.com>
>> >> >> Subject: Re: Form submitted twice (no
>> AJAX!)
>> >> >> To: user@struts.apache.org
>> >> >> Date: Thursday, November 20, 2008, 3:33
>> PM
>> >> >> Why is this form submitte twice ?
>> >> >> 
>> >> >> 
>> >> >> Milan Milanovic wrote:
>> >> >> > 
>> >> >> > Yes, but it is the same when I
>> remove ajax
>> >> with
>> >> >> simple. Here is my jsp
>> >> >> > page, there is no AJAX word there
>> and I still
>> >> get
>> >> >> submited twice:
>> >> >> > 
>> >> >> > <html
>> >> >>
>> xmlns="http://www.w3.org/1999/xhtml"
>> >> >> xml:lang="en">
>> >> >> > <head>
>> >> >> > <script
>> >> type="text/javascript">
>> >> >> >     // Dojo configuration
>> >> >> >     djConfig = {
>> >> >> >         baseRelativePath:
>> >> >> "/myApp/struts/dojo",
>> >> >> >         isDebug: true,
>> >> >> >         bindEncoding:
>> "UTF-8",
>> >> >> >         debugAtAllCosts: true // not
>> needed,
>> >> but
>> >> >> allows the Venkman
>> >> >> > debugger to work with the includes
>> >> >> >     };
>> >> >> > </script>
>> >> >> > <script
>> type="text/javascript"
>> >> >> >        
>> >> >>
>> >>
>> src="/myApp/struts/dojo/dojo.js"></script>
>> >> >> > <script
>> type="text/javascript"
>> >> >> >        
>> >> >>
>> >>
>> src="/myApp/struts/simple/dojoRequire.js"></script>
>> >> >> > </head>
>> >> >> > <body onload="">
>> >> >> > 
>> >> >> > 
>> >> >> > <div id="menu">
>> >> /myApp/index.jsp Main 
>> >> >> &nbsp; |&nbsp; 
>> >> >> > /myApp/j_acegi_logout Logout
>> </div>
>> >> >> > 
>> >> >> > <div id="sidebar">
>> >> >> > <h1>Menu</h1>
>> >> >> > <div
>> class="project">
>> >> >> > <p> /myApp/index.jsp Main page
>> >> </p>
>> >> >> > <p>&nbsp;</p>
>> >> >> > <p>&nbsp;</p>
>> >> >> > <p> # <br />
>> >> >> >  </p>
>> >> >> > </div>
>> >> >> > </div>
>> >> >> > 
>> >> >> > <div>
>> >> >> > <h2>Choose report</h2>
>> >> >> > <br>
>> >> >> >  <div align="left"
>> >> style="width:
>> >> >> 600px; border-width:thin;
>> >> >> > border-style:solid;
>> >> border-color:threedlightshadow;
>> >> >> text-align: left;">
>> >> >> > 
>> >> >> > 			
>> >> >> > <form namespace="/reports
>> >> >> id="showReport"
>> >> name="showReport"
>> >> >> > onsubmit="return true;"
>> >> >>
>> >>
>> action="/myApp/reports/showReport.action"
>> >> >> > method="post">
>> >> >> >    <table
>> >> class="wwFormTable">
>> >> >> > 		
>> >> >> > 		From date: <script
>> >> >> type="text/javascript">
>> >> >> >    
>> >> dojo.require("dojo.widget.DatePicker");
>> >> >> > </script>
>> >> >> > <div
>> >> >> >     
>> dojoType="dropdowndatepicker" 
>> >>  
>> >> >> id="fromDate"   
>> >> >> >
>> value="2008-11-11T00:00:00"   
>> >> >> name="dojo.fromDate"   
>> >> >> > inputName="fromDate"    
>> >> >> displayFormat="dd.MM.yyyy" 
>> >> >> >
>> >>
>> saveFormat="rfc"></div><br/>
>> >> >> >  		Do datuma: <script
>> >> >> type="text/javascript">
>> >> >> >    
>> >> dojo.require("dojo.widget.DatePicker");
>> >> >> > </script>
>> >> >> > 
>> >> >> > 		<tr>
>> >> >> > 			<td
>> >> align="right"><label
>> >> >> for="users"
>> >> >>
>> >>
>> class="label">User:</label></td>
>> >> >> > 			<td><select
>> >> name="user.id"
>> >> >> id="user">
>> >> >> >     <option
>> >> >>
>> value="1">Mike</option>
>> >> >> >     <option
>> >> >>
>> value="2">John</option>
>> >> >> >     <option
>> >> >>
>> value="3">Peter</option>
>> >> >> > </select></td>
>> >> >> > 		</tr>
>> >> >> > 		<tr>
>> >> >> > 			<td
>> colspan="2"><input
>> >> >> type="submit"
>> >> id="showReport_0"
>> >> >> value="Show
>> >> >> > report"
>> class="submit"
>> >> >> style="submit"/>
>> >> >> > </td>
>> >> >> > 		</tr>
>> >> >> > </table></form>
>> >> >> > 
>> >> >> > </div>
>> >> >> > </body>
>> >> >> > </html>
>> >> >> > 
>> >> >> > 
>> >> >> > 
>> >> >> > 
>> >> >> > Jeromy Evans - Blue Sky Minds wrote:
>> >> >> >> 
>> >> >> >> Milan Milanovic wrote:
>> >> >> >>> Hi,
>> >> >> >>>
>> >> >> >>> I have a simple jsp form:
>> >> >> >>>
>> >> >> >>> <head>
>> >> >> >>> 	<s:head
>> theme="ajax"
>> >> >> debug="true" />
>> >> >> >>> </head>
>> >> >> >>> <s:form
>> >> action="showReport"
>> >> >> namespace="/reports"
>> >> validate="true">
>> >> >> >>>   
>> >> >> >> <snip>
>> >> >> >> 
>> >> >> >>> 		And when user click submit
>> button,
>> >> this form
>> >> >> get submitted twice, i.e.
>> >> >> >>> showReport form action
>> method is
>> >> called twice!
>> >> >> I'm NOT USING AJAX here,
>> >> >> >>> I
>> >> >> >>> DON'T HAVE ANY
>> Javascript
>> >> functions in
>> >> >> this page.
>> >> >> >>>
>> >> >> >>>   
>> >> >> >> 
>> >> >> >> You DO have javascript in your
>> page and
>> >> you ARE
>> >> >> using ajax.
>> >> >> >> 
>> >> >> >> <s:head
>> theme="ajax">
>> >> instructs
>> >> >> struts to include the dojo javascripts, 
>> >> >> >> and sets the default theme to
>> ajax.
>> >> >> >> <s:form
>> >> ...valudate="true">
>> >> >> instructs struts to include client-side 
>> >> >> >> javascript validation (or
>> possibly ajax
>> >> >> validation; I can't recall if 
>> >> >> >> that requires the theme on the
>> form
>> >> itself or
>> >> >> not).
>> >> >> >> 
>> >> >> >> Viewing the source of your page
>> would
>> >> tell you
>> >> >> this.  Firefox with 
>> >> >> >> Firebug will tell you what's
>> >> happening.
>> >> >> >> 
>> >> >> >> Clean it up and see how you go.
>> >> >> >> 
>> >> >> >> 
>> >> >> >>
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail:
>> >> >> user-unsubscribe@struts.apache.org
>> >> >> >> For additional commands, e-mail:
>> >> >> user-help@struts.apache.org
>> >> >> >> 
>> >> >> >> 
>> >> >> >> 
>> >> >> > 
>> >> >> > 
>> >> >> 
>> >> >> -- 
>> >> >> View this message in context:
>> >> >>
>> >>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
>> >> > 
>> >> >
>> >>
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail:
>> >> user-unsubscribe@struts.apache.org
>> >> > For additional commands, e-mail:
>> >> user-help@struts.apache.org
>> >> > 
>> >> > 
>> >> > 
>> >> 
>> >> -- 
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
>> > 
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail:
>> user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20623212.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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20624008.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: Form submitted twice (no AJAX!)

Posted by Dave Newton <ne...@yahoo.com>.
Those aren't links. They're text. That's why I asked if everything came through okay.


--- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:

> From: Milan Milanovic <mi...@yahoo.com>
> Subject: Re: Form submitted twice (no AJAX!)
> To: user@struts.apache.org
> Date: Friday, November 21, 2008, 10:19 AM
> There is no menu code, just those two links.
> 
> Milan
> 
> 
> newton.dave wrote:
> > 
> >>> > <div id="menu">
> /myApp/index.jsp Main
> >>> &nbsp; |&nbsp;
> >>> > /myApp/j_acegi_logout Logout </div>
> > 
> > Is your menu not implemented yet?
> > 
> > 
> > --- On Fri, 11/21/08, Milan Milanovic
> <mi...@yahoo.com> wrote:
> > 
> >> From: Milan Milanovic
> <mi...@yahoo.com>
> >> Subject: Re: Form submitted twice (no AJAX!)
> >> To: user@struts.apache.org
> >> Date: Friday, November 21, 2008, 9:39 AM
> >> Dear Dave,
> >> 
> >> I don't understand. That is exactly what I get
> when
> >> page is generated. I
> >> omited some plain html code.
> >> 
> >> 
> >> --
> >> Milan
> >> 
> >> 
> >> newton.dave wrote:
> >> > 
> >> > I don't think that came through properly;
> perhaps
> >> try pastebin or similar.
> >> > 
> >> > Dave
> >> > 
> >> > 
> >> > --- On Thu, 11/20/08, Milan Milanovic
> >> <mi...@yahoo.com> wrote:
> >> > 
> >> >> From: Milan Milanovic
> >> <mi...@yahoo.com>
> >> >> Subject: Re: Form submitted twice (no
> AJAX!)
> >> >> To: user@struts.apache.org
> >> >> Date: Thursday, November 20, 2008, 3:33
> PM
> >> >> Why is this form submitte twice ?
> >> >> 
> >> >> 
> >> >> Milan Milanovic wrote:
> >> >> > 
> >> >> > Yes, but it is the same when I
> remove ajax
> >> with
> >> >> simple. Here is my jsp
> >> >> > page, there is no AJAX word there
> and I still
> >> get
> >> >> submited twice:
> >> >> > 
> >> >> > <html
> >> >>
> xmlns="http://www.w3.org/1999/xhtml"
> >> >> xml:lang="en">
> >> >> > <head>
> >> >> > <script
> >> type="text/javascript">
> >> >> >     // Dojo configuration
> >> >> >     djConfig = {
> >> >> >         baseRelativePath:
> >> >> "/myApp/struts/dojo",
> >> >> >         isDebug: true,
> >> >> >         bindEncoding:
> "UTF-8",
> >> >> >         debugAtAllCosts: true // not
> needed,
> >> but
> >> >> allows the Venkman
> >> >> > debugger to work with the includes
> >> >> >     };
> >> >> > </script>
> >> >> > <script
> type="text/javascript"
> >> >> >        
> >> >>
> >>
> src="/myApp/struts/dojo/dojo.js"></script>
> >> >> > <script
> type="text/javascript"
> >> >> >        
> >> >>
> >>
> src="/myApp/struts/simple/dojoRequire.js"></script>
> >> >> > </head>
> >> >> > <body onload="">
> >> >> > 
> >> >> > 
> >> >> > <div id="menu">
> >> /myApp/index.jsp Main 
> >> >> &nbsp; |&nbsp; 
> >> >> > /myApp/j_acegi_logout Logout
> </div>
> >> >> > 
> >> >> > <div id="sidebar">
> >> >> > <h1>Menu</h1>
> >> >> > <div
> class="project">
> >> >> > <p> /myApp/index.jsp Main page
> >> </p>
> >> >> > <p>&nbsp;</p>
> >> >> > <p>&nbsp;</p>
> >> >> > <p> # <br />
> >> >> >  </p>
> >> >> > </div>
> >> >> > </div>
> >> >> > 
> >> >> > <div>
> >> >> > <h2>Choose report</h2>
> >> >> > <br>
> >> >> >  <div align="left"
> >> style="width:
> >> >> 600px; border-width:thin;
> >> >> > border-style:solid;
> >> border-color:threedlightshadow;
> >> >> text-align: left;">
> >> >> > 
> >> >> > 			
> >> >> > <form namespace="/reports
> >> >> id="showReport"
> >> name="showReport"
> >> >> > onsubmit="return true;"
> >> >>
> >>
> action="/myApp/reports/showReport.action"
> >> >> > method="post">
> >> >> >    <table
> >> class="wwFormTable">
> >> >> > 		
> >> >> > 		From date: <script
> >> >> type="text/javascript">
> >> >> >    
> >> dojo.require("dojo.widget.DatePicker");
> >> >> > </script>
> >> >> > <div
> >> >> >     
> dojoType="dropdowndatepicker" 
> >>  
> >> >> id="fromDate"   
> >> >> >
> value="2008-11-11T00:00:00"   
> >> >> name="dojo.fromDate"   
> >> >> > inputName="fromDate"    
> >> >> displayFormat="dd.MM.yyyy" 
> >> >> >
> >>
> saveFormat="rfc"></div><br/>
> >> >> >  		Do datuma: <script
> >> >> type="text/javascript">
> >> >> >    
> >> dojo.require("dojo.widget.DatePicker");
> >> >> > </script>
> >> >> > 
> >> >> > 		<tr>
> >> >> > 			<td
> >> align="right"><label
> >> >> for="users"
> >> >>
> >>
> class="label">User:</label></td>
> >> >> > 			<td><select
> >> name="user.id"
> >> >> id="user">
> >> >> >     <option
> >> >>
> value="1">Mike</option>
> >> >> >     <option
> >> >>
> value="2">John</option>
> >> >> >     <option
> >> >>
> value="3">Peter</option>
> >> >> > </select></td>
> >> >> > 		</tr>
> >> >> > 		<tr>
> >> >> > 			<td
> colspan="2"><input
> >> >> type="submit"
> >> id="showReport_0"
> >> >> value="Show
> >> >> > report"
> class="submit"
> >> >> style="submit"/>
> >> >> > </td>
> >> >> > 		</tr>
> >> >> > </table></form>
> >> >> > 
> >> >> > </div>
> >> >> > </body>
> >> >> > </html>
> >> >> > 
> >> >> > 
> >> >> > 
> >> >> > 
> >> >> > Jeromy Evans - Blue Sky Minds wrote:
> >> >> >> 
> >> >> >> Milan Milanovic wrote:
> >> >> >>> Hi,
> >> >> >>>
> >> >> >>> I have a simple jsp form:
> >> >> >>>
> >> >> >>> <head>
> >> >> >>> 	<s:head
> theme="ajax"
> >> >> debug="true" />
> >> >> >>> </head>
> >> >> >>> <s:form
> >> action="showReport"
> >> >> namespace="/reports"
> >> validate="true">
> >> >> >>>   
> >> >> >> <snip>
> >> >> >> 
> >> >> >>> 		And when user click submit
> button,
> >> this form
> >> >> get submitted twice, i.e.
> >> >> >>> showReport form action
> method is
> >> called twice!
> >> >> I'm NOT USING AJAX here,
> >> >> >>> I
> >> >> >>> DON'T HAVE ANY
> Javascript
> >> functions in
> >> >> this page.
> >> >> >>>
> >> >> >>>   
> >> >> >> 
> >> >> >> You DO have javascript in your
> page and
> >> you ARE
> >> >> using ajax.
> >> >> >> 
> >> >> >> <s:head
> theme="ajax">
> >> instructs
> >> >> struts to include the dojo javascripts, 
> >> >> >> and sets the default theme to
> ajax.
> >> >> >> <s:form
> >> ...valudate="true">
> >> >> instructs struts to include client-side 
> >> >> >> javascript validation (or
> possibly ajax
> >> >> validation; I can't recall if 
> >> >> >> that requires the theme on the
> form
> >> itself or
> >> >> not).
> >> >> >> 
> >> >> >> Viewing the source of your page
> would
> >> tell you
> >> >> this.  Firefox with 
> >> >> >> Firebug will tell you what's
> >> happening.
> >> >> >> 
> >> >> >> Clean it up and see how you go.
> >> >> >> 
> >> >> >> 
> >> >> >>
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> >> To unsubscribe, e-mail:
> >> >> user-unsubscribe@struts.apache.org
> >> >> >> For additional commands, e-mail:
> >> >> user-help@struts.apache.org
> >> >> >> 
> >> >> >> 
> >> >> >> 
> >> >> > 
> >> >> > 
> >> >> 
> >> >> -- 
> >> >> View this message in context:
> >> >>
> >>
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
> >> > 
> >> >
> >>
> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail:
> >> user-help@struts.apache.org
> >> > 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >>
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20623212.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

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


Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
There is no menu code, just those two links.

Milan


newton.dave wrote:
> 
>>> > <div id="menu"> /myApp/index.jsp Main
>>> &nbsp; |&nbsp;
>>> > /myApp/j_acegi_logout Logout </div>
> 
> Is your menu not implemented yet?
> 
> 
> --- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:
> 
>> From: Milan Milanovic <mi...@yahoo.com>
>> Subject: Re: Form submitted twice (no AJAX!)
>> To: user@struts.apache.org
>> Date: Friday, November 21, 2008, 9:39 AM
>> Dear Dave,
>> 
>> I don't understand. That is exactly what I get when
>> page is generated. I
>> omited some plain html code.
>> 
>> 
>> --
>> Milan
>> 
>> 
>> newton.dave wrote:
>> > 
>> > I don't think that came through properly; perhaps
>> try pastebin or similar.
>> > 
>> > Dave
>> > 
>> > 
>> > --- On Thu, 11/20/08, Milan Milanovic
>> <mi...@yahoo.com> wrote:
>> > 
>> >> From: Milan Milanovic
>> <mi...@yahoo.com>
>> >> Subject: Re: Form submitted twice (no AJAX!)
>> >> To: user@struts.apache.org
>> >> Date: Thursday, November 20, 2008, 3:33 PM
>> >> Why is this form submitte twice ?
>> >> 
>> >> 
>> >> Milan Milanovic wrote:
>> >> > 
>> >> > Yes, but it is the same when I remove ajax
>> with
>> >> simple. Here is my jsp
>> >> > page, there is no AJAX word there and I still
>> get
>> >> submited twice:
>> >> > 
>> >> > <html
>> >> xmlns="http://www.w3.org/1999/xhtml"
>> >> xml:lang="en">
>> >> > <head>
>> >> > <script
>> type="text/javascript">
>> >> >     // Dojo configuration
>> >> >     djConfig = {
>> >> >         baseRelativePath:
>> >> "/myApp/struts/dojo",
>> >> >         isDebug: true,
>> >> >         bindEncoding: "UTF-8",
>> >> >         debugAtAllCosts: true // not needed,
>> but
>> >> allows the Venkman
>> >> > debugger to work with the includes
>> >> >     };
>> >> > </script>
>> >> > <script type="text/javascript"
>> >> >        
>> >>
>> src="/myApp/struts/dojo/dojo.js"></script>
>> >> > <script type="text/javascript"
>> >> >        
>> >>
>> src="/myApp/struts/simple/dojoRequire.js"></script>
>> >> > </head>
>> >> > <body onload="">
>> >> > 
>> >> > 
>> >> > <div id="menu">
>> /myApp/index.jsp Main 
>> >> &nbsp; |&nbsp; 
>> >> > /myApp/j_acegi_logout Logout </div>
>> >> > 
>> >> > <div id="sidebar">
>> >> > <h1>Menu</h1>
>> >> > <div class="project">
>> >> > <p> /myApp/index.jsp Main page
>> </p>
>> >> > <p>&nbsp;</p>
>> >> > <p>&nbsp;</p>
>> >> > <p> # <br />
>> >> >  </p>
>> >> > </div>
>> >> > </div>
>> >> > 
>> >> > <div>
>> >> > <h2>Choose report</h2>
>> >> > <br>
>> >> >  <div align="left"
>> style="width:
>> >> 600px; border-width:thin;
>> >> > border-style:solid;
>> border-color:threedlightshadow;
>> >> text-align: left;">
>> >> > 
>> >> > 			
>> >> > <form namespace="/reports
>> >> id="showReport"
>> name="showReport"
>> >> > onsubmit="return true;"
>> >>
>> action="/myApp/reports/showReport.action"
>> >> > method="post">
>> >> >    <table
>> class="wwFormTable">
>> >> > 		
>> >> > 		From date: <script
>> >> type="text/javascript">
>> >> >    
>> dojo.require("dojo.widget.DatePicker");
>> >> > </script>
>> >> > <div
>> >> >      dojoType="dropdowndatepicker" 
>>  
>> >> id="fromDate"   
>> >> > value="2008-11-11T00:00:00"   
>> >> name="dojo.fromDate"   
>> >> > inputName="fromDate"    
>> >> displayFormat="dd.MM.yyyy" 
>> >> >
>> saveFormat="rfc"></div><br/>
>> >> >  		Do datuma: <script
>> >> type="text/javascript">
>> >> >    
>> dojo.require("dojo.widget.DatePicker");
>> >> > </script>
>> >> > 
>> >> > 		<tr>
>> >> > 			<td
>> align="right"><label
>> >> for="users"
>> >>
>> class="label">User:</label></td>
>> >> > 			<td><select
>> name="user.id"
>> >> id="user">
>> >> >     <option
>> >> value="1">Mike</option>
>> >> >     <option
>> >> value="2">John</option>
>> >> >     <option
>> >> value="3">Peter</option>
>> >> > </select></td>
>> >> > 		</tr>
>> >> > 		<tr>
>> >> > 			<td colspan="2"><input
>> >> type="submit"
>> id="showReport_0"
>> >> value="Show
>> >> > report" class="submit"
>> >> style="submit"/>
>> >> > </td>
>> >> > 		</tr>
>> >> > </table></form>
>> >> > 
>> >> > </div>
>> >> > </body>
>> >> > </html>
>> >> > 
>> >> > 
>> >> > 
>> >> > 
>> >> > Jeromy Evans - Blue Sky Minds wrote:
>> >> >> 
>> >> >> Milan Milanovic wrote:
>> >> >>> Hi,
>> >> >>>
>> >> >>> I have a simple jsp form:
>> >> >>>
>> >> >>> <head>
>> >> >>> 	<s:head theme="ajax"
>> >> debug="true" />
>> >> >>> </head>
>> >> >>> <s:form
>> action="showReport"
>> >> namespace="/reports"
>> validate="true">
>> >> >>>   
>> >> >> <snip>
>> >> >> 
>> >> >>> 		And when user click submit button,
>> this form
>> >> get submitted twice, i.e.
>> >> >>> showReport form action method is
>> called twice!
>> >> I'm NOT USING AJAX here,
>> >> >>> I
>> >> >>> DON'T HAVE ANY Javascript
>> functions in
>> >> this page.
>> >> >>>
>> >> >>>   
>> >> >> 
>> >> >> You DO have javascript in your page and
>> you ARE
>> >> using ajax.
>> >> >> 
>> >> >> <s:head theme="ajax">
>> instructs
>> >> struts to include the dojo javascripts, 
>> >> >> and sets the default theme to ajax.
>> >> >> <s:form
>> ...valudate="true">
>> >> instructs struts to include client-side 
>> >> >> javascript validation (or possibly ajax
>> >> validation; I can't recall if 
>> >> >> that requires the theme on the form
>> itself or
>> >> not).
>> >> >> 
>> >> >> Viewing the source of your page would
>> tell you
>> >> this.  Firefox with 
>> >> >> Firebug will tell you what's
>> happening.
>> >> >> 
>> >> >> Clean it up and see how you go.
>> >> >> 
>> >> >> 
>> >> >>
>> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail:
>> >> user-unsubscribe@struts.apache.org
>> >> >> For additional commands, e-mail:
>> >> user-help@struts.apache.org
>> >> >> 
>> >> >> 
>> >> >> 
>> >> > 
>> >> > 
>> >> 
>> >> -- 
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
>> > 
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail:
>> user-help@struts.apache.org
>> > 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20623212.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: Form submitted twice (no AJAX!)

Posted by Dave Newton <ne...@yahoo.com>.
>> > <div id="menu"> /myApp/index.jsp Main
>> &nbsp; |&nbsp;
>> > /myApp/j_acegi_logout Logout </div>

Is your menu not implemented yet?


--- On Fri, 11/21/08, Milan Milanovic <mi...@yahoo.com> wrote:

> From: Milan Milanovic <mi...@yahoo.com>
> Subject: Re: Form submitted twice (no AJAX!)
> To: user@struts.apache.org
> Date: Friday, November 21, 2008, 9:39 AM
> Dear Dave,
> 
> I don't understand. That is exactly what I get when
> page is generated. I
> omited some plain html code.
> 
> 
> --
> Milan
> 
> 
> newton.dave wrote:
> > 
> > I don't think that came through properly; perhaps
> try pastebin or similar.
> > 
> > Dave
> > 
> > 
> > --- On Thu, 11/20/08, Milan Milanovic
> <mi...@yahoo.com> wrote:
> > 
> >> From: Milan Milanovic
> <mi...@yahoo.com>
> >> Subject: Re: Form submitted twice (no AJAX!)
> >> To: user@struts.apache.org
> >> Date: Thursday, November 20, 2008, 3:33 PM
> >> Why is this form submitte twice ?
> >> 
> >> 
> >> Milan Milanovic wrote:
> >> > 
> >> > Yes, but it is the same when I remove ajax
> with
> >> simple. Here is my jsp
> >> > page, there is no AJAX word there and I still
> get
> >> submited twice:
> >> > 
> >> > <html
> >> xmlns="http://www.w3.org/1999/xhtml"
> >> xml:lang="en">
> >> > <head>
> >> > <script
> type="text/javascript">
> >> >     // Dojo configuration
> >> >     djConfig = {
> >> >         baseRelativePath:
> >> "/myApp/struts/dojo",
> >> >         isDebug: true,
> >> >         bindEncoding: "UTF-8",
> >> >         debugAtAllCosts: true // not needed,
> but
> >> allows the Venkman
> >> > debugger to work with the includes
> >> >     };
> >> > </script>
> >> > <script type="text/javascript"
> >> >        
> >>
> src="/myApp/struts/dojo/dojo.js"></script>
> >> > <script type="text/javascript"
> >> >        
> >>
> src="/myApp/struts/simple/dojoRequire.js"></script>
> >> > </head>
> >> > <body onload="">
> >> > 
> >> > 
> >> > <div id="menu">
> /myApp/index.jsp Main 
> >> &nbsp; |&nbsp; 
> >> > /myApp/j_acegi_logout Logout </div>
> >> > 
> >> > <div id="sidebar">
> >> > <h1>Menu</h1>
> >> > <div class="project">
> >> > <p> /myApp/index.jsp Main page
> </p>
> >> > <p>&nbsp;</p>
> >> > <p>&nbsp;</p>
> >> > <p> # <br />
> >> >  </p>
> >> > </div>
> >> > </div>
> >> > 
> >> > <div>
> >> > <h2>Choose report</h2>
> >> > <br>
> >> >  <div align="left"
> style="width:
> >> 600px; border-width:thin;
> >> > border-style:solid;
> border-color:threedlightshadow;
> >> text-align: left;">
> >> > 
> >> > 			
> >> > <form namespace="/reports
> >> id="showReport"
> name="showReport"
> >> > onsubmit="return true;"
> >>
> action="/myApp/reports/showReport.action"
> >> > method="post">
> >> >    <table
> class="wwFormTable">
> >> > 		
> >> > 		From date: <script
> >> type="text/javascript">
> >> >    
> dojo.require("dojo.widget.DatePicker");
> >> > </script>
> >> > <div
> >> >      dojoType="dropdowndatepicker" 
>  
> >> id="fromDate"   
> >> > value="2008-11-11T00:00:00"   
> >> name="dojo.fromDate"   
> >> > inputName="fromDate"    
> >> displayFormat="dd.MM.yyyy" 
> >> >
> saveFormat="rfc"></div><br/>
> >> >  		Do datuma: <script
> >> type="text/javascript">
> >> >    
> dojo.require("dojo.widget.DatePicker");
> >> > </script>
> >> > 
> >> > 		<tr>
> >> > 			<td
> align="right"><label
> >> for="users"
> >>
> class="label">User:</label></td>
> >> > 			<td><select
> name="user.id"
> >> id="user">
> >> >     <option
> >> value="1">Mike</option>
> >> >     <option
> >> value="2">John</option>
> >> >     <option
> >> value="3">Peter</option>
> >> > </select></td>
> >> > 		</tr>
> >> > 		<tr>
> >> > 			<td colspan="2"><input
> >> type="submit"
> id="showReport_0"
> >> value="Show
> >> > report" class="submit"
> >> style="submit"/>
> >> > </td>
> >> > 		</tr>
> >> > </table></form>
> >> > 
> >> > </div>
> >> > </body>
> >> > </html>
> >> > 
> >> > 
> >> > 
> >> > 
> >> > Jeromy Evans - Blue Sky Minds wrote:
> >> >> 
> >> >> Milan Milanovic wrote:
> >> >>> Hi,
> >> >>>
> >> >>> I have a simple jsp form:
> >> >>>
> >> >>> <head>
> >> >>> 	<s:head theme="ajax"
> >> debug="true" />
> >> >>> </head>
> >> >>> <s:form
> action="showReport"
> >> namespace="/reports"
> validate="true">
> >> >>>   
> >> >> <snip>
> >> >> 
> >> >>> 		And when user click submit button,
> this form
> >> get submitted twice, i.e.
> >> >>> showReport form action method is
> called twice!
> >> I'm NOT USING AJAX here,
> >> >>> I
> >> >>> DON'T HAVE ANY Javascript
> functions in
> >> this page.
> >> >>>
> >> >>>   
> >> >> 
> >> >> You DO have javascript in your page and
> you ARE
> >> using ajax.
> >> >> 
> >> >> <s:head theme="ajax">
> instructs
> >> struts to include the dojo javascripts, 
> >> >> and sets the default theme to ajax.
> >> >> <s:form
> ...valudate="true">
> >> instructs struts to include client-side 
> >> >> javascript validation (or possibly ajax
> >> validation; I can't recall if 
> >> >> that requires the theme on the form
> itself or
> >> not).
> >> >> 
> >> >> Viewing the source of your page would
> tell you
> >> this.  Firefox with 
> >> >> Firebug will tell you what's
> happening.
> >> >> 
> >> >> Clean it up and see how you go.
> >> >> 
> >> >> 
> >> >>
> >>
> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail:
> >> user-help@struts.apache.org
> >> >> 
> >> >> 
> >> >> 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >>
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> > For additional commands, e-mail:
> user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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

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


RE: Form submitted twice (no AJAX!)

Posted by Martin Gainty <mg...@hotmail.com>.
Good Afternoon Milan

forgive the mid-thread interruption but 
Dave is talking about the theme setting for struts head tag set to simple or ajax as in
<ww:head theme="ajax"/>

so if you specified attribute theme=simple you will reference  $classpath/template/simple/head.ftl
or if you specified attribute theme=ajax you will reference  $classpath/template/ajax/head.ftl

The referenced head.ftl contains the dojo code you will be using so in the case of simple/head.ftl
<script language="JavaScript" type="text/javascript">
    // Dojo configuration
    djConfig = {
        baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>",
        isDebug: ${parameters.debug?default(false)},
        bindEncoding: "${parameters.encoding}",
        debugAtAllCosts: ${parameters.debug?default(false)}, // not needed, but allows the Venkman debugger to work with the includes
    };
</script>
<script language="JavaScript" type="text/javascript"
        src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script>
<script language="JavaScript" type="text/javascript"
        src="<@s.url includeParams='none' value='/struts/simple/dojoRequire.js' includeParams="none" encode='false'/>">
</script>whereas the ajax head.ftl would look something like
<script language="JavaScript" type="text/javascript">
    // Dojo configuration
    djConfig = {
        isDebug: ${parameters.debug?default(false)?string},
        bindEncoding: "${parameters.encoding}"
        <#if parameters.baseRelativePath?if_exists != "">
          ,baseRelativePath: "<@s.url value='${parameters.baseRelativePath}' includeParams='none' encode='false' />"
          ,baseScriptUri: "<@s.url value='${parameters.baseRelativePath}' includeParams='none' encode='false' />"
        <#else>
          ,baseRelativePath: "${base}/struts/dojo/"
          ,baseScriptUri: "${base}/struts/dojo/"
        </#if>  
        <#if parameters.locale?if_exists != "">
          ,locale: "${parameters.locale}"
        </#if>
        <#if parameters.extraLocales?exists>
          ,extraLocale: [
            <#list parameters.extraLocales as locale>
                "${locale}"<#if locale_has_next>,</#if>
            </#list>
          ]
        </#if>
         ,parseWidgets : ${parameters.parseContent?string}
        
    };
</script>

<#if parameters.compressed?default(true)>
  <#assign dojoFile="dojo.js">
<#else>
  <#assign dojoFile="dojo.js.uncompressed.js">
</#if>

<#if parameters.cache?default(true)>
  <#assign profile="struts_">
<#else>
  <#assign profile="">
</#if>           

<#if parameters.baseRelativePath?if_exists != "">
  <script language="JavaScript" type="text/javascript"
        src="<@s.url value='${parameters.baseRelativePath}/${profile}${dojoFile}' includeParams='none' encode='false'  />"></script>
<#else>
  <script language="JavaScript" type="text/javascript"
        src="${base}/struts/dojo/${profile}${dojoFile}"></script>
</#if>  

<script language="JavaScript" type="text/javascript"
        src="${base}/struts/ajax/dojoRequire.js"></script>
<#if parameters.debug?default(false)>
<script language="JavaScript" type="text/javascript">
    dojo.hostenv.writeIncludes(true);
</script>     
</#if>        
<link rel="stylesheet" href="${base}/struts/xhtml/styles.css" type="text/css"/>

<script language="JavaScript" src="${base}/struts/utils.js" type="text/javascript"></script>
<script language="JavaScript" src="${base}/struts/xhtml/validation.js" type="text/javascript"></script>
<script language="JavaScript" src="${base}/struts/css_xhtml/validation.js" type="text/javascript"></script>

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




> Date: Fri, 21 Nov 2008 06:39:07 -0800
> From: milanmilanovich@yahoo.com
> To: user@struts.apache.org
> Subject: Re: Form submitted twice (no AJAX!)
> 
> 
> Dear Dave,
> 
> I don't understand. That is exactly what I get when page is generated. I
> omited some plain html code.
> 
> 
> --
> Milan
> 
> 
> newton.dave wrote:
> > 
> > I don't think that came through properly; perhaps try pastebin or similar.
> > 
> > Dave
> > 
> > 
> > --- On Thu, 11/20/08, Milan Milanovic <mi...@yahoo.com> wrote:
> > 
> >> From: Milan Milanovic <mi...@yahoo.com>
> >> Subject: Re: Form submitted twice (no AJAX!)
> >> To: user@struts.apache.org
> >> Date: Thursday, November 20, 2008, 3:33 PM
> >> Why is this form submitte twice ?
> >> 
> >> 
> >> Milan Milanovic wrote:
> >> > 
> >> > Yes, but it is the same when I remove ajax with
> >> simple. Here is my jsp
> >> > page, there is no AJAX word there and I still get
> >> submited twice:
> >> > 
> >> > <html
> >> xmlns="http://www.w3.org/1999/xhtml"
> >> xml:lang="en">
> >> > <head>
> >> > <script type="text/javascript">
> >> >     // Dojo configuration
> >> >     djConfig = {
> >> >         baseRelativePath:
> >> "/myApp/struts/dojo",
> >> >         isDebug: true,
> >> >         bindEncoding: "UTF-8",
> >> >         debugAtAllCosts: true // not needed, but
> >> allows the Venkman
> >> > debugger to work with the includes
> >> >     };
> >> > </script>
> >> > <script type="text/javascript"
> >> >        
> >> src="/myApp/struts/dojo/dojo.js"></script>
> >> > <script type="text/javascript"
> >> >        
> >> src="/myApp/struts/simple/dojoRequire.js"></script>
> >> > </head>
> >> > <body onload="">
> >> > 
> >> > 
> >> > <div id="menu"> /myApp/index.jsp Main 
> >> &nbsp; |&nbsp; 
> >> > /myApp/j_acegi_logout Logout </div>
> >> > 
> >> > <div id="sidebar">
> >> > <h1>Menu</h1>
> >> > <div class="project">
> >> > <p> /myApp/index.jsp Main page </p>
> >> > <p>&nbsp;</p>
> >> > <p>&nbsp;</p>
> >> > <p> # <br />
> >> >  </p>
> >> > </div>
> >> > </div>
> >> > 
> >> > <div>
> >> > <h2>Choose report</h2>
> >> > <br>
> >> >  <div align="left" style="width:
> >> 600px; border-width:thin;
> >> > border-style:solid; border-color:threedlightshadow;
> >> text-align: left;">
> >> > 
> >> > 			
> >> > <form namespace="/reports
> >> id="showReport" name="showReport"
> >> > onsubmit="return true;"
> >> action="/myApp/reports/showReport.action"
> >> > method="post">
> >> >    <table class="wwFormTable">
> >> > 		
> >> > 		From date: <script
> >> type="text/javascript">
> >> >     dojo.require("dojo.widget.DatePicker");
> >> > </script>
> >> > <div
> >> >      dojoType="dropdowndatepicker"   
> >> id="fromDate"   
> >> > value="2008-11-11T00:00:00"   
> >> name="dojo.fromDate"   
> >> > inputName="fromDate"    
> >> displayFormat="dd.MM.yyyy" 
> >> > saveFormat="rfc"></div><br/>
> >> >  		Do datuma: <script
> >> type="text/javascript">
> >> >     dojo.require("dojo.widget.DatePicker");
> >> > </script>
> >> > 
> >> > 		<tr>
> >> > 			<td align="right"><label
> >> for="users"
> >> class="label">User:</label></td>
> >> > 			<td><select name="user.id"
> >> id="user">
> >> >     <option
> >> value="1">Mike</option>
> >> >     <option
> >> value="2">John</option>
> >> >     <option
> >> value="3">Peter</option>
> >> > </select></td>
> >> > 		</tr>
> >> > 		<tr>
> >> > 			<td colspan="2"><input
> >> type="submit" id="showReport_0"
> >> value="Show
> >> > report" class="submit"
> >> style="submit"/>
> >> > </td>
> >> > 		</tr>
> >> > </table></form>
> >> > 
> >> > </div>
> >> > </body>
> >> > </html>
> >> > 
> >> > 
> >> > 
> >> > 
> >> > Jeromy Evans - Blue Sky Minds wrote:
> >> >> 
> >> >> Milan Milanovic wrote:
> >> >>> Hi,
> >> >>>
> >> >>> I have a simple jsp form:
> >> >>>
> >> >>> <head>
> >> >>> 	<s:head theme="ajax"
> >> debug="true" />
> >> >>> </head>
> >> >>> <s:form action="showReport"
> >> namespace="/reports" validate="true">
> >> >>>   
> >> >> <snip>
> >> >> 
> >> >>> 		And when user click submit button, this form
> >> get submitted twice, i.e.
> >> >>> showReport form action method is called twice!
> >> I'm NOT USING AJAX here,
> >> >>> I
> >> >>> DON'T HAVE ANY Javascript functions in
> >> this page.
> >> >>>
> >> >>>   
> >> >> 
> >> >> You DO have javascript in your page and you ARE
> >> using ajax.
> >> >> 
> >> >> <s:head theme="ajax"> instructs
> >> struts to include the dojo javascripts, 
> >> >> and sets the default theme to ajax.
> >> >> <s:form ...valudate="true">
> >> instructs struts to include client-side 
> >> >> javascript validation (or possibly ajax
> >> validation; I can't recall if 
> >> >> that requires the theme on the form itself or
> >> not).
> >> >> 
> >> >> Viewing the source of your page would tell you
> >> this.  Firefox with 
> >> >> Firebug will tell you what's happening.
> >> >> 
> >> >> Clean it up and see how you go.
> >> >> 
> >> >> 
> >> >>
> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail:
> >> user-unsubscribe@struts.apache.org
> >> >> For additional commands, e-mail:
> >> user-help@struts.apache.org
> >> >> 
> >> >> 
> >> >> 
> >> > 
> >> > 
> >> 
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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
> 

_________________________________________________________________
Access your email online and on the go with Windows Live Hotmail.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_access_112008

Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Dear Dave,

I don't understand. That is exactly what I get when page is generated. I
omited some plain html code.


--
Milan


newton.dave wrote:
> 
> I don't think that came through properly; perhaps try pastebin or similar.
> 
> Dave
> 
> 
> --- On Thu, 11/20/08, Milan Milanovic <mi...@yahoo.com> wrote:
> 
>> From: Milan Milanovic <mi...@yahoo.com>
>> Subject: Re: Form submitted twice (no AJAX!)
>> To: user@struts.apache.org
>> Date: Thursday, November 20, 2008, 3:33 PM
>> Why is this form submitte twice ?
>> 
>> 
>> Milan Milanovic wrote:
>> > 
>> > Yes, but it is the same when I remove ajax with
>> simple. Here is my jsp
>> > page, there is no AJAX word there and I still get
>> submited twice:
>> > 
>> > <html
>> xmlns="http://www.w3.org/1999/xhtml"
>> xml:lang="en">
>> > <head>
>> > <script type="text/javascript">
>> >     // Dojo configuration
>> >     djConfig = {
>> >         baseRelativePath:
>> "/myApp/struts/dojo",
>> >         isDebug: true,
>> >         bindEncoding: "UTF-8",
>> >         debugAtAllCosts: true // not needed, but
>> allows the Venkman
>> > debugger to work with the includes
>> >     };
>> > </script>
>> > <script type="text/javascript"
>> >        
>> src="/myApp/struts/dojo/dojo.js"></script>
>> > <script type="text/javascript"
>> >        
>> src="/myApp/struts/simple/dojoRequire.js"></script>
>> > </head>
>> > <body onload="">
>> > 
>> > 
>> > <div id="menu"> /myApp/index.jsp Main 
>> &nbsp; |&nbsp; 
>> > /myApp/j_acegi_logout Logout </div>
>> > 
>> > <div id="sidebar">
>> > <h1>Menu</h1>
>> > <div class="project">
>> > <p> /myApp/index.jsp Main page </p>
>> > <p>&nbsp;</p>
>> > <p>&nbsp;</p>
>> > <p> # <br />
>> >  </p>
>> > </div>
>> > </div>
>> > 
>> > <div>
>> > <h2>Choose report</h2>
>> > <br>
>> >  <div align="left" style="width:
>> 600px; border-width:thin;
>> > border-style:solid; border-color:threedlightshadow;
>> text-align: left;">
>> > 
>> > 			
>> > <form namespace="/reports
>> id="showReport" name="showReport"
>> > onsubmit="return true;"
>> action="/myApp/reports/showReport.action"
>> > method="post">
>> >    <table class="wwFormTable">
>> > 		
>> > 		From date: <script
>> type="text/javascript">
>> >     dojo.require("dojo.widget.DatePicker");
>> > </script>
>> > <div
>> >      dojoType="dropdowndatepicker"   
>> id="fromDate"   
>> > value="2008-11-11T00:00:00"   
>> name="dojo.fromDate"   
>> > inputName="fromDate"    
>> displayFormat="dd.MM.yyyy" 
>> > saveFormat="rfc"></div><br/>
>> >  		Do datuma: <script
>> type="text/javascript">
>> >     dojo.require("dojo.widget.DatePicker");
>> > </script>
>> > 
>> > 		<tr>
>> > 			<td align="right"><label
>> for="users"
>> class="label">User:</label></td>
>> > 			<td><select name="user.id"
>> id="user">
>> >     <option
>> value="1">Mike</option>
>> >     <option
>> value="2">John</option>
>> >     <option
>> value="3">Peter</option>
>> > </select></td>
>> > 		</tr>
>> > 		<tr>
>> > 			<td colspan="2"><input
>> type="submit" id="showReport_0"
>> value="Show
>> > report" class="submit"
>> style="submit"/>
>> > </td>
>> > 		</tr>
>> > </table></form>
>> > 
>> > </div>
>> > </body>
>> > </html>
>> > 
>> > 
>> > 
>> > 
>> > Jeromy Evans - Blue Sky Minds wrote:
>> >> 
>> >> Milan Milanovic wrote:
>> >>> Hi,
>> >>>
>> >>> I have a simple jsp form:
>> >>>
>> >>> <head>
>> >>> 	<s:head theme="ajax"
>> debug="true" />
>> >>> </head>
>> >>> <s:form action="showReport"
>> namespace="/reports" validate="true">
>> >>>   
>> >> <snip>
>> >> 
>> >>> 		And when user click submit button, this form
>> get submitted twice, i.e.
>> >>> showReport form action method is called twice!
>> I'm NOT USING AJAX here,
>> >>> I
>> >>> DON'T HAVE ANY Javascript functions in
>> this page.
>> >>>
>> >>>   
>> >> 
>> >> You DO have javascript in your page and you ARE
>> using ajax.
>> >> 
>> >> <s:head theme="ajax"> instructs
>> struts to include the dojo javascripts, 
>> >> and sets the default theme to ajax.
>> >> <s:form ...valudate="true">
>> instructs struts to include client-side 
>> >> javascript validation (or possibly ajax
>> validation; I can't recall if 
>> >> that requires the theme on the form itself or
>> not).
>> >> 
>> >> Viewing the source of your page would tell you
>> this.  Firefox with 
>> >> Firebug will tell you what's happening.
>> >> 
>> >> Clean it up and see how you go.
>> >> 
>> >> 
>> >>
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> >> For additional commands, e-mail:
>> user-help@struts.apache.org
>> >> 
>> >> 
>> >> 
>> > 
>> > 
>> 
>> -- 
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20622377.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: Form submitted twice (no AJAX!)

Posted by Dave Newton <ne...@yahoo.com>.
I don't think that came through properly; perhaps try pastebin or similar.

Dave


--- On Thu, 11/20/08, Milan Milanovic <mi...@yahoo.com> wrote:

> From: Milan Milanovic <mi...@yahoo.com>
> Subject: Re: Form submitted twice (no AJAX!)
> To: user@struts.apache.org
> Date: Thursday, November 20, 2008, 3:33 PM
> Why is this form submitte twice ?
> 
> 
> Milan Milanovic wrote:
> > 
> > Yes, but it is the same when I remove ajax with
> simple. Here is my jsp
> > page, there is no AJAX word there and I still get
> submited twice:
> > 
> > <html
> xmlns="http://www.w3.org/1999/xhtml"
> xml:lang="en">
> > <head>
> > <script type="text/javascript">
> >     // Dojo configuration
> >     djConfig = {
> >         baseRelativePath:
> "/myApp/struts/dojo",
> >         isDebug: true,
> >         bindEncoding: "UTF-8",
> >         debugAtAllCosts: true // not needed, but
> allows the Venkman
> > debugger to work with the includes
> >     };
> > </script>
> > <script type="text/javascript"
> >        
> src="/myApp/struts/dojo/dojo.js"></script>
> > <script type="text/javascript"
> >        
> src="/myApp/struts/simple/dojoRequire.js"></script>
> > </head>
> > <body onload="">
> > 
> > 
> > <div id="menu"> /myApp/index.jsp Main 
> &nbsp; |&nbsp; 
> > /myApp/j_acegi_logout Logout </div>
> > 
> > <div id="sidebar">
> > <h1>Menu</h1>
> > <div class="project">
> > <p> /myApp/index.jsp Main page </p>
> > <p>&nbsp;</p>
> > <p>&nbsp;</p>
> > <p> # <br />
> >  </p>
> > </div>
> > </div>
> > 
> > <div>
> > <h2>Choose report</h2>
> > <br>
> >  <div align="left" style="width:
> 600px; border-width:thin;
> > border-style:solid; border-color:threedlightshadow;
> text-align: left;">
> > 
> > 			
> > <form namespace="/reports
> id="showReport" name="showReport"
> > onsubmit="return true;"
> action="/myApp/reports/showReport.action"
> > method="post">
> >    <table class="wwFormTable">
> > 		
> > 		From date: <script
> type="text/javascript">
> >     dojo.require("dojo.widget.DatePicker");
> > </script>
> > <div
> >      dojoType="dropdowndatepicker"   
> id="fromDate"   
> > value="2008-11-11T00:00:00"   
> name="dojo.fromDate"   
> > inputName="fromDate"    
> displayFormat="dd.MM.yyyy" 
> > saveFormat="rfc"></div><br/>
> >  		Do datuma: <script
> type="text/javascript">
> >     dojo.require("dojo.widget.DatePicker");
> > </script>
> > 
> > 		<tr>
> > 			<td align="right"><label
> for="users"
> class="label">User:</label></td>
> > 			<td><select name="user.id"
> id="user">
> >     <option
> value="1">Mike</option>
> >     <option
> value="2">John</option>
> >     <option
> value="3">Peter</option>
> > </select></td>
> > 		</tr>
> > 		<tr>
> > 			<td colspan="2"><input
> type="submit" id="showReport_0"
> value="Show
> > report" class="submit"
> style="submit"/>
> > </td>
> > 		</tr>
> > </table></form>
> > 
> > </div>
> > </body>
> > </html>
> > 
> > 
> > 
> > 
> > Jeromy Evans - Blue Sky Minds wrote:
> >> 
> >> Milan Milanovic wrote:
> >>> Hi,
> >>>
> >>> I have a simple jsp form:
> >>>
> >>> <head>
> >>> 	<s:head theme="ajax"
> debug="true" />
> >>> </head>
> >>> <s:form action="showReport"
> namespace="/reports" validate="true">
> >>>   
> >> <snip>
> >> 
> >>> 		And when user click submit button, this form
> get submitted twice, i.e.
> >>> showReport form action method is called twice!
> I'm NOT USING AJAX here,
> >>> I
> >>> DON'T HAVE ANY Javascript functions in
> this page.
> >>>
> >>>   
> >> 
> >> You DO have javascript in your page and you ARE
> using ajax.
> >> 
> >> <s:head theme="ajax"> instructs
> struts to include the dojo javascripts, 
> >> and sets the default theme to ajax.
> >> <s:form ...valudate="true">
> instructs struts to include client-side 
> >> javascript validation (or possibly ajax
> validation; I can't recall if 
> >> that requires the theme on the form itself or
> not).
> >> 
> >> Viewing the source of your page would tell you
> this.  Firefox with 
> >> Firebug will tell you what's happening.
> >> 
> >> Clean it up and see how you go.
> >> 
> >> 
> >>
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail:
> user-help@struts.apache.org
> >> 
> >> 
> >> 
> > 
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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

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


Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Why is this form submitte twice ?


Milan Milanovic wrote:
> 
> Yes, but it is the same when I remove ajax with simple. Here is my jsp
> page, there is no AJAX word there and I still get submited twice:
> 
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> <head>
> <script type="text/javascript">
>     // Dojo configuration
>     djConfig = {
>         baseRelativePath: "/myApp/struts/dojo",
>         isDebug: true,
>         bindEncoding: "UTF-8",
>         debugAtAllCosts: true // not needed, but allows the Venkman
> debugger to work with the includes
>     };
> </script>
> <script type="text/javascript"
>         src="/myApp/struts/dojo/dojo.js"></script>
> <script type="text/javascript"
>         src="/myApp/struts/simple/dojoRequire.js"></script>
> </head>
> <body onload="">
> 
> 
> <div id="menu"> /myApp/index.jsp Main  &nbsp; |&nbsp; 
> /myApp/j_acegi_logout Logout </div>
> 
> <div id="sidebar">
> <h1>Menu</h1>
> <div class="project">
> <p> /myApp/index.jsp Main page </p>
> <p>&nbsp;</p>
> <p>&nbsp;</p>
> <p> # <br />
>  </p>
> </div>
> </div>
> 
> <div>
> <h2>Choose report</h2>
> <br>
>  <div align="left" style="width: 600px; border-width:thin;
> border-style:solid; border-color:threedlightshadow; text-align: left;">
> 
> 			
> <form namespace="/reports id="showReport" name="showReport"
> onsubmit="return true;" action="/myApp/reports/showReport.action"
> method="post">
>    <table class="wwFormTable">
> 		
> 		From date: <script type="text/javascript">
>     dojo.require("dojo.widget.DatePicker");
> </script>
> <div
>      dojoType="dropdowndatepicker"    id="fromDate"   
> value="2008-11-11T00:00:00"    name="dojo.fromDate"   
> inputName="fromDate"     displayFormat="dd.MM.yyyy" 
> saveFormat="rfc"></div><br/>
>  		Do datuma: <script type="text/javascript">
>     dojo.require("dojo.widget.DatePicker");
> </script>
> 
> 		<tr>
> 			<td align="right"><label for="users" class="label">User:</label></td>
> 			<td><select name="user.id" id="user">
>     <option value="1">Mike</option>
>     <option value="2">John</option>
>     <option value="3">Peter</option>
> </select></td>
> 		</tr>
> 		<tr>
> 			<td colspan="2"><input type="submit" id="showReport_0" value="Show
> report" class="submit" style="submit"/>
> </td>
> 		</tr>
> </table></form>
> 
> </div>
> </body>
> </html>
> 
> 
> 
> 
> Jeromy Evans - Blue Sky Minds wrote:
>> 
>> Milan Milanovic wrote:
>>> Hi,
>>>
>>> I have a simple jsp form:
>>>
>>> <head>
>>> 	<s:head theme="ajax" debug="true" />
>>> </head>
>>> <s:form action="showReport" namespace="/reports" validate="true">
>>>   
>> <snip>
>> 
>>> 		And when user click submit button, this form get submitted twice, i.e.
>>> showReport form action method is called twice! I'm NOT USING AJAX here,
>>> I
>>> DON'T HAVE ANY Javascript functions in this page.
>>>
>>>   
>> 
>> You DO have javascript in your page and you ARE using ajax.
>> 
>> <s:head theme="ajax"> instructs struts to include the dojo javascripts, 
>> and sets the default theme to ajax.
>> <s:form ...valudate="true"> instructs struts to include client-side 
>> javascript validation (or possibly ajax validation; I can't recall if 
>> that requires the theme on the form itself or not).
>> 
>> Viewing the source of your page would tell you this.  Firefox with 
>> Firebug will tell you what's happening.
>> 
>> Clean it up and see how you go.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20609456.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: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Yes, but it is the same when I remove ajax with simple. Here is my jsp page,
there is no AJAX word there and I still get submited twice:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript">
    // Dojo configuration
    djConfig = {
        baseRelativePath: "/myApp/struts/dojo",
        isDebug: true,
        bindEncoding: "UTF-8",
        debugAtAllCosts: true // not needed, but allows the Venkman debugger
to work with the includes
    };
</script>
<script type="text/javascript"
        src="/myApp/struts/dojo/dojo.js"></script>
<script type="text/javascript"
        src="/myApp/struts/simple/dojoRequire.js"></script>
</head>
<body onload="">


<div id="menu"> /myApp/index.jsp Main  &nbsp; |&nbsp;  /myApp/j_acegi_logout
Logout </div>

<div id="sidebar">
<h1>Menu</h1>
<div class="project">
<p> /myApp/index.jsp Main page </p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p> # <br />
</p>
</div>
</div>

<div>
<h2>Choose report</h2>
<br>
 <div align="left" style="width: 600px; border-width:thin;
border-style:solid; border-color:threedlightshadow; text-align: left;">

			
<form namespace="/reports id="showReport" name="showReport" onsubmit="return
true;" action="/myApp/reports/showReport.action" method="post">
   <table class="wwFormTable">
		
		From date: <script type="text/javascript">
    dojo.require("dojo.widget.DatePicker");
</script>
<div
     dojoType="dropdowndatepicker"    id="fromDate"   
value="2008-11-11T00:00:00"    name="dojo.fromDate"    inputName="fromDate"    
displayFormat="dd.MM.yyyy"  saveFormat="rfc"></div><br/>
 		Do datuma: <script type="text/javascript">
    dojo.require("dojo.widget.DatePicker");
</script>

		<tr>
			<td align="right"><label for="users" class="label">User:</label></td>
			<td><select name="user.id" id="user">
    <option value="1">Mike</option>
    <option value="2">John</option>
    <option value="3">Peter</option>
</select></td>
		</tr>
		<tr>
			<td colspan="2"><input type="submit" id="showReport_0" value="Show
report" class="submit" style="submit"/>
</td>
		</tr>
</table></form>

</div>
</body>
</html>




Jeromy Evans - Blue Sky Minds wrote:
> 
> Milan Milanovic wrote:
>> Hi,
>>
>> I have a simple jsp form:
>>
>> <head>
>> 	<s:head theme="ajax" debug="true" />
>> </head>
>> <s:form action="showReport" namespace="/reports" validate="true">
>>   
> <snip>
> 
>> 		And when user click submit button, this form get submitted twice, i.e.
>> showReport form action method is called twice! I'm NOT USING AJAX here, I
>> DON'T HAVE ANY Javascript functions in this page.
>>
>>   
> 
> You DO have javascript in your page and you ARE using ajax.
> 
> <s:head theme="ajax"> instructs struts to include the dojo javascripts, 
> and sets the default theme to ajax.
> <s:form ...valudate="true"> instructs struts to include client-side 
> javascript validation (or possibly ajax validation; I can't recall if 
> that requires the theme on the form itself or not).
> 
> Viewing the source of your page would tell you this.  Firefox with 
> Firebug will tell you what's happening.
> 
> Clean it up and see how you go.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20602366.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: Form submitted twice (no AJAX!)

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Milan Milanovic wrote:
> Hi,
>
> I have a simple jsp form:
>
> <head>
> 	<s:head theme="ajax" debug="true" />
> </head>
> <s:form action="showReport" namespace="/reports" validate="true">
>   
<snip>

> 		And when user click submit button, this form get submitted twice, i.e.
> showReport form action method is called twice! I'm NOT USING AJAX here, I
> DON'T HAVE ANY Javascript functions in this page.
>
>   

You DO have javascript in your page and you ARE using ajax.

<s:head theme="ajax"> instructs struts to include the dojo javascripts, 
and sets the default theme to ajax.
<s:form ...valudate="true"> instructs struts to include client-side 
javascript validation (or possibly ajax validation; I can't recall if 
that requires the theme on the form itself or not).

Viewing the source of your page would tell you this.  Firefox with 
Firebug will tell you what's happening.

Clean it up and see how you go.


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


Re: Form submitted twice (no AJAX!)

Posted by Gianluca Musella <gi...@gmail.com>.
mmm... I don't know.

Times ago I've a similar problem. The problem was that ffx3 loads
pages two times if there are <img> with empty or null src attribute.

Hope this helps.

Gianluca


2008/11/19 Milan Milanovic <mi...@yahoo.com>:
>
> It is Eclipse integrated browser, I supose that it use IE 7. I tried also
> with ffx3, and it is the same!
>
>
> Gianluca Musella wrote:
>>
>> Do you use ffx or ie or something other?
>>
>> 2008/11/19 Milan Milanovic <mi...@yahoo.com>:
>>>
>>> Yes, just like here:
>>> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>>> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>>>
>>> --
>>> Milan
>>>
>>>
>>> diogo pontual wrote:
>>>>
>>>> Are you using Spring with Struts2???
>>>>
>>>>
>>>>
>>>> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
>>>> <mi...@yahoo.com>wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I have a simple jsp form:
>>>>>
>>>>> <head>
>>>>>        <s:head theme="ajax" debug="true" />
>>>>> </head>
>>>>> <s:form action="showReport" namespace="/reports" validate="true">
>>>>>
>>>>>                From date: <s:datetimepicker id="fromDate"
>>>>> displayFormat="dd.MM.yyyy"
>>>>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>>>>>                To date: <s:datetimepicker id="toDate"
>>>>> displayFormat="dd.MM.yyyy"
>>>>> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
>>>>>                <tr>
>>>>>                        <td colspan="2"> </td>
>>>>>                </tr>
>>>>>                <tr>
>>>>>                        <td colspan="2"><s:select id="user" label="User"
>>>>>                                list="users" name = "user.id"
>>>>> emptyOption="false"
>>>>>                                listKey = "id" value = "user.id"
>>>>>                                headerKey="None" multiple="false"
>>>>> theme="simple"/>
>>>>>                        </td>
>>>>>                </tr>
>>>>>                <tr>
>>>>>                        <td colspan="2"><s:submit value="Show report"
>>>>> theme="simple" /></td>
>>>>>                </tr>
>>>>> </s:form>
>>>>>
>>>>> And when user click submit button, this form get submitted twice, i.e.
>>>>> showReport form action method is called twice! I'm NOT USING AJAX here,
>>>>> I
>>>>> DON'T HAVE ANY Javascript functions in this page.
>>>>>
>>>>> In my struts.xml I have:
>>>>>
>>>>> <action name="showReport" method="showReport" class="ReportAction">
>>>>>                 <result>/pages/reports/report.jsp</result>
>>>>>                 <result
>>>>> name="input">/pages/reports/chooseReport.jsp</result>
>>>>> </action>
>>>>>
>>>>> What is the problem here ?
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Diogo Dauster Pontual
>>>> diogopontual@gmail.com
>>>> 61.81850270
>>>>
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585258.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
>
>

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


Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
It is Eclipse integrated browser, I supose that it use IE 7. I tried also
with ffx3, and it is the same!


Gianluca Musella wrote:
> 
> Do you use ffx or ie or something other?
> 
> 2008/11/19 Milan Milanovic <mi...@yahoo.com>:
>>
>> Yes, just like here:
>> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>>
>> --
>> Milan
>>
>>
>> diogo pontual wrote:
>>>
>>> Are you using Spring with Struts2???
>>>
>>>
>>>
>>> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
>>> <mi...@yahoo.com>wrote:
>>>
>>>>
>>>> Hi,
>>>>
>>>> I have a simple jsp form:
>>>>
>>>> <head>
>>>>        <s:head theme="ajax" debug="true" />
>>>> </head>
>>>> <s:form action="showReport" namespace="/reports" validate="true">
>>>>
>>>>                From date: <s:datetimepicker id="fromDate"
>>>> displayFormat="dd.MM.yyyy"
>>>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>>>>                To date: <s:datetimepicker id="toDate"
>>>> displayFormat="dd.MM.yyyy"
>>>> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
>>>>                <tr>
>>>>                        <td colspan="2"> </td>
>>>>                </tr>
>>>>                <tr>
>>>>                        <td colspan="2"><s:select id="user" label="User"
>>>>                                list="users" name = "user.id"
>>>> emptyOption="false"
>>>>                                listKey = "id" value = "user.id"
>>>>                                headerKey="None" multiple="false"
>>>> theme="simple"/>
>>>>                        </td>
>>>>                </tr>
>>>>                <tr>
>>>>                        <td colspan="2"><s:submit value="Show report"
>>>> theme="simple" /></td>
>>>>                </tr>
>>>> </s:form>
>>>>
>>>> And when user click submit button, this form get submitted twice, i.e.
>>>> showReport form action method is called twice! I'm NOT USING AJAX here,
>>>> I
>>>> DON'T HAVE ANY Javascript functions in this page.
>>>>
>>>> In my struts.xml I have:
>>>>
>>>> <action name="showReport" method="showReport" class="ReportAction">
>>>>                 <result>/pages/reports/report.jsp</result>
>>>>                 <result
>>>> name="input">/pages/reports/chooseReport.jsp</result>
>>>> </action>
>>>>
>>>> What is the problem here ?
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>>>>
>>>>
>>>
>>>
>>> --
>>> Diogo Dauster Pontual
>>> diogopontual@gmail.com
>>> 61.81850270
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585258.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: Form submitted twice (no AJAX!)

Posted by Steven Yang <ke...@gmail.com>.
can you post the html generated from your action and jsp?

Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
It is defined as "prototype"! 


diogo pontual wrote:
> 
> Well, some time ago I was faced to the same problem. The workaround was:
> define all Action's and Interceptor's scope as prototype in my
> applicationContext.xml.
> 
> I hope this help you.
> 
> Diogo Pontual
> 
> On Wed, Nov 19, 2008 at 3:41 PM, Gianluca Musella <
> gianluca.musella@gmail.com> wrote:
> 
>> Do you use ffx or ie or something other?
>>
>> 2008/11/19 Milan Milanovic <mi...@yahoo.com>:
>> >
>> > Yes, just like here:
>> > http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>> > http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>> >
>> > --
>> > Milan
>> >
>> >
>> > diogo pontual wrote:
>> >>
>> >> Are you using Spring with Struts2???
>> >>
>> >>
>> >>
>> >> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
>> >> <mi...@yahoo.com>wrote:
>> >>
>> >>>
>> >>> Hi,
>> >>>
>> >>> I have a simple jsp form:
>> >>>
>> >>> <head>
>> >>>        <s:head theme="ajax" debug="true" />
>> >>> </head>
>> >>> <s:form action="showReport" namespace="/reports" validate="true">
>> >>>
>> >>>                From date: <s:datetimepicker id="fromDate"
>> >>> displayFormat="dd.MM.yyyy"
>> >>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>> >>>                To date: <s:datetimepicker id="toDate"
>> >>> displayFormat="dd.MM.yyyy"
>> >>> atype="date" name="toDate" label="Do datuma"
>> theme="simple"/><br/><br/>
>> >>>                <tr>
>> >>>                        <td colspan="2"> </td>
>> >>>                </tr>
>> >>>                <tr>
>> >>>                        <td colspan="2"><s:select id="user"
>> label="User"
>> >>>                                list="users" name = "user.id"
>> >>> emptyOption="false"
>> >>>                                listKey = "id" value = "user.id"
>> >>>                                headerKey="None" multiple="false"
>> >>> theme="simple"/>
>> >>>                        </td>
>> >>>                </tr>
>> >>>                <tr>
>> >>>                        <td colspan="2"><s:submit value="Show report"
>> >>> theme="simple" /></td>
>> >>>                </tr>
>> >>> </s:form>
>> >>>
>> >>> And when user click submit button, this form get submitted twice,
>> i.e.
>> >>> showReport form action method is called twice! I'm NOT USING AJAX
>> here,
>> I
>> >>> DON'T HAVE ANY Javascript functions in this page.
>> >>>
>> >>> In my struts.xml I have:
>> >>>
>> >>> <action name="showReport" method="showReport" class="ReportAction">
>> >>>                 <result>/pages/reports/report.jsp</result>
>> >>>                 <result
>> >>> name="input">/pages/reports/chooseReport.jsp</result>
>> >>> </action>
>> >>>
>> >>> What is the problem here ?
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>> >>>
>> >>>
>> >>
>> >>
>> >> --
>> >> Diogo Dauster Pontual
>> >> diogopontual@gmail.com
>> >> 61.81850270
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> Diogo Dauster Pontual
> diogopontual@gmail.com
> 61.81850270
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585835.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: Form submitted twice (no AJAX!)

Posted by diogo pontual <di...@gmail.com>.
Well, some time ago I was faced to the same problem. The workaround was:
define all Action's and Interceptor's scope as prototype in my
applicationContext.xml.

I hope this help you.

Diogo Pontual

On Wed, Nov 19, 2008 at 3:41 PM, Gianluca Musella <
gianluca.musella@gmail.com> wrote:

> Do you use ffx or ie or something other?
>
> 2008/11/19 Milan Milanovic <mi...@yahoo.com>:
> >
> > Yes, just like here:
> > http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
> > http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
> >
> > --
> > Milan
> >
> >
> > diogo pontual wrote:
> >>
> >> Are you using Spring with Struts2???
> >>
> >>
> >>
> >> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
> >> <mi...@yahoo.com>wrote:
> >>
> >>>
> >>> Hi,
> >>>
> >>> I have a simple jsp form:
> >>>
> >>> <head>
> >>>        <s:head theme="ajax" debug="true" />
> >>> </head>
> >>> <s:form action="showReport" namespace="/reports" validate="true">
> >>>
> >>>                From date: <s:datetimepicker id="fromDate"
> >>> displayFormat="dd.MM.yyyy"
> >>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
> >>>                To date: <s:datetimepicker id="toDate"
> >>> displayFormat="dd.MM.yyyy"
> >>> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
> >>>                <tr>
> >>>                        <td colspan="2"> </td>
> >>>                </tr>
> >>>                <tr>
> >>>                        <td colspan="2"><s:select id="user" label="User"
> >>>                                list="users" name = "user.id"
> >>> emptyOption="false"
> >>>                                listKey = "id" value = "user.id"
> >>>                                headerKey="None" multiple="false"
> >>> theme="simple"/>
> >>>                        </td>
> >>>                </tr>
> >>>                <tr>
> >>>                        <td colspan="2"><s:submit value="Show report"
> >>> theme="simple" /></td>
> >>>                </tr>
> >>> </s:form>
> >>>
> >>> And when user click submit button, this form get submitted twice, i.e.
> >>> showReport form action method is called twice! I'm NOT USING AJAX here,
> I
> >>> DON'T HAVE ANY Javascript functions in this page.
> >>>
> >>> In my struts.xml I have:
> >>>
> >>> <action name="showReport" method="showReport" class="ReportAction">
> >>>                 <result>/pages/reports/report.jsp</result>
> >>>                 <result
> >>> name="input">/pages/reports/chooseReport.jsp</result>
> >>> </action>
> >>>
> >>> What is the problem here ?
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
> >>>
> >>>
> >>
> >>
> >> --
> >> Diogo Dauster Pontual
> >> diogopontual@gmail.com
> >> 61.81850270
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Diogo Dauster Pontual
diogopontual@gmail.com
61.81850270

Re: Form submitted twice (no AJAX!)

Posted by Gianluca Musella <gi...@gmail.com>.
Do you use ffx or ie or something other?

2008/11/19 Milan Milanovic <mi...@yahoo.com>:
>
> Yes, just like here:
> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
> http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
>
> --
> Milan
>
>
> diogo pontual wrote:
>>
>> Are you using Spring with Struts2???
>>
>>
>>
>> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
>> <mi...@yahoo.com>wrote:
>>
>>>
>>> Hi,
>>>
>>> I have a simple jsp form:
>>>
>>> <head>
>>>        <s:head theme="ajax" debug="true" />
>>> </head>
>>> <s:form action="showReport" namespace="/reports" validate="true">
>>>
>>>                From date: <s:datetimepicker id="fromDate"
>>> displayFormat="dd.MM.yyyy"
>>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>>>                To date: <s:datetimepicker id="toDate"
>>> displayFormat="dd.MM.yyyy"
>>> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
>>>                <tr>
>>>                        <td colspan="2"> </td>
>>>                </tr>
>>>                <tr>
>>>                        <td colspan="2"><s:select id="user" label="User"
>>>                                list="users" name = "user.id"
>>> emptyOption="false"
>>>                                listKey = "id" value = "user.id"
>>>                                headerKey="None" multiple="false"
>>> theme="simple"/>
>>>                        </td>
>>>                </tr>
>>>                <tr>
>>>                        <td colspan="2"><s:submit value="Show report"
>>> theme="simple" /></td>
>>>                </tr>
>>> </s:form>
>>>
>>> And when user click submit button, this form get submitted twice, i.e.
>>> showReport form action method is called twice! I'm NOT USING AJAX here, I
>>> DON'T HAVE ANY Javascript functions in this page.
>>>
>>> In my struts.xml I have:
>>>
>>> <action name="showReport" method="showReport" class="ReportAction">
>>>                 <result>/pages/reports/report.jsp</result>
>>>                 <result
>>> name="input">/pages/reports/chooseReport.jsp</result>
>>> </action>
>>>
>>> What is the problem here ?
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>>>
>>>
>>
>>
>> --
>> Diogo Dauster Pontual
>> diogopontual@gmail.com
>> 61.81850270
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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
>
>

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


Re: Form submitted twice (no AJAX!)

Posted by Milan Milanovic <mi...@yahoo.com>.
Yes, just like here: 
http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html
http://struts.apache.org/2.0.12/docs/struts-2-spring-2-jpa-ajax.html 

--
Milan


diogo pontual wrote:
> 
> Are you using Spring with Struts2???
> 
> 
> 
> On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
> <mi...@yahoo.com>wrote:
> 
>>
>> Hi,
>>
>> I have a simple jsp form:
>>
>> <head>
>>        <s:head theme="ajax" debug="true" />
>> </head>
>> <s:form action="showReport" namespace="/reports" validate="true">
>>
>>                From date: <s:datetimepicker id="fromDate"
>> displayFormat="dd.MM.yyyy"
>> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>>                To date: <s:datetimepicker id="toDate"
>> displayFormat="dd.MM.yyyy"
>> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
>>                <tr>
>>                        <td colspan="2"> </td>
>>                </tr>
>>                <tr>
>>                        <td colspan="2"><s:select id="user" label="User"
>>                                list="users" name = "user.id"
>> emptyOption="false"
>>                                listKey = "id" value = "user.id"
>>                                headerKey="None" multiple="false"
>> theme="simple"/>
>>                        </td>
>>                </tr>
>>                <tr>
>>                        <td colspan="2"><s:submit value="Show report"
>> theme="simple" /></td>
>>                </tr>
>> </s:form>
>>
>> And when user click submit button, this form get submitted twice, i.e.
>> showReport form action method is called twice! I'm NOT USING AJAX here, I
>> DON'T HAVE ANY Javascript functions in this page.
>>
>> In my struts.xml I have:
>>
>> <action name="showReport" method="showReport" class="ReportAction">
>>                 <result>/pages/reports/report.jsp</result>
>>                 <result
>> name="input">/pages/reports/chooseReport.jsp</result>
>> </action>
>>
>> What is the problem here ?
>> --
>> View this message in context:
>> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>>
>>
> 
> 
> -- 
> Diogo Dauster Pontual
> diogopontual@gmail.com
> 61.81850270
> 
> 

-- 
View this message in context: http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20585089.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: Form submitted twice (no AJAX!)

Posted by diogo pontual <di...@gmail.com>.
Are you using Spring with Struts2???



On Wed, Nov 19, 2008 at 3:32 PM, Milan Milanovic
<mi...@yahoo.com>wrote:

>
> Hi,
>
> I have a simple jsp form:
>
> <head>
>        <s:head theme="ajax" debug="true" />
> </head>
> <s:form action="showReport" namespace="/reports" validate="true">
>
>                From date: <s:datetimepicker id="fromDate"
> displayFormat="dd.MM.yyyy"
> type="date" name="fromDate" label="Od datuma" theme="simple"/><br/>
>                To date: <s:datetimepicker id="toDate"
> displayFormat="dd.MM.yyyy"
> atype="date" name="toDate" label="Do datuma" theme="simple"/><br/><br/>
>                <tr>
>                        <td colspan="2"> </td>
>                </tr>
>                <tr>
>                        <td colspan="2"><s:select id="user" label="User"
>                                list="users" name = "user.id"
> emptyOption="false"
>                                listKey = "id" value = "user.id"
>                                headerKey="None" multiple="false"
> theme="simple"/>
>                        </td>
>                </tr>
>                <tr>
>                        <td colspan="2"><s:submit value="Show report"
> theme="simple" /></td>
>                </tr>
> </s:form>
>
> And when user click submit button, this form get submitted twice, i.e.
> showReport form action method is called twice! I'm NOT USING AJAX here, I
> DON'T HAVE ANY Javascript functions in this page.
>
> In my struts.xml I have:
>
> <action name="showReport" method="showReport" class="ReportAction">
>                 <result>/pages/reports/report.jsp</result>
>                 <result
> name="input">/pages/reports/chooseReport.jsp</result>
> </action>
>
> What is the problem here ?
> --
> View this message in context:
> http://www.nabble.com/Form-submitted-twice-%28no-AJAX%21%29-tp20584806p20584806.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
>
>


-- 
Diogo Dauster Pontual
diogopontual@gmail.com
61.81850270