You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mounir Benzid <mb...@meetingmasters.de> on 2012/02/28 21:17:27 UTC
Maven repository and struts2-jquery-plugin
Hi,
please point me to a maven repo with the latest jq-plugin release
I only have this link on google code:
http://code.google.com/p/struts2-jquery/downloads/detail?name=struts2-jquery-plugin-3.2.1.jar
Thanks!
cheers
- Mounir
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: struts2-jquery-plugin: form submit returns twice the submit and
textfield
Posted by Mounir Benzid <mb...@meetingmasters.de>.
Hi Dave,
targets="formResult" in <s:aj> is unnecessary in my case. Simply
removing it solved the problem.
Thanks!
- Mounir
Am 29.02.2012 00:50, schrieb Dave Newton:
> You update the div with the same jsp as the form, so you're adding the page
> to itself.
>
> d.
>
> (pardon brevity and typos, on cell)
> On Feb 28, 2012 6:44 PM, "Mounir Benzid"<mb...@meetingmasters.de> wrote:
>
>> Here's a simple enough example of how to use the<sj:a> tag available in
>> the struts2-jquery plugin (v 3.2.1)
>> http://www.weinfreund.de/**struts2-jquery-showcase/index.**action<http://www.weinfreund.de/struts2-jquery-showcase/index.action>
>>
>>
>> Well what I get though is somehow mysterious (to me).
>>
>> The first time when I call the action [1] given by its URL
>> http://localhost:8080/myApp/**test/me<http://localhost:8080/myApp/test/me>
>> I get the correct server response, that is
>>
>> - a line saying "Echo: Hello me!"
>> - underneath it a textfield containig the phrase "Hello me !"
>> - followed by a submit button
>>
>> This is what it looks like:
>> Before: http://i40.tinypic.com/vf8782.**jpg<http://i40.tinypic.com/vf8782.jpg>
>>
>> Nice.
>>
>> But after I submit the form the textfield and the submit button get
>> somehow mysteriously duplicated! (but not the "Echo:..." textline)
>>
>> So there's still the initial textfield with the updated Hello +
>> whatever-you-typed-in phrase but yet another textfield and yet another
>> submit button.
>>
>> The only difference I can tell between the initial and the duplicated
>> textfield is that the latter never gets a refresh.
>> It always contains the initial "Hello me !" phrase.
>>
>> This is how it looks like after the submit:
>> After: http://i41.tinypic.com/2ji44j.**jpg<http://i41.tinypic.com/2ji44j.jpg>
>>
>> Maybe someone can tell what I'm missing here.
>> Thanks!
>>
>>
>> [1] http://pastebin.com/Wq0Ek1H4<http://pastebin.com/Wq0Ek1H4>**(Action
>> class)
>>
>> [2] http://pastebin.com/6yF2xwu4 (jsp)
>>
>> ------------------------------**------------------------------**
>> ------------------------------**------------------------------**
>> ------------------------------**----------------------
>>
>> [1] ACTION class
>>
>> package xxx.actions.yyy;
>>
>> import org.apache.log4j.Logger;
>> import org.apache.struts2.convention.**annotation.Action;
>> import org.apache.struts2.convention.**annotation.Actions;
>> import org.apache.struts2.convention.**annotation.Namespace;
>> import org.apache.struts2.convention.**annotation.Result;
>>
>> import com.opensymphony.xwork2.**ActionSupport;
>>
>> @Namespace("/test")
>> public class HelloWorldAction extends ActionSupport {
>>
>> public String getYourName() {return yourName; }
>> public void setYourName(String value) {this.yourName = value;}
>>
>> @Actions({
>> @Action(value="{yourName}", results={@Result(location =
>> "test.jsp")}),
>> @Action(value="put", results={@Result(location = "test.jsp")})
>> })
>> public String execute() {
>> yourName = "Hello " + yourName + " !";
>> logger.debug("execute: " + yourName);
>> return SUCCESS;
>> }
>>
>> private static final long serialVersionUID = 1L;
>> private String yourName;
>> private static Logger logger = Logger.getLogger(**
>> HelloWorldAction.class);
>>
>> }
>>
>>
>> [2] (jsp)
>> ------------------------------**------------------------------**
>> ------------------------------**----------------------------
>>
>> <%@ taglib prefix="s" uri="/struts-tags" %>
>> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
>>
>> <html>
>>
>> <head>
>> <sj:head/>
>> </head>
>>
>> <body>
>>
>> <div id="formResult">
>> <p>Echo : ${yourName}</p>
>> </div>
>>
>> <s:form id="form" action="put">
>> <s:textfield id="echo" name="yourName"/>
>> </s:form>
>>
>> <sj:a
>> id="ajaxformlink"
>> formIds="form"
>> targets="formResult"
>> indicator="indicator"
>> button="true"
>> buttonIcon="ui-icon-gear"
>> Submit form here
>> </sj:a>
>>
>> <img id="indicator" src="images/indicator.gif" alt="Loading..."
>> style="display:none"/>
>>
>> </body>
>>
>> </html>
>>
>>
>>
>>
>>
>>
--
Mounir Benzid
Systementwickler / EDV
meetingmasters.de
meetings meisterhaft managen
· Unabhängige Vermittlung von Tagungshotels
· Online-Hotelreservierungssystem zur Integration in die Veranstaltungs-Webseite
· Webbasiertes Veranstaltungs- und Teilnehmermanagement
· E-Procurement für den Tagungshoteleinkauf
· Webbasierte Anfrage und Verhandlung von Firmenraten
Max-Planck-Straße 22
D-54296 Trier
fon +49 (0)651-145789-38
fax +49 (0)651-145789-20
www.meetingmasters.de
mb@meetingmasters.de
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: struts2-jquery-plugin: form submit returns twice the submit and textfield
Posted by Dave Newton <da...@gmail.com>.
You update the div with the same jsp as the form, so you're adding the page
to itself.
d.
(pardon brevity and typos, on cell)
On Feb 28, 2012 6:44 PM, "Mounir Benzid" <mb...@meetingmasters.de> wrote:
> Here's a simple enough example of how to use the <sj:a> tag available in
> the struts2-jquery plugin (v 3.2.1)
> http://www.weinfreund.de/**struts2-jquery-showcase/index.**action<http://www.weinfreund.de/struts2-jquery-showcase/index.action>
>
>
> Well what I get though is somehow mysterious (to me).
>
> The first time when I call the action [1] given by its URL
> http://localhost:8080/myApp/**test/me<http://localhost:8080/myApp/test/me>
> I get the correct server response, that is
>
> - a line saying "Echo: Hello me!"
> - underneath it a textfield containig the phrase "Hello me !"
> - followed by a submit button
>
> This is what it looks like:
> Before: http://i40.tinypic.com/vf8782.**jpg<http://i40.tinypic.com/vf8782.jpg>
>
> Nice.
>
> But after I submit the form the textfield and the submit button get
> somehow mysteriously duplicated! (but not the "Echo:..." textline)
>
> So there's still the initial textfield with the updated Hello +
> whatever-you-typed-in phrase but yet another textfield and yet another
> submit button.
>
> The only difference I can tell between the initial and the duplicated
> textfield is that the latter never gets a refresh.
> It always contains the initial "Hello me !" phrase.
>
> This is how it looks like after the submit:
> After: http://i41.tinypic.com/2ji44j.**jpg<http://i41.tinypic.com/2ji44j.jpg>
>
> Maybe someone can tell what I'm missing here.
> Thanks!
>
>
> [1] http://pastebin.com/Wq0Ek1H4 <http://pastebin.com/Wq0Ek1H4>**(Action
> class)
>
> [2] http://pastebin.com/6yF2xwu4 (jsp)
>
> ------------------------------**------------------------------**
> ------------------------------**------------------------------**
> ------------------------------**----------------------
>
> [1] ACTION class
>
> package xxx.actions.yyy;
>
> import org.apache.log4j.Logger;
> import org.apache.struts2.convention.**annotation.Action;
> import org.apache.struts2.convention.**annotation.Actions;
> import org.apache.struts2.convention.**annotation.Namespace;
> import org.apache.struts2.convention.**annotation.Result;
>
> import com.opensymphony.xwork2.**ActionSupport;
>
> @Namespace("/test")
> public class HelloWorldAction extends ActionSupport {
>
> public String getYourName() {return yourName; }
> public void setYourName(String value) {this.yourName = value;}
>
> @Actions({
> @Action(value="{yourName}", results={@Result(location =
> "test.jsp")}),
> @Action(value="put", results={@Result(location = "test.jsp")})
> })
> public String execute() {
> yourName = "Hello " + yourName + " !";
> logger.debug("execute: " + yourName);
> return SUCCESS;
> }
>
> private static final long serialVersionUID = 1L;
> private String yourName;
> private static Logger logger = Logger.getLogger(**
> HelloWorldAction.class);
>
> }
>
>
> [2] (jsp)
> ------------------------------**------------------------------**
> ------------------------------**----------------------------
>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
>
> <html>
>
> <head>
> <sj:head/>
> </head>
>
> <body>
>
> <div id="formResult">
> <p>Echo : ${yourName}</p>
> </div>
>
> <s:form id="form" action="put">
> <s:textfield id="echo" name="yourName"/>
> </s:form>
>
> <sj:a
> id="ajaxformlink"
> formIds="form"
> targets="formResult"
> indicator="indicator"
> button="true"
> buttonIcon="ui-icon-gear"
> >
> Submit form here
> </sj:a>
>
> <img id="indicator" src="images/indicator.gif" alt="Loading..."
> style="display:none"/>
>
> </body>
>
> </html>
>
>
>
>
>
>
struts2-jquery-plugin: form submit returns twice the submit and textfield
Posted by Mounir Benzid <mb...@meetingmasters.de>.
Here's a simple enough example of how to use the <sj:a> tag available in
the struts2-jquery plugin (v 3.2.1)
http://www.weinfreund.de/struts2-jquery-showcase/index.action
Well what I get though is somehow mysterious (to me).
The first time when I call the action [1] given by its URL
http://localhost:8080/myApp/test/me
I get the correct server response, that is
- a line saying "Echo: Hello me!"
- underneath it a textfield containig the phrase "Hello me !"
- followed by a submit button
This is what it looks like:
Before: http://i40.tinypic.com/vf8782.jpg
Nice.
But after I submit the form the textfield and the submit button get
somehow mysteriously duplicated! (but not the "Echo:..." textline)
So there's still the initial textfield with the updated Hello +
whatever-you-typed-in phrase but yet another textfield and yet another
submit button.
The only difference I can tell between the initial and the duplicated
textfield is that the latter never gets a refresh.
It always contains the initial "Hello me !" phrase.
This is how it looks like after the submit:
After: http://i41.tinypic.com/2ji44j.jpg
Maybe someone can tell what I'm missing here.
Thanks!
[1] http://pastebin.com/Wq0Ek1H4 <http://pastebin.com/Wq0Ek1H4>(Action
class)
[2] http://pastebin.com/6yF2xwu4 (jsp)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[1] ACTION class
package xxx.actions.yyy;
import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@Namespace("/test")
public class HelloWorldAction extends ActionSupport {
public String getYourName() {return yourName; }
public void setYourName(String value) {this.yourName = value;}
@Actions({
@Action(value="{yourName}", results={@Result(location =
"test.jsp")}),
@Action(value="put", results={@Result(location = "test.jsp")})
})
public String execute() {
yourName = "Hello " + yourName + " !";
logger.debug("execute: " + yourName);
return SUCCESS;
}
private static final long serialVersionUID = 1L;
private String yourName;
private static Logger logger =
Logger.getLogger(HelloWorldAction.class);
}
[2] (jsp)
----------------------------------------------------------------------------------------------------------------------
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<html>
<head>
<sj:head/>
</head>
<body>
<div id="formResult">
<p>Echo : ${yourName}</p>
</div>
<s:form id="form" action="put">
<s:textfield id="echo" name="yourName"/>
</s:form>
<sj:a
id="ajaxformlink"
formIds="form"
targets="formResult"
indicator="indicator"
button="true"
buttonIcon="ui-icon-gear"
>
Submit form here
</sj:a>
<img id="indicator" src="images/indicator.gif" alt="Loading..."
style="display:none"/>
</body>
</html>
Re: Maven repository and struts2-jquery-plugin
Posted by Łukasz Lenart <lu...@googlemail.com>.
jQuery Plugin is available from Central
http://code.google.com/p/struts2-jquery/wiki/FAQ#How_can_I_use_the_Plugin_from_Maven?
Regards
--
Łukasz
Mobile +48 606 323 122
Office +27 11 0838747
http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org