Stepping into Java Beans from JSP

I am trying to figure out how to step into the Java Source code for my beans that are used in my JSP pages. I need to be able to debug them by stepping into them, using break points, etc.
I have Nitro installed and a sample JSP page with the import to my test Java Bean class. What I did was create two projects in my work space. One as a Web project application and one as a Java project. I referenced and opened both projects. Everything compiles fine and the syntax is correct.
The problem is I can not make the link for importing the class.
I get this error: Class com.BrianTest.MyBean not found in import com.BrianTest.MyBean
Anyone got a clue or a good example? I did try and add the class path and I tried to put it in a Jar file and attach the source to the Jar, but same problem.
Thanks :?

Stepping into jsp:useBean is not possible, but you can step-into jsp getter & setter tag.
Since you are using java bean from a dependent project you need to configure your server with DevLoader.
And currently only Tomcat server can be configured with Sysdeo Devloader to handle this situation
Download Sysdeo DevLoader for Tomcat from http://www.sysdeo.com/eclipse/tomcatPlugin.html
NOTE: If the project is self sufficient and not dependent on other projects/locations for classess/libraries then NitroX picks up all the libraries & classes present within default WEB-INF/lib & WEB-INF/classes respectively. And in this case you need not modify server configuration.
Sysdeo DevLoader is to allow your web project to use libraries/classes from dependent projects. All you need to do is extract DevLoader.zip present within tomcatPluginV3.zip inside your Tomcat/server/classes folder.
For more information about DevLoader please refer to http://www.sysdeo.com/eclipse/readmeDevLoader.html
This will solve your problem and you should be able to run/debug your application. And most important make sure you have the correct NitroX build that supports Sysdeo DevLoader, refer http://www.m7.com/whatsnew.htm document against your build id (Help > About NitroX > NitroX Icon)

