开发者

Struts 2.2.3 dojo form submit

I'm trying to implement a form submission using ajax in struts 2.2.3. I imported dojo plugin library to ma project and this is how my jsp looks like.

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <sx:head/>
</head>
<body>
<div class="container" id="container">
<jsp:include page="menu.jsp" />
<s:actionerror/>
    <s:form action="Login" method="post">
         <s:textfield name="username" label="User Name"/>
         <s:password name="password" label="Password"/>
         <s:submit type="submit" align="right" />
    </s:form>
</div>
</body>
</html>

I know there is nothing using "sx" here. Right now the jsp works fine with refreshing the page. I want data to be sent using ajax (without refreshing the page). What should i modified to achieve that? It would be really helpful if anyone c开发者_JS百科an provide me a link to an example or a tutorial which shows struts2 with ajax FORM SUBMIT.


using sx:submit instead of s:submit

<s:form action="Login" method="post" id="form1">
     <s:textfield name="username" label="User Name"/>
     <s:password name="password" label="Password"/>
     <sx:submit align="right" targets="form1" />
</s:form>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