Advertisement

09.10.2007 at 10:46AM PDT, ID: 22818388
[x]
Attachment Details

help with a JSTL application ....

Asked by aej1973 in Java Standard Tag Library (JSTL) & Server Tags, Java Programming Language, New to Java Programming

Tags: equal, excepted, jstl

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/webapps/billing/JSP/ (my 3 files)
apache-tomcat-5.5.20/webapps/billing/WEM-INF/lib/ 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.JasperException: /JSP/view_sub_info.jsp(23,69) equal symbol expected
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: /JSP/view_sub_info.jsp(23,69) equal symbol expected
      org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
      org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
      org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.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.first_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
 
Loading Advertisement...
 
[+][-]09.10.2007 at 06:18PM PDT, ID: 19865364

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Standard Tag Library (JSTL) & Server Tags, Java Programming Language, New to Java Programming
Tags: equal, excepted, jstl
Sign Up Now!
Solution Provided By: suprapto45
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.11.2007 at 08:24AM PDT, ID: 19869456

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.11.2007 at 07:27PM PDT, ID: 19873504

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_1_20070628