Impossible to access a bean from a JSP in NES 4.0

We are trying to use a bean in a JSP using the common tag <jsp:useBean id="... /> in a Netscape Enterprise Server 4.0.
Always we obtain the same error: "JSP compilation error: java.lang.Exception: JSP parse error (line 43) - Incomplete tag ending of /jsp:useBean". Someone can help us?
Thanks.

Check NAS4.0 supports jsp 0.92 specs?
use this tag...
<USEBEAN name="..." type="..." lifespan="..." >
</USEBEAN>

Similar Messages

  • Can't access a Bean from a JSP page !

    Hello everybody,
    I work with Oracle 8i 8.1.7, it means Oracle HTTP Server + Oracle JSP 1.1.0.0.0. But i don't use the Oracle Servlet Engine.
    In this context, i try to load ` JSP page, which instantiate a Bean. But it is impossible to access to this bean !...
    1) In jserv.properties file, i have mentionned the CLASSPATH to beans directory, as said in the OracleJSP documentation :
    wrapper.classpath=D:\...\myBeansDirectory\
    2) i have copied the .class file of my bean in the bean directory ...
    So did i forget something ?
    Seeking desperatly help !
    Thanks.

    Hi,
    Did you restart the HTTP listener after adding the CLASSPATH to the jserv.properties file? The change in jserv.properties (and in any other configuration files) will take effect only after the listener is restarted.
    Good luck,
    Srinivas.

  • Accessing Managed Beans from Code

    Hi,
    How can I access managed beans from my code? I am too new to JSF to know if what I am doing is right from a design perspective. But what I am trying to do is to use Actions as sort of a Web Facade that aggregates state from other beans (all of them Managed beans right now) to build up state that is necessary for displaying pages.
    Thanks for you help
    Suhail

    Just answering my own question. The answer was given in a different thread (http://forum.java.sun.com/thread.jsp?forum=427&thread=427057&message=1901909#1901909) . JSF has provided various Factories (look at the FactoryFinder API) that allow one I presume to access the internal state of a FacesContext. One of the factory is ApplicationFactory. This factory from what I can make out essentially gives you access to everything (actionlisteners, navigationhanlder,components etc) in you application. My original question was about accessing something (for some reason) named ValueBinding. I can access the managed beans declared in my faces-config.xml by invoking getValue(facesContext). I can naturally also set the value of a bean by invoking setValue(...). I just needed the getValue and it seems to work.
    Ofcourse keep in mind that the underlying managed bean will not necessarily be initialized when you access it so test for nullness. As a general rule I think its best not to create the beans but access them using this facility. After all its not for nothing these are called Managed Beans.
    Now if only the faces implementation would persist the changes to Navigation hanlders that one makes in the code ;-)

  • Database access by Bean, error in JSP(view)

    Hello,
    I have a web application. All my database connection logic, execution of query is done in my bean. I have verified that the code in my bean is fine and so I have not posted that code.
    My jsp code is as follows:
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    <html>
    <head><title>Trial JSP Page</title>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="PRIVATE">
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    </head>
    <jsp:useBean id="data" class="com.bean.samples.ConnectionBean"/>
    <jsp:setProperty name="data" property="drivername" value="oracle.jdbc.driver.OracleDriver"/>
    <jsp:setProperty name="data" property="url" value="jdbc:oracle:thin:@someurl"/>
    <jsp:setProperty name="data" property="username" value="name"/>
    <jsp:setProperty name="data" property="password" value="passwd"/>
    <jsp:setProperty name="data" property="query" value="SELECT * FROM tablename"/>
    <%
    data.processQuery();
    ResultSet rs = data.getRs();
    ResultSetMetaData rsmd = data.getRsmd();
    %>
    <body text="black">
    The table has <jsp:getProperty name="data" property="count"/> columns and <jsp:getProperty name="data" property="rowcnt"/>
    rows in it.
    The first column name is <%= rsmd.getColumnLabel(1) %>.
    The current row is <%= rs.getRow() %>.
    </pre>
    </body>
    </html>
    Output of browser:
    The table has 2 columns and 6 rows in it. The first column name is ITEMNO. The current row is
    Error: 500
    Location: /schedule/jsp/Trial.jsp
    Internal Servlet Error:
    java.lang.IllegalStateException: Response has already been committed
         java.lang.Throwable(java.lang.String)
         java.lang.Exception(java.lang.String)
         java.lang.RuntimeException(java.lang.String)
         java.lang.IllegalStateException(java.lang.String)
         void org.apache.tomcat.core.HttpServletResponseFacade.sendError(int, java.lang.String)
         void org.apache.jasper.runtime.JspServlet.unknownException(javax.servlet.http.HttpServletResponse, java.lang.Throwable)
         void org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
         void org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
         void org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request, org.apache.tomcat.core.Response)
         void org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection, java.lang.Object [])
         void org.apache.tomcat.service.TcpConnectionThread.run()
         void java.lang.Thread.run()
    Error is being thorwn on the statemnt:
    The current row is <%= rs.getRow() %>.
    Can anyone help with this?
    Thanks in advance.

    Hi beattris,
    No I dont close the rs and conn objects.
    The relevant method of my bean is :
    public void processQuery() throws Exception{
         try{
              Class.forName(getDrivername());
              conn = DriverManager.getConnection(getUrl(),getUsername(),getPassword());
              st = conn.createStatement();
              rs = st.executeQuery(getQuery());
              rsmd = rs.getMetaData();
              int columncount = rsmd.getColumnCount();
              int rowcount = 0;
              setCount(columncount);
              while(rs.next()){
                   rowcount++;
              setRowcnt(rowcount);
         }catch(Exception e){
              throw e;
    I did some searching on the internet for this error and found that it is tricky one and so far I havent found a way to correct it.
    The link i went to were:
    http://developer.java.sun.com/developer/Books/ProJSP/Chap19.pdf
    and
    http://archives2.real-time.com/rte-tomcat/2000/Jun/msg02490.html
    Well, I hope I get some answers soon.
    Thanks.

  • JNDI Naming Problem accessing Session Bean from Message Driven Bean

    Hi,
         I am facing a very strange problem in JNDI look up accessing a Session Bean from a Message Driven Bean. I have a session fa�ade bean(Remote Bean) which is being called from Struts Action class getting the home reference from the ServiceLocator (I have implemented ServiceLocator pattern to obtain JNDI reference for all EJBs). When I am calling the session fa�ade EJB from the Struts Action class everything is working fine.
         But when I am trying to call the same EJB from my Message Driven Bean, I am getting a JNDI exception (NameNotFoundException - No Object bound to name �java:comp/env/ejb/EJBJNDIName�). I am trying to get the remote reference from the same ServiceLocator which is successfully providing me a reference while calling from the struts action class. But the same ServiceLocator is not able to provide me a reference while calling from the Message Driven Bean. If I use the JNDI name directly like �EJBJNDIName� in the lookup it is working fine. The lookup for the name is working fine and I am able to call the Session Fa�ade bean with that reference.
         I am really not sure what exactly the problem is. If I have any problem in the ServiceLocator, it should have given me the same error while calling from Struts Action class. But it is working fine with the full name �java:comp/env/ejb/EJBJNDIName� calling from the struts action class. I am not sure whether Message Driven Bean has something to do with it. Why I am not able to get a reference of the EJB with the full name? Please Help.
    Thanks
    Amit

    Hi Bhagya,
    Thanks for your response. I think from EJB container we can call Local EJBs with the full JNDI name. The session facade bean which is being called is a remote bean. From the session facade bean I am calling a local stateless session bean for database access. I am getting the reference of the local EJB from my session facade bean with full JNDI name "java:comp/env/ejb/EJBJNDIName". It is working fine with out any problem. My servicelocator is able to provide me the reference of the local EJB from the session facade remote bean with Full JNDI name. I am only having this problem calling from the MDB. I am really not sure whether what is causing it?
    Thanks
    Amit

  • Accessing managed-bean in a JSP (portal theme).

    I have a tricky situation where I need to access a managed-bean outside a JSF jsr 168 api portlet. Now I need to reference the bean in the themes jsp (just fyi themes loosely relate to JSP's which control the look and feel, navigation within portal page). I was thinking of a way to set a managed-bean variable in the jsp before the portlet where the managed-bean is declared. Is this possible ? Any ideas ?

    You can just access managed beans using JSTL EL.${myBean}or if you strictly want to specify the scope, e.g. session scope${sessionScope.myBean}where "myBean" is the managed bean name. Keep in mind that you cannot use this in input elements, but only in output elements. If you want to use this in input elements, then you should be using JSF components with deferred EL #{myBean.input} and so on.

  • Accessing user libraries from deployed JSP. Problem

    I've created a workspace and project contining 1 web bean "AQABeanPK1.AQATableView" .
    I then used the 'manage libaries' to add it to Jdeveloper as a library.
    I also added the webbean to Jdeveloper via the manage web objects tool
    In my jsp project I included the library in the project settings
    created a JSP and used the web bean from the component palette.
    When I deploy the JSP I get the error :-
    Errors compiling:C:\jdev903\j2ee\home\application-deployments\webapp1\webapp1\persistence\_pages\\_CustomersView1__Browse.java
    Line # Error
    118
    [jsp src:line #:22]
    Class AQABeanPK1.AQATableView not found. AQABeanPK1.AQATableView CA = null;
    129
    [jsp src:line #:22]
    Class AQABeanPK1.AQATableView not found. CA = (AQABeanPK1.AQATableView) pageContext.findAttribute("CA");
    134
    [jsp src:line #:22]
    Class AQABeanPK1.AQATableView not found. CA = (AQABeanPK1.AQATableView) pageContext.findAttribute("CA");
    139
    [jsp src:line #:24]
    Variable CA may not have been initialized. CA.render();
    If I create the webbean in the same project as the JSP then I get a successful run.
    Any help on deploying user libraires would be appreciated
    Cheers
    Colin

    Place your web bean .jar file in the OC4J j2ee\home\lib directory.

  • WPC: Access Java beans from XSL

    Hi,
    How can we access custom Java beans from within the XSLs used to render WPC webforms? Do we have to implement a custom XSLT Helper? I am able to access standard Java classes using the <xmlns> tag but when I try to reference our custom classes the WPC editor throws a ClassNotFound exception. Any help will be appreciated.
    Thanks and Regards,
    Shibendra

    Hi,
    How can we access custom Java beans from within the XSLs used to render WPC webforms? Do we have to implement a custom XSLT Helper? I am able to access standard Java classes using the <xmlns> tag but when I try to reference our custom classes the WPC editor throws a ClassNotFound exception. Any help will be appreciated.
    Thanks and Regards,
    Shibendra

  • Sending Hashtable[] to Bean from a JSP

    Is it possible to send a Hashtable[] from a JSP to bean if possible
    how
    Thanks
    Srikanth

    In the HTML side use <input type="file"> tag as follows -
    <FORM action='fupload.jsp' method='POST'
    enctype='multipart/form-data'>
    <P><INPUT type=file id="fldFile" name="fldFile"></P>
    <P><INPUT type=submit id='btnSubmit' name='btnSubmit' value='Upload
    File'></P>
    </FORM>
    At the server side
    - read the request.getinputstream()
    - read the all the buffer until end of the stream
    - In the buffer move to the file data disposition, start writing to a file.
    To understand completely, read
    http://www.ietf.org/rfc/rfc1867.txt
    HTH.
    Elangs.

  • Accessing a EJB from a JSP

              A scenario from some one new to web server, server application development.
              I have downloaded and installed an evaluation copy of WebLogic 7.x and successfully
              installed it (W2K version). The product starts up without error and I can connect
              to is successfully. I have created a simple java bean (actually an EJB) and have
              been able to deploy it successfully without any errors.
              I have a simple JSP invoked from a simple HTML page that contains a simple form.
              The JSP is attempting to instaniate the bean via the jsp:useBean tag however,
              all I am able to get back is an error that tells me that my class "could not be
              loaded". Here is the stack trace:
              weblogic.servlet.jsp.JspException: (line 3): class 'USDataworks.MICRworks.MICRworksBean'
              could not be loaded
                   at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:710)
                   at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1372)
                   at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java:3612)
                   at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1924)
                   at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1817)
                   at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1745)
                   at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:959)
                   at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
                   at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
                   at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
                   at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
                   at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
                   at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
                   at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:517)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
                   at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
                   at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
                   at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
                   at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
                   at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
                   at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
                   at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              If I leave out the jsp:useBean tag I am able to return a simple HTML page based
              on information sent to the server, so I know some of the environment is properly
              set up.
              I have browsed through some of the WebLogic site and have been referred to any
              number of configuration files (*.properties) which do not appear to exist. I
              am frustrated and confused and would appreciate any help in getting this to work.
              Thank you.
              

              In the Weblogic 7.0.2 instalation, there is a tool for creating taglibrary to wrap
              an ejb cals to jsp tags. The tool names simply ejb2jsp and is described in document
              : "Programming Weblogic JSP" (pdf). My problem is: when I try to load my ejb ...jar
              file, the tool throws this Null pointer exception: (below).
              Have anybody some experience with this? It's the same for gui and cmd-line version.
              Could you advice me?
              Thank you.
              D:\SRC\jbproject\TestEntity>java weblogic.servlet.ejb2jsp.gui.Main
              error occurred: java.lang.NullPointerException
              java.lang.NullPointerException
              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:287)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
              at weblogic.servlet.ejb2jsp.Utils.createBeanDescriptor(Utils.java:343)
              at weblogic.servlet.ejb2jsp.Utils.createDefaultDescriptor(Utils.java:314
              at weblogic.servlet.ejb2jsp.Utils.createDefaultDescriptor(Utils.java:266
              at weblogic.servlet.ejb2jsp.gui.Main.loadFromPaths(Main.java:391)
              at weblogic.servlet.ejb2jsp.gui.Main.doNew(Main.java:378)
              at weblogic.servlet.ejb2jsp.gui.Main$5.run(Main.java:575)
              at weblogic.servlet.ejb2jsp.gui.MainWorker.run(Main.java:757)
              at java.lang.Thread.run(Thread.java:479)
              error occurred: java.lang.NullPointerException
              java.lang.NullPointerException
              at weblogic.servlet.ejb2jsp.gui.Main.doNew(Main.java:379)
              at weblogic.servlet.ejb2jsp.gui.Main$5.run(Main.java:575)
              at weblogic.servlet.ejb2jsp.gui.MainWorker.run(Main.java:757)
              at java.lang.Thread.run(Thread.java:479)
              "Xiang Rao" <[email protected]> wrote:
              >
              >EJB and Java Bean are two different things. I don't think you can use
              >useBean tag
              >for EJB. On the other hand, you can write a Java Bean to wrap your EJB
              >and use
              >useBean tag.
              >
              >"Marek Kossak" <[email protected]> wrote:
              >>
              >>A scenario from some one new to web server, server application development.
              >>
              >>I have downloaded and installed an evaluation copy of WebLogic 7.x and
              >>successfully
              >>installed it (W2K version). The product starts up without error and
              >>I can connect
              >>to is successfully. I have created a simple java bean (actually an
              >EJB)
              >>and have
              >>been able to deploy it successfully without any errors.
              >>
              >>I have a simple JSP invoked from a simple HTML page that contains a
              >simple
              >>form.
              >> The JSP is attempting to instaniate the bean via the jsp:useBean tag
              >>however,
              >>all I am able to get back is an error that tells me that my class "could
              >>not be
              >>loaded". Here is the stack trace:
              >>
              >>weblogic.servlet.jsp.JspException: (line 3): class 'USDataworks.MICRworks.MICRworksBean'
              >>could not be loaded
              >>     at weblogic.servlet.jsp.JspLexer.jspException(JspLexer.java:710)
              >>     at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1372)
              >>     at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java:3612)
              >>     at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1924)
              >>     at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1817)
              >>     at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1745)
              >>     at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:959)
              >>     at weblogic.servlet.jsp.JspParser.doit(JspParser.java:90)
              >>     at weblogic.servlet.jsp.JspParser.parse(JspParser.java:213)
              >>     at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              >>     at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
              >>     at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:353)
              >>     at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:211)
              >>     at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
              >>     at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:517)
              >>     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:351)
              >>     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
              >>     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5445)
              >>     at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:780)
              >>     at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3105)
              >>     at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2588)
              >>     at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:213)
              >>     at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:189)
              >>
              >>If I leave out the jsp:useBean tag I am able to return a simple HTML
              >>page based
              >>on information sent to the server, so I know some of the environment
              >>is properly
              >>set up.
              >>
              >>I have browsed through some of the WebLogic site and have been referred
              >>to any
              >>number of configuration files (*.properties) which do not appear to
              >exist.
              >> I
              >>am frustrated and confused and would appreciate any help in getting
              >this
              >>to work.
              >>
              >>Thank you.
              >
              

  • Accessing A DB From A JSP

    Hi,
    I've been using the code at the bottom of this message to access a database. I've been having some trouble though when the user stops the browser session mid way through a page loading. Occasionally it can cause the web server to crash. I'm guessing a connection must be left open somewhere, and that is causing the problem. Has anyone got any advice on ways I can avoid this?
    Cheers,
    Lee
    import java.sql.*;
    import java.util.*;
    public class DBAccess {
      // Username, password & URL for accessing tables
      private String uname = "username";
      private String pword = "password";
      private String url = "Conn URL here";
      // Declare connection and statement that will be used to create recordsets
      private Connection conn = null;
      private Statement stmt = null;
      private ResultSet rs = null;
      private int rowCount = 0;
      private int colCount = 0;
      private Properties props = new Properties();
      private Driver drv = null;
      // Get records from table and return in a 3D array
      public String[][] getTableRecords(String strSQL) {
        // Ensure that the variables used are set to 0 or null.  This will ensure
        // that there are no errors related to the results containing info from a
        // previous procedure call.
        rs = null;
        conn = null;
        stmt = null;
        rowCount = 0;
        colCount = 0;
        props = new Properties();
        drv = null;
        try {
          drv = (Driver) Class.forName("somedriver").newInstance();
        catch (Exception e) {
          System.out.println(e);
          return null;
        // Set properties for making a connection
        props.put("user", uname);
        props.put("password", pword);
        try {
          conn = drv.connect(url, props);
          stmt = conn.createStatement();
        catch (SQLException e) {
          System.out.println("SQL Error : " + e);
          return null;
        String[][] results = new String[0][0];
        // Execute SQL Query
        try {
          rs = stmt.executeQuery(strSQL);
          ResultSetMetaData rsmd = rs.getMetaData();
          // Get amount of columns.
          colCount = rsmd.getColumnCount();
          while (rs.next()) {
            rowCount++;
          // Remember to reset the resultset
          rs.close();
          rs = stmt.executeQuery(strSQL);
          if (rowCount < 1) {
            results = null;
          else {
            results = new String[rowCount][colCount];
            int currentRow = 0;
            while (rs.next()) {
              for (int i = 1; i <= colCount; i++) {
                String currentField = rs.getString(i);
                if (currentField == null) {
                  currentField = "";
                // -1 is used to make sure that the rows/columns with an index of 0 are filled
                results[currentRow][i - 1] = currentField;
              currentRow++;
          // Close everything
          rs.close();
          stmt.close();
          conn.close();
        catch (Exception e) {
          results = null;
          System.out.println("SQL Error : "+ e);
        return results;
      // Execute some SQL that doesn't return a recordset
      public void execSQL(String action) {
        try {
          drv = (Driver) Class.forName("drivername").newInstance();
        catch (Exception e) {
          System.out.println(e);
        // Set properties for making a connection
        props = new Properties();
        props.put("user", uname);
        props.put("password", pword);
        try {
          conn = drv.connect(url, props);
          stmt = conn.createStatement();
          stmt.execute(action);
          // Close connection and statement
          stmt.close();
          conn.close();
        catch (SQLException e) {
          try {
            conn.close();
            stmt.close();
          catch (Exception f) {
          System.out.println("SQL Error : " + e);
      // Return the number of columns that are in the resultset
      public int getNoOfCols() {
        return colCount;
    }

    There are more than one possibilities out there. I want to describe two of it.
    1) For rapid software development, you can use taglibs (Java Standard Tag Libraries or jakarta db taglibs) in your jsps. There are also other taglibs from different vendors, but I know only these two.
    2) You can use JNDI to establish a database connection through a datasource object. This is the more often way in a production environment. There are also possibilities with pooling and so on.
    It depends, on what you want to develop, for a simple page or prototyping, and low traffic, it is possible to use taglibs. For a complete web application, it is better to establish the connection through Datasources, which are handled by the JSP / Servlet container or the application server.
    so long
    ThK

  • ClassNotFoundException when trying to access applet (jar) from a jsp page?

    I have my applet in a jar file and I am specifying the applet tag in my jsp page as follows:
    <applet code="website.utils.DragDropUploadApplet.class" name="DragDropApp" width="17" height="17" archive="utils.jar" codebase="." ></applet>
    I tried with and without the codebase. The jar file is at the same location as the jsp page which has the above applet tag, however I get a ClassNotFoundException in the Sun Java Console in Internet Explorer. Any inputs on resolving this will be much appreciated.
    Here is the error:
    load: class website.utils.DragDropUploadApplet.class not found.
    java.lang.ClassNotFoundException: website.utils.DragDropUploadApplet.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more
    Exception in thread "Thread-12" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-website.utils.DragDropUploadApplet.class" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    load: class website.utils.DragDropUploadApplet.class not found.
    java.lang.ClassNotFoundException: website.utils.DragDropUploadApplet.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more
    Exception in thread "Thread-13" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-website.utils.DragDropUploadApplet.class" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    load: class website.utils.DragDropUploadApplet.class not found.
    java.lang.ClassNotFoundException: website.utils.DragDropUploadApplet.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more
    Exception in thread "Thread-14" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-website.utils.DragDropUploadApplet.class" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    load: class website.utils.DragDropUploadApplet.class not found.
    java.lang.ClassNotFoundException: website.utils.DragDropUploadApplet.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more
    Exception in thread "Thread-15" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    load: class website.utils.DragDropUploadApplet.class not found.
    java.lang.ClassNotFoundException: website.utils.DragDropUploadApplet.class
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadCode(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed.
    at sun.applet.AppletClassLoader.getBytes(Unknown Source)
    at sun.applet.AppletClassLoader.access$100(Unknown Source)
    at sun.applet.AppletClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 10 more
    Exception in thread "Thread-16" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-website.utils.DragDropUploadApplet.class" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "thread applet-website.utils.DragDropUploadApplet.class" java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Thanks,
    Monisha

    Hi mshah101,
    This can happen if the applet is compiled using an higher version of java and the browser is pointing to an older version (even if minor version number is higher)

  • Accessing input field from the JSP in dynpage

    HI all,
          I am trying to access the input field of the jsp page in my JSPDynpage but it is always return null.My Input is a normal HTML element not a HTMLB element
    JSP File :
         <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
      <hbj:form id="myFormId" >
         <div class="content">
            <table cellpadding="2" cellspacing="2">
                        <tr>
                               <td>
                                  <label for="name"><strong>UserName:</strong></label><span id="info_name">(This field is required)</span><br />                           
                                     <input name="name" id="name" size="10" maxlength="10" type="text" />
                               </td>
                        </tr>
                        <tr>
                             <td>
                                  <label for="email"><strong>EmailID:</strong></label><span id="info_email">(This field is required)</span><br />                           
                                     <input name="email" id="email" size="20" maxlength="20" type="text" /></td>
                        </tr>\
    </Table>
    JSPDynpage:
           InputField myInputField = (InputField) getComponentByName("name");
         if (myInputField != null) {
          name = myInputField.getValueAsDataType().toString();
                   InputField myInputField1 = (InputField) getComponentByName("email");
         if (myInputField1 != null) {
          name = myInputField1.getValueAsDataType().toString();
    In both the cases myInputField and myInputField1 are null . My Question is what should be the parameter that i need to pass for getComponentByName method.
    Regards,
    Raj.

    hi,
    The way you are trying to get the input field value works good with hbj type elements.
    either you change your input field to an hbj one or use java script inside your jsp page to catch the value
    like
    for HTML:
    [HTML Input Field|http://www.w3schools.com/HTMLDOM/met_doc_getelementbyid.asp]
    and for HTMLB
    refer this link:
    [SAP HTMLB GuideLines|http://www.sapdesignguild.org/resources/htmlb_guidance/index.html]
    Regards,
    Srinu

  • Impossible to access the appstore from my iphone 4 ios 5.1 after identification failure with unknown error message

    from yesterday - impossible to update apps from appstore - unknown message - after identification when the download starts

    Look to the right under More Like This ---------->

  • Error while accessing seesion bean from java client, is the lookup ok?

    I got the following error..
    Exception in thread "main" java.lang.VerifyError: (class: com/sun/enterprise/iio
    p/POAEJBORB, method: addCSIv2Component signature: (Lcom/sun/corba/ee/internal/co
    re/IOR;[B)Lcom/sun/corba/ee/internal/core/IOR;) Incompatible object argument for
    function call
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:199)
            at org.omg.CORBA.ORB.create_impl(ORB.java:303)
            at org.omg.CORBA.ORB.init(ORB.java:352)
            at com.sun.enterprise.util.ORBManager.createORB(ORBManager.java:140)
            at com.sun.enterprise.util.ORBManager.init(ORBManager.java:69)
            at com.sun.enterprise.naming.java.javaURLContextFactory.getObjectInstanc
    e(javaURLContextFactory.java:27)
            at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:594)
            at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:543)
            at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.jav
    a:282)
            at javax.naming.InitialContext.lookup(InitialContext.java:357)
            at samples.helloworld.ejb.Client.main(Client.java:32)
    the program is:
    env.put("java.naming.factory.initial",
                       "com.sun.jndi.cosnaming.CNCtxFactory");
               env.put("java.naming.provider.url", "iiop://" + host + ":"+port);
               System.out.println("after setting properties.");
               Context initial = new InitialContext(env);
               System.out.println("before setting initial context.");
               Object objref = initial.lookup("GreeterEJB");
               System.out.println("after lookup.");
    //END OF ADDITIONS FOR IAS
               //Context initial = new InitialContext();
               //Object objref = initial.lookup("GreeterEJB");
               System.out.println("before home");
               GreeterHome home = (GreeterHome)PortableRemoteObject.narrow(objref,
                                                GreeterHome.class);
               System.out.println("before create");
               Greeter remote = home.create();
               String msg = remote.getGreeting();                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    This error usually shoots up due to the incompatibility with the dependecies. Can you please summarise how you went on compiling the application. Meanwhile, I'm trying to simulate same scenario with the GreeterEJB and the Converter examples.
    Regards
    Raj

Maybe you are looking for

  • Problem with HTML in a read only textarea item

    I'm working on a messaging system for our site. For the body of the message, we use a standard textarea item. However, if we come to the messaging page from a certain page in our system, then we pre-load the textarea item, and make it read only. The

  • Terminal how can i get the picture dimension of a file?

    Is it possible to get the dimension of an picture (120 x 120 px) via terminal command? The information is visible under the finder "getinfo" command for picture files. Can anyone help?

  • Upgrade Elements from App Store to another version?

    I am learning that the version of Elements 10 that I purchased from the Mac App Store doesn't accept actions. Is there a way to upgrade to a version that does? Thank you!!

  • Can't upgrade anything in my system.

    Started off this problem with a normal system update. Was notified pacman should be updated first, went to update it: core is up to date extra 1383.4K 259.2K/s 00:00:05 [###########################################] 100% community is up to date :: The

  • Autocad hatches and "open" swatch

    Hey guys. I'm doing my thesis in landscape architecture, working a lot in illustrator. I was wondering if is there any chance to get some cool autocad hatches that I have into Illustrator, to make them swatches. I was looking also a way to have "open