$BlogRSDURL$>
#
# DWR - https://dwr.dev.java.net/ (Direct Web Remoting)
#
dwr.version=1.0
dwr.dir=${lib.dir}/dwr-${dwr.version}
dwr.jar=${dwr.dir}/dwr.jar
<!-- Web -->
<path id="web.compile.classpath">
...
<pathelement location="${dwr.jar}"/>
</path>
<target name="package-web" depends="compile-web,jsp-2" description="Package WAR">
...
<war destfile="${webapp.dist}/${webapp.war}"
webxml="${webapp.target}/WEB-INF/web.xml" compress="true">
...
<lib file="${dwr.jar}"/>
</war>
</target>
<!-- dwr servlet -->
<servlet>
<servlet-name>dwr-invoker</servlet-name>
<display-name>DWR Servlet</display-name>
<servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<!-- dwr mapping -->
<servlet-mapping>
<servlet-name>dwr-invoker</servlet-name>
<url-pattern>/dwr/*</url-pattern>
</servlet-mapping>
<excludes>
<pattern>/dwr/*</pattern>
</excludes>
<dwr>
<allow>
<convert converter="bean" match="com.octasoft.fp.*"/>
<create creator="spring" javascript="userManager">
<param name="beanName" value="userManager"/>
<include method="getUser"/>
<include method="getUsers"/>
</create>
</allow>
</dwr>
<script src="/appfuse/dwr/engine.js" type="text/javascript"></script>
<script src="/appfuse/dwr/util.js" type="text/javascript"></script>
<script src="/appfuse/dwr/interface/userManager.js" type="text/javascript"></script>
<script>
DWREngine.setErrorHandler(doNothing);
var nickname = "";
function doNothing() {
return false;
}
function getNickname() {
if (nickname == "") {
userManager.getUser(popUser,document.loginForm.j_username.value);
document.loginForm.j_password.focus();
return false;
} else {
return validateForm( document.loginForm, false, true, true, false, 1)
}
}
var popUser = function(user) {
if (user == undefined) {
return false;
} else {
DWRUtil.setValue("nick", "Hello, " + user.nickName);
nickname = user.nickName;
}
}
</script>
<form method="post" name="loginForm" id="loginForm"
action="<c:url value="/authorize"/>" onsubmit="return getNickname();">
<div id="nick"></div>
<input name="j_username" type="text" id="j_username"/>
<input name="j_password" type="password" id="j_password"/>
</form>
<< Home