浏览 1443 次
锁定老帖子 主题:dwr的问题
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2008-08-04
<bean id="loginTarget" class="com.ssh.service.impl.LoginServiceImpl"> <property name="sshUserMainDAO"> <ref bean="sshUserMainDAO" /> </property> </bean> dwr 配置文件: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd"> <dwr> <allow> <create creator="spring" javascript="lo"> <param name="beanName" value="loginTarget" /> <param name="location" value="applicationContext-Spring.xml" /> <include method="dwr" /> </create> </allow> </dwr> 我的类中 public String dwr(String u){ return u+"OK"; } jsp中: <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <%@ page isELIgnored="false"%> <%@taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>首页</title> <script type='text/javascript' src='dwr/interface/lo.js'></script> <script type='text/javascript' src='dwr/engine.js'></script> <script type='text/javascript' src='dwr/util.js'></script> <script type="javascript"> function ch(){ lo.dwr('hi',cpa); } function cpa(){ alert(data); } </script> </head> <body> <input type="button" id="del" value="del" onclick="ch()"> </body> </html> 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |