In a jsp page I have this form:

<form name ="form1" id="form1" method="post" action=portlet:actionURL name=acao
input type="text" name="data" id="2">

and I use this to fil the form with data:

document.getElementById("2").value= lonlat;

I'm using document.getElementById("1").submit(); to auto submit the form but it auto refresh all the page but my intent is to auto submit without refreshing all the page.

有帮助吗?

解决方案

on submit you need to make Ajax call and in portlet class override the serveResource

In jsp or java script you can get resource url as

<portlet:resourceURL var="resourceURL">  
 </portlet:resourceURL> 

serveResource() method

@Override  
          public void serveResource(ResourceRequest resourceRequest,  
                    ResourceResponse resourceResponse) throws IOException,  
                    PortletException {  


     // do your stuff here

     }
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top