Jsp:useBean error.

Under webapps\CustSys\web-inf\classes, I have save my CIS.class file. Is this the rite way to access the java class file : doReport() is a function inside the class file.
Inside test2.jsp:
<jsp:useBean id="report" scope="application" class="CIS"/>
<html>
<%report.doReport();%>
</html>
the following error appear:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 0 in the jsp file: /test2.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Tomcat4129\work\Standalone\localhost\CustSys\test2_jsp.java:41: cannot resolve symbol
symbol : class CIS
location: class org.apache.jsp.test2_jsp
CIS report = null;
^
An error occurred at line: 0 in the jsp file: /test2.jsp
Generated servlet error:
C:\Tomcat4129\work\Standalone\localhost\CustSys\test2_jsp.java:43: cannot resolve symbol
symbol : class CIS
location: class org.apache.jsp.test2_jsp
report = (CIS) pageContext.getAttribute("report", PageContext.APPLICATION_SCOPE);
^
An error occurred at line: 0 in the jsp file: /test2.jsp
Generated servlet error:
C:\Tomcat4129\work\Standalone\localhost\CustSys\test2_jsp.java:46: cannot resolve symbol
symbol : class CIS
location: class org.apache.jsp.test2_jsp
report = (CIS) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "CIS");
^
3 errors
     at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
     at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
     at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:353)
     at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
     at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
     at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
     at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
     at java.lang.Thread.run(Thread.java:534)
pls help identify wat's the error. thanks

You will have to put the CIS class in a package and provide the fully qualified class name pkg.CIS in your useBean defintion
cheers,
ram.

