<%@ page import="java.sql.*" %> <% Connection con = null; String mainstoryId = ""; String storyOrder = ""; String mainstoryLayout = ""; String storyDisplay = ""; String storyHeadline = ""; String mainstoryDate = ""; try { String event = request.getParameter("event"); if(event != null) event = event; else event = event; con = GDBC.doConnect(); if(con != null) { mainstoryId = NewsStory.getmainStoryId(con); System.out.println("got the main story Id at testindex.jsp"+mainstoryId); mainstoryLayout = NewsStory.getstoryLayout(con,mainstoryId); System.out.println("got the main story Layout at testindex.jsp"+mainstoryLayout); storyDisplay = mainstoryLayout; mainstoryDate = NewsStory.getstoryDate(con,mainstoryId); System.out.println("got the main story Date at testindex.jsp"+mainstoryDate); session.setAttribute("MainStoryId",mainstoryId); session.setAttribute("MainStoryDate",mainstoryDate); }else { %> Problem in getting connetion from database <% } %> Garlic-The stinky newspaper
<% if(storyDisplay.equalsIgnoreCase("LAYOUT1")) { %> <% }else if(storyDisplay.equalsIgnoreCase("LAYOUT2")) { %> <% }else if(storyDisplay.equalsIgnoreCase("LAYOUT3")) { %> <% }else if(storyDisplay.equalsIgnoreCase("LAYOUT4")) { %> <%}%> <% }catch(Exception ex) { ex.printStackTrace(); System.out.println("Problem occured while loading jsp"+ex); %> Problem Occured : "<%=ex%>" <% }finally { con = GDBC.closeConnect(con); } %>