Hello, I need some help with JSTL. I am trying to get a small app running but have some problems. I have 3 files:
add_sub_info.jsp, view_sub_info.jsp, view_missing_info.jsp
The add_sub_info is my main file where I fill in some info and on hitting the submit button I can view the details on the view_sub_info.jsp page provied there is no error. If there is any error the view_missing_info.jsp page will have to be displayed. My file structure is as follows;
apache-tomcat-5.5.20/webap
ps/billing
/JSP/ (my 3 files)
apache-tomcat-5.5.20/webap
ps/billing
/WEM-INF/l
ib/ tab ibraries
The error I am getting when I try and run the app is as follows:
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperEx
ception: /JSP/view_sub_info.jsp(23,
69) equal symbol expected
org.apache.jasper.servlet.
JspServlet
Wrapper.ha
ndleJspExc
eption(Jsp
ServletWra
pper.java:
512)
org.apache.jasper.servlet.
JspServlet
Wrapper.se
rvice(JspS
ervletWrap
per.java:3
77)
org.apache.jasper.servlet.
JspServlet
.serviceJs
pFile(JspS
ervlet.jav
a:314)
org.apache.jasper.servlet.
JspServlet
.service(J
spServlet.
java:264)
javax.servlet.http.HttpSer
vlet.servi
ce(HttpSer
vlet.java:
802)
root cause
org.apache.jasper.JasperEx
ception: /JSP/view_sub_info.jsp(23,
69) equal symbol expected
org.apache.jasper.compiler
.DefaultEr
rorHandler
.jspError(
DefaultErr
orHandler.
java:39)
org.apache.jasper.compiler
.ErrorDisp
atcher.dis
patch(Erro
rDispatche
r.java:405
)
org.apache.jasper.compiler
.ErrorDisp
atcher.jsp
Error(Erro
rDispatche
r.java:86)
My code is as follows:
add_sub_info.jsp:
<body>
<%@ page import = "java.util.Date" %>
<table width="100%">
<tr>
<td><h1 align="left" class="style1">Subscriber Information</h1></td>
<td><div align="right"><span class="style4">Date : <%=new Date()%></span> </div></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="3" cellpadding="2">
<form name="form1" method="post" action="view_sub_info.jsp"
>
<tr>
<td width="164">First Name </td>
<td width="158"><input type="text" name="first_name"></td>
</tr>
<tr>
<td>Last Name </td>
<td><input type="text" name="last_name"></td>
</tr>
view_sub_info.jsp
</head>
<body>
<%@ page import = "java.util.Date" %>
<%@ taglib uri="
http://java.sun.com/jstl/core_rt" prefix="c" %>
<c:if test="${param.first_name eq '' or param.last_name eq ''}">
<c:set var="first_name" value = "${param.first_name} scope = "session"/>
<c:set var="last_name" value = "${param.last_name} scope = "session"/>
<c:redirect url="view_missing_info.jsp
">
<c:if test="${param.first_name eq ''}">
<c:param first_name="first_name" value = "missing"/>
</c:if>
<c: if test="${param.last_name eq ''}">
<c:param last_name="last_name" value = "missing"/>
</c:if>
</c:redirect>
</c:if>
<table width="100%">
<tr>
<td><h1 align="left" class="style1">Subscriber Information</h1></td>
<td><div align="right"><span class="style4">Date : <%=new Date()%></span> </div></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="3" cellpadding="2">
<form name="form1" method="post" action="sub_info.jsp">
<tr>
<td width="164">First Name </td>
<td width="158">${param.first_
name}</td>
</tr>
<tr>
<td>Last Name </td>
<td>${param.last_name}</td
>
</tr>
view_missing_info.jsp
<body>
<%@ page import = "java.util.Date" %>
<%@ taglib uri="
http://java.sun.com/jstl/core_rt" prefix="c" %>
<c:if test="${param.first_name eq 'missing' or param.last_name eq 'missing'}">
<p class="missing"> You have not filled in some details</p>
</c:if>
<table width="100%">
<tr>
<td><h1 align="left" class="style1">Subscriber Information</h1></td>
<td><div align="right"><span class="style4">Date : <%=new Date()%></span> </div></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="3" cellpadding="2">
<form name="form1" method="post" action="sub_info.jsp">
<tr>
<td width="164">First Name </td>
<td width="158"><input type="text" name="first_name" value="${sessionScope.firs
t_name}" />
<c: if test ="${param.first_name eq 'missing'}">
<span class ="missing"> * Required Field</span>
</c:if>
</td>
</tr>
<tr>
<td>Last Name </td>
<td width="158"><input type="text" name="last_name" value="${sessionScope.last
_name}" />
<c: if test ="${param.last_name eq 'missing'}">
<span class ="missing"> * Required Field</span>
</c:if>
</td>
Thank you for the help.
A
Start Free Trial