This Domain(Admin5.com) is for Sale:

Velocity 的应用示例

时间:2007-10-22  来源:不详  作者:林子

{

ps.setString(index, (String) parameter);

}

else

{

ps.setObject(index, parameter);

}

}

catch (Exception e)

{

//Utilities.debugPrintln(e.getMessage());

e.printStackTrace();

}

}

public static void closeDbConnection(java.sql.Connection con)

{

try

{

con.close();

}

catch (Exception e)

{

Utilities.debugPrintln(e.getMessage());

}

}

public static String getResultPage(String title, String message, String jumpLink,VelocityServlet servlet, HttpServletRequest request,HttpServletResponse response, Context context)

{

Template template = null;

context.put("MessageTitle", title);

context.put("ResultMessage", message);

context.put("JumpLink", jumpLink);

try

{

template = servlet.getTemplate("/templates/Message.htm");

StringWriter sw = new StringWriter();

template.merge(context, sw);

return sw.toString();

}

catch (Exception ex)

{

看完这篇,您有何感觉呢?

文章评论

共有位Admini5网友发表了评论 查看完整内容

24小时热门信息