我自己的MVC框架DWF的范例包。用实际的例子说明了如何使用我的DWF框架来开发网站。
源代码在线查看: vcommand.java
package dark.web.frame.example.littleo.command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dark.web.frame.velocity.VelocityCommand;
import org.apache.velocity.Template;
import org.apache.velocity.context.Context;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2004
* Company: DIS
* Create Time: 2005-2-28 17:39:54
* @author darkhe
* @version 1.0
*/
public class VCommand extends VelocityCommand
{
/**
* @param arg0
* @param arg1
* @param arg2
* @return
* @throws java.lang.Exception
* @see dark.web.frame.velocity.VelocityCommand#process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.velocity.context.Context)
*/
public Template process(
HttpServletRequest request,
HttpServletResponse response,
Context context)
throws Exception
{
context.put("hello", "hello, my love");
Template t = getTemplate("v.vm");
if( t == null )
{
log.info("Template is null");
}
else
{
log.info("Template is " + t);
}
return t;
}
}