Context-root problem

Discussions

Web tier: servlets, JSP, Web frameworks: Context-root problem

  1. Context-root problem (1 messages)

    dear friends

    I just setup small j2ee module, which contains 5 jsps, and three entities.

    According to Jboss Eclipse IDE

    http://docs.jboss.com/jbosside/tutorial/build/en/html/packaging.html

    I placed all my files(.JAR,.WAR,.EAR).

    Here is my struscture for entities.

    /src/samples.ejb.cmp.cmpcustomer.ejb.customer

    I placed my jsps under
    /src/WEB-INF/customer/

    web.xml and jboss-web.xml

    /src/WEB-INF/web.xml
    /src/WEB-INF/jboss-web.xml


    XDoclet generates fallowing files
    /src/META-INF/application.xml
    /src/META-INF/ejb-jar.xml
    /src/META-INF/jbosscmp-jdbc.xml
    /src/META-INF/ jboss.xml


    Jboss-web.xml looks like


    ###################################################
    <jboss-web>

    <!-- Resource Environment References -->
    <!--
    For additional resouce-env-ref tags add a merge file called jbossweb-resource-env-ref.xml
    -->

    <!-- Resource references -->
    <!--
    For additional resouce-ref tags add a merge file called jbossweb-resource-ref.xml
    -->

    <!-- EJB References -->

    <context-root>test-client</context-root>

    <ejb-local-ref>
    <ejb-ref-name>Address</ejb-ref-name>
    <local-jndi-name>ejb/Address</local-jndi-name>
    </ejb-local-ref>

    <ejb-local-ref>
    <ejb-ref-name>Subscription</ejb-ref-name>
    <local-jndi-name>ejb/Subscription</local-jndi-name>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>Customer</ejb-ref-name>
    <local-jndi-name>ejb/Customer</local-jndi-name>
    </ejb-local-ref>
    <!--
    For additional ejb-ref tags add a merge file called jbossweb-ejb-ref.xml
    -->

    <!-- EJB Local References -->
    </jboss-web>


    ###################################################
    web.xml looks like

    ######################################################
    <?xml version="1.0" encoding="UTF-8"?>

    <!--
    Copyright 2006 Sun Microsystems, Inc. All rights reserved.
    Use is subject to license terms.
    -->

    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>CMRCustomerWeb</display-name>

    <display-name>createCustomer</display-name>
    <servlet-name>createCustomer</servlet-name>
    <jsp-file>/createCustomer.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>


    <display-name>editCustomer</display-name>
    <servlet-name>editCustomer</servlet-name>
    <jsp-file>/editCustomer.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>


    <display-name>searchCustomer</display-name>
    <servlet-name>searchCustomer</servlet-name>
    <jsp-file>/searchCustomer.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>


    <display-name>searchAddress</display-name>
    <servlet-name>searchAddress</servlet-name>
    <jsp-file>/searchAddress.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>


    <display-name>createSubscription</display-name>
    <servlet-name>createSubscription</servlet-name>
    <jsp-file>/createSubscription.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>


    <display-name>searchSubscription</display-name>
    <servlet-name>searchSubscription</servlet-name>
    <jsp-file>/searchSubscription.jsp</jsp-file>
    <load-on-startup>0</load-on-startup>

    <servlet-mapping>
    <servlet-name>createCustomer</servlet-name>
    <url-pattern>/createCustomer.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>editCustomer</servlet-name>
    <url-pattern>/editCustomer.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>searchCustomer</servlet-name>
    <url-pattern>/searchCustomer.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>searchAddress</servlet-name>
    <url-pattern>/searchAddress.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>createSubscription</servlet-name>
    <url-pattern>/createSubscription.jsp</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>searchSubscription</servlet-name>
    <url-pattern>/searchSubscription.jsp</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>54</session-timeout>
    </session-config>
    <ejb-local-ref>
    <ejb-ref-name>Address</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.AddressLocalHome</local-home>
    samples.ejb.cmp.cmpcustomer.ejb.customer.AddressLocal
    <ejb-link>Address</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>Subscription</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.SubscriptionLocalHome</local-home>
    samples.ejb.cmp.cmpcustomer.ejb.customer.SubscriptionLocal
    <ejb-link>Subscription</ejb-link>
    </ejb-local-ref>
    <ejb-local-ref>
    <ejb-ref-name>Customer</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>samples.ejb.cmp.cmpcustomer.ejb.customer.CustomerLocalHome</local-home>
    samples.ejb.cmp.cmpcustomer.ejb.customer.CustomerLocal
    <ejb-link>Customer</ejb-link>
    </ejb-local-ref>
    <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    </welcome-file-list>
    </web-app>



    ##########################################################################

    application.xml looks like this

    ###########################################################################

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE application PUBLIC
    "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
    "http://java.sun.com/dtd/application_1_3.dtd">

    <display-name>test-client</display-name>

    test-ejb.jar



    <web-uri>test-client.war</web-uri>
    <context-root>test-client</context-root>



    #############################################################


    Problem Explanation.


    when deploy the my test-client.ear file it is deployed successfully.

    when i call my web page http://localhost:8080/test-client

    It is displaying like this and not jsp are present.

    #######################################
    Directory Listing For /

    Filename Size Last Modified


    Apache Tomcat/5.5.9

    #######################################



    Please help me .....i am facing problem from 1 week.


    Thanking you in advance

    Best regards
    Krishna Kanth
  2. Try placing your JSPs outside the WEB-INF folder.