سؤال

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