• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

JSP and JavaBeans Help

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should also place your bean in a package other than the default. Most servlet containers have problems with classes in the default package.
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic