문제

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