Calling Beans from JSP page

hi,
I tried to my best to call java beans from JSP page but it generate error that "unable to load class....", please help me that in which directory jsp file and bean *.class file reside, currently my setting are as follows.
Note: I am using tomcat server and my jsp and servlet files are running seccessfuly, there is any special change in classpath for java beans? if any please tell
My jsp file is in tomcat-->webapps-->jsp--><my file>
My bean (*.class) file-->webapps-->Root-->web-inf-->classes--><my file>
Pleae help me for the above problem.
Mubashar ([email protected])

According to J2EE standards:
The web appl directory structure should be:
WebAppRootDirectory
|
|---html, jsp, images etc
|
|---WEB-INF---
|---classes--
|---lib
|
|
1) Make sure WEB-INF is in capital letters
2) Place all ur beans in classes dir or sub-directory in
classes
3) In Tomcat place WebAppRootDirectory in webapps
directory
[email protected]

Similar Messages

  • How to call Servlet from jsp page and how to run this app using tomcat..?

    Hi ,
    I wanted to call servlet from jsp action i.e. on submit button of JSP call LoginServlet.Java file.
    Please tell me how to do this into jsp page..?
    Also i wanted to execute this application using tomcat.
    Please tell me how to do this...? what setting are required for this...? what will be url ..??
    Thanks.

    well....my problem is as follows:
    whenever i type...... http://localhost:8080/appName/
    i am getting 404 error.....it is not calling to login.jsp (default jsp)
    but when i type......http://localhost:8080/appName/login.do........it executes servlet properly.
    Basically this 'login.do' is form action (form action='/login.do').....and i wanted to execute this from login jsp only.(from submit button)
    In short can anyone please tell me how to diaplay jsp page using tomcat 5.5
    plz help me.

  • How to read all rows stored in pojo bean from jsp page

    Hi sir
    After storing all rows into ArrayList object in pojo class, how to retrieve those rows from jsp page and display them together one by one.
    Regards

    Well, you wouldn't do it in Java. You would do it in JSTL, preferably.
    So if your POJO had a getRows method which returned your List of row objects, you would get the list like this (after putting the POJO into request scope under the name of "pojo"):
    ${pojo.rows}
    And if you wanted to go through that list and process each of the rows, then c:forEach would be the way:
    <c:forEach value="row" items="${pojo.rows} />
    (check the documentation, I'm posting this from memory)

  • Calling Classes From JSP pages

    I am importing an application specific class in a JSP page and calling it
              (Win NT). It compiles the servlet successfully but cannot appear to find the
              class during execution.
              I have tried placing the class file / jar file containing the class in
              CLASSPATH environment / weblogic JAVAPATH variable / weblogic ServletClasses
              directory .. so far without any luck.
              I would appreciate any suggestions.
              Regards,
              Pradeep
              

    Put it in WEBLOGICCLASSPATH variable. And make sure it is only in
              WEBLOGICCLASSPATH , nowhere else.
              Cheers - Wei
              John Brown <[email protected]> wrote in message
              news:39693f9e$[email protected]..
              > I am importing an application specific class in a JSP page and calling it
              > (Win NT). It compiles the servlet successfully but cannot appear to find
              the
              > class during execution.
              > I have tried placing the class file / jar file containing the class in
              > CLASSPATH environment / weblogic JAVAPATH variable / weblogic
              ServletClasses
              > directory .. so far without any luck.
              > I would appreciate any suggestions.
              >
              > Regards,
              >
              > Pradeep
              >
              >
              >
              

  • How to call java bean from jsp

    hi
    How to call a java bean from jsp page..
    Is any other way to call javabean from jsp page apart from this sample code...
    <jsp:useBean id="obj" class="com.devsphere.articles.calltag.TestBean"/>
    thnx in advance

    If you also use servlets, you can attach beans to the request or session and use them directly in your JSP's. So if you do:
    request.setAttribute("name", yourBean);and then forward to a JSP, you can reference the bean like:
    ${requestScope.name}

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • How to call Java Beans from JSP (eg.put them in a WAR or package)

    Can anyone explain to me what are the steps and ways to call java beans from JSP?

    1st, put the javabean classes in the right place:
    the web-inf/classes/your_bean.class directory of corresponding web application
    2nd in your jsp page:
    <jsp:useBean id="obj_var_name" class="your_bean"/>
    <jsp:setProperty name="obj_var_name" property="smthg" value="smthg_calue"/>
    Micheal

  • How to call RDF report from JSP page

    Dear all,
    I want to call a RDF report from JSP page. I am creating the JSP page using j developer 10G.
    Can anyone help me out in this case. Is there any tag or procedure or any other way by of that i can perform this work.
    please help and send the reply on [email protected],[email protected]
    thanks
    Ashok

    Hi Ashok,
    You can use rwservlet - nothing really to do with JDeveloper. Once you have report server up and running (hint: read http://download-uk.oracle.com/docs/cd/B14099_19/bi.1012/b14048/toc.htm), you can call a report like this:
    http://server:port/rwservlet?report=my_report.rdf&destype=cache&desformat=html&p_my_parameter=xxx etcHope this helps,
    John

  • How to call cystal report8 report file from jsp page

    hi guys
    present i am using cystal report8 already i am having ReportViewer.jar and ReportviewerBean.jar files
    using that please send me sample code how to call that report from jsp page..
    and how to pass the parameters from jsp page to crystalreport8 report file.
    it was very urgent task to me..so please send sample code on above topic..
    or send me crystalreport8 API
    thanks
    regards

    Hi,
    I also want to work on crystal report but i dont have the ReportViewerBean.jar and ReportViewer.jar. So, please tell from where will i get those jar files.
    Thanks in advanced.

  • 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.

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • Send message from JSP page to Java message driven bean

    Hi all
    I'm using Jdev903.
    I need to send a message from JSP page (Web Application) to Java Message Driven Bean.
    * I created Message Driven Bean that named: MyMessageDrivenEJBBean
    * I have configed jms.xml:
    <topic-connection-factory name="ChatTopicConnectionFactory" location="jms/theTopicConnectionFactory"/>
    <topic name="ChatTopic" location="jms/theTopic"/>
    * In JSP page, my code is:
    final Context ctx = new InitialContext();
    // 1: Lookup ConnectionFactory via JNDI
    TopicConnectionFactory factory =(TopicConnectionFactory)ctx.lookup("jms/theTopicConnectionFactory");
    But trouble occurs is:
    javax.naming.NameNotFoundException: jms/theTopicConnectionFactory not found
    please help me!
    thank a lot.

    Welcome to the Sun forums.
    1. Please post your code using code tags, this formats it so that it is easier for people to read and understand it. Click on 'CODE' above the text area when posting.
    2. As far as possible, please post an SSCCE
    What have learnt about JSPs and servlets till now? Because reading the values submitted in a form is pretty much the base of all operations. I suggest you Google for [servlet tutorials|http://www.google.com/search?q=servlet+tutorial] and [JSP tutorials|http://www.google.com/search?q=jsp+tutorial] and go through them thoroughly. After you understand what is to be done and what options are available to you, if you still face problems, please feel free to post your queries here. But this isn't exactly a site for tutorials, especially since there are so many good ones already out there, that explain all this stuff in detail. There's no point in re-inventing the wheel.
    Hints: [ServletRequest#getParameter()|http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)] and [RequestDispatcher#forward|http://java.sun.com/javaee/5/docs/api/javax/servlet/RequestDispatcher.html]

  • Removing ADFBindingFilter from jsp page

    I have showReport()method in showReport bean (it is not registered in faces-config.xml as managed-bean) that I am calling from jsp page with JSP call showReport.showReport(). My showReport() method looks like this:
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding("#{data.documentReportsPageDef}");
    DCBindingContainer dc = (DCBindingContainer) vb.getValue(fc);
    OperationBinding execute =
    dc.getOperationBinding("ExecuteWithParams");
    execute.execute();
    Headless_ documentReportsPageDef code:
    <pageDefinition xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.3.36.73" id="documentReportsPageDef"
    Package="...view.pageDefs">
    <executables>
    <iterator id="DocumentReportsIterator" Binds="DocumentReports"
    RangeSize="-1" DataControl="AppModuleDataControl"/>
    </executables>
    <bindings>
    <action id="ExecuteWithParams" IterBinding="DocumentReportsIterator"
    InstanceName="AppModuleDataControl.DocumentReports"
    DataControl="AppModuleDataControl" RequiresUpdateModel="true"
    Action="95">
    <NamedData NDName="DocumentType" NDValue="@CDBR"
    NDType="java.lang.String"/>
    <NamedData NDName="RefNo" NDValue="12635"
    NDType="java.lang.String"/>
    <NamedData NDName="IsInstant"
    NDValue="1"
    NDType="java.lang.String"/>
    </action>
    <table IterBinding="DocumentReportsIterator" id="DocumentReports" >
    <AttrNames>
    <Item Value="Id"/>
    <Item Value=".."/>
    </AttrNames>
    </table>
    </bindings>
    </pageDefinition>
    It is registered in DataBindings.cpx
    Everything works fine until I remove:
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    from web.xml so ADFBindingBindingFilter would not be invoked for my jsp page. I have reason for this
    On execute.execute()line I get:
    Resolving collection source:DocumentReports for iterator binding:DocumentReportsIterator
    DCUtil, returning:oracle.adfinternal.view.faces.model.binding.FacesCtrlRangeBinding, for DocumentReports
    Looking for RSI with name :DocumentReports for iterator binding:DocumentReportsIterator
    DCBindingContainer.reportException :oracle.jbo.JboException
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    If I restore filter-mapping so adfBindings are used for *.jsp page I get:
    Resolving VO:DocumentReports for iterator binding:DocumentReportsIterator
    DCUtil, returning:oracle.adfinternal.view.faces.model.binding.FacesCtrlRangeBinding, for DocumentReports
    Column count: 13
    So everything works fine again.
    Question: Can I make this work without ADFBindingsFilter on jsp page? I am invoking everything programmatically and I don’t understand why I need to set this filter on jsp?
    With this strange implementation, I am trying to solve problem discussed in article:
    oracle.jbo.common.Lock locks the application
    If my idea is hopeless, please clarify me this :)

    Ok, this is quite clear answer. Thank You.
    One more thing:
    In oracle.jbo.common.Lock locks the application Steve M, has left the the question open by "I'll ask one of our developers to comment in this thread on ideas for implementing this long-running report.". Maybe You could close this one too?

  • How to print report from JSP Page

    Hi Everybody,
    I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
    1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
    2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
    Could anyone help me to solve this problem.

    Hi Everybody,
    I am developing a simple project in JSP with MS Access. I hav some tables and reports for them. I hav a JSP page which gets inputs from user and save it in the table. Its working fine. But my problems are,
    1) I hav a button called "SAVE & PRINT" in that bottom of the page, if i click that button, the currently entered data has to save in the table and the same data has to print from the MS Access report. I dont know how to print this report from JSP page.
    2) Another button called "REPRINT". If i click that button, it has to ask a number to print the report page, that number is nothing but a field in that report.
    Could anyone help me to solve this problem.

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

Maybe you are looking for