Javascript 无刷新页面的portlet jsp自动提交表单
在jsp页面中,我有以下表单:Javascript 无刷新页面的portlet jsp自动提交表单,javascript,jsp,portlet,Javascript,Jsp,Portlet,在jsp页面中,我有以下表单: <form name ="form1" id="form1" method="post" action=portlet:actionURL name=acao input type="text" name="data" id="2"> 我正在使用document.getElementById(“1”).submit();要自动提交表单,但它会自动刷新所有页面,但我的目的是在不刷新所有页面的情况下自动提交。在提交时,您需要进行Ajax调用,并在port
<form name ="form1" id="form1" method="post" action=portlet:actionURL name=acao
input type="text" name="data" id="2">
我正在使用document.getElementById(“1”).submit();要自动提交表单,但它会自动刷新所有页面,但我的目的是在不刷新所有页面的情况下自动提交。在提交时,您需要进行Ajax调用,并在portlet类中覆盖ServerSource 在jsp或java脚本中,您可以通过以下方式获取资源url
<portlet:resourceURL var="resourceURL">
</portlet:resourceURL>
<portlet:resourceURL var="resourceURL">
</portlet:resourceURL>
@Override
public void serveResource(ResourceRequest resourceRequest,
ResourceResponse resourceResponse) throws IOException,
PortletException {
// do your stuff here
}