Use the struts div labels Ajax generated form cannot be submitted data, online e

I use the struts div labels to achieve Ajax submission page.
The main page div.jsp as follows:
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Enter first and last name</title>
<s:head theme="ajax" debug="false" />
</head>
<body>


<!-- -- URL pages to display>
<s:url id="news" action="divNews" />
<s:div id="divNews" theme="ajax" href="%{news}" showLoadingText="false" />
</body>
</html>


URL triggered action DivNewsAction.java as follows:
import java.util.ArrayList;
import java.util.List;

import org.apache.struts2.config.Result;
import org.apache.struts2.config.Results;

import com.opensymphony.xwork2.ActionSupport;

@Results(value = { @Result(name = "input", value = "/divNews.jsp") })
public class DivNewsAction extends ActionSupport {

	private static final long serialVersionUID = 6560408661223488775L;

	private static String[] ALL_NEWS = { "China will host the 2008 Olympic Games, the opening date of August 8, 2008",
			"The water cube, another Olympic building the bird's Nest stadium recently completed "," Chang'e lunar satellite successfully launched "," Shenzhou six spacecraft victory.",
			"Chinese A share stock market oversold bounce", };

	private String key;

	private List<String> news = new ArrayList<String>();

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String execute() {

		if (key == null)
			key = "";

		for (String n : ALL_NEWS) {
			if (n.contains(key)) {
				news.add(n);
			}
		}

		return INPUT;
	}

	public List<String> getNews() {
		return news;
	}

	public void setNews(List<String> news) {
		this.news = news;
	}

}


Action executes generated page divNews.jap as follows:
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Enter first and last name</title>
<s:head theme="ajax" debug="false" />
<style type="text/css">
div,body,td {
	font-size: 12px;
}
</style>
</head>
<body>
<%
Thread.sleep(1000);
%>
<div style="padding: 10px; width: 350px; background-color: #E5E5E5;">

	<s:iterator value="news">
		<s:property /> <br/>
	</s:iterator>

        <s:url id="news2" action="divNews" />
	
	<!Ajax queries of the form:>
	<s:form name="newsActionForm" id="newsActionForm">
		<s:textfield name="key" label="Key word" />
		<s:submit value="Press inquiries" href="%{news2}" formId="newsActionForm"
			theme="ajax" targets="divNews" />
	</s:form>

</body>
</html>


Then I used the generated form textfield input characters, according to press inquiries found textfield characters that have not submitted to the key attribute in the action; but I have theme= "Ajax" attribute is removed in s:submit can be submitted. The problem is I have to use ajax, may I ask how to solve?
,

Started by Alston at November 07, 2016 - 1:39 PM

Examination of the client source code framework JS is sent to the client not together.. You'd better move to the Java forums, the and Java configuration.

Posted by Augustine at November 19, 2016 - 2:29 PM

There is no report any errors.?

Posted by Karen at December 02, 2016 - 3:18 PM