File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes JSP and  JavaBeans Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP and  JavaBeans Help" Watch "JSP and  JavaBeans Help" New topic
Author

JSP and JavaBeans Help

Sreedhar mar
Ranch Hand

Joined: Sep 15, 2003
Posts: 34
I wrote a Jsp file . In that i used a javabean. I am using weblogic 8.1. This is the code
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<html>
<head>
<title> Global Auctions - view item, Holder Bean </title>
</head>
<boby>
<h1>View Item Holder Bean </h1>
<jsp:useBean id="item" class="Item" scope="session" >
<jsp:setProperty name="item" property="catId" value="3000" >
<jsp:setProperty name="item" property="desc" value="Mango" >
</jsp:useBean>
<table>
<tr><td>Item number : </td><td><%= item.getCatId() %></td></tr>
<tr><td>Item Desciption : </td><td><%= item.getDesc() %></td></tr>
</table>
</boby>
</html>
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The above code giving an error
##############################################################
Compilation of 'C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java' failed:
--------------------------------------------------------------------------------
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:128: cannot resolve symbol
probably occurred due to an error in /item.jsp line 8:
<jsp:useBean id="item" class="Item" scope="session" >
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:129: cannot resolve symbol
probably occurred due to an error in /item.jsp line 8:
<jsp:useBean id="item" class="Item" scope="session" >
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:132: cannot resolve symbol
probably occurred due to an error in /item.jsp line 8:
<jsp:useBean id="item" class="Item" scope="session" >
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:134: cannot resolve symbol
probably occurred due to an error in /item.jsp line 8:
<jsp:useBean id="item" class="Item" scope="session" >

--------------------------------------------------------------------------------
Full compiler error(s):
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:128: cannot resolve symbol
symbol : class Item
location: class jsp_servlet.__item
Item item = null; //[ /item.jsp; Line: 8]
^
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:129: cannot resolve symbol
symbol : class Item
location: class jsp_servlet.__item
item = (Item)session.getAttribute("item"); //[ /item.jsp; Line: 8]
^
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:132: cannot resolve symbol
symbol : class Item
location: class jsp_servlet.__item
item = (Item)session.getAttribute("item"); //[ /item.jsp; Line: 8]
^
C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver__appsdir_myservletExp_dir_myservletExp\jsp_servlet\__item.java:134: cannot resolve symbol
symbol : class Item
location: class jsp_servlet.__item
item = new Item(); //[ /item.jsp; Line: 8]
^
4 errors
###########################################################

anyone can rectify the problem
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
You need to add an import statement so the JSP can find your Item class.
And of course the Item class needs to be found in your WEB-INF/classes directory or in a jar-file located in WEB-INF/lib


42
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61751
    
  67

You should also place your bean in a package other than the default. Most servlet containers have problems with classes in the default package.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP and JavaBeans Help