LogsController.java from Kneobase at Krugle
Show LogsController.java syntax highlighted
/*
* Created on 30/06/2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.kneobase.web.logs;
import java.io.File;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;
/**
* @author gustavo
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class LogsController extends AbstractCommandController {
/* (non-Javadoc)
* @see org.springframework.web.servlet.mvc.AbstractCommandController#handle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)
*/
protected ModelAndView handle(
HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors)
throws Exception {
LogsCommand logsCommand = (LogsCommand) command;
String contextRelativePath = "/kneobase-logs/sources/"+logsCommand.robot+".txt";
String filePath = request.getSession().getServletContext().getRealPath(contextRelativePath);
File file = new File(filePath);
logsCommand.setExists(file.exists());
logsCommand.setIncludeFile(request.getContextPath()+contextRelativePath);
Map model = errors.getModel();
return new ModelAndView("logs", model );
}
}
See more files for this project here
Kneobase is an enterprise search engine, based upon the Lucene search engine and the Spring framework. It allows to perform full-text search across many different content sources. It is highly adaptable out-of-the-box and has a pluggable architecture.
Project homepage:
http://sourceforge.net/projects/kneobase
Programming language(s): Java,XML
License: other
LogsCommand.java
LogsController.java