/* * CoreActions.java * * Created on 6. April 2007, 13:53 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package jet.examples; import java.io.IOException; import javax.servlet.ServletException; import jet.servlet.action.JetActionException; import jet.servlet.JetContext; import jet.servlet.JetData; /** * * @author mmeiste10.1 */ public class LoginActions { public void home( JetContext context, JetData data )throws IOException{ try{ context.render( data, "jet/ftl/examples/pages/login/home.ftl" ); }catch(JetActionException e){ context.getResponse().sendRedirect(context.getContextPath() + data.get("servlet.initparameters.errorpage").toString() ); } } public void error( JetContext context, JetData data )throws IOException, ServletException{ try{ context.render( data, "jet/ftl/examples/login/error.ftl" ); }catch(JetActionException e){ throw new ServletException(e); } } public void logout( JetContext context, JetData data )throws IOException, ServletException{ try{ context.getRequest().getSession().invalidate(); context.render( data, "jet/ftl/examples/pages/login/logout.ftl" ); }catch(JetActionException e){ throw new ServletException(e); } } }