Similar Messages

  • jsp:useBean error== The value for useBean class is invalid

    Can anybody tell me why am i getting the error for the JavaBean.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /SimpleBean.jsp(9,0) The value for the useBean class attribute com.stardeveloper.bean.test.SimpleBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1272)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3426)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:216)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.
    Apache Tomcat/6.0.20
    my jsp file is in path c:\tomcat6\webapps\dev\SimpleBean.jsp
    my JavaBean compiled class is in path
    c:\tomcat6\webapps\dev\WEB-INF\classes\com\stardeveloper\bean\test\SimpleBean.class
    and my SimpleBean java class declaration is
    package com.stardeveloper.bean.test;
    public class SimpleBean implements java.io.Serializable
    and my jsp page SimpleBean.jsp pages call to useBean is as follows
    <jsp:useBean id="simple" class="com.stardeveloper.bean.test.SimpleBean">
         <jsp:setProperty name="simple" property="name" value="Sujoy" />
         <jsp:setProperty name="simple" property="age" value="26" />
    </jsp:useBean>
    Please help me anybody.

    First, try restarting Tomcat :-)
    Main 3 reasons for "useBean class is invalid"
    - class must be in a package (ok)
    - class must be public, and have public constructor that takes no arguments (check)
    - class must be compiled, valid and on the classpath. Normally this means the WEB-INF/classes directory.
    From what you have told us, everything seems to check out.
    Try recompiling the .class file to ensure it is valid.
    Does your constructor do anything which might thrown an exception?
    Can you invoke it in scriptlet code without getting an exception?
    <%@ page import="com.stardeveloper.bean.test.SimpleBean" %>
    <% SimpleBean sb = new SimpleBean() %>Trying it in scriptlet code like this might give you a different error message that might help your diagnosis.
    cheers,
    evnafets

  • Jsp:useBean giving error while compiling JSP's in JDeveloper

    Hello,
    I am having another problem with JSP's in JDeveloper 10.1.3. jsp:useBean and jsp:setProperty are all giving problems. I am not sure what I need to do to get rid of this error
    Thanks,
    Lakshmisri

    Your original post mentions issues with jsp:useBean and jsp:setProperty, now you're talking about tag libraries and directives. Can you be more specific about what you're trying to do? Are you having problems getting JDev to recognize a tag library or are you having problems with the tag library when running the app? What directive are you trying to use that causes the termination error?

  • 9.0.3 Preview - Class not found error after including jsp:useBean

    Hi,
    I got a Java.lang.NoClassDefFoundError while compiling a JSP Page, after including a simple web bean as follows:
    <jsp:useBean id="catviews" scope="request" class="CategoryView" />
    <jsp:setProperty name="catviews" property="*" />
    somewhere within the HTML page...
    <%= catviews.getCategory() %>
    The JSP page without the bean compiles fine and the Javabean itself compiles without error. The bean class is where JDev automatically puts it (i.e in a sub-directory of the classes directory within the project) and JDev does not raise any error on that JSP Page before compiling.
    The error seems to point to the first line of the page, to the directive of the JSP page:
    <%@ contentType="text/html" ... %> which is apparently harmless. What can be wrong ?
    Thanks for your reply.

    'Class not found' means 'Class not found' , the class you are referencing is not in your project's classpath. You should make sure your project's classpath point to the location where this class is deployed to. This could be a directory or a .jar file. You should also include the package name as part fo the class.

  • Error trying to use jsp:useBean

              I am trying to use a class in a JSP that is basically a connection to an
              Oracle database. It works fine when used from a servlet. However, when I try
              to instantiate it from a JPS page, I get errors. Here is the snippet from
              the JSP page:
              <%@ page import="engr.projmgmt.*" %>
              <jsp:useBean id="OB" class="engr.projmgmt.OracleBroker" />
              The class is here:
              /usr/local/apache/servlets/engr/projmgmt/OracleBroker.class
              The weblogic class path contains /usr/local/apache/servlets.
              I get the following error in the weblogic log:
              Mon Aug 13 17:39:15 PDT 2001:<E> <ServletContext-General> Servlet failed
              with Exception
              java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
              java.lang.IllegalAccessException: engr/projmgmt/OracleBroker
              at java.beans.Beans.instantiate(Beans.java:215)
              at java.beans.Beans.instantiate(Beans.java:55)
              at jsp_servlet._PM._index._jspService(_index.java:90)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :120)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:915)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:879)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:269)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              --------------- nested within: ------------------
              weblogic.utils.NestedRuntimeException: cannot instantiate
              'engr.projmgmt.OracleBroker' - with nested exception:
              [java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
              java.lang.IllegalAccessException: engr/projmgmt/OracleBroker]
              at jsp_servlet._PM._index._jspService(_index.java:92)
              at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              :120)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:915)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              l.java:879)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              Manager.java:269)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              Anyone have anyideas?
              Thanks,
              CC
              

    I appears that your default constructor is not publicly accessible from the
              exception.
              Sam
              "Chuck Carson" <[email protected]> wrote in message
              news:[email protected]...
              >
              > I am trying to use a class in a JSP that is basically a connection to an
              > Oracle database. It works fine when used from a servlet. However, when I
              try
              > to instantiate it from a JPS page, I get errors. Here is the snippet from
              > the JSP page:
              >
              > <%@ page import="engr.projmgmt.*" %>
              > <jsp:useBean id="OB" class="engr.projmgmt.OracleBroker" />
              >
              > The class is here:
              > /usr/local/apache/servlets/engr/projmgmt/OracleBroker.class
              > The weblogic class path contains /usr/local/apache/servlets.
              >
              > I get the following error in the weblogic log:
              >
              > Mon Aug 13 17:39:15 PDT 2001:<E> <ServletContext-General> Servlet failed
              > with Exception
              > java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
              > java.lang.IllegalAccessException: engr/projmgmt/OracleBroker
              > at java.beans.Beans.instantiate(Beans.java:215)
              > at java.beans.Beans.instantiate(Beans.java:55)
              > at jsp_servlet._PM._index._jspService(_index.java:90)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              > :120)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:915)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:879)
              > at
              >
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              > Manager.java:269)
              > at
              >
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              > at
              > weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              > --------------- nested within: ------------------
              > weblogic.utils.NestedRuntimeException: cannot instantiate
              > 'engr.projmgmt.OracleBroker' - with nested exception:
              > [java.lang.ClassNotFoundException: class engr.projmgmt.OracleBroker :
              > java.lang.IllegalAccessException: engr/projmgmt/OracleBroker]
              > at jsp_servlet._PM._index._jspService(_index.java:92)
              > at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
              > at
              >
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
              > :120)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:915)
              > at
              >
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
              > l.java:879)
              > at
              >
              weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
              > Manager.java:269)
              > at
              >
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              > at
              > weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              >
              >
              > Anyone have anyideas?
              >
              > Thanks,
              > CC
              >
              >
              

  • How to assign the class value dynamically  in jsp:useBean ?its urgent

    Hi
    I want to set the class value of <jsp:useBean> dynamically
    when i am trying to this way
    <jsp:useBean id="<%=id %>" class="<%=beanclass %>" scope="request">
    <jsp:setProperty name="<%=id %>" property="*"/>
    </jsp:useBean>
    where beanclass is .class file that is to be used by the usebean tag
    i am getting following error
    The value for the useBean class attribute <%=beanclass %> is invalid.
    please help as soon as possible
    regards,
    Rameshwari

    You can not do that.The jsp:useBean and jsp:setProperty are action tags and not custom tags. Action tags get translated into Java code in the translation unit and are then compiled. Custom tag are backed by classes and the tag get translated into a method call of the class.

  • Jsp:useBean

    I really shouldn't be trying to use JSP any more ...
    I have been having problems using JavaBeans in JSP pages now - every time a problem is solved, that other little thing that always wanted a go at annoying me arrives ...
    The code is:
    <jsp:useBean id="pollResult" scope="application" class="com.ora.jsp.beans.poll.PollBean" />Because another JSP page I created (using JavaBeans) worked, using a JavaBean from the directory com.ora.jsp.beans.userinfo.UserInfoBean, I assumed that THIS would work - but it didn't! The error was:
    org.apache.jasper.JasperException: /calculate.jsp(11,2) According to TLD or attribute directive in tag file, attribute test does not accept any expressionsAnother problem, is there a solution?
    Sincerely, I'm sorry to plague everyone out there with all my problems - maybe I should give up and become a potato farmer instead ...

    Hi
    My Calculate.jsp looks like this:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <jsp:useBean id="pollResult" scope="application"
      class="com.ora.jsp.beans.poll.PollBean" />
    <jsp:useBean id="answer" class="com.ora.jsp.beans.poll.AnswerBean" >
      <jsp:setProperty name="answer" property="*" />
    </jsp:useBean>
    <c:choose>
      <c:when test="${answer.valid}" >
        <c:set target="${pollResult}" property="answer"
          value="${answer}" />
        <jsp:forward page="result.jsp" />
      </c:when>
      <c:otherwise>
        <jsp:forward page="poll.jsp" />
      </c:otherwise>
    </c:choose>I am using JSTL 1.1.

  • Jsp:useBean gives cannot be resolved to a type in Tomcat

    Hi, I am using Tomcat 5.5
    I have a simple JavaBean for test purposes :
    import java.io.Serializable;
        public class testBean implements Serializable {
            int number;
            public testBean() {
            public int getNumber() {
                return number;
            public void setNumber(int newValue) {
                number = newValue;
        }In a file called testBean.java
    I have successfuly compiled it and put the class file the WEB-INF/classes directory.
    I have the following JSP page :
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <jsp:useBean id="pub" scope="session" class="testBean" />
    <jsp:setProperty name="pub" property="number" value="1" />
    <html>
    <head>
    </head>
    <body>
    <jsp:getProperty name="pub" property="number" />
    </body>
    </html>When I open this jsp page I get the following error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /test.jsp
    Generated servlet error:
    testBean cannot be resolved to a typeThis example is pretty minimal and I don't understand why it doesn't work. The error seems to be coming from the first JSP statement.
    Any help would be greatly appreciated.
    Thanks in advance.

    1. Put your bean class in a package.
    package test;
    import...........2. Put the .class file in web-inf/classes/test/testBean.class
    3. Specify the fully qualified name of the class in the useBean declaration.
    <jsp:useBean class="test.testBean" .../>Note: You'd be better off following the java bean naming conventions. Specifically your class name should be TestBean (first letter caps).
    ram.

  • Need help on jsp:useBean

    My JSP code that calls the bean is as follows:
    <%@ page import ="java.sql.*" %>
    <%! String loginId, logPassword; %>
    <% loginId=request.getParameter("LoginId");
         logPassword=request.getParameter ("LogPassword");%>
    <jsp:useBean id="simpleCon" scope="session" class="OSA_Java.SimpleConnection">
    <jsp:setProperty name="simpleCon" property="driver"
    value="sun.jdbc.odbc.JdbcOdbcDriver"/>
    <jsp:setProperty name="simpleCon" property="url" value="jdbc:odbc:OSA"/>
    <jsp:setProperty name="simpleCon" property="username" value=""/>
    <jsp:setProperty name="simpleCon" property="password" value=""/>
    </jsp:useBean>
    <%! Connection conObj; %>
    <% conObj=simpleCon.getCon();%>
    <% if ( conObj == null)
         { out.println ("Connection failed");return; }
    %>
    <jsp:useBean id="loginBean" scope="session" class="OSA_Java.LoginBean">
    <jsp:setProperty name="loginBean" property="con" value="<%=conObj%>"/>
    <jsp:setProperty name="loginBean" property="loginId" value="<%=loginId%>"/>
    <jsp:setProperty name="loginBean" property="logPassword" value="<%=logPassword%>"/>
    <jsp:setProperty name="loginBean" property="*" />
    </jsp:useBean>
    <html>
    <head>
    <title>Customer Orders</title>
    <h4><center>Customer Orders</center> </h4>
    </head>
    <body>
    <%
         String loginResults = loginBean.getCustomerName();
         if (loginResults != null)
              out.println ("Hello " + loginResults + "!! Welcome to this site" );
    %>
    <pre>
         Place Orders Track
    Orders Report Defects/Changes
    </pre>
    <% }
         else { %> 
              <%= "Error!!! Invalid User Name/Password" %>
              <%@ include file="Login.htm" %>
         <% } %>
    </p>
    <p>
    </p>
    <p>
    </p>
    <p>
    </p>
    </body>
    </html>
    My bean code for SimpleConnection is as follows:
    package OSA_Java;
    import java.sql.*;
    public class SimpleConnection
         public String driver, url, username, password;
         public String loginId,logPassword;
         public Connection con;
         public SimpleConnection () {}
         public void setDriver (String driver)
              this.driver = driver;
         public String getDriver ()
              return driver;
         public void setUrl (String url)
              this.url = url;
         public String getUrl ()
              return url;
         public void setUsername (String userName)
              this.username = username;
         public String getUsername ()
              return username;
         public void setPassword (String password)
              this.password = password;
         public String getPassword ()
              return password;
         public void setLoginId (String loginId)
              this.loginId = loginId;
         public String getLoginId ()
              return loginId;
         public void setLogPassword (String logPassword)
                   this.logPassword = logPassword;
              public String getLogPassword ()
                   return logPassword;
         public void setCon (Connection con)
              this.con = con;
         public Connection getCon ()
              System.out.println ("in get Con url" + con + " driver " + driver);
              if ( con == null) // Connect, if not already connected
                   try
                        //Load database driver.
                        Class.forName (driver);
                        // Establish network connection to database
                        System.out.println(driver);
                        con= DriverManager.getConnection (url, username, password);
                        System.out.println("in get url" + url);
                   } catch(Exception e)
                        System.out.println("in get Con" + e);
                   System.out.println("returning con" + con);
                   return con;
    When I load the JSP file, it prints a message "connection failed".
    and no message from SimpleConnection is printed on the server.
    Thanks
    newtojsp

    <jsp:useBean id="simpleCon" scope="session" class="OSA_Java.SimpleConnection">
    <jsp:setProperty name="simpleCon" property="driver"
    value="sun.jdbc.odbc.JdbcOdbcDriver"/>
    <jsp:setProperty name="simpleCon" property="url" value="jdbc:odbc:OSA"/>
    <jsp:setProperty name="simpleCon" property="username" value=""/>
    <jsp:setProperty name="simpleCon" property="password" value=""/>
    </jsp:useBean>
    Where is your .class file from the bean? Is it under /WEB-INF/classes/OSA_Java/SimpleConnection.class?

  • Not getting sets for jsp:useBean bean when in request scope

    I have a JSF (JSP) page in which I have a bean that I declare using jsp:useBean.
    The bean implements Map. I have a h:inputText and an h:inputHidden with a value referencing the bean.
    The odd thing is that if in jsp:useBean, I set the scope to session, everything works as I expect. However, if I change the scope to request, the put method on the bean never gets called.
    Can anyone explain why this is happening?
    Thanks,
    ken clark

    Yes, I understand that old data I had is gone -- that is fine, I expect that.
    My question is, why do I not get calls on the put method of my Map implementation when the screen is submitted? (I have a breakpoint in the method in the debugger, so I know when I get hit.)
    If the scope is session, I get put calls (yes, the old data is there, it gets overwritten).
    If the scope is request though, I simply never see the calls made at all, and my application errors out for lack of data.

  • JSP:useBean in Tomcat with external libraries

    Hi!
    I would like to use netbeans 4.1 for developing jsp-pages, but are facing a problem when trying to use the built-in jsp compiler.
    in my code I use something like:
    <jsp:useBean id="id" class="package.Classname" scope="application" />while package is an external package initially created from JAXB. To include it into netbeans, I have put the directory containing all the classes into the build libraries and also into the test libraries. In the 'Projects'-Explorer it shows all the classes contained.
    When I try to run the jsp-File, I get an error like this:
    Compiling 1 source file to C:\Develop\ApplicationDescriptionGenerator\build\generated\classes
    C:\Develop\ApplicationDescriptionGenerator\build\generated\src\org\apache\jsp\general_jsp.java:48: cannot find symbol
    symbol: class Classname
    location packageI do not understand this behaviour, especially, as the 'web' folder created by netbeans includes all necessary classes, and when I copy it to my tomcat installation, it works fine.
    Does anybody know, what I have to change, so that I can test it from inside netbeans?
    Thanks a lot!

    Here is the java program or bean class that I'm using, UserData.java compiled into UserData.class:
    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; }
    To put the data into the session, I used the following form:
    <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>
    and SaveName.jsp is this:
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>

  • Jsp:useBean   in a session

    I'm going through a JSP tutorial and I've gotten to the Beans and Form Processing section. I'm having the Form submit a jsp page(SaveName.jsp), within this jsp the first line has problems
    <jsp:useBean id="user" class="UserData" scope="session"/>
    Looks like the "user" is not getting created into the session. I've compiled the UserData.java program and put the UserData.class file in the proper classes folder that is in my ClassPath.
    Does anyone see anything that I'm missing here, or I can provide more info too.
    Thanks,
    KLWatter
    HTTP Status 500 -
    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:
    [javac] Compiling 1 source file
    C:\Tomcat 5.0\work\Catalina\localhost\_\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:\Tomcat 5.0\work\Catalina\localhost\_\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:\Tomcat 5.0\work\Catalina\localhost\_\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:127)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    Here is the java program or bean class that I'm using, UserData.java compiled into UserData.class:
    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; }
    To put the data into the session, I used the following form:
    <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>
    and SaveName.jsp is this:
    <jsp:useBean id="user" class="UserData" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>

  • Unable to use jsp:useBean tag

    when I use
    <jsp:useBean id="addressBean" class="AddressBean" scope="session"/>
    I get the following error
    Exception Details: org.apache.jasper.JasperException
    Unable to compile class for JSP No Java compiler was found to compile the generated source for the JSP. This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK to the common/lib directory of the Tomcat server, followed by a Tomcat restart. If using an alternate Java compiler, please check its installation and access path.
    So my question is how to use the <jsp:useBean> tag in JSC

    Please see my message How to set developer's mode for oracle jsp engine.
    As a very early warning of the future, this way of setting configuration paramemter in web.xml for oracle jsp engine will be deprecated in the next major version of oc4j and desupported probably later on. Yes, it is still supported in 10.1.3 and the next major version, though.

  • The element type jsp:useBean must be terminated by the matching end-tag

    Hi, I have deployed an application under WLS 8.1 SP4 and I get this error, when I try to access a page. I searched through the BEA site and it does refer to solution id S-13709 which says issue has been fixed in WLS 7.0. Hence should I not be seeing this error?
              java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page: "org.xml.sax.SAXParseException: The element type "jsp:useBean" must be terminated by the matching end-tag "</jsp:useBean>"., "

    It would be useful if you provided a little more information about what you're trying to do on your JSP page. For instance, are you using an include directive or include action on the page? Are you trying to start the "jsp:useBean" element in one file, and end it in another? That, in particular, would likely be rejected.

  • jsp:useBean... didn't create new bean?

    According to tutorial or specification (in my perception),
    the following tag will create a new bean if it doesn't
    exist:
        <jsp:useBean id="prodDetail"
            class="mycomp.model.ProductDetail"
            scope="request" />Say I put the tag in Product.jsp, and it is an entry form
    for insert and update a new product. For insert, I intend
    to access Product.jsp directly from browser. For update,
    I have clients to access a servlet that in turn, will
    dispatch {[Product.jsp + prodDetail to be updated)}.
    There was no problem with update, however, for insert
    (directly access Product.jsp via url), I got this exception.
    I am using Tomcat, and I wonder whether it's a "Java error"
    or "Tomcat error".
    Any help would be appreciated. Thanks...
    javax.servlet.ServletException
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
         at _0002fProduct_0002ejspProduct_jsp_0._jspService(_0002fProduct_0002ejspProduct_jsp_0.java:187)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    ...etc...
    Root cause:
    java.lang.NullPointerException
         at _0002fProduct_0002ejspProduct_jsp_0._jspService(_0002fProduct_0002ejspProduct_jsp_0.java:112)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
    ...etc...

    Whoops, sorry, I made a silly silly mistake, apparently
    there was an extra scriplet <% } %> I forgot to delete.
    It's works now....
    I figured that out when I was composing following posting
    about snipplet of the JSP..., so I guess this "embarassing"
    posting does help me too...., in a short time :D

