<!-- ireport --> <servlet> <servlet-name>DisplayChart</servlet-name> <servlet-class>org.jfree.chart.servlet.DisplayChart</servlet-class> </servlet> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>JasperServlet</servlet-name> <servlet-class>com.jasper.JasperServlet</servlet-class> </servlet>
dwr.xml(与web.xml同级) <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN" "http://www.getahead.ltd.uk/dwr/dwr10.dtd"> <dwr> <allow> <create creator="new" javascript="testDwrService"> <param name="class" value="com.dwr.TestDwrService" /> </create> </allow> </dwr>
dwr service /** * TestDwrService.java * com.dwr * * Function: TODO * * ver date author * ────────────────────────────────── * Jun 9, 2010 程仁银 * * Copyright (c) 2010, All Rights Reserved. */
package com.dwr;
/** * ClassName:TestDwrService * Project: * Company: LINKAGE * * @author 程仁银 * @version * @since Ver 1.1 * @Date Jun 9, 2010 2:06:14 PM * * @see */ public class TestDwrService { /**
* 验证用户名 * @param username 用户名 * @return 验证后的信息 */
public String checkUsername(String username) { //要返回的验证后的信息 String flag = ""; //这里可以改为调用数据库验证,原理都是一样的, if (username.equals("cry")) { flag = "用户名可用"; } else { flag = "用户名不存在"; } return flag; } }
[code="java"]web.xml DisplayChart org.jfree.chart.servlet.DisplayChart This is the description of my J2EE component This is the display name of my J2EE comp...