1,105,331 Community Members

jsp help

Member Avatar
03hasnam
Junior Poster in Training
70 posts since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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>
Member Avatar
stultuske
Posting Expert
5,290 posts since Jan 2007
Reputation Points: 935 [?]
Q&As Helped to Solve: 774 [?]
Skill Endorsements: 35 [?]
Featured
 
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.

Member Avatar
03hasnam
Junior Poster in Training
70 posts since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article