Maybe you are looking for

  • Possible to determine exception thrown in a finally block?

    I believe the answer to this is 'no', but I thought I would ask just to confirm. If an exception is thrown in a try block, is there a way in the finally block to determine what exception was thrown? I tried using Throwable#fillinStackTrace and Thread

  • IChat audio/video not working in a particular scenario.

    Three differnt people with 3 different setups trying to do an audio chat: John: MacBook(2.0Ghz, Leopard), connected via AirportExpress, using an AIM account Anne: MacBook(2.4Ghz, Snow Leopard), connected via a 3G USB Modem, using a .Mac account Mark:

  • Why do I have to pay more?

    So I want to buy a Production PRemium CS6. It costs 1899$ in the US and almost 2200$ in Russia. And Adobe does not allow me to buy it in the US store for I have registere my account in Russia. What the ...? It's digital download, why do I have to pay

  • AR balances not tally wth GL balances

    Hi Experts, When comparing the GL account balance (AR reconciliation account) VS customer balances in local currency report (FI-AR),noticed that there is a differences. And after checking I foud out that the differences are due to the reconciliation

  • Sftp to idoc issue

    Hi experts, I have requirement on sftp to idoc interface where I NEED TO SEND 100  FROM SFTP TO SAP VIA SAP PI.I HAVE TO SEND 100 RECORDS.IN 100 RECORDS 99 RECORDS ARE 15 FIELDS AND ONLY ONE RECORD  HAVE 17 FEILDS . HOW CAN I SEND 17 FIELDS RECORD FR