I am new to jsp,when I try to invoke a jsp page by some parameters named cId and passWord,I getting this error,The code I have been trying is given below,I have already gone through the same error which have been seen by googling,but still I am getting the same issue. The code is:
<body>
<%
String cidMessage = "cID";
String passEncrypted = "passWord";
System.out.println("CID ISSSSSSSSSSSS"+cId);
if ((cId.equals(cidMessage)) && (passWord.equals(passEncrypted))) {
System.out.println("Validation Correct"+cId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String time = sdf.format(date.getTime());
String xmlOutput = "<smsreport>"
+ "<date>" + time + "</date>"
+ "<result>" + "SUCESS" + "</result>"
+ "<msgid>" + currentTimeMillis() + "</msgid>"
+ "<msgparts>" + "1" + "</msgparts>"
+ "</smsreport>";
try {
byte[] contents = xmlOutput.getBytes();
response.setContentType("text/xml");
response.setContentLength(contents.length);
response.getOutputStream().write(contents);
response.getOutputStream().flush();
} catch (Exception e) {
throw new ServletException(e);
}
} else {
System.out.println("Validation Wrong"+cId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
String time = sdf.format(date.getTime());
String xmlOutput = "<smsreport>"
+ "<date>" + time + "</date>"
+ "<result>ERROR</result>"
+ "<msgid>" + "ErrorCode" + "</msgid>"
+ "<msgparts>" + "ErrorMessage" + "</msgparts>"
+ "</smsreport>";
try {
byte[] contents = xmlOutput.getBytes();
response.setContentType("text/xml");
response.setContentLength(contents.length);
response.getOutputStream().write(contents);
response.getOutputStream().flush();
} catch (Exception e) {
throw new ServletException(e);
}
}
%>
</body>