Similar Messages

  • 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 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 Java Bean From JSP

    <%@ page contentType="text/html;charset=windows-1252" errorPage = "error.jsp"%>
    <%@ page import="java.sql.*,java.io.*,javax.sql.*, mypackage1.*"%>
    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <title>Process</title>
      </head>
      <body>
          <P align="center">
            <STRONG><FONT face="Algerian" size="6" color="#0033cc">Result from the Query</FONT></STRONG>
          </P>
          <P align="center"> </P>
          <P align="center"> </P>
          <P align="center"> </P>
          <P align="center"> </P>
          <P align="center">
       <%
            int rowsChanged;
            Connection con;
            try
              String sql;
              sql = request.getParameter("query");
              System.out.println(sql);
              session=request.getSession(true);
              String name = (String)session.getAttribute("theID");
              String password = (String)session.getAttribute("paswd");
              String driver="oracle.jdbc.OracleDriver";
              Class.forName(driver);
              String url ="jdbc:oracle:thin:@minerva.humber.ca:1521:grok" ;      
              con = DriverManager.getConnection(url,name,password);
              if(sql.substring(0,6).equalsIgnoreCase("Select"))
                  Statement stat = con.createStatement();
                     ResultSet rs = stat.executeQuery(sql);
          %>
         <jsp:useBean id="myBean" scope="page" class="mypackage1.Table" >
               </jsp:useBean>
             <jsp:setProperty name="myBean" property="*" param="<%rs%>"/>
          <%
            myBean.setTable(rs);
            out.println(myBean.getTable());
         %>
          <%
           else
              Statement stat = con.createStatement();
              rowsChanged = stat.executeUpdate(sql);
              out.println("<h3><STRONG><FONT face=Algerian size=5 color=#0033cc>Number of rows affected are: "+rowsChanged+"</h3></Strong></Font>");
           }//End of Try
           catch(Exception e)
              System.out.println(e+ "gd"+ e.getMessage());     
          %>
          </P>
            <P align="center">
            <a href="check.jsp">Please Click Here to Return to Main Page</a>
          </P>
      </body>
    </html>Above is my JSP file, which is calling a Java bean class called Table. The thing is that Its not returning any Table from the Table Class. I dont know how to use Java bean as I m new to it. Following is my Table Class. So If anyone can plz help me then it would be great. I m suffering from 2 days just because of this class and JSP.
    package mypackage1;
    import java.io.Serializable;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    public class Table implements Serializable
      private ResultSet rs;
      public Table()
      public void setTable(ResultSet result)
        rs = result;
      public String getTable()
             String output=null;
             try
                    ResultSetMetaData metadata;
                    metadata=rs.getMetaData();
         // find the number of fields in customer table
                    int col=metadata.getColumnCount();
                    output = "<table/><tr/>";
                    for(int i=1;i<=col;i++)
                        output+="<td/><b/>"+metadata.getColumnName(i)+"</b/></td/>";
                    output += "</tr/>";
                    while (rs.next())
                           output="<tr/>";
                           for(int i=1;i<=col;i++)
                             output+="<td/>"+rs.getString(i)+"</td/>";
                           output += "</tr/></table/>";
                    }//End of While
               catch(Exception e)
        return output;
      }//End of Table method
    }//End of Class

    First reaction: yuck.
    This is not something you should be using a bean for.
    Beans are meant for storing data, not for generating HTML from.
    I don't really like queries on a JSP page either, but thats a different story again.
    I would recommend you use JSTL for this.
    1 - it provides a c:forEach tag for looping
    2 - it provides sql tags for doing queries in a database
    IF you are going to do database queries from a JSP page, I absolutely recommend you use the JSTL tags.
    (end rant)
    Your problem is probably caused by the fact that in your bean you have the following
    try{
      // code here
    catch (Exception e){
      // completely ignore exception and carry on as if nothing bad happened.
      // what you should be doing is something like:
      System.out.println("Error occurred " + e.getMessage());
      e.printStackTrace();
      return e.getMessage();
    }Cheers,
    evnafets

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

  • What is the difference between java direct or java bean in JSP?

    What is the difference if I use java code directly in JSP or use java bean in JSP?
    Which class to use for receiving the passed parameter from html or java script? Any difference for java code and java bean in the way receiving the passed data?
    How can I pass string from jsp to html or java script?

    it's generally accepted as better design to separate presentation from logic. meaning, the java code in the jsp should be used to support displaying data, as oppsoed to implementing the application - like database access, etc.
    when the logic is separated from the presentation, it allows you to reuse logic components within several jsp pages.
    if you decide to change the presentation layer in the future (to support wap, for example) you don't need to rewrite your entire application, since the "guts" of the application is outside of the jsps.
    it is also a good idea to separate your business logic from your data layer. adding a "buffer zone" between these layers helps in the same manner as in separating presentation from logic. if you're using flat files for storage now, upgrading to a database wouldn't require rewriting all your business logic, just the methods which write out the data to a file, for example.
    once you feel comfortable with separating the various layers, check out the struts framework at http://jakarta.apache.org/
    to answer your second question, to get parameters passed in from HTML forms, use ServletRequet's getParameter() method.
    in tomcat:
    <% String lastName = request.getParameter( "lastname" ); %>
    to answer your third question: when displaying the HTML from withing a jsp, print out the string to a javascript variable or a hidden form element:
    <% String firstName = "mike"; %>
    <input type="hidden" name="firstname" value="<%= firstName %>">
    <script language="javascript1.2">
    var firstName = "<%= firstName %>";
    </script>
    this jsp results in the following html:
    <input type="hidden" name="firstname" value="mike">
    <script language="javascript1.2">
    var firstName = "mike";
    </script>

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

  • How to call precedure in impl into java bean

    Dear all,
    i'm tried to call procedure at impl.java into java bean.
    but, there is error which is it cannot find the root of this.getDBTranstation
    any idea.
    TQ

    Hi
    Please tell me
    How to call ethod in AppModuleImpl from other bean?
    I have created method in AppModuleImpl
    public String callFuncWithArgs(String p_company, String p_division, String p_user, String p_wrkord_type,
    String p_service_type, String p_HOLD_CODE_TYPE) {
    return (String)callStoredFunction(VARCHAR2, "WS_tran.Margin_TO_USER(?,?,?,?,?,?)",
    new Object[] { p_company, p_division, p_user, p_wrkord_type, p_service_type,
    p_HOLD_CODE_TYPE });
    This method is working after run APPModule. But I want to call this method from SparesTEOImpl class and
    public boolean validateUnitPrice(int unitprice) {
    //want to call here AppModuleImpl
    callFuncWithArgs(String p_company, String p_division, String p_user, String p_wrkord_type,
                                       String p_service_type, String p_HOLD_CODE_TYPE) here
    Please tell me how to call , I wrote in following ways but I got error...
    public boolean validateUnitPrice(int unitprice) {
    String margin=appImpl.callFuncWithArgs("00004","SDWSG", "S1","CSH", "SP","M");
    System.out.println("Output"+margin);
    return margin;
    After that I got the following error.
    Exception in thread "main" oracle.jbo.InvalidOwnerException: JBO-25301: Application module AppModuleImpl_0 is not a root app module but has no parent
        at oracle.jbo.server.ComponentObjectImpl.getRootApplicationModule(ComponentObjectImpl.java:177)
        at oracle.jbo.server.ApplicationModuleImpl.getDBTransaction(ApplicationModuleImpl.java:3656)
        at model.AppModuleImpl.callStoredFunction(AppModuleImpl.java:128)
        at model.AppModuleImpl.callFuncWithArgs(AppModuleImpl.java:160)
        at model.SparesTEOImpl.validateUnitPrice(SparesTEOImpl.java:55)
        at model.SparesTEOImpl.main(SparesTEOImpl.java:67)
    Process exited with exit code 1.
    Please tell me how to solve this problem...

  • Hi frnds i want to help in servlet,java bean and JSP

    hi friends i'm right now in M.SC(IT) and i want to do project in SERVLET,,JAVA BEANS and JSP ,
    so pls give me a title about that
    NOTE: I develop a project in group(2 persons there)
    my email id is : [email protected] , [email protected] , [email protected]

    You cannot pair your iPod to a cell phone, so forget about it.
    The only way you can get free WiFi is to hang out at a Denny's, a Starbucks, or a truck stop, and I don't think your parents would approve....

  • How to call stand Alone java program from jsp

    Hello all...
    I want to use the stand alone java program in jsp page. I compiled the java program and place the class file in classes folder under web-inf. But when i try to instantiate the java class inside jsp it is not recognizing the class. Where might be the problem
    Plz help....
    Shamim

    hi , this is dheeraj.. i need to know that how to execute java code and class in jsp.. if anyone know about if bt tell me.. i just know that we can use java code by java beans in jsp.. if you know any knowledge regarding this topic please send me.....

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

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

  • Using java beans in jsp using tomcat

    hi i have made a form to enter user first name and last anme with html and then i have made a value javabean in which i want to store the information filled bu user. i want to display the information stored in java bean in jsp page i have made the full application and i have made class file of java bean as well as jsp file but when i try to run this web application in tomcat i am getting class not found exception.
    could anybody tell me that where i should store the bean class in tomcat and do i need to make any package in which i have to place my java bean file plz tell me complete procedure along with code if possible

    whew thats a lot of questions... All of this is pretty basic stuff. I would recommend you take a look at the web services tutorial: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/
    lets see.
    Starting a package name with com is just a generic standard which is followed.
    It is most correct when creating commercial packages to create packages like com.companyName.project
    http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html
    You should not need a page import directive unless you are using classes in scriptlets: ie <% %> tags in your JSP. Your jsp:useBean tag will automatically import necessary classes - you don't need to import classes for beans specifically
    <jsp:useBean id="myClass" scope="session" class="com.myPackage" />
    Your directory structure should be something like this
    webApplicationRootDirectory
    - page1.html
    - page2.html
    - page3.jsp
    - page4.jsp
    - WEB-INF
         - web.xml
         - classes
           - com
             - myPackage
               - myClass.classerrrm. Thats about it I think.

  • 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

  • How to convert csv files into java bean objects?

    Hi,
    I have a CSV file, I want to store the data availabale in that csv file into java bean, I am new to this csv files how can I convert CSV files into java beans.
    Please help me.
    Adavanced Thanks,
    Mahendra

    You can use the java.io API to read (and write) files. Use BufferedReader to read the CSV file line by line. Use String#split() to split each line into an array of parts which were separated by comma (or semicolon). If necessary run some escaping of quotes. Finally collect all parts in a two-dimensional List of Strings or a List of Javabeans.
    java.io API: [http://www.google.com/search?q=java.io+javase+api+site:sun.com]
    java.io tutorial: [http://www.google.com/search?q=java.io+tutorial+site:sun.com]
    Basic CSV parser/formatter example: [http://balusc.blogspot.com/2006/06/parse-csv-upload.html]

Maybe you are looking for

  • HOW to retrieve PURCHASE ORDER DATA from archieve file and print a report

    Dear all 1) I have retrieve purchase order data from archived files. 2)  print purchase order data and created pdf file. VIJ............. Moderator message - Please ask a specific question - post locked Edited by: Rob Burbank on Apr 28, 2009 12:00 PM

  • ITunes 9.2 freezes the moment it opens, even without iPhone connected

    I upgraded to iTunes 9.2 as well as OS4 on my iPhone 3G, and suddenly it started freezing the moment I open it today, both with iPhone connected and without, so it can't have anything to do with the phone. It opens much quicker than normal (it usuall

  • Can we call Java class from LiveCycle Process?

    hi.. I have a general query, is it possible to call customeized java class from Workbench Process? I found dat we can invoke a web service... is there some operation like that for calling a java class... Thanks and Regards, Ambika

  • Stop all Message delivery until start-up class executes

              On fail-over, I need to be able to keep any messages from topics/queues from being           sent to the destinations until a start-up class has been executed and initialized           the application. The problem is that the mdb's get depl

  • How to create users in BI Analytics

    hi gems... I want to create some users who have only the read access to the reports in the dashboard....and some users who has the right to create as well as view the reports in the dashboard... I have installed 10.1.3.4.1 BI Analytics version.. Is t