BEAN : Bean included in JSP Page

Hi ,
I had developed a web-application in that I had included a bean in a JSP code by using the following
<jsp:useBean id="testbean" scope="session" class="path.test" />
now the problem is some times when we click on that particular JSP page where this bean is included the screen instead of generating the jsp page it gives a complete path of the bean location as specified in the JSP ( i.e ) "path.test" .
When I click the refresh button then the page get's loaded properly.
This issue taken place rarely but it's very important to solve this and it happens in all the JSP pages wherever I had included a bean but only sometimes .
Why so??? and help me to solve this problem
Server: Apache � Tomcat 5.0
thanks in advance

You are absolutely correct. All your java classes should be in packages.
I actually think its a java limitation introduced in Java 1.4 - they no longer allow access to the unnamed package.
For full details check out: http://developer.java.sun.com/developer/bugParade/bugs/4361575.html
My suggestion: include all your beans in packages. Its not that hard is it?
Cheers,
evnafets

Similar Messages

  • How does session bean contain in the JSP page

    May i know how session bean contains in the JSP page
    If the situation is like the following ...
    if i dont want to put the session bean in the session
    like this :
    session.setAttribute("UserBean",userBean);
    the way i get the session bean is only
    session.getAttribute("UserBean");
    Does have the other way to get the Session bean during the JSP
    if i dont want to use this kind of way,
    what else i can do for?
    may i know the solution with detailed
    and please attach the solution of code to me if you know...
    thanks...

    Hi,
    I am not clear with ur query..
    What I understood from ur query is that, u are trying to put the session ejb in the HttpSession Object for some use ahead in future?
    If this is the case, then I think are approach is not correct.
    StatefulSession beans are meant for this purpose, i.e they will be maintaining the client session. So use the same using the JndiLookup of the HomeInterface and the getting the Home reference and calling the businessmethods
    sameer

  • How to include a jsp page in another jsp jsp page

    hi,
    i m trying to include a jsp page name "header.jsp" into one jsp page name"selectattribute.jsp" i m using these commands in "selectattribute.jsp"
    <%@include file "header.jsp"%> bcz both these jsp page are C:\program files\tomcat 4.0\webapps\examples\jsp\Poject\
    but the problem is that , i m invoking this jsp page "selectattribute.jsp" from a servlet reportcontroller.java using REQUEST DISPATCHER.
    the servlet is in
    C:\Program files\tomcat 4.0\webapps\examples\WEB-INF\classes\Project\
    i want to know how to include some other jsp page in a jsp page and how to invoke applet from jsp page when that particular jsp page is being invoked by servlet.
    plz help
    manish

    use this for including in your selectattribute.jsp
    <jsp:include page="header.jsp" flush="true"/>
    I never tried calling an applet. I think you can write the code for calling the applet in a javabean method and call the method in the jsp

  • Friends..how can i include a jsp page in a servlet

    like i want to use like
    if(conditionl)
    out.println(" welcome");
    //////// here i want to include some jsp page /////
    I tried with...
    <% @include %> but its not working
    Thanks in advance

    I tried with...
    <% @include %> but its not working
    Thanks in advanceThat only woks for JSP Pages.
    You have to call the include method of the RequestDispatcher
    if(conditionl)
      out.println(" welcome");
      getRequestDispachter("/myJSPDir/my.jsp").include(request, response);
    }

  • Including a JSP page into a JSF page

    Hi !!
    I have read some posts here about <f:subwview>. There says to use:
    <f:subview>
       <jsp:include page="somepage.jsp"/>
    </f:subview>But it does not work.
    How can i include a jsp page into a JSF page?
    Thanks !!!

    Hi,
    Replace <jsp:include page="somepage.jsp">
    with <%@ include file="datasetView.jspf" %>
    See thread: http://forum.java.sun.com/thread.jspa?messageID=3413354&#3413354

  • Can we include a JSP page in an already included JSP Page

    Hi guys,
    I have a doubt with JSP include tag. The problem is ..
    Can we include a JSP page in an already included JSP Page
    AS shown below
    I have one JSP page
    Index.jsp
    -in this I am including "include.jsp"
    -Again within the "include.jsp" I am including "include1.jsp"
    It is neither giving an error nor displaying the content which is there in the "include1.jsp" but it is displaying the content of "include.jsp"
    first of all let me know whether it is possible or no.. If so then why is it not coming and what is required to do this..
    fast...
    Thanks
    Sreenadha Reddy K

    Hi guys,
    I have a doubt with JSP include tag. The
    g. The problem is ..
    Can we include a JSP page in an already included JSP
    Page
    AS shown below
    I have one JSP page
    Index.jsp
    -in this I am including "include.jsp"
    -Again within the "include.jsp" I
    he "include.jsp" I am including "include1.jsp"
    It is neither giving an error nor displaying the
    content which is there in the "include1.jsp" but it is
    displaying the content of "include.jsp"
    first of all let me know whether it is possible or
    no.. If so then why is it not coming and what is
    required to do this..
    fast...
    Thanks
    Sreenadha Reddy KIt is possible , u just have to change all the files and save them all again, clear the temp dirs where all the jsp's as compiled. Now after all this try , it should work .

  • How to add multiple bean id in a jsp page

    i need to add two bean id in a single jsp page can anyone suggest me how can i do that?
    <jsp:useBeanid="newmember" class = "com.assignment.member" scope ="request"/>now if i want to add another bean id in the same jsp page is that possible? how can i do that? please help

    <jsp:useBeanid="newmember" class = "com.assignment.member" scope ="request"/>
    <jsp:useBeanid="newmember2" class = "com.assignment.member2" scope ="request"/>
    <jsp:useBeanid="newmember3" class = "com.assignment.membe3r" scope ="request"/>
    upto N bean

  • Bean Value display in JSP Page

    Hi,
    I am trying to display a value stored in my bean on the jsp page. The value is to be displayed on the initial jsp page.
       public void doInitialization()
              request = (IPortalComponentRequest) this.getRequest();
              response = (IPortalComponentResponse) this.getResponse();
              myContext = request.getComponentContext();
              myProfile = myContext.getProfile();      
              Statement += "doInitialization";
              BeanContainer = new MockUpBean();
              BeanContainer.setValues( Statement);
              myProfile.putValue( "myBean", BeanContainer);
              // reset String
              BeanContainer = ( MockUpBean) myProfile.getValue( "myBean");     
        }// public void doInitialization()
    On the JSP Page side:
    <jsp:useBean id="myBean" scope="application" class="MockUpBeanPackage.MockUpBean" />
    <%= myBean.getValues()%>
    The jsp page does no pick up the value I try to store in the doInitialise method.
    Any thoughts on what I may have done wrong in my code.
    I try response.write("Test"), this too does not show up in my JSP page.
    Any advice would be appreciated.
    Thank you
    NAC

    Marty,
    The portalapp.xml file is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="MockUpPage">
          <component-config>
            <property name="ClassName" value="MockUpPackage.MockUpPage"/>
            <property name="SecurityZone" value="MockUpPackage/low_safety"/>       
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="pagelet/InitialPage.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    Again any help would be apreciated. I have used this piece of code to write values to beans in various projects, never had any issues. This is the first time I am having an issue with this piece of code.
    NAC

  • Bean not found by JSP page

    Hi! All
    I am using a bean in my jsp page. When I open the jsp page, I get an error that "Class SQLBean.DbBean not found". Please help. I have my bean class compiled and saved under C:\tomcat\webapps\examples\WEB-INF\classes
    Here is the bean class:
    package SQLBean;
    import java.sql.*;
    import java.io.*;
    public class DbBean {
    String dbURL = "jdbc:db2:sample";
    String dbDriver = "jdbc:odbc:akhil.mdb";
    private Connection dbCon;
    public Class DbBean(){
    super();
    public boolean connect(String user, String password) throws ClassNotFoundException,SQLException{
    System.out.print("hey");
    Class.forName(dbDriver);
    dbCon = DriverManager.getConnection(dbURL, user, password);
    return true;
    public void close() throws SQLException{
    dbCon.close();
    public ResultSet execSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    ResultSet r = s.executeQuery(sql);
    return (r == null) ? null : r;
    public int updateSQL(String sql) throws SQLException{
    Statement s = dbCon.createStatement();
    int r = s.executeUpdate(sql);
    return (r == 0) ? 0 : r;
    Here is the jsp page:
    <HTML>
    <HEAD><TITLE>DataBase Search</TITLE></HEAD>
    <BODY>
    <%@ page language="Java" import="java.sql.*" %>
    <jsp:useBean id="db" scope="request" class="SQLBean.DbBean" />
    <jsp:setProperty name="db" property="*" />
    <%!
    ResultSet rs = null ;
    ResultSetMetaData rsmd = null ;
    int numColumns ;
    int i;
    %>
    <center>
    <h2> Results from here</h2>
    <hr>
    <br><br>
    <%
    out.print("Here");
    db.connect("atayal", "arduous");
    try {
    out.print("HI");
    rs = db.execSQL("select * from contacts");
    }catch(SQLException e) {
    throw new ServletException("Your query is not working", e);
    %>
    <%
    while(rs.next()) {
    %>
    <%= rs.getString("email") %>
    <BR>
    <%
    %>
    <BR>
    <%
    db.close();
    %>
    Done
    </body>
    </HTML>
    Thanks in advance

    Thank you for your valuable feedback duffymo. Could
    you explain a little what you mean by "Putting .class
    files in the Tomcat examples directory is a really bad
    idea in the long run". Also, could you direct me to
    some source where I can find more information on
    creating WAR files keeping in mind that I am a
    beginner.
    Thanks.But putting your web apps into WAR files, you can have quite a few different web apps running on the tomcat server as compared to if u place your files into the default webapp folder, u can only have 1 web app running.
    For creating WAR file, the easiest way is to use an IDE like JBuilder.

  • Pass bean property name across JSP pages

    First, the sample code:
    <%-- ================ some.jsp =============== --%>
    <%-- bunch of code [...] --%>
    <tr>
    <td><bean:message key="prompt.desc" /></td>
    <td><html:textarea property="desc" /></td>
    </tr>
    <tr>
    <td>
    <bean:message key="prompt.notes" />
    <tiles:insert page="checkSpellTile.jsp" flush="false"></tiles:insert>
    </td>
    </tr>
    <tr>
    <td><html:textarea property="notes" /></td>
    </tr>
    <%-- ================ end some.jsp =============== --%>
    <%-- ================ checkSpellTile.jsp =============== --%>
    <%-- some JSP code [...] --%>
    <spellingComp:executeSpelling
    mode="popup"
    textComponentName="notes"
    />
    <%-- ================ end checkSpellTile.jsp =============== --%>
    So, my first foray into JSP programming - I have a number of
    different JSP pages that need spell check widgets associated
    to some text fields. The sample code shown works fine. The
    prompt, "Notes ...:" is following by the spell check
    [clickable] widget. Then the user clicks the widget, the
    spell check is launched and it checks the text in the
    "notes" field for the form.
    The sticky situation that I can't seem to solve is that each
    of the forms associated with each of the different JSP pages
    has a different name for the text field (that needs to be
    spell checked).
    I've tried doing this (between the <tiles:insert...></tiles:insert...>):
    <tiles:put name="theNotes" beanName="orderForm" beanProperty="notes"/>
    ... and then in the checkSpellTile.jsp, inserting this:
    <tiles:importAttribute name="theNotes"/>
    ... and then for the "textComponentName" attribute:
    textComponentName="theNotes"
    Any ideas how do solve this problem?

    First, the sample code:
    <%-- ================ some.jsp =============== --%>
    <%-- bunch of code [...] --%>
    <tr>
    <td><bean:message key="prompt.desc" /></td>
    <td><html:textarea property="desc" /></td>
    </tr>
    <tr>
    <td>
    <bean:message key="prompt.notes" />
    <tiles:insert page="checkSpellTile.jsp" flush="false"></tiles:insert>
    </td>
    </tr>
    <tr>
    <td><html:textarea property="notes" /></td>
    </tr>
    <%-- ================ end some.jsp =============== --%>
    <%-- ================ checkSpellTile.jsp =============== --%>
    <%-- some JSP code [...] --%>
    <spellingComp:executeSpelling
    mode="popup"
    textComponentName="notes"
    />
    <%-- ================ end checkSpellTile.jsp =============== --%>
    So, my first foray into JSP programming - I have a number of
    different JSP pages that need spell check widgets associated
    to some text fields. The sample code shown works fine. The
    prompt, "Notes ...:" is following by the spell check
    [clickable] widget. Then the user clicks the widget, the
    spell check is launched and it checks the text in the
    "notes" field for the form.
    The sticky situation that I can't seem to solve is that each
    of the forms associated with each of the different JSP pages
    has a different name for the text field (that needs to be
    spell checked).
    I've tried doing this (between the <tiles:insert...></tiles:insert...>):
    <tiles:put name="theNotes" beanName="orderForm" beanProperty="notes"/>
    ... and then in the checkSpellTile.jsp, inserting this:
    <tiles:importAttribute name="theNotes"/>
    ... and then for the "textComponentName" attribute:
    textComponentName="theNotes"
    Any ideas how do solve this problem?

  • How to execute a backing-bean method before loading JSP Page?

    Hi everybody.
    Scene:
    An AdfForm, with
    -SelectChoice, referenced to a <list> of pageDef, which is referenced to an ADF BC.
    Goal:
    -Executing the query of the ADF BC before load the SelectChoice, to load the correct values.
    A good question to know:
    Exists any way to execute a method of backing before loading a JSP Page?
    Any similar to onload method of javascript. It could be fantastic.
    Thanks in advance,
    Jaime

    hi Jaime
    If I understand correctly, you are using the ADF Model for data binding.
    Because your goal is "Executing the query of the ADF BC ...", maybe you can also consider to refresh an executable in your Page Definition.
    See also "10.5.5 How to Use Refresh Correctly for InvokeAction and Iterator Bindings"
    at http://download.oracle.com/docs/html/B25947_01/bcdcpal005.htm#BJECHBHF
    It says "... You can use the Refresh property on iterator bindings and invokeAction executables in your page definition to control when each are evaluated during the ADF page lifecycle, either during the prepareModel phase, the prepareRender phase, or both. ...".
    Although you have posted your question in a structured way, which is a good thing, I think it would help to understand your question if you can explain how you determine "the correct values" for your list, what is varying?
    success
    Jan Vervecken

  • How to include a JSP page contained in a JAR file ?

    Hello,
    I have a Servlet in which I would like to include, in the Response, the content of a JSP page contained in an external JAR file included in my lib directory ?
    Could someone help me please ?
    Thanks in advance.
    bgOnline

    I don't think thats possible with the standard j2ee server.
    There are probably ways around it, but it would involve a large component of custom coding.

  • Including a jsp page onto other jsp

    Could any one tell me how to include a jsp on other jsp
    For ex: including header.jsp and footer.jsp on all pages of application.
    Thanks

    There are a number of ways.
    You can copy/paste the contents of header and footer into each and every individual jsp file in your system.
    You can use <jsp:include>
    You can use the include directive <%@ include %>
    (JSP2.0 required) You can configure a "prelude" and "coda" in web.xml which are automatically included like directives at the top and bottom of every JSP page.
    Cheers,
    evnafets

  • Display more than one BI bean graph on JSP page

    Hi,
    I want to show BI Beans graphs on a JSP page (just the Jdev 10.1.2 included components, not the OLAP backed ones) but I want to show a different graph for each row iterated in the JSP so I'll end up with up to 20 graphs on the screen.
    Currently I can have it showing the 20 graphs quite happily, but they're all the same (that is, they all look the same but they have different IDs). I note from the way I understand this works that they're all being made off the currentRow of the viewobject. I want to somehow increment the current row for the data as the view iterator advances. I could break the model 2 separation and do it with java scriptlet in the JSP but this is my least favoured way. Is there some other way I can have all the graphs prepared from a struts action which does advance through the data and then goes on to show the jsp?
    I'm guessing this is somewhat related to a master detail graph - except when I tried to run with one I got some nasty exceptions within the graph tag library. I'm not sure that's what I want anyway as I need to format the page as a report so I need each graph to be a separate image.
    Any help appreciated
    - Nathaniel

    What I'm after is a way to create the BI Beans graphs supplied with Jdev 10.1.2 ni a java class rather than a JSP. Is there a way to do this?

  • How do I get the bean property to JSP page for use in a Scriplet

    Hi all,
    I am new to JSF and would like to know how can I get the Bean property to a JSP page and then use that property to dynamically display the contents.
    Thank in advance,

    Hi,
    I think the following page will be helpfull.
    http://java.sun.com/developer/technicalArticles/javaserverpages/JSP20/
    Akif

Maybe you are looking for

  • Cannot create a large hardcover book in iphoto '08

    I'm trying to create a large (8.5 x 11) hardcover book in iphoto. I've followed all of the directions (selecting the album, selecting "book" and then selecting the size and theme but nothing happens. The only book that I seem to be able to create is

  • Wrong digital signature for Add-on

    I have just upgraded to 2004 (patch 5). My Add-on is installed (finally) and is successfully loading (finally)when SAP B1 is launched. Whenever I re-compile my Add-on for development and replace my Add-on exe I get the error "Wrong digital signature

  • New instance of a generic type?

    Hello! I'm quite new to writing generics and I have this (possibly lame) question: how can I create a new instance of a generic type? Let's say that inside a class MyClass<T> I have a method with following interface, whose only purpose would be to re

  • Mediaplayback object event listeners

    Folks, I'm new to using Flash and its actionscript. I'm using the Flash MX version. I'm working on an audio project that involves timestamped metadata associated with the audio. So I'm creating links in a web page to allow someone to jump to and play

  • JMF Read While Writing

    Hello, my fellow programmers I have one delicate problem with JMF. I develop video streaming from file. So one Thread is reserved for creating JMF player player=Manager.createPlayer(Manager.createDataSource(new MediaLocator(f.toURI().toURL()))); play