J
JavaQueries
hi
i m unable to fugure out y I m getting this error
it's a suggestion page and on submitting this page I have to reload
the page but with status of the page (requires approval) in form of
url
earlier say few days back , it was working fine , i had absolutely no
issues in this
since 2-3 days everytime i submit the page , i m getting the error
Error 500: ERROR: Cannot forward. Writer or Stream already obtained.
Error 500
my code is listed below
pls help
<%@ include file="../includes/sessionChecker.jsp"%>
<%@ page isThreadSafe="false" errorPage="../html/messError.jsp" %>
<%@ page import="java.io.*,java.util.*,java.sql.*" %>
<%@ page import="com.syntaxsoft.util.*" %>
<%@ page import="com.syntaxsoft.util.DateUtil" %>
<%@ page import="com.syntaxsoft.admin.*" %>
<%@ page import="com.syntaxsoft.employee.*" %>
<%@ page import="com.syntaxsoft.db.*" %>
<%@ include file="../includes/cssJsInclude.jsp"%>
<%@ taglib uri="QuinnoxTags" prefix="QuinnoxTags" %>
<html>
<head>
<title>Suggestions</title>
<meta http-equiv="Content-Type" content="xls/html;
charset=iso-8859-1">
<link href="../STYLESHEET/stylesheet.css" rel="stylesheet"
type="text/css">
</head>
<body>
<%!
Table sqltab;
SqlBuilder sqlObj;
%>
<%
String dofc = "",subject="",suggestion = "",docsrno="",actions="";
String pick_button = "",locateid = "",employid="",url="";
String employeeid="";
String tabname=" ";
boolean success = false;
ResultSet rs= null;
%>
<%
employid = (String) session.getAttribute("empid");
locateid = (String) session.getAttribute("locationid");
Employee empobj = Employee.getEmployee(employid);
DateUtil dateform = new DateUtil(locateid);
actions = request.getParameter("actions");
pick_button = request.getParameter("DECISION");
System.out.println("ACTION"+actions);
System.out.println("pick_button"+pick_button);
%>
<body>
<%
if(actions.equals("create")){
if(pick_button == null){
%>
<form name="form1" method="post" action="../HRFiles/Suggestions.jsp">
<input type="hidden" name="actions" value="<%=actions%>">
<div class="page_heading">Suggestion Box</div><br>
<table>
<tr><th>From:</th><td><%=empobj.getFullName()%>&l t;/td></tr>
<tr><th>Dated:</th><td><%=dateform.getToday()%>&l t;/td></tr>
<tr><th>Subject</th><td><QuinnoxTags:TextBox type="text"
name="subject" maxLength="65" required="true" value=" "
label="Subject"/></td></tr>
<tr><th colspan="2">Suggestion:</th></tr>
<tr><td colspan="2"><QuinnoxTags:TextBox name="suggestion"
type="textarea" cols="60" rows="13" required="true" value=" "
label="Suggestion" maxLength="250"/></td></tr>
</table><br>
<table>
<tr>
<td align="right">
<input type="submit" name="DECISION" value="Submit" class="button">
</td>
</tr>
</table>
<input type="hidden" name="empid" value="<%=employid%>"
<jsp:include page="../masters/flow.jsp" flush="true">
<jsparam name="CREATOR" value="true"/>
<jsparam name="TABNAME" value="SUGGESTION_WKFLOW"/>
</jsp:include>
<!-- <table>
<tr><td align="right"><input type="submit" name="submit"
value="Submit" class='button'></td></tr>
</table>-->
</form>
<%
}
else{
dofc = dateform.getTodayMillis()+"";
subject = request.getParameter("subject");
suggestion = request.getParameter("suggestion");
tabname =request.getParameter("TABNAME");
// insert into SUGGESTIONS
// generate key
IDs idObj = IDs.getIDs();
docsrno = idObj.getId("SUGGESTIONID");
sqlObj=new SqlBuilder("SUGGESTIONS");
sqlObj.setColumn("DOCSLNO",docsrno);
sqlObj.setColumn("EMPID",employid);
sqlObj.setColumn("DOFC",dofc);
sqlObj.setColumn("DOFCZONE",locateid);
sqlObj.setColumn("SUBJECT",tabname);
sqlObj.setColumn("SUGGESTION",suggestion);
// System.out.println("empid is "+request.getParameter("empid"));
System.out.println("empid is "+employid);
success = sqlObj.set(SqlBuilder.INSERT);
%>
<jsp:include page="../masters/flow1.jsp" flush="true">
<jsparam name="DECISION"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.DECISION)%>"
/>
<jsparam name="empid" value="<%=request.getParameter(\"empid\")%>"
/>
<jsparam name="VIEWLEVEL"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.VIEWLEVEL)%>
" />
<jsparam name="VIEWERID"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.VIEWERID)%>"
/>
<jsparam name="COMMENTS"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.COMMENTS)%>"
/>
<jsparam name="DOCSLNO" value="<%=docsrno%>"/>
<jsparam name="CREATOR" value="true"/>
<jsparam name="TABNAME"
value="<%=request.getParameter(\"TABNAME\")%>" />
<jsparam name="MASTER_TABLE" value="SUGGESTIONS" />
</jsp:include>
<jsp:include page="../includes/redirectInclude.jsp" flush="true">
<jsparam name="url"
value="../HRFiles/ViewSuggestion.jsp?flag=empview" />
</jsp:include>
<%
} // end of if(pick_button == null)
} // end of if(actions == create)
if(actions.equals("select")){
rs = sqltab.select("select * from SUGGESTIONS");
if(rs.next()){
%>
<div class="page_heading">List of Suggestions</div><br>
<table>
<tr>
<th>Employee Id</th>
<th>Employee Name</th>
<th>Suggestion Date</th>
<th>Subject</th>
</tr>
<%
do{
docsrno = rs.getString("DOCSLNO");
employeeid = rs.getString("EMPID");
dofc = rs.getString("DOFC");
subject = rs.getString("SUBJECT");
Employee empobj1 = Employee.getEmployee(employeeid);
url = "../HRFiles/Suggestions.jsp?actions=view&docsrno="+docsrno;
%>
<tr>
<td><a href="<%=url%>"><%=employeeid%></a></td>
<td><a href="<%=url%>"><%=empobj1.getFullName()%></a></td>
<td><a href="<%=url%>"><%=dateform.getDate(dofc)%></a></td>
<td><a href="<%=url%>"><%=subject%></a></td>
</tr>
<%
}while(rs.next());
} // end of if
} // end of if(actions == select)
if(actions.equals("view")){
docsrno = request.getParameter("docsrno");
rs = sqltab.select("select * from SUGGESTIONS where
DOCSLNO='"+docsrno+"'");
if(rs.next()){
do{
docsrno = rs.getString("DOCSLNO");
employeeid = rs.getString("EMPID");
dofc = rs.getString("DOFC");
subject = rs.getString("SUBJECT");
suggestion = rs.getString("SUGGESTION");
}while(rs.next());
} // end of if()
Employee empobj2 = Employee.getEmployee(employeeid);
%>
<div class="page_heading">Suggestion Box</div><br>
<table>
<tr><th>From:</th><td><%=empobj2.getFullName()%>& lt;/td></tr>
<tr><th>Dated:</th><td><%=dateform.getDate(dofc)%> ;</td></tr>
<tr><th>Subject</th><td><%=subject%></td>&l t;/tr>
<tr><th colspan="2">Suggestion:</th></tr>
<tr><td colspan="2"><textarea name="suggestion" cols="70" rows="10"
readonly><%=suggestion%></textarea></td></tr>
</table><br>
<table>
<tr><td colspan="4" align="right"><a
href="javascript:history.back()">Back</a></td></tr>
</table>
<%
} // end of if(actions == view)
%>
</body>
</html>
rgds
i m unable to fugure out y I m getting this error
it's a suggestion page and on submitting this page I have to reload
the page but with status of the page (requires approval) in form of
url
earlier say few days back , it was working fine , i had absolutely no
issues in this
since 2-3 days everytime i submit the page , i m getting the error
Error 500: ERROR: Cannot forward. Writer or Stream already obtained.
Error 500
my code is listed below
pls help
<%@ include file="../includes/sessionChecker.jsp"%>
<%@ page isThreadSafe="false" errorPage="../html/messError.jsp" %>
<%@ page import="java.io.*,java.util.*,java.sql.*" %>
<%@ page import="com.syntaxsoft.util.*" %>
<%@ page import="com.syntaxsoft.util.DateUtil" %>
<%@ page import="com.syntaxsoft.admin.*" %>
<%@ page import="com.syntaxsoft.employee.*" %>
<%@ page import="com.syntaxsoft.db.*" %>
<%@ include file="../includes/cssJsInclude.jsp"%>
<%@ taglib uri="QuinnoxTags" prefix="QuinnoxTags" %>
<html>
<head>
<title>Suggestions</title>
<meta http-equiv="Content-Type" content="xls/html;
charset=iso-8859-1">
<link href="../STYLESHEET/stylesheet.css" rel="stylesheet"
type="text/css">
</head>
<body>
<%!
Table sqltab;
SqlBuilder sqlObj;
%>
<%
String dofc = "",subject="",suggestion = "",docsrno="",actions="";
String pick_button = "",locateid = "",employid="",url="";
String employeeid="";
String tabname=" ";
boolean success = false;
ResultSet rs= null;
%>
<%
employid = (String) session.getAttribute("empid");
locateid = (String) session.getAttribute("locationid");
Employee empobj = Employee.getEmployee(employid);
DateUtil dateform = new DateUtil(locateid);
actions = request.getParameter("actions");
pick_button = request.getParameter("DECISION");
System.out.println("ACTION"+actions);
System.out.println("pick_button"+pick_button);
%>
<body>
<%
if(actions.equals("create")){
if(pick_button == null){
%>
<form name="form1" method="post" action="../HRFiles/Suggestions.jsp">
<input type="hidden" name="actions" value="<%=actions%>">
<div class="page_heading">Suggestion Box</div><br>
<table>
<tr><th>From:</th><td><%=empobj.getFullName()%>&l t;/td></tr>
<tr><th>Dated:</th><td><%=dateform.getToday()%>&l t;/td></tr>
<tr><th>Subject</th><td><QuinnoxTags:TextBox type="text"
name="subject" maxLength="65" required="true" value=" "
label="Subject"/></td></tr>
<tr><th colspan="2">Suggestion:</th></tr>
<tr><td colspan="2"><QuinnoxTags:TextBox name="suggestion"
type="textarea" cols="60" rows="13" required="true" value=" "
label="Suggestion" maxLength="250"/></td></tr>
</table><br>
<table>
<tr>
<td align="right">
<input type="submit" name="DECISION" value="Submit" class="button">
</td>
</tr>
</table>
<input type="hidden" name="empid" value="<%=employid%>"
<jsp:include page="../masters/flow.jsp" flush="true">
<jsparam name="CREATOR" value="true"/>
<jsparam name="TABNAME" value="SUGGESTION_WKFLOW"/>
</jsp:include>
<!-- <table>
<tr><td align="right"><input type="submit" name="submit"
value="Submit" class='button'></td></tr>
</table>-->
</form>
<%
}
else{
dofc = dateform.getTodayMillis()+"";
subject = request.getParameter("subject");
suggestion = request.getParameter("suggestion");
tabname =request.getParameter("TABNAME");
// insert into SUGGESTIONS
// generate key
IDs idObj = IDs.getIDs();
docsrno = idObj.getId("SUGGESTIONID");
sqlObj=new SqlBuilder("SUGGESTIONS");
sqlObj.setColumn("DOCSLNO",docsrno);
sqlObj.setColumn("EMPID",employid);
sqlObj.setColumn("DOFC",dofc);
sqlObj.setColumn("DOFCZONE",locateid);
sqlObj.setColumn("SUBJECT",tabname);
sqlObj.setColumn("SUGGESTION",suggestion);
// System.out.println("empid is "+request.getParameter("empid"));
System.out.println("empid is "+employid);
success = sqlObj.set(SqlBuilder.INSERT);
%>
<jsp:include page="../masters/flow1.jsp" flush="true">
<jsparam name="DECISION"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.DECISION)%>"
/>
<jsparam name="empid" value="<%=request.getParameter(\"empid\")%>"
/>
<jsparam name="VIEWLEVEL"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.VIEWLEVEL)%>
" />
<jsparam name="VIEWERID"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.VIEWERID)%>"
/>
<jsparam name="COMMENTS"
value="<%=request.getParameter(com.syntaxsoft.admin.WorkFlow.COMMENTS)%>"
/>
<jsparam name="DOCSLNO" value="<%=docsrno%>"/>
<jsparam name="CREATOR" value="true"/>
<jsparam name="TABNAME"
value="<%=request.getParameter(\"TABNAME\")%>" />
<jsparam name="MASTER_TABLE" value="SUGGESTIONS" />
</jsp:include>
<jsp:include page="../includes/redirectInclude.jsp" flush="true">
<jsparam name="url"
value="../HRFiles/ViewSuggestion.jsp?flag=empview" />
</jsp:include>
<%
} // end of if(pick_button == null)
} // end of if(actions == create)
if(actions.equals("select")){
rs = sqltab.select("select * from SUGGESTIONS");
if(rs.next()){
%>
<div class="page_heading">List of Suggestions</div><br>
<table>
<tr>
<th>Employee Id</th>
<th>Employee Name</th>
<th>Suggestion Date</th>
<th>Subject</th>
</tr>
<%
do{
docsrno = rs.getString("DOCSLNO");
employeeid = rs.getString("EMPID");
dofc = rs.getString("DOFC");
subject = rs.getString("SUBJECT");
Employee empobj1 = Employee.getEmployee(employeeid);
url = "../HRFiles/Suggestions.jsp?actions=view&docsrno="+docsrno;
%>
<tr>
<td><a href="<%=url%>"><%=employeeid%></a></td>
<td><a href="<%=url%>"><%=empobj1.getFullName()%></a></td>
<td><a href="<%=url%>"><%=dateform.getDate(dofc)%></a></td>
<td><a href="<%=url%>"><%=subject%></a></td>
</tr>
<%
}while(rs.next());
} // end of if
} // end of if(actions == select)
if(actions.equals("view")){
docsrno = request.getParameter("docsrno");
rs = sqltab.select("select * from SUGGESTIONS where
DOCSLNO='"+docsrno+"'");
if(rs.next()){
do{
docsrno = rs.getString("DOCSLNO");
employeeid = rs.getString("EMPID");
dofc = rs.getString("DOFC");
subject = rs.getString("SUBJECT");
suggestion = rs.getString("SUGGESTION");
}while(rs.next());
} // end of if()
Employee empobj2 = Employee.getEmployee(employeeid);
%>
<div class="page_heading">Suggestion Box</div><br>
<table>
<tr><th>From:</th><td><%=empobj2.getFullName()%>& lt;/td></tr>
<tr><th>Dated:</th><td><%=dateform.getDate(dofc)%> ;</td></tr>
<tr><th>Subject</th><td><%=subject%></td>&l t;/tr>
<tr><th colspan="2">Suggestion:</th></tr>
<tr><td colspan="2"><textarea name="suggestion" cols="70" rows="10"
readonly><%=suggestion%></textarea></td></tr>
</table><br>
<table>
<tr><td colspan="4" align="right"><a
href="javascript:history.back()">Back</a></td></tr>
</table>
<%
} // end of if(actions == view)
%>
</body>
</html>
rgds