Simple jsp example of using BI Bean in Myeclipse

hi
anyone can show me a simple jsp example of using BI Bean in Myeclipse
or how to import BI Bean into Myeclipse
I would so thankful for who can answer me.. please its urgent
thanks

Sorry, I was not very clear in my last message.
I need all my webservices to share the same bean during one user session.
Then, if a page calls 2 different web services, only 1 database connection is made instead of 2. And if the user opens other pages which call other webservices, they will use the connection kept into the session bean.
Anyway, I tried to do like it is said in your website but I can not build my project. I have an error : java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/.../build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. I do not understand because I have downloaded the jax-ws 2.1.1 api and no other libraries are imported in my project. :-(
I wonder if it is not related to netbeans...

Similar Messages

  • Simple JSP example problems

    Hello, I am new to JSP and I was wondering if I could get some help from some people that know what they are doing. I'm trying to run a simple JSP example that I got out of a book. But I've modified it a bit to just play around with it. But it doesn't want to run. I'm starting to think it's something wrong with the way I'm building/installing the stuff. I'm running IBM WebSphere 4 and JBuilder 8. I was just wondering if you could look at my code just to make sure I'm doing this right.
    It's a pretty simple example. A JSP calls a class to get a message to print out.
    Here's the code for the class: (HelloWorld.java)
    package helloworld;
    public class HelloWorld
    private String message = "No message specified";
    public String getMessage()
    return(message);
    public void setMessage(String message)
    this.message = message;
    =================================================================
    Here's the code for the JSP: (HelloWorld.jsp)
    <html>
    <head>
    <title>Using JavaBeans with JSP</title>
    </head>
    <body>
    <jsp:useBean id="helloWorld" class = "helloworld.HelloWorld" />
    <ol>
    <li>Initial Value (JSP Expression):
    <%= helloWorld.getMessage() %></li>
    <li><jsp:setProperty name="helloWorld"
    property="message"
    value="Hello World" />
    Value after setting property with setProperty:
    <jsp:getProperty name="helloWorld"
    property="message" /></li>
    </ol>
    </body>
    </html>
    I just wanted to be able to test out a JSP hitting a class file. Does someone have a better/easier way to do this? Or do you see anything wrong with my example? Thanks in advance.

    The 1 thing missing in your example is the import directive for the helloworld.HelloWorld class.
    Add the following line somewhere around the start of your jsp and things should be fine
    <%@ page import="helloworld.HelloWorld" %>
    Cheers

  • JSP on BEA  Weblogic: random error when loading a jsp page that uses a Bean

    Hi!
    I wrote a simple jsp page that stores a String in a JavaBean, and then forwards to another jsp page to display that String. The jsp pages are deployed on a BEA Weblogic 6 Server, but I get a weird behaviour when loading the page into my browser. Usually I get an error message:
    /Response.jsp(9): class 'query.jsp.QueryBean' could not be loaded
    probably occurred due to an error in /Query.jsp line 9:
    <jsp:useBean id = "queryBean" scope = "request" class = "query.jsp.QueryBean" />
    But the funny thing is that after reloading the page a few times it eventually works. The bahaviour seems to be totally random - sometimes it works, sometimes it claims not finding the JavaBean class.
    Anyone experienced something similar?
    Thank you very much,
    Charlie

    Is QueryBean.class located under '<appname>/Web_inf/query/jsp/'?
    If it is please try changing the package name to something else like com.myclass or something like that.

  • Example of using session bean with webservices

    Hello,
    I am working with netbeans 5.5 (with JAX-WS 2.0 library) and using Tomcat.
    I have created webservices and everything is working well so far. However, each webservice is making a connection to my database.
    I would like to use a session bean so that I make the connection only once (at the begining of the client session for example) and store it into my session bean.
    I am a newbie in those things, I search on the Web and on this forum some code examples. The only thing I have found is this article http://weblogs.java.net/blog/ramapulavarthi/archive/2006/06/maintaining_ses.html
    When I tried this, the session doesn't seem to work at all : I get the same result (counter=1) twice.
    Does anybody have a complete example of how to use a session with webservices please?
    Thanks a lot!

    Sorry, I was not very clear in my last message.
    I need all my webservices to share the same bean during one user session.
    Then, if a page calls 2 different web services, only 1 database connection is made instead of 2. And if the user opens other pages which call other webservices, they will use the connection kept into the session bean.
    Anyway, I tried to do like it is said in your website but I can not build my project. I have an error : java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/.../build/web/WEB-INF/lib/jaxb-impl.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. I do not understand because I have downloaded the jax-ws 2.1.1 api and no other libraries are imported in my project. :-(
    I wonder if it is not related to netbeans...

  • Need a simple Dashboard example

    Hello All,
    Can any one provide me an simple Dashboard example (Charts)  using Flex 3 .
    The dashboard should use a MYSQL database as a source.
    Many thanks,

    this is the mxml file
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
                [Bindable] private var dataColl:ArrayCollection;
                private function init():void{
                    xmlServ.send();
                private function handleResult(event:ResultEvent):void{
                    dataColl = (event.result as ArrayCollection).getItemAt(0).main as ArrayCollection;
            ]]>
        </mx:Script>
        <mx:HTTPService id="xmlServ" url="data.xml" resultFormat="array" result="handleResult(event)"/>
        <mx:TabNavigator id="myTabz" width="100%" height="100%">
            <mx:Canvas label="DataGrid" width="100%" height="100%">
                <mx:DataGrid dataProvider="{dataColl}" width="100%" height="100%">
                    <mx:columns>
                        <mx:DataGridColumn dataField="Products" headerText="Products"/>
                        <mx:DataGridColumn dataField="stock" headerText="Stock"/>
                    </mx:columns>
                </mx:DataGrid>
            </mx:Canvas>
            <mx:Canvas label="Line Chart" width="100%" height="100%">
                <mx:LineChart id="myLineChart" dataProvider="{dataColl}" showDataTips="true" width="100%" height="100%">
                    <mx:horizontalAxis>
                        <mx:CategoryAxis dataProvider="{dataColl}" categoryField="Products"/>
                    </mx:horizontalAxis>
                    <mx:series>
                        <mx:LineSeries yField="stock" displayName="Stock"/>
                    </mx:series>
                </mx:LineChart>
            </mx:Canvas>
            <mx:Canvas label="Bar Chart" width="100%" height="100%">
                <mx:BarChart id="myBarChart" dataProvider="{dataColl}" showDataTips="true" width="100%" height="100%">
                    <mx:verticalAxis>
                        <mx:CategoryAxis dataProvider="{dataColl}" categoryField="Products"/>
                    </mx:verticalAxis>
                    <mx:series>
                        <mx:BarSeries yField="Products" xField="stock" displayName="Stock"/>
                    </mx:series>
                </mx:BarChart>
            </mx:Canvas>
            <mx:Canvas label="Pie Chart" width="100%" height="100%">
                <mx:PieChart id="myPieChart" dataProvider="{dataColl}" showDataTips="true" width="100%" height="100%">
                    <mx:series>
                        <mx:PieSeries field="stock" nameField="Products" labelPosition="inside"/>
                    </mx:series>
                </mx:PieChart>
            </mx:Canvas>
        </mx:TabNavigator>
    </mx:Application>
    and the data.xml is
    <?xml version="1.0"?>
    <main>
        <Products>Products 1</Products>
        <stock>36</stock>
    </main>
    <main>
        <Products>Products 2</Products>
        <stock>48</stock>
    </main>
    <main>
        <Products>Products 3</Products>
        <stock>46</stock>
    </main>
    <main>
        <Products>Products 4</Products>
        <stock>78</stock>
    </main>

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • Problem using a bean in JSP on Tomcat 5.0.28

    Hi,
    I'm new to JSP, I've installed Tomcat 5.0.28 and I'm able to run JSP but when I try an asp wich uses a bean it gives me this error, the directory structure is
    testingProject with the first.jsp
    testingProject\WEB-INF\classes\myPackage with the test.class
    the first.asp
    <%@ page import="myPackage.Test" %>
    <html><head><title>Test</title></head>
    <body bgcolor=white>
    <jsp:useBean id="list" class="myPackage.Test"> </jsp:useBean>
    <jsp:getProperty name="list" property="value1" />
    <%=list.value1%>
    <p>
    </body></html>
    the Test.java
    package myPackage;
    public class Test{
    String value1="testinggggggggg";
    public void Test(){
    public String getValue1(){ return value1}
    the error
    thanks in advance
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 6 in the jsp file: /first.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat 5.0\work\Catalina\localhost\testingProject\org\apache\jsp\first_jsp.java:60: cannot resolve symbol
    symbol : variable value1
    location: class myPackage.Test
    out.print(list.value1);
    ^
    1 error
         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)

    There are two ways of getting info from the bean.
    1) the jsp:getProperty tag, which seems correct in your code
    2) the <%= ... tag. In that case you must write a valid java expression. In your case: list.getValue1()

  • Defining the path for the use of beans in a JSP

              Hello,
              I would like to use a bean in a JSP file, via the <jsp:usebean> directive.
              I didn't find any property (weblogic property) which could define the path
              to the directory of my beans classes.
              So :
              1) i have put the path of this directory in the weblogic classpath in the weblogic
              start script.
              2) i made the same with the java classpath.
              Both solutions don't work at all.
              Any suggestion would be appreciated.
              Thanks in advance.
              

              We use the \weblogic\myserver\serverclasses for beans..
              of course we pack beans into jar files, and these jar files are included into
              the wls classpath..
              "Sylvain R." <[email protected]> wrote:
              >
              >Hello,
              >I would like to use a bean in a JSP file, via the <jsp:usebean> directive.
              >I didn't find any property (weblogic property) which could define the
              >path
              > to the directory of my beans classes.
              >So :
              >1) i have put the path of this directory in the weblogic classpath in
              >the weblogic
              >start script.
              >2) i made the same with the java classpath.
              >
              >Both solutions don't work at all.
              >
              >Any suggestion would be appreciated.
              >Thanks in advance.
              >
              

  • Using java bean with jsp

    hello friends,
    i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
    i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
    also when i use an additional field other than username the jsp page is showing error.
    Please give me the correct method to use java bean with jsp in this circumstance.
    thank you.

    thank you, but i have a problem left. the case is like this.
    i got the jsp and bean worked fine when i have a sinle input text field.
    but when i added a second text field i recieved the following error.
    javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         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)
    where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
    pls hlp.

  • Using web beans in JSP

    I would like to know how create a tree using Web Beans that Jdeveloper provides. Using the web object editor I could add two Beans which mapped to JSTree and JSTreeData(in oracle.jdeveloper.jsp.wb package), though I don't know the difference between them. I tried to include Both these beans in the JSP(which appear as tags) but I am unable to render the tree. Let's say I have a parent node (text: row1, url: url1, 3 childs) and 3 child nodes (text: row2..row4, url: url2..url4, each with no childs). How do I write it in the JSP to render it properly
    -Rajeev

    I would like to know how create a tree using Web Beans that Jdeveloper provides. Using the web object editor I could add two Beans which mapped to JSTree and JSTreeData(in oracle.jdeveloper.jsp.wb package), though I don't know the difference between them. I tried to include Both these beans in the JSP(which appear as tags) but I am unable to render the tree. Let's say I have a parent node (text: row1, url: url1, 3 childs) and 3 child nodes (text: row2..row4, url: url2..url4, each with no childs). How do I write it in the JSP to render it properly
    -Rajeev

  • Using BI Bean in JSP

    Hi,
    Can anyone please provider some pointers on using BIBeans in a JSP page. There are few options in my knowledge.
    1)Using BI-Beans API for writing our own JSP tags.
    2)In Jdev(10g) there seems to be some support for Graphs through ADF.
    3)JSP and UIX tags provided BI-Graph beans.
    thanks
    Rahul

    U may be used the code similar to following :
    Context context = new InitialContext.();
    Object obj = (Object)context.lookup("Your JNDI name");
    YourHome home = (YourHome)obj.portableRemoteObject.narrow(obj,
    YourHome.class);
    YourRemote remote = home.create();
    System.out.println("your Business methods : "+remote.businessMethod1());
    Put this code or whatever code used in ur console client in JSP and invoke the businessMethods using remote object.
    I worked with BEAWeblogic 5.1, I think similar case may be there with BEA Weblogic7 also.
    First, make a jar file with ome.Remote and Bean by using the deploymenttool, then compile with ejb compiler, the new Jar is the complete deployable file. Take this file and register in weblogic.properties file that is specify the path of the Jar file in the weblogic.properties file. and put the JSP in public-html directory and start the server. if the bean is deployed successfully, open JSP file in a browser then it will work.... if the bean is not deployed you won't get any result.
    I can say, just placing the initialContext part of code on the JSP and running the JSP. I think, this may helps u...
    Ramana

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • Precompiling a JSP that uses a bean

    Hi,
              I am facing a problem when I startup Weblogic with precompiling ON.
              I have a JSP that uses a bean. When the JSP is being compiled, Weblogic is
              actually trying to instantiate the bean and is executing code in the
              constructor of the bean !
              When I use the weblogic.jspc compiler to compile the JSP, no such thing
              happens.
              So this happens only when I precompile such a JSP when starting up Weblogic
              server.
              - Why does weblogic attempt to instantiat the bean ?
              - Is there any way to tell weblogic "dont instantiate this bean now" ?
              Also, the compiler is unable to find a class that is required by the bean. However, this class is there in the /applications/..../WEB-INF/lib in a JAR file. So why is the class not being found ?
              Thanks,
              Jay
              

    Do a stack trace from the constructor to determine who is calling it, and
              maybe why ...
              Peace,
              Cameron Purdy
              Tangosol Inc.
              << Tangosol Server: How Weblogic applications are customized >>
              << Download now from http://www.tangosol.com/download.jsp >>
              "Jayakumar Nandakumar" <[email protected]> wrote in message
              news:3bb0f6d6$[email protected]..
              > Hi,
              > I am facing a problem when I startup Weblogic with precompiling ON.
              >
              > I have a JSP that uses a bean. When the JSP is being compiled, Weblogic is
              > actually trying to instantiate the bean and is executing code in the
              > constructor of the bean !
              >
              > When I use the weblogic.jspc compiler to compile the JSP, no such thing
              > happens.
              >
              > So this happens only when I precompile such a JSP when starting up
              Weblogic
              > server.
              >
              > - Why does weblogic attempt to instantiat the bean ?
              > - Is there any way to tell weblogic "dont instantiate this bean now" ?
              >
              > Also, the compiler is unable to find a class that is required by the bean.
              However, this class is there in the /applications/..../WEB-INF/lib in a JAR
              file. So why is the class not being found ?
              >
              > Thanks,
              > Jay
              

  • Anyone has a simple poll I can use or look at to give me an example of how

    Anyone has a simple poll I can use or look at to give me an idea of how to do one? Something with radio button, and when a user chose a button it adds one to the total of that selection but minuses the other percentages of the other selection....something like that. And maybe using a graphical bar....hmmmm this looks hard already.

    Something like this?import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Test extends JFrame {
      JSlider[] js = new JSlider[5];
      int[] oldValues = new int[5];
      boolean isAdj=false;
      public Test() {
        JPanel content = (JPanel)getContentPane();
        content.setLayout(new BoxLayout(content, BoxLayout.X_AXIS));
        for (int x=0; x<js.length; x++) {
          js[x] = new JSlider(JSlider.VERTICAL,0,100,50);
          js[x].addChangeListener(new ChangeListener() {
         public void stateChanged(ChangeEvent ce) {
           if (!((JSlider)ce.getSource()).getValueIsAdjusting()) sliderSlid(ce);
          content.add(js[x]);
        this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
        addWindowListener(new WindowAdapter() {
          public void windowClosed(WindowEvent e) { System.exit(0); }
      private void sliderSlid(ChangeEvent ce) {
        if (isAdj) return;
        isAdj=true;
        int newTot=0;
        JSlider thisSlider = (JSlider)ce.getSource();
        int thisVal = thisSlider.getValue();
        System.out.println("TV="+thisVal);
        for (int x=0; x<js.length; x++) newTot+=js[x].getValue();
        System.out.println("NT="+newTot);
        double scale = (250.-thisVal)/(newTot-thisVal);
        System.out.println("SC="+scale);
        for (int x=0; x<js.length; x++) {
          if (js[x]!=thisSlider) js[x].setValue((int)(js[x].getValue()*scale));
        isAdj=false;
      public static void main(String[] args) {
        Test test = new Test();
        test.setSize(200,200);
        test.show();
    }

  • How do I expand my simple JSP page to implement Connection Pooling?

    Hi everyone,
    I have a small SQL database which contains information about Students and a StudenBean which contains their attributes and appropriate get/set methods (which I haven't needed to use yet).
    I want to write a simple JSP page which displays all the students details in one big table. I can do this using the basic prototyping method of adding the dataSource and driver details to the deployment descriptor (web.xml - I'm using the latest version of Tomcat by the way) and then accessing the database using JSP standard SQL actions.
    Here's a snipet of what I've done (just an example, the final code works):
    <sql:query var="temp"
    sql="SELECT * FROM Employee ORDER BY UserName"
    />
    <c:forEach items="${temp.rows}" var="row">
    <td><c:out value ="${row.UserName}"/></td>
    <td><c:out value ="${row.FirstName}"/></td>
    <td><c:out value ="${row.LastName}"/></td>
    Now I want to upgrade! I want to access the dataSource using Connection Pooling and it's causing me a lot of trouble. I already have the required working classes/data such as ConnectionPool.java, ResourceManagerListener.java, the MySQL driver etc.
    However, I don't know what the best way to setup the connection for my purposes would be and where I should do it.
    Do I need to write a servlet or tag handler/custom action to establish the connection and access my bean through it? I would like to keep a similar sort of business logic as I already have developed i.e. be able to use actions in my JSP page to cycle through the database and print out each detail from the row.
    Rather confused and muddled. Thanks for any input!

    Good idea.
    Set up a JNDI data source for your app, according to these docs:
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    You'll have to put the right information into your web.xml and a context.xml. Once you've done that, your JSTL JSPs will simply use the connection resource automagically.
    MOD

Maybe you are looking for

  • I can't access the iCloud settings on my iPod Touch

    I am trying to set up an iCloud accout for my iPod Touch, but cannot access the appropriate section of my iPod's settings. I have iOS 6 (although it didn't work on iOS 5 either). The iCloud settings are grayed out, and when I go to the iTunes and App

  • Quicktime in not working

    I noticed a few days ago that Quicktime wasn't working. Tried to uninstall it and now iTunes is also not working. Tried both uninstalling and reinstalling. Still not working. Please help! This is the error message I get from Quicktime: Process: Quick

  • New software downloaded and now emails don't work?

    Just downloaded new software and I can't get my emails to come through - keeps saying cannot connect to server? My hotmail account worked but my work email account (exchange) didn't? Any ideas?

  • How to select each character of column value

    Hi All, How can i get each character separately of a column value in a select statement. LIKE i emp table if ename='Test' then i want a select statement that can give me the result like this T,e,s,t Regards, Anil R

  • Middle Ware Comp

    Hello friends... What does a middle ware component... how does it helpful in bw... can anybody tell me about Ilink, and MQ series... thanking you... nith