Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / July 2006



Tip: Looking for answers? Try searching our database.

Need help with jsp and java bean

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
The ScareCrow - 27 Jul 2006 00:56 GMT
A department has built there own site using jsp.  I need to get this up and
running through cf7.1

I have created a server instance, so this is seperate from the rest of the
intranet.
Basically, I think I have to "install" the javabean. But don't know how.

The jsp code is as attached (initial login page)

There is a file "LoginBean.java"

Now for the error

jrun.jsp.tags.GetProperty$NoSuchPropertyException: (/loginPage.jsp:13) The
bean loginBean does not have a enteredcustomerid property
    at jrun.jsp.tags.GetProperty.init(GetProperty.java:78)
    at jrun.jsp.tags.GetProperty.doStartTag(GetProperty.java:39)
    at jrun__loginPage2ejspe._jspService(jrun__loginPage2ejspe.java:75)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
 
 jrun.jsp.runtime.UncaughtPageException: Unhandled exception thrown from
/loginPage.jsp:13
    at jrun.jsp.runtime.Utils.handleException(Utils.java:57)
    at
jrun.jsp.runtime.JRunPageContext.handlePageException(JRunPageContext.java:384)
    at jrun__loginPage2ejspe._jspService(jrun__loginPage2ejspe.java:119)
    at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
    at jrun.jsp.JSPServlet.service(JSPServlet.java:119)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at jrun.servlet.http.WebService.invokeRunnable(WebService.java:172)
    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
 

Any help please...

Ken

<%@ page import="LoginBean"%>
<jsp:useBean id="loginBean" scope="session" class="LoginBean"/>
<html>
<head>
<title>Bibliography Database - Login Option</title>
</head>
<body>
<h3 align="center"><font face="Arial">Bibliography Database - Login
Menu<br></font></h3>

<form action="servlet/LoginHandler" method="post">
<table>
 <tr>
  <td>Login Name:</td> <td><input type="text" name="customerId"
value="<jsp:getProperty name="loginBean" property="enteredcustomerid"/>"></td>
 </tr>
 <tr>
  <td>Password:</th> <td><input type="password" name="password" size="15"
MAXLENGTH=25 value="<jsp:getProperty name="loginBean"
property="enteredpassword" />"> </th>
 </tr>
 <tr>
  <td></th><td><input type="submit" value="Login"></th>
 </tr>
</table>
<br>
<br>
<p><font color="red"><jsp:getProperty name="loginBean"
property="message"/></font></p>
</form>

</body>
</html>
cecropin - 28 Jul 2006 01:37 GMT
Ken,

Based on the erorr it seems as though there's no property within the bean
called "enteredcustomerid".  Where's the Java code for the bean? Are you
certain the JSP code itself is correct?

 -Tim
cecropin - 28 Jul 2006 19:31 GMT
Ken,

I have no idea how this would have run even on Tomcat because the two methods
getenteredcustomerid and getenteredpassword are not in accordance to JavaBean
specs.  The methods should be "getEnteredCustomerId" and "getEnteredPassword".  
The JavaBean properties need to adhere to the naming convention.  I can't find
a good reference for this at the moment.  But I did reproduce your error and
was able to resolve it by making the changes above.  You'll also have to change
the property value from within the JSP to match the case of the getter.

With regard to deployment.  Technically it's the .class file that's being
utilized, you happen to have the JRun web app instance set to autocompile and
reload servlets, JSPs, and helper classes for the two previously mentioned
items.  You can confirm this by inspecting the compile></compile> and  
<reload></reload> tags in jrun-web.xml.  

If you update the Java file where it's currently located (WEB-INF/classes) and
update the JSP it should fix the problem.

Regards,
Tim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.