1.11M Members

jsp help

 
0
 

i am getting lots of error like this for all form inputs. i am trying to use javabeans and jsp where a jsp will be responsible for outputting the final information (cost of booking and bookingreference). The servlet needs to pass control to this JSP. this is the error which is repeated

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 20 in the jsp file: /output.jsp
BookingBean cannot be resolved to a type
<h1>Get Value from BookingBean</h1>
<jsp:useBean id="formData" class="BookingBean" scope ="request"      
  <jsp:setProperty name="formData" property="firstName" param="fname" /        <jsp:setProperty name="formData" property="surName" param="surname" />         <jsp:setProperty name="formData" property="email" param="email1" />

this is the jsp fil, please help me guys

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ page import="java.util.*" %>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Output.jsp</title>
    </head>
    <body>
        <h1>Get Value from BookingBean</h1>
        
        
        <jsp:useBean id="formData" class="BookingBean" scope ="request">
        <jsp:setProperty name="formData" property="firstName" param="fname" />
        <jsp:setProperty name="formData" property="surName" param="surname" />
        <jsp:setProperty name="formData" property="email" param="email1" />
        <jsp:setProperty name="formData" property="promo" param="promocode" />
        <jsp:setProperty name="formData" property="date" param="date" />
        <jsp:setProperty name="formData" property="time" param="time" />
        <jsp:setProperty name="formData" property="location" param="location" />
        <jsp:setProperty name="formData" property="adult" param="adults" />
        <jsp:setProperty name="formData" property="children" param="children" />
        <jsp:setProperty name="formData" property="oap" param="oap" />
        </jsp:useBean>
        
        
        <TABLE BORDER=1>
            <tr><td>Receipt No: ....</td><td><jsp:getProperty name="formData" property="firstName" /></td>
                <td><jsp:getProperty name="formData" property="surName" /></td><td><jsp:getProperty name="formData" property="email" /></td>  
            </tr>
            
            <tr><td>Promotional Code: <jsp:getProperty name="formData" property="promo" /></td>
                <td><jsp:getProperty name="formData" property="date" /></td>
                <td><jsp:getProperty name="formData" property="location" /> &nbsp; <jsp:getProperty name="formData" property="time" /></td>
            </tr>
            <tr><td>Adults:<jsp:getProperty name="formData" property="adult" /><br>
                    Children's: <jsp:getProperty name="formData" property="children" /> <br>
                    OAP: <jsp:getProperty name="formData" property="oap" /> </td>
                <TD COLSPAN=2><h3>Total Price: £......</h3></td>
            </tr>
        </table>
       
        
        
        
        
    </body>
</html>
 
0
 

your jsp is looking for a class BookingBean, which it can not find. it may not have been compiled, it may not exist, or it's not on your path.

 
0
 

it does exit and i am using netbeans and it is correctly declared with correct spelling and is in the same web application folder as the jsp.

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article