|
|
|
@ -32,13 +32,33 @@ public class NewsServlet extends HttpServlet
|
|
|
|
new Field( "( SELECT MAX( id ) FROM not_noticias )" ) ) );
|
|
|
|
new Field( "( SELECT MAX( id ) FROM not_noticias )" ) ) );
|
|
|
|
|
|
|
|
|
|
|
|
private SQLExecuter executer = null;
|
|
|
|
private SQLExecuter executer = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static boolean velocityInit = false;
|
|
|
|
|
|
|
|
|
|
|
|
public void init()
|
|
|
|
public void init()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if( !velocityInit )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
String TEMPLATE_DIR = this.getServletContext().getRealPath( "/" ) + "html/";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
|
|
|
props.setProperty( "file.resource.loader.path", TEMPLATE_DIR );
|
|
|
|
|
|
|
|
Velocity.init( props );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch( Exception ex )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
velocityInit = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( DBM != null )
|
|
|
|
if( DBM != null )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DBM = new JDBCManager( bdUrl + "?prepareThreshold=1",
|
|
|
|
DBM = new JDBCManager( bdUrl + "?prepareThreshold=1",
|
|
|
|
|