日期:2014-05-20 浏览次数:20941 次
<allow> <create javascript="CheckCallerNbr" creator="spring"> <param name="class" value="com.seaway.sh.service.TermManager" /> <param name="beanName" value="termManager" /> </create> </allow>
public class TermManagerImpl extends GenericManagerImpl<Term, String> implements TermManager { TermDao termDao; public TermManagerImpl(TermDao termDao) { super(termDao); this.termDao = termDao; } public String checkCallerNbr(String callerNbr) { System.out.println("checkCallerNbr method is execute!"); System.out.println("callerNbr is : " + callerNbr); return "Hello ," + callerNbr; } }
<head> <title><fmt:message key="termDetail.title" /> </title> <meta name="heading" content="<fmt:message key='termDetail.heading'/>" /> <script src="<c:url value='/dwr/engine.js' />" type="text/javascript"></script> <script src="<c:url value='/dwr/util.js' />" type="text/javascript"></script> <script src="<c:url value='/dwr/interface/CheckCallerNbr.js' />" type="text/javascript"></script> <script src="<c:url value='/scripts/hello.js' />" type="text/javascript"></script> </head> <input type="button" onclick="hello();" value="Hello"> <div id="msg"></div>
function hello() { CheckCallerNbr.checkCallerNbr("spring",callback); } function callback(data) { alert(data); DWRUtil.setValue('msg',data); }