Tomcat 5.0 & JavaBean

I'm getting in trouble with Tomcat & JavaBean.
1) I've installed Tomcat 5.0 in the following directories:
"C:\Programmi\Apache Software Foundation\Tomcat 5.0"
2) I've started Tomcat and I tried it in "http://localhost:8080". Tomcat Web Server works perfectly.
3) I've created the following simple JavaBean (prova.java). It do nothing. I've compiled it (using JcreatorLE ide) and I copied files in the following directory:
"C:\Programmi\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\ServiceDiscovery\WEB-INF\classes"
4) prova.java 's code is very simple:
public class prova
     public prova()
5) Under the main Tomcat's directory ("C:\Programmi\Apache Software Foundation\Tomcat 5.0\webapps\ROOT") I've created a new directory ("ServiceDiscovery"). In this directory I've copied the "WEB-INF" directory which was in the Tomcat's main directory. The current directory state is:
C:\Programmi\Apache Software Foundation\Tomcat 5.0\webapps\ROOT\ServiceDiscovery
|
+--- WEB-INF (directory)
| |
| +--- classes (directory)
| | |
| | +--- org\apache\jsp\index_jsp.class
| | |
| | +--- prova.java
| | |
| | +--- prova.class
| |
| +--- lib (directory)
| |
| +--- web.xml
|
+--- index.jsp
5) I've edited the following script at the beginning (first line) of index.jsp:
"<jsp:useBean id="prova" class="prova" scope="session" />"
6) When I open Internet Explorer at the URL "http://localhost:8080/ServiceDiscovery", Tomcat server reply with this error message:
org.apache.jasper.JasperException: /ServiceDiscovery/index.jsp(3,0) The value for the useBean class attribute provami.prova is invalid.
     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
     org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
     org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
     org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1217)
     org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
     org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
     org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
     org.apache.jasper.compiler.Generator.generate(Generator.java:3261)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:461)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:442)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:430)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:274)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
I don't understand what's going wrong? Something in my script? Something in my JavaBean? Something in Tomcat configuration?
Please help me finding a solution!

You shouldn't install any s'ware to a directory whose name contains spaces. I'd move Tomcat out of those directories if I were you.
3) I've created the following simple JavaBean
(prova.java). It do nothing. I've compiled it (using
JcreatorLE ide) and I copied files in the following
directory:
"C:\Programmi\Apache Software Foundation\Tomcat
5.0\webapps\ROOT\ServiceDiscovery\WEB-INF\classes"This is a bad idea. Create a context for your own Web app by creating a directory under TOMCAT_HOME/webapps and put your stuff under that directory. Using ROOT isn't a good practice, IMO. Learn how to do it properly:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev/index.html
>
4) prova.java 's code is very simple:
public class prova
public prova()
}Add a package statement to your JavaBean. Tomcat won't deal with servlets or JavaBeans that aren't in a package. The default package is insufficient.
>
5) Under the main Tomcat's directory
("C:\Programmi\Apache Software Foundation\Tomcat
5.0\webapps\ROOT") I've created a new directory
("ServiceDiscovery"). In this directory I've copied
the "WEB-INF" directory which was in the Tomcat's main
directory. The current directory state is:
C:\Programmi\Apache Software Foundation\Tomcat
5.0\webapps\ROOT\ServiceDiscovery
|
+--- WEB-INF (directory)
| |
| +--- classes (directory)
| | |
| | +--- org\apache\jsp\index_jsp.class
| | |
| | +--- prova.java
| | |
| | +--- prova.class
| |
| +--- lib (directory)
| |
| +--- web.xml
|
+--- index.jsp
I'd still recommend that each Web app have its own context. Putting your stuff in the Tomcat ROOT context is a bad idea. Better to learn a good habit now.
5) I've edited the following script at the beginning
(first line) of index.jsp:
"<jsp:useBean id="prova" class="prova" scope="session"
/>"
And how did that object get into session scope?
6) When I open Internet Explorer at the URL
"http://localhost:8080/ServiceDiscovery", Tomcat
server reply with this error message:
org.apache.jasper.JasperException:
/ServiceDiscovery/index.jsp(3,0) The value for the
useBean class attribute provami.prova is invalid.You've got a few problems. Add a package for starters. Reinstall Tomcat to a directory without spaces in its name. Create a new context for your Web app. Then come back if it still doesn't work.

