Javabean class

          Sorry guys, I got a real lousy question.
          Where do you actually save the javabean classes so that the server can detect?
          I use jsp to call a function in the javabean class but it seems that the server
          could not find the class files. Really need help! Thanks in advance.
          

In the WAR with the JSP typically.
          Peace,
          Cameron Purdy
          Tangosol, Inc.
          http://www.tangosol.com
          Tangosol: How Weblogic applications are customized
          "newbie" <[email protected]> wrote in message
          news:3b43fcb3$[email protected]..
          >
          > Sorry guys, I got a real lousy question.
          > Where do you actually save the javabean classes so that the server can
          detect?
          > I use jsp to call a function in the javabean class but it seems that the
          server
          > could not find the class files. Really need help! Thanks in advance.
          

Similar Messages

  • Cannot find JavaBean class?

    Created JSP program that calls a javabean but for some reason it cannot find the javabean class. I moved the NonConfBean.class and NonConfBean.java modules to the directory: C:\jakarta-tomcat-4.0.3\webapps\examples\WEB-INF\classes. Also, I modified my CLASSPATH to the following: .;C:\j2sdk1.4.0\lib;C:\jakarta-tomcat-4.0.3\webapps\examples\WEB-INF\classes.
    Here is the JSP:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <%@ page import="accsp.application.*"%>
    <head>
    <title>Add ACCSP Application for Non-Confidential Data</title>
    </head>
    <body>
    <jsp:useBean id="accapp"
    class="accsp.application.NonConfBean"
                                  scope="request" />
    <jsp:setProperty name="accapp" property="*"/>
    <BR>
    <% accapp.updateDatabase(); %>
    <jsp:forward page="NonconfPresentation.jsp" />
    </body>
    </html>
    And here is the error:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\jakarta-tomcat-4.0.3\work\localhost\webdav\myJSPs\addaccspapp$jsp.java:3: Package accsp.application not found in import.
    import accsp.application.*;
    ^
    1 error, 1 warning
    If I take out the import I receive the following error:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred between lines: 7 and 9 in the jsp file: /myJSPs/addaccspapp.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0.3\work\localhost\webdav\myJSPs\addaccspapp$jsp.java:60: Class accsp.application.NonConfBean not found.
    accsp.application.NonConfBean accapp = null;
    Why is this happening?

    Yes I have put NonConfBean.class in the following directories just to make sure I am covering all bases:
    1. C:\accsp\application
    2. C:\j2sdk1.4.0\accsp\application
    3. C:\jakarta-tomcat-4.0.3\accsp\application
    4. C:\jakarta-tomcat-4.0.3\webapps\examples\WEB-INF\classes\accsp\application
    Here is my classpath: .;C:\j2sdk1.4.0\lib\tools.jar;C:\accsp\application;C:\j2sdk1.4.0\accsp\application;C:\jakarta-tomcat-4.0.3\accsp\application;C:\jakarta-tomcat-4.0.3\webapps\examples\WEB-INF\classes\accsp\application
    And here is the JSP that tries to do the import:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@page import="accsp.application.*" %>
    <html>
    <head>
    <title>Add ACCSP Application for Non-Confidential Data</title>
    </head>
    <body>
    <jsp:useBean id="accapp"
    class="accsp.application.NonConfBean"
                                  scope="request" />
    <jsp:setProperty name="accapp" property="*"/>
    </jsp:useBean>
    <BR>
    <% accapp.updateDatabase(); %>
    <jsp:forward page="NonconfPresentation.jsp" />
    </body>
    </html>
    And here is the error message:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\jakarta-tomcat-4.0.3\work\localhost\webdav\myJSPs\addaccspapp$jsp.java:3: Class accsp.application.NonConfBean not found in import.
    import accsp.application.NonConfBean;

  • HELP! Beginning JSP with JavaBean Class

    First of all, I'm using jdk1.4 beta and Jakarta's tomcat version 4.0.1 release build.
    Hello. I desparately need help. I have a JavaBean class ("CarBean.class") saved in %catalina_home%\webapps\root\myapp\web-inf\classes\com\wrox\cars\CarBean.class
    I also have a jsp page saved as carpage.jsp in %catalina_home%\webapps\root\myapp\
    So when I point my browser to http://localhost:8080/myapp/carpage.jsp, I get an internal server error. It appears it can't find the JavaBean class for some reason. I'm pretty sure I have my envionment variables set up right. I can get it to work, if I save the JavaBean class in c:\jdk1.4\jre\class\com\wrox\cars
    Here's my JavaBean class source file:
    package com.wrox.cars;
    import java.io.Serializable;
    public class CarBean implements Serializable {
    public CarBean() {
    private String make = "Ford";
    public String getMake() {
    return make;
    public void setMake(String make) {
    this.make = make;
    and here's my jsp page:
    <html>
    <head>
    <title>Using a JavaBean</title>
    </head>
    <body>
    <h2>Using a JavaBean</h2>
    <% com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean(); %>
    I own a <%= myCar.getMake() %>
    <% myCar.setMake("Ferrari"); %>
    Now I own a <%= myCar.getMake() %>
    </body>
    </html>
    I'm not new to java, just JSP. I just don't know why I can't get the jsp to locate the JavaBean class. I remember I used to have an older version of Tomcat and I recall not having any problems. It seems the Tomcat 4.XX is somewhat significantly different than previous versions. Perhaps I configured my Tomcat wrong? Help would be greatly appreciated. Thanks.

    hi
    i am not using Tomcat server but as i worked in JWS you have to import the bean class from jsp files.
    so the first code in jsp file will be like this
    <%@ page import = "CarBean">
    becoz JWS cant automatically find the bean class we have to explicitly import bean.but i dont know if tomcat finds
    bean or one have to import.
    hope this will help u.
    regards
    manoj choudhury.

  • Problems accessing JavaBeans classes in a JSP.

    Hi,
    I have created some Javabeans �Product� and �ShoppingBasket� and compiled into their classes ok.
    I have created a JSP that uses these beans, however when I do a web run from Jbuilder4 I get a message saying it is unable to compile the class.
    I don�t understand as the classes are already compiled. I double checked the spelling and the made sure the classes were in the same folder.
    Is this some problem with Jbuilder 4 or the way I have imported the classes?
    Here is my import statement:
    <%@ page language="java" contentType="text/html" import="ShoppingBasket, Product, java.sql.*" %>
    and here is the error message Jbuilder is giving me:
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\OU2007\TM427\EasyShop\work\localhost_8080\_0002fmyproject_0002feasyshop_0002fshopproducts_0002ejspshopproducts_jsp_0.java:15: Class ShoppingBasket not found in import.
    import ShoppingBasket;

    Cross post:
    http://forum.java.sun.com/thread.jspa?threadID=5149952
    MeTitus

  • How to retest JSP immediately after modifying a javabean class?

    I am modifying and recompiling a javabean, but the changes don't seem to be reflected when I run the JSP which uses that bean? Do you always have to restart the java server to reload the classes used in JSP pages?
    Thanks,
    David Frankel

    The immediate answer to your question is Yes. You must restart the web server in order for changed compiled classes. The "classes" that are able to be recompiled are those done by the webserver (jsp's).

  • JavaBeans class attribute problem

    Hi,
    I am using JavaBeans in my JSP application to represent the business logic. I am just writing a simple JavaBean to calculate wages. The bean(which is called PayBean) compiles fine and the class resides in the folder \web-inf\classes\com\mybean\pay\
    In the JSP page I have
    <jsp:useBean id="payBean" class="com.mybean.pay.PayBean"/>to call my bean.
    However, when I ran the JSP I get the following error:
    The value for the useBean class attribute com.mybean.pay.PayBean is invalid.
    I tried restarting tomcat, but to no avail. Does anyone know what is wrong with my code?
    I have written and used bean using the same procedure and it ran fine, so I am really puzzled.
    Thanks

    Your bean payBean must have a public constructor that takes no arguments. (or no constructor at all, in which case it automatically gets one)
    ie
    package com.mybean.pay.PayBean
    public class PayBean{
      public PayBean(){ 
    }Cheers,
    evnafets

  • Add a button in javabean class

    hi how can i have an add button in my class, i what an action listener in my class which will allow me to have a button to add a record in my javabean,i what to have createInsert button,how can i create that in my class.am not yet connect to database i just what to have structure ready,than when databse ready can link my variables,but for now i what createinsert button where i can create a record
    my class is
    Edited by: ADF007 on 2012/09/21 4:24 PM
    Edited by: ADF007 on 2012/09/21 4:53 PM
    Edited by: ADF007 on 2012/09/21 5:04 PM
    Edited by: ADF007 on 2012/09/21 5:08 PM
    Edited by: ADF007 on 2012/09/25 4:16 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    how can i make my method to accept parameter am ,not able to view your video
        public String addperson(ResPersonBean ineap){
            System.out.println("Add new Person" + ineap.getusername() + ineap.getSurName() + ineap.getIdNumber() + ineap.getEmail() + ineap.TelNumber + ineap.getOwnership() + ineap.getAccountOfficer());
            return " = new value" + ineap.getusername() + ineap.getSurName() + ineap.getIdNumber() + ineap.getEmail() + ineap.TelNumber + ineap.getOwnership() + ineap.getAccountOfficer();
        }at the moment am geting <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: java.lang.NullPointerException
    java.lang.NullPointerException
    error at the moment i just drag and drop the method and do edit action binding->values->variables->bindings->addperson->currentRow->DataProvider. i gues the error is because i did not return anything
    this is what i have done drag and drop addperson method->edit action binding->value->variables->ResPersonBeanIterator->currentRow->dataprovider,when i click addperson i get this Add new Person [email protected],which is the information i already hard coded how can i get another row to add new record
    Edited by: ADF112 on 2012/09/28 9:59 AM
    Edited by: ADF112 on 2012/10/02 8:24 AM

  • JavaBean class invalid error

    Hello there,
    I am new to jsp development and am having problems using javabeans. I get a class invalid error. I have created a simple example that works fine without the useBean line (there Bean doesn't do anything in the example). I have looked over earlier posts in which others have discussed this same problem (http://onesearch.sun.com/search/clickthru?qt=useBean+invalid&url=http%3A%2F%2Fforum.java.sun.com%2Fthread.jspa%3FforumID%3D45%26threadID%3D567258&pathInfo=%2Fonesearch%2Findex.jsp&hitNum=1&col=developer-forums), but I none of the proposed fixes has worked for me. I hope that someone will see something that I'm missing. Below are the files that make up the example
    // userInput.jsp
      <html>
        <body>
          <h3>UserInput Form</h3>
          <form name="inputForm" action="userOutput02.jsp" method="post">
            <input type="text" name="userName">
            <input type="submit" name="submit" value="GO">
          </form>
        </body>
      </html>
    // userOutput02.jsp
      <jsp:useBean id="userInfo" scope="session" class="beans.User" />
      <html>
        <body>
          <h3>User Output</h3>
          Hello <%=request.getParameter("userName")%><br>
          <a href="userInput.jsp">Enter another name</a>
        </body>
      </html>
    // User.java
      package beans;
      public class User {
        protected String name;
        public User () {}
        public String getName () {
          return name;
        public void setName (String userName) {
          name = userName;
      }// Location of User.class
    <%webApplicationRoot%>/WEB-INF/classes/beans
    // Error Message when userOutput02.jsp is loaded
    org.apache.jasper.JasperException: /jsp/userOutput02.jsp(1,1) The value for the useBean class attribute beans.User is invalid.

    Well, I doubt this is your problem, since I don't see you trying to set anything, but the form field should really match your setter.
    If the setter is setName, the form field should be named "name" (though I'd switch everything to userName instead of name, myself, as name tends to be a reserved word in various applications and languages).
    Other than that, are you using Tomcat, weblogic, or...?

  • JavaBean Class Detection Problem

    I cannot get the JSP compiler to recognize a JavaBean that I have created. I'm getting the error "Class UTest.UtilTest not found in type declaration" from oracle.jsp.provider.*. The compiler seems to be finding the file UtilTest.class in the UTest directory, since I get a "not found" error when I rename the class file.
    This problem is occurring when running a JSP page under OAS on an NT system. The code is working fine when running under JDeveloper.
    Any suggestions?
    null

    You have a getter method whose name starts with "set".
    You're not following the beans naming conventions correctly. If a property is called "foo", then the getters & setters are named "getFoo" and "setFoo".

  • How To Access JSP Image file Path inside JavaBean Class

    In my Webapplication,i have jsp and javabeans files. i need to send one image file path contains in Image folder to JavaBean[MyBean.java].
    From MyBean i am trying to display that image using PdfGen Application[JAR] in a new PDF Document.
    The Web Application Structure is as
    MyWebApp
    Image
    \ mypic.gif
    JSP
    \myjsp.jsp
    WEB-INF
    classes
    \pack.MyBean.java
    My Question :
    Inside the webapplication[JSP] the image file is accessed as a URL.(like http://localhost:7001/mywebapp/Image/mypic.gif). but From JavaBean: How To access this file? becz inside javabean it needs a complete system path..How to solve this problem? plz send me any solutions related to my problem....Thank U.

    Dear Madruguinha!
    Thank you very much for your tips.
    but i find another one method for accessing the image.
    // Inside Servlet or JSP
    String realPath=getServletContext().getRealPath("Image"+"/pic1.gif");
    Now we can send this exact system path variable to any java beans or java class that needs the image path as "drivename:\foldername\filename" like "c:\myflolder\mypic.gif" and not web context path.

  • How to run jsp using javabean class in tomcat

    hello all,
    i have bean class placed in classes folder of tomcat and placed jsp and html in root directory. i am not able to run it , if i have do any setting in web.xml, pls let me know from u

    No XML required, but you must put the class into a package.
    Packages are folders with some files that identify whats in them, so you will end up with something like
    yourWebbApp/classes/yourPackage/yourClass

  • Javabean class not found by jsp page

    I have created one bean which has setFunctionId(String) and getFunctionId() methods. I put the class files at /weblogic/myserver/serverclasses directory. While I am accessing the .jsp page it is telling "Thu Aug 03 15:46:16 EDT 2000:<E> <ServletContext-General> Servlet failed with Ex
              ception
              java.lang.NoSuchMethodError: myjsp.TestBean: method setFunctionId(Ljava/lang/Str
              ing;)V not found
              at jsp_servlet._testasfs._jspService(_testasfs.java:90)
              at weblogic.servlet.jsp.JspBase.service(Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled C
              ode)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled C
              ode)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(Compile
              d Code)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
              at weblogic.socket.MuxableSocketHTTP.execute(Compiled Code)
              at weblogic.kernel.ExecuteThread.run(Compiled Code)"
              Would appreciate your help..
              

    Thank you for your valuable feedback duffymo. Could
    you explain a little what you mean by "Putting .class
    files in the Tomcat examples directory is a really bad
    idea in the long run". Also, could you direct me to
    some source where I can find more information on
    creating WAR files keeping in mind that I am a
    beginner.
    Thanks.But putting your web apps into WAR files, you can have quite a few different web apps running on the tomcat server as compared to if u place your files into the default webapp folder, u can only have 1 web app running.
    For creating WAR file, the easiest way is to use an IDE like JBuilder.

  • Where to place javabean classes

     

    Put these classes in WEB-INF/classes and enable dynamic reloading. To do that-
    open krededit-> SOFTWARE-> iplanet-> Application Server->6.0->CCS0->SYSTEM_JAVA->Versioning and set it to 0. Bydefault it is 1, disabled. And restart the iAS to pickup this change.
    Or, redeploy the application.
    Hope this would help.
    Should you have any question further, get back.
    Thanks,
    Rakesh.

  • How do i create objects of ordinary Classes from a javabean

    I want to create a class Person below that I want to create an object from in my javabeans.
    Look below Person class definition for continuation.
    package data;
    public class Person
    private String name;
    public Person()
    name = "No name yet.";
    public Person(String initialName)
    name = initialName;
    public void setName(String newName)
    name = newName;
    public String getName()
    return name;
    public void writeOutput()
    System.out.println("Name: " + name);
    public boolean sameName(Person otherPerson)
    return (this.name.equalsIgnoreCase(otherPerson.name));
    I run this bean class in the WEB-INF/classes/data folder creating a Person object in the deal() method below
    When I compile the class it seems to fail. It does not recognise the Person class. Can you help me with a description of what to do to call
    ordinary class objects from javabean class definitions.
    What directories should the simple classes be put and what should I include in the javabean to be able to access them?
    package data;
    import java.sql.*;
    import data.*;
    public class Bean
    { private Connection databaseConnection ;
    // private Person p;
    public Bean()
    super();
    public boolean connect() throws ClassNotFoundException, SQLException
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String sourceURL = "jdbc:odbc:robjsp";
    databaseConnection = DriverManager.getConnection(sourceURL);
    return true;
    public ResultSet execquery(String restrict) throws SQLException
    Statement statement = databaseConnection.createStatement();
    String full = "SELECT customerid,CITY,Address from customers " + restrict;
    ResultSet authorNames = statement.executeQuery(full);
    return (authorNames ==null ) ? null : authorNames;
    public String deal() throws SQLException
    {  Person p = new Person();
    p.setName("Roberto");
    return p.getName();
    }

    There is no "Copy File" function in Lightroom.
    Lightroom was designed to eliminate the need to make duplicate copies of files. The organizational tools in Lightroom allow you to have one file categorized in many ways, you can assign multiple keywords to the photos (for example: Winery, Finger Lakes, Fall Foliage, Jessica). Similarly, you can have a file categorized in multiple Lightroom collections at the same time, all without making a copy of the photo. The benefit of this is that you don't need to make multiple copies of each photo, one copy suffices, and thus disk space is saved; and furthermore if you should edit a photo or add metadata, you only need to do this once, and the photo's appearance, or the photo's metadata is changed, and visible to you no matter how you choose to access the photo (pick any keyword or any collection and you will see the change)

  • For WebLogic 5.1, where should I put my class files for my JavaBeans?

    With JBuilder4, I have built an application with JSP and a few Java Beans (Those JavaBeans are instantiated in those JSP files). There are no EJBs. The package name is called 'onlinetrade'. I have tested the application on JBuilder's web server, it works pretty well.
    Now I am moving this application to WegLogic 5.1. I have encountered a problem with WebLogic 5.1
    and do not know where I should place my JavaBean class files --
    Originally, the JSP files for my application are in package path-- ..onlinetrade\jsp
    and the class files for my beans are in the package path -- ..onlinetrade\jsp\bean\*.class
    Now, with WebLogic 5.1,
    1) I have put my JSP files in
    C:\weblogic\myserver\public_html\onlinetrade\jsp
    2) I have created subdirectory and put my bean class files in
    C:\weblogic\myserver\classfiles\onlinetrade\jsp\bean
    When I started weblogic and the first page - login.jsp page can be up and accessed. But when I login and forward to another JSP page called 'controller.jsp', where a bean is instantiated, I got the following error
    Compilation of 'C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java' failed:
    C:\weblogic\myserver\classfiles\jsp_servlet\_onlinetrade\_jsp\__controller.java:210: cannot access jsp_servlet._onlinetrade._jsp.registerBean
    probably occurred due to an error in /onlinetrade/jsp/controller.jsp line 53:
    registerBean registerBeanInstance = new registerBean();
    I know the javac is working, and a java file is created upon the JSP page, but the problem is -- the bean class files cannot be found!!!
    Where should I create the package path and put my bean class file so that my JSP pages can pick them up?
    Any help is greatly appreciated!
    Thanks.
    --Tim

    I have mine in WEB-INF/classes

Maybe you are looking for