My task is to give an existing JSP site a fresh look and feel.
However, I'm facing an issue where my CSS is interfering with the functionality of JSP - which seems quite strange to me.
Essentially, there's a line of code in the JSP that redirects the page once a form is submitted.
String redirectUrl = "Absolute path to next page"
response.sendRedirect(redirectUrl);
During development, I'm embedding my CSS inline in the page head. When I do this, the sendRedirect doesn't function properly. Upon checking the page source, I noticed that the page only partially loads and stops halfway through my CSS. (regardless of the CSS content)
However, when I move my CSS to external files (as it will ultimately be), the sendRedirect works as expected.
The only explanation I can come up with is that JSP may have a limit on the number of lines of code it can handle, and my CSS might be causing the page to bloat beyond its capacity. Could this be the reason?
If not, what other factors could be causing this issue?
Edit -- HERE IS MY CODE
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-GB">
<head>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
<meta charset="utf-8" /><%@include file="/WEB-INF/ss_layout_head_info.jsp"%>
<%=serverbean.evalResInc("internet_2.0_opening_head_content")%>
<%-- Instantiate the form validation bean and supply the error message map --%>
<%@ page import="company.forms.FeedbackFormBean" %>
<%@ page import="java.util.*" %>
<%
java.util.Map errorMap = new java.util.HashMap();;
errorMap.put(FeedbackFormBean.ERR_FULLNAME_ENTER, serverbean.evalIdcScp("langRef(#active.ssLanguage, \"ww2SpecifyFullName\")"));
errorMap.put(FeedbackFormBean.ERR_EMAIL_ENTER, serverbean.evalIdcScp("langRef(#active.ssLanguage, \"ww2SpecifyEmailAddress\")"));
errorMap.put(FeedbackFormBean.ERR_EMAIL_INVALID, serverbean.evalIdcScp("langRef(#active.ssLanguage, \"ww2EmailAddressNotValid\")"));
errorMap.put(FeedbackFormBean.ERR_COMMENTS_ENTER, serverbean.evalIdcScp("langRef(#active.ssLanguage, \"ww2SpecifyComments\")"));
errorMap.put(FeedbackFormBean.ERR_POSSIBLE_SPAM, serverbean.evalIdcScp("langRef(#active.ssLanguage, \"ww2PossibleSpamInput\")"));
%>
<%String httpAbsoluteCgiPath = serverbean.evalIdcScp("HttpAbsoluteCgiPath");%>
<%String siteId = serverbean.evalIdcScp("siteId");%>
<%String nodeId = serverbean.evalIdcScp("nodeId");%>
<%String fs = serverbean.evalIdcScp("fs");%>
<jsp:useBean id="form" class="company.forms.FeedbackFormBean" scope="request">
<jsp:setProperty name="form" property="errorMessages" value='<%= errorMap %>'/>
<jsp:setProperty name="form" property="siteId" value='<%= siteId %>'/>
</jsp:useBean>
<%if ("true".equals(request.getParameter("process"))) { %>
<jsp:setProperty name="form" property="*" />
<%if (form.process()) {
serverbean.putLocal("fullName", form.getFullName());
serverbean.putLocal("email", form.getEmail());
serverbean.putLocal("phone", form.getPhone());
serverbean.putLocal("comments", form.getComments());
serverbean.putLocal("dUser", "sysadmin");
serverbean.putLocal("IdcService", "INTERNET_2.0_CHECKIN_FEEDBACK_RESPONSE");
serverbean.executeService();
// Go to success page
String redirectUrl = httpAbsoluteCgiPath + "?IdcService=SS_GET_PAGE&nodeId=" + siteId + "FeedbackForm&fs=1";
response.sendRedirect(redirectUrl);
return;
}
}
---- WILL NOT NEED ANYTHING PAST THIS POINT ----