<%@ include file="checks.jsp" %>
<%
	int parentID = request.getParameter("parent") == null ? 0 : Integer.parseInt(request.getParameter("parent"));
	if(request.getParameter("subject") != null)
		newsSession.addNews(parentID, new java.util.Date(), request.getParameter("subject"), request.getParameter("content"));
%>

<% if(parentID != 0) { %>
<jsp:forward page="newsdetail.jsp">
	<jsp:param name="id" value="<%=parentID%>" />
</jsp:forward>
<% } else { %>
<jsp:forward page="news.jsp" />
<% } %>