Similar Messages

  • TOMCAT WEB SERVER & JAVABEANS

    Hello fellow Java ppl. I was wondering if anyone knew the directory that you have to place a javabean and its .class file in when it is being called by a .jsp program. Any help you could give would be appreciated, i've been working on this for 8 hours now...

    ok, i did that but then i got this error....
    org.apache.jasper.JasperException: Unable to compile class for JSPC:\WEBSERVER\Jakarta\jakarta-tomcat-4.0-b5\work\localhost\examples\jsp\Adesh\_00028af_00029strminfo2_jsp.java:61: Class org.apache.jsp.lineBean not found.
    lineBean bean0 = null;
    ^
    C:\WEBSERVER\Jakarta\jakarta-tomcat-4.0-b5\work\localhost\examples\jsp\Adesh\_00028af_00029strminfo2_jsp.java:64: Class org.apache.jsp.lineBean not found.
    bean0= (lineBean)
    ^
    C:\WEBSERVER\Jakarta\jakarta-tomcat-4.0-b5\work\localhost\examples\jsp\Adesh\_00028af_00029strminfo2_jsp.java:69: Class org.apache.jsp.lineBean not found.
    bean0 = (lineBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "lineBean");
    ^
    - mybean is my package
    - linebean is the class
    - bean0 is the id in the declaration in the jsp file.

  • Using a dynamic client in a JavaBean using Tomcat

    I am trying to create a JavaBean which uses a dynamic web service client which will call the web service but I keep getting the following error:
    The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: javax/xml/rpc/ServiceFactory
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceFactory
    I have these import statements at the top:
    import javax.xml.rpc.Service;
    import javax.xml.rpc.ServiceFactory;
    I think the problem is I need to include the service factory folder or file in Tomcat but I'm not sure where the folder is and where it goes in Tomcat. Is it a folder or jar file? Any advice is really appreciated.
    Thanks

    You'll need to include the following jars
    jaxrpc-api.jar
    jaxrpc-impl.jar
    jaxrpc-spi.jar
    You should find them in %JWSDP_HOME%\jaxrpc\lib

  • Problems in using Tomcat 4.0 and javaBeans

    Help!
    I find that I can't import javaBeans in the normal way
    For example, the bean class file should be placed in the application's Web-inf\classes (however, when I have changed to use the Tomcat 4.0, I have to place them in the outermost classes directory!???
    What's wrong???
    Another problem is that when I try to import the bean class into the JSP, an internal error occurs:
    Apache Tomcat/4.0.1 - HTTP Status 500 - Internal Server Error
    org.apache.jasper.compiler.ParseException: /trial.jsp(10,0) Attribute > has no value
    <probably it tells me that the bean class can't be loaded???>
    here are the source codes:
    Counter.class =>
    public class Counter {
    private int count;
    public Counter() {
    count = 0;
    public int getCount() {
    count++;
    return count;
    public void setCount(String strCount) {
    count = Integer.parseInt(strCount);
    jsp file=>
    <html>
    <body>
    <%@ page language="java" import="Counter"%>
    <jsp:useBean id="bname" scope="session" class="Counter" \>
    </body>
    </html>

    it's my first time i'm using javaBeans too. but i just tried this it worked:
    <html>
    <body>
    <%@ page import="dbBean" %>
    <jsp:useBean id="Bean" class="dbBean">
    <%
    //dbBean Bean=new dbBean();
    Bean.setUserID(request.getParameter("id"));
    Bean.setUserPass(request.getParameter("pass"));
    Bean.setFirstName(request.getParameter("fname"));
    Bean.setLastName(request.getParameter("lname"));
    Bean.setEmail(request.getParameter("email"));
    %>
    </jsp:useBean>
    </body>
    </html>
    hopefully it does work for you too
    Sumit

  • Using javabean in tomcat(unable to compile class)

    Hello, I am using jakarta-tomcat-5.0.28, OS:WinXP
    I am getting the following error when i use javabean in tomcat (the example is executed just fine in another web server:Blazix)
    I am very new to this (JSP, Servlets and tomcat) so any help would be greatly appreciate.
    THE ERROR IS:
    ==============================================================
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /SaveName.jsp
    Generated servlet error:
    C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:42: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.SaveName_jsp
    UserData user = null;
    ^
    An error occurred at line: 1 in the jsp file: /SaveName.jsp
    Generated servlet error:
    C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:44: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.SaveName_jsp
    user = (UserData) jspxpage_context.getAttribute("user", PageContext.SESSION_SCOPE);
    ^
    An error occurred at line: 1 in the jsp file: /SaveName.jsp
    Generated servlet error:
    C:\Programs\internet\jakarta-tomcat-5.0.28\work\Catalina\localhost\JSPSession\org\apache\jsp\SaveName_jsp.java:46: cannot resolve symbol
    symbol : class UserData
    location: class org.apache.jsp.SaveName_jsp
    user = new UserData();
    ^
    3 errors
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:412)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
    ===============================================================
    ERROR END
    I use the folowing files:
    GetName.html
    SaveName.jsp
    NextPage.jsp
    UserData.java
    My Dir Structure is:
    /JSPSession
        GetName.html
         SaveName.jsp
         NextPage.jsp
       /WEB-INF
          /classes
             UserData.java
             UserData.class
       /libThe Code for the files is:
    GetName.html
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="SaveName.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>---------------------------------------------------------------------------------------------------
    SaveName.jsp
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    <A HREF="NextPage.jsp">Continue</A>
    </BODY>
    </HTML>-----------------------------------------------------------------------------------------------------
    NextPage.jsp
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>------------------------------------------------------------------------------------------------------------
    UserData.java
    public class UserData {
        String username;
        String email;
        int age;
        public void setUsername( String value ) {
            username = value;
        public void setEmail( String value ) {
            email = value;
        public void setAge( int value ) {
            age = value;
        public String getUsername() { return username; }
        public String getEmail() { return email; }
        public int getAge() { return age; }
    }

    A very common question. Tomcat dislikes classes which are not packaged. So, add a package statement in your UserBean.java
    package beans; // or something like thatand then place the compiled class file UserBean.class into WEB-INF/classes/beans.
    Put the import statement into the JSP accordingly and try again.
    ***Annie***

  • Urgent :How to Start the JavaBean in the start up of Tomcat Server

    Hi All
    1. I need JavaBeans to be Started at the time of Starting of the Tomcat Server where i am Storing some global Database values in Hashtable collection.
    2. I dont want to show the full address like http://domain.com:8080/mypath/jsp/file.jsp
    how to reduce the path http://domain.com/file.jsp .. i don't want to show the full path (port number, where i am storing the files
    3. when the user type http://domain.com:8080/mypath/jsp/
    it shows all the files under that directory.. i dont want to show the direcotry content to outside user .. how to restrict that.
    thanks and regards
    sreekant

    i want to start some jsp files at the start of the
    tomcat server.
    in some IDE i saw an option like "when start up"
    i want that type of facility to my site for loading
    global variables to all the web pages.1) JSPs have to be hit by something (some kindof request or dispatched request) so "starting jsp files" isn't quite the right mechanism.
    2) The servlet spec provides 2 ways to load things on startup:
    i) the <load-on-startup> tag in the web.xml for loading a particular servlet when the particular application loads
    ii) The ServletContextListener interface and the corresponding <listener> tag in the web.xml. If your initializing is non-web specific (e.g. logging, starting up some kind of service, initializing global vars) than this is the better (and easier) route to take.
    If you want to put these in the root context to happen when tomcat starts, then you'll have to make these modifications to tomcat's root web application (ROOT in the webapps folder).
    ncuka
    ncuka

  • Strange thing with tomcat+jsp+javabean

    I use javabean in jsp with tomcat container.if I put the javabean file in a package,then it works well.But if I don't, I means,there are no package clause in my javabean file.then it complaint that org.apache.jsp. error:class not found.
    It is very strange.Of course place the class file I put is right.Do anyone encounter the same problem.I use tomcat4.0.4

    Did you import the classfile? Even if it is not there in a package, you need to import it.
    For example, if you have a Test.java (Test.class) in your web-inf\\classes with out any package statement, then you need to code this in your jsp,
    <%@ page import="Test" %> (I don't exactly remember whether you need to import 'Test' or 'Test.class'). Just give a try.
    Sudha

  • Compiling JavaBean (Tomcat 5.5/J2SDK1.4.2/JRE)

    Alright, I'm getting extremely confused by all the different JAVA technologies, packages, libraries, versions, etc. The case is as follows:
    I have an UploadBean, using javax.servlet.*, from rt.jar. The only thing I have to do, is compiling the JavaBean, but I fail in doing that. I did compile Beans before, but those were Beans not using the rt.jar, so I compiled it with JDE by using javac.exe in command prompt. Since that's not possible, I need to find a way to compile my Bean, without the javac.exe.
    I searched the whole web for clear solutions, but none of them seem to work. I just can't find the right way to compile it, while is should be so simple.
    In which folder do I find the right tool to simply compile my UploadBean.java to UploadBean.class?
    10 point for the winning solution!
    Thanks in advance.

    You didn't need to download it.
    The javax.servlet classes would be found in Tomcat /common/lib directory in servlet-api.jar
    I presume you have already read the section in the release notes:
    Tomcat 5.5 is designed to run on J2SE 5.0 and later, and requires
    configuration to run on J2SE 1.4.  Make sure to read the "RUNNING.txt"
    file in the fulldocs downloadable file(s) if you are using J2SE 1.4.

  • Where should JavaBeans be placed when using Tomcat?

    I want to use a javaBean from inside a JSP, but it seems like Tomcat can't find the bean (...can't find the class).
    Is there a particular catalogue where the bean-classes should be placed?
    My test-JSP looks like this:
    <html>
    <head>
         <title>Untitled</title>
    </head>
    <body>
         <jsp: useBean id="enBean" class = "ASimpleBean"/>
    </body>
    </html>

    Your problem most probably is that your class isn't a member of a package. A recent change to the way java/tomcat works is that classes in the default package (ie no package) aren't visible any more.
    Put your class in a package(eg SimplePackage), so your className would become simplePackage.ASimpleBean
    The class files should be placed under your web-inf/classes directory on your web application.
    Hope this helps,
    evnafets

  • Where to place javabeans in tomcat

    I have a problem finding my javabeans in apache tomcat 4. I have a project with jsp pages in a folder called crm. I have made some java beans which is in com.xxx.crm.beans package (folders). these folders (package) is placed in the crm folder and in my jsp page I use this code:
    <jsp:useBean id="ValidationBean" scope="session" class="com.xxx.crm.beans.ValidationBean" />
    <jsp:setProperty name="ValidationBean" property="*" />
    what am I missing out? I have also tried to restart tomcat. Do I have to place javabeans in the appservers classpath?
    Structure:
    crm/
    login.jsp
    crm/com/xxx/crm/beans/
    validationbean.class
    thanks in advance.
    nicolai

    thx :)
    I still run into problems. I have made the WEB-INF/classes folder and placed my folders and classes (com.xxx.crm.ValidationBean) in the project (jsp) folder. The message I get is:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /crm/login.jsp
    Generated servlet error:
        [javac] Compiling 1 source file
    C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:42: cannot resolve symbol
    symbol  : class ValidationBean
    location: class org.apache.jsp.login_jsp
          ValidationBean ValidationBean = null;
          ^
    An error occurred at line: 1 in the jsp file: /crm/login.jsp
    Generated servlet error:
    C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:44: cannot resolve symbol
    symbol  : class ValidationBean
    location: class org.apache.jsp.login_jsp
            ValidationBean = (ValidationBean) pageContext.getAttribute("ValidationBean", PageContext.SESSION_SCOPE);
                              ^
    An error occurred at line: 1 in the jsp file: /crm/login.jsp
    Generated servlet error:
    C:\jboss_tomcat\tomcat-4.1.x\work\Standalone\localhost\_\crm\login_jsp.java:47: cannot resolve symbol
    symbol  : class ValidationBean
    location: class org.apache.jsp.login_jsp
                ValidationBean = (ValidationBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "ValidationBean");
                                  ^
    3 errorsValidationBean code:
    package com.xxx.crm;
    import java.io.*;
    import java.lang.*;
    import java.sql.*;
    import javax.sql.*;
    import javax.naming.*;
    import com.mysql.jdbc.*;
    // bean class
    public class ValidationBean implements Serializable {
      protected String username;
      protected String password;
      protected boolean validUser = false;
      private boolean isValidated = false;
      // constructor
      public ValidationBean() {
      }I use Borland JBuilder 8 Personal, and have compiled it there.

  • Javabeans problem with Tomcat

    Hi!
    I�m using Tomcat 5.5 with jdk5.0. I�m trying to start using beans but can�t get my jsp-pages to read the beans. I have compiled the bean and keep the .class file in
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\Beans\test.class
    I keep the .jsp file in
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\kise\test.jsp
    It seems like the bean is not found. I�m thinking that I might need to set some paths but I don�t know which ones or how to set them.
    When trying to open the .jsp file that refers to the bean I get an internal server error message:
    org.apache.jasper.JasperException: /kise/test.jsp(8,6) The value for the useBean class attribute Beans.test is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3268)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Does anyone know what might be wrong? I would be very grateful for some help, I have been working on solving this for a day now.... /Malin

    Ok, here is the code for the bean:
    package Beans;
    import java.io.*;
    import java.beans.*;
    public class test implements java.io.Serializable {
         public String name;
         public String getName() {
              return name;
         public void setName(String value) {
              name=value;
    and here is the jsp-code:
    <HTML>
    <HEAD><TITLE>Test</TITLE>
    <BODY>
    <%@ page language="java" %>
    <%@ page import="Beans.test" %>
    <jsp:useBean id="malin" scope="session" class="Beans.test" />
    <jsp.setProperty name="malin" property="name" value="korv" />
    <jsp:getProperty name="malin" property="name" />
    </BODY>
    </HTML>
    Thanks for helping. /Malin

  • 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

  • Help with jsp and javaBean in eclipse/Tomcat

    Hi,
    I am new to JSP and JavaBean. I am going through tutorial for a jsp page that uses a javaBean. I am using eclipse to create jsp page and the java bean.
    My eclipse project "Date" has five package as under:-
    1. Deployment Descriptor
    2. Java Resources: src
    3. build
    4. WebContent
    I have my data.jsp page in WebContent/WEB-INF/ folder. When I just run date.jsp in a browser as: http://localhost:8080/Date/date.jsp, it gets launched into the browser correctly. But when I add a JavaBean "TimeFormatterBean.java" in the Java Resources:src folder and use it in date.jsp page, I get errors as under:-
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 5 in the jsp file: /date.jsp
    TimeFormatterBean cannot be resolved to a type
    2: pageEncoding="ISO-8859-1"%>
    3: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    4:
    5: <jsp:useBean id="formatter" class="TimeFormatterBean"/>
    6:
    7: <html>
    8: <head>
    The data.jsp page is as under:-
    <jsp:useBean id="formatter" class="TimeFormatterBean"/>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
         <h1> Date JSP </h1>
         <p> The  current time is:
         <%= new java.util.Date() %>
         <jsp:getProperty name="formatter" property="name"/>
         </p>
    </body>
    </html>I can see "TimeFormatterBean.class" in build/classes folder.
    If anyone could please help me out with this, it would be very helpful
    Thanks a lot!

    You probably should place TimeFormatterBean inside a package, or maybe you could try importing it , even if it�s in the default package, with something like this <%@ page import="TimeFormatterBean" %> at the top

  • JavaBean jsp and tomcat

    hi i'm beginner in java and jsp.So i'd try the javabeans but whitout succes...
    this my Hero.class file :
    package zobi;
    public class Hero {
              private String nom;          
              public Hero(String n){}          
              public void setHn(String n){
                        this.nom = n;
              public String getHn(){
                        return this.nom;
    and my .jsp :
    <%@ language="java" import="zobi.Hero" %>
    <html>
    <head>
    <title>JB essai:xxx</title>
    </head>
    <body>
    <jsp:useBean id="boris" scope="page" class="toto.Hero"/>
    <jsp:setProperty name="boris" property="setHn" value="bkoris"/>
    <jsp:getProperty name="boris" property="getHn" />
    </body>
    </html>
    when i'm runnig the jsp i have this errors :
    org.apache.jasper.JasperException: zobi.Hero
    and
    java.lang.ClassNotFoundException: zobi.Hero
    my toto.java & my toto.class files are in the subfolders Web-inf/classes/
    and i'm using tomcat4.1.24, so if U have an idea or a tip, please help me ;)
    good bye thx
    PS: sorry for my poor english :-\

    your error is being thrown from the Apache Jasper packages, so you might not find much useful info here, but what I'd do is check the mailing list archives at apache.org, and maybe see if Jasper has some API docs that will let you know when/why/where this error gets thrown.

  • Problem with JavaBeans in JSP.IT'S URGENT!!!

    Hi, i have problems with JavaBeans in JSP.
    In a jsp file( locating in ROOT directory of tomcat 4.0.6 :jakarta-tomcat-4.0.6\webapps\root ) i have this code:
    <jsp:useBean id="paramBean" class="licentza.ParamBean" />
    <jsp:setProperty name="paramBean"
    property="nume"
              value='<%= request.getParameter("numeUser") %>' />
    where ParamBean it's a "bean" class locating in jakarta-tomcat-4.0.6\webapps\examples\web-inf\classes\licentza (licentza is the package i'm using).
    And i get this error:
    Generated servlet error:
    D:\jakarta-tomcat-4.0.6\work\Standalone\localhost\_\dora\intrare2$jsp.java:67: Class licentza.ParamBean not found.
    ParamBean paramBean = null;
    What is the problem?Thank you.

    Hi,
    Put the class file or the package under :jakarta-tomcat-4.0.6\webapps\root\WEB-INF\classes.
    Rajesh

Maybe you are looking for

  • Call Forward to Voicemail

    I am having an issue when forwarding to another extension.  I know this is probably a simple answer but I'm stumped. I am going into the DN Configuration page for extension A.  Under Call Forward, for the destination I am entering extension B for: Fo

  • Mac OS X Lion Mailboxes cannot be read in Snow Leopard mail.

    Yesterday I made a backup of my Mail folder from the User Library, because I wanted to remove Lion by the usage of the Factory Disks, because Lion is too slow responsive. Now I am back to Snow Leopard, but I figured out that unlike Snow Leopard, Lion

  • How to change row colour without using WDTableCellDesign

    Hi I change the row colour of my tree table depending on the level of the tree. WDTableCellDesign doesn't have the colours that I want. I want to use different shades of blue. How do i do this? I have a variable of type type     com.sap.ide.webdynpro

  • JFileChooser - Select All Files in the Directory

    Hi all. I am currently using JFileChooser and I need a functionality that will let the user choose a directory and then automatically select all the files that exists in that directory. I have tried looking around for references, but no luck so far.

  • ESS - Translations management

    Hi everybody, I have installed ESS into SAP Portal. ESS works fine with any languages (EN IT FR ) The standard interface displays messages like : "Employee Self-Service applications provide you with easy access to information and services for employe