Jsp configuration load on start up in web.xml

Is my configuration for jsp correct.i want my JSP to be loaded after servlet initialised.What changes i need to do to make it work on any server..like tomcat or websphere
<!-- JSP CONFIGURATION -->
<jsp-file>/hello.jsp</jsp-file>
<load-on-startup>2</load-on-startup>
<!-- SERVLET CONFIGURATION -->
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.example.HelloServlet</servlet-class>
<!-- or -->
<jsp-file>/hello.jsp</jsp-file>
<!-- optional and one only, greater value than 0 means don't wait for the first request load it beforehand -->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Message was edited by:
raghuveer_vellanki

when you give a load on startup value as 1 for a servlet declaration in the web.xml the Server calls your servlet when u start it, and calls means the server loads your servlet anc calls the init method. so u may do whatever you like in init method like starting some other application, setting some parameters , etc

Similar Messages

  • Load On start up  in web.xml

    Hi.........
    what is the use of load on start up we give in web.xml while we are developing a struts application....

    when you give a load on startup value as 1 for a servlet declaration in the web.xml the Server calls your servlet when u start it, and calls means the server loads your servlet anc calls the init method. so u may do whatever you like in init method like starting some other application, setting some parameters , etc

  • How to Install, Configure and getting started with Hyperion Web Analyzer9

    i have installed both
    Hyperion Reporting and Analysis - System 9 Services Release 9.3.1 Microsoft Windows x86 Installer.
    Hyperion Reporting and Analysis - System 9 UI Services Release 9.3.1 Microsoft Windows x86 Installer
    Now tell me step by step on how to configure and how start Web analyzer
    I dont know how to start server/services. (Any Web server required?)
    Getting started would be more helpful.
    Need help ASAP.
    thanks,
    Ram

    Hi,
    First of all have you installed Shared Services as you will need that as that foundation of the installation.
    You will also need to install other components such as essbase if you intend to use it with web analysis.
    If you have done that, then you will first need a repository to hold Reporting and Analysis information.
    Afte start up the configuration utility and select the Reporting & analysis elements and go through the steps entering
    details such as shared services connection, repository information.
    It should install the components as a service.
    You should really read the installation document :- http://download.oracle.com/docs/cd/E10530_01/doc/epm.931/hs_windows_install.pdf
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Unable to load descriptor .../web.xml - DescriptorException - Java EE6 war

    Deploying a simple Java EE 6 war into WebLogic 10.3.3 fails with <Unable to load descriptor /root/Oracle/Middleware/user_projects/domains/palis1/servers/AdminServer/upload/SimpleEE6App.war/WEB-INF/web.xml of module SimpleEE6App.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:<null>
    The web app consists of one JSF 2 web dialog, one managed bean, one stateless session bean and one entity bean. In GlassFish v3 the app works fine. Then I installed the actual version of WebLogic server in order to check whether I can run EE6 apps there to. But deploying the war using WebLogic admin console fails with
    ... <AdminServer> <main> <<WLS Kernel>> <> <> <1273649525966> <BEA-000360> <Server started in RUNNING mode>
    ... <AdminServer> <[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <admin> <> <> <1273649790693> <BEA-160197> <Unable to load descriptor /root/Oracle/Middleware/user_projects/domains/palis1/servers/AdminServer/upload/SimpleEE6App.war/WEB-INF/web.xml of module SimpleEE6App.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-enumeration-valid: string value '3.0' is not a valid enumeration value for web-app-versionType in namespace http://java.sun.com/xml/ns/javaee:<null>
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:245)
    at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:231)
    at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:155)
    at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:323)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:788)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:409)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:759)
    at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:768)
    at weblogic.servlet.internal.WebAppDescriptor.getWebAppBean(WebAppDescriptor.java:141)
    at weblogic.servlet.utils.WarUtils.getWebAppBean(WarUtils.java:124)
    at weblogic.application.compiler.WARModule.processLibraries(WARModule.java:413)
    at weblogic.application.compiler.WARModule.merge(WARModule.java:455)
    at weblogic.application.compiler.flow.SingleModuleMergeFlow.proecessModule(SingleModuleMergeFlow.java:16)
    at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.ReadOnlyWarMerger.merge(ReadOnlyWarMerger.java:27)
    at weblogic.application.compiler.flow.AppMergerFlow.mergeInput(AppMergerFlow.java:88)
    at weblogic.application.compiler.flow.AppMergerFlow.compile(AppMergerFlow.java:41)
    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    at weblogic.application.compiler.FlowDriver$CompilerFlowDriver.compile(FlowDriver.java:96)
    at weblogic.application.compiler.AppMerge.runBody(AppMerge.java:157)
    at weblogic.utils.compiler.Tool.run(Tool.java:158)
    at weblogic.utils.compiler.Tool.run(Tool.java:115)
    at weblogic.application.compiler.AppMerge.merge(AppMerge.java:169)
    at weblogic.deploy.api.internal.utils.AppMerger.merge(AppMerger.java:88)
    at weblogic.deploy.api.internal.utils.AppMerger.getMergedApp(AppMerger.java:63)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createDeployableObject(WebLogicDeployableObjectFactoryImpl.java:181)
    at weblogic.deploy.api.model.internal.WebLogicDeployableObjectFactoryImpl.createLazyDeployableObject(WebLogicDeployableObjectFactoryImpl.java:156)
    at weblogic.deploy.api.tools.SessionHelper.inspect(SessionHelper.java:661)
    at com.bea.console.actions.app.install.Flow$2.execute(Flow.java:469)
    at com.bea.console.utils.DeploymentUtils.runDeploymentAction(DeploymentUtils.java:5000)
    at com.bea.console.actions.app.install.Flow.appSelected(Flow.java:467)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.beehive.netui.pageflow.FlowController.invokeActionMethod(FlowController.java:870)
    at org.apache.beehive.netui.pageflow.FlowController.getActionMethodForward(FlowController.java:809)
    at org.apache.beehive.netui.pageflow.FlowController.internalExecute(FlowController.java:478)
    at org.apache.beehive.netui.pageflow.PageFlowController.internalExecute(PageFlowController.java:306)
    at org.apache.beehive.netui.pageflow.FlowController.execute(FlowController.java:336)
    The web.xml is
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>faces/index.xhtml</welcome-file>
    </welcome-file-list>
    </web-app>
    After changing the version number I got the same error message with the differing number. I also tryed to deploy the web-app_3_0.xsd into the server. This also did not solve the problem.
    Any ideas?
    Thanks in advance
    Axel Burghof

    The web app consists of one JSF 2 web dialog, one managed bean, one stateless session bean and one entity bean. In GlassFish v3 the app works fine. Then I installed the actual version of WebLogic server in order to check whether I can run EE6 apps there to. But deploying the war using WebLogic admin console fails with ...
    Hey Axel -
    WLS 10.3.x does not implement Java EE 6 -- it's a Java EE 5 based server.
    While we have added support for a few independent Java EE 6 specifications where we can -- such as JSF 2.0 in WLS 10.3.3 and JPA 2.0/JAX-RS 1.1 with WLS 10.3.4 that is coming in the next patchset -- we don't support all of the Java EE 6 model and thus you can't use any of the EJB 3.1, Servlet 3.0 changes and you can't deploy EJBs (and JPA entities) inside of a WAR file. Our next major release will be a Java EE 6 implementation, where this will be possible.
    -steve-

  • Servlet configuration in Weblogic 5.1.. web.xml vs weblogic.properties..

    Can someone please tell me how the <servlet> entry differs from
              weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
              in weblogic properties?
              Do these perform identical functions?
              

    Yes this is the source of my confusiong. It seems to be that WL can be told
              about servlets
              two ways. Firstly through the web.xml file and also via weblogic.properties.
              I don't understand
              why the second one exists.
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > I only work with WAR files, so I cannot speak to non-WARd servlets with
              any
              > confidence. I know that WL could use web.xml for non-WARd servlets in
              order
              > to obtain the other information associated with the servlet:
              >
              > <!ELEMENT servlet (icon?, servlet-name, display-name?, description?,
              > (servlet-class|jsp-file), init-param*, load-on-startup?,
              > security-role-ref*)>
              >
              > --
              >
              > Cameron Purdy
              > http://www.tangosol.com
              >
              >
              > "Robert Nicholson" <[email protected]> wrote in message
              > news:[email protected]...
              > > If what you say is true then why is there the need to also tell WL about
              > the
              > > servlets themselves?
              > >
              > > Presumably this is for when the servlets exist outside of a WAR then?
              > >
              > > "Cameron Purdy" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > The weblogic.properties tells WL to load a WAR or specific servlet.
              The
              > > > <servlet> entry (I assume you refer to
              > > > http://java.sun.com/j2ee/dtds/web-app_2_2.dtd) defines the presence of
              a
              > > > servlet within a WAR (a deployment unit):
              > > >
              > > > >
              > > > The servlet element contains the declarative data of a
              > > > servlet. If a jsp-file is specified and the load-on-startup element is
              > > > present, then the JSP should be precompiled and loaded.
              > > > [end-quote]
              > > >
              > > > In the case of a WAR deployment, you have to tell WL that the WAR
              > exists,
              > > > then it will look in the WAR and figure out what servlets are there
              from
              > > the
              > > > <servlet> tags in your web.xml. You set up a WAR in the
              > > weblogic.properties
              > > > as such:
              > > >
              > > > weblogic.httpd.webApp.<http-path>=<os-path>
              > > >
              > > > For example:
              > > > weblogic.httpd.webApp.website=c:/weblogic/website.war
              > > >
              > > > --
              > > >
              > > > Cameron Purdy
              > > > http://www.tangosol.com
              > > >
              > > >
              > > > "Robert Nicholson" <[email protected]> wrote in message
              > > > news:[email protected]...
              > > > > Can someone please tell me how the <servlet> entry differs from
              > > > >
              > > > > weblogic.httpd.register.snoop=examples.servlets.SnoopServlet
              > > > >
              > > > > in weblogic properties?
              > > > >
              > > > > Do these perform identical functions?
              > > > >
              > > > >
              > > >
              > > >
              > >
              > >
              >
              >
              

  • How to configure a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I wrestled with this for a long time. I may have done something wrong, but to get my mySQL JDNI reference to work, I had to add it to the server.xml file. You can try with web.xml, but I eventually just got frustrated and put it in server.xml.
    The following is between two <context> tags:
    <Resource name="jdbc/instance_name_goes_here"
                   auth="Container"
                   type="javax.sql.DataSource"/>
              <ResourceParams name="jdbc/same_instance_name_here">
                   <parameter>
                        <name>username</name>
                        <value>user_name_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>password</name>
                        <value>password_goes_here</value>
                   </parameter>
                   <parameter>
                        <name>driverClassName</name>
                        <value>jdbc_fully_qualified_class_name</value>
                   </parameter>
                   <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
                   <parameter>
                        <name>url</name>
                        <value>jdbc_connect_url_database_vendor_specific</value>
                   </parameter>
                   <parameter>
                        <name>maxActive</name>
                        <value>8</value>
                   </parameter>
                   <parameter>
                        <name>maxIdle</name>
                        <value>8</value>
                   </parameter>
              </ResourceParams>
    - Saish
    "My karma ran over your dogma." - Anon

  • Configuring a JNDI ressource in the web.xml file

    Hi,
    does someone know if there is a way to configure a JNDI ressource with its parameters only in the web.xml file ?
    In my case, the JNDI ressouce is an oracle database an its conenction paramters: driverClassName, username, password, etc...
    Actually, I put everything in the configuration file of Tomcat but I would like my war file to be 100% independent of the application server.
    Thanks in advance.
    Fred.

    I'm pretty sure you can't do it that way round. The logic of the thing is that database access URLs etc. tend to depend on the where the server is. The whole idea of these resources is to put the stuff that's specific to the server in server.xml and refer to it using names that should remain the same if you deploy your webapp on another server. Of, for example, you have test, stage and production servers running the same webapps but connecting to different databases.

  • How to configure Load Balancer in front of Web Logic Cluster

    hi all,
    I installed 2 weblogic servers in cluster and now i want to deploy Hardware Load balancer in front of them, i want to know do i require any configuration on servers or i just deploy hardware Load balancer in front clustered servers with round robin technique.
    Regards,
    imran

    I think there are two important configuration when you use hardware load balancer in front of WebLogic cluster.
    1) Passive Cookie Persistance
    You need to configure hardware load balancer so that it can identify Weblogic session cookie for routing request primary server holding HTTP sesstion.
    2) External DNS
    If there is firewall between hardware load balancer and weblogic cluster and NAT (Network translation ) is used, then you need to configure "External DNS" for each weblogic server in cluster. You need to specify the hostname used by load balancer in "external DNS".
    More details about this are available at.
    http://edocs.bea.com/wls/docs92/cluster/load_balancing.html#wp1026940
    http://e-docs.bea.com/wls/docs92/cluster/planning.html#wp1088950
    Hope this will help...
    Jayesh
    Yagna Sys

  • Web.xml + jsp deployment problem

    Hi people,
    I have an eclipse project that has 1 servlet and 1 jsp page. I'm having problem in deployment. The servlet works fine but jsp is not accessible. The structure of my web.xml file is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" 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>IBNSubscriberServlet</display-name>
         <servlet>
              <description></description>
              <display-name>SubscriberServlet</display-name>
              <servlet-name>SubscriberServlet</servlet-name>
              <servlet-class>com.ibn.servlets.SubscriberServlet</servlet-class>          
         </servlet>
         <servlet-mapping>
              <servlet-name>SubscriberServlet</servlet-name>
              <url-pattern>/SubscriberServlet</url-pattern>
         </servlet-mapping>
         <servlet>
             <servlet-name>MonitoringG7</servlet-name>
             <jsp-file>/com.ibn.view.MonitoringG7.jsp</jsp-file>
         </servlet>     
         <servlet-mapping>
              <servlet-name>MonitoringG7</servlet-name>
              <url-pattern>/*</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
    </web-app>On requesting this JSP url, http://localhost:8080/IBNSubscriberServlet/MonitoringG7.jsp the http 404 status message comes which says the resource is not found. Cn someone please check the above jsp mappings in the web.xml file?
    Inside my "src", folder I have "com.ibn.view" which contains jsp file.
    thanks.

    this is how my web.xml looks like now.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" 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>IBNSubscriberServlet</display-name>
         <servlet>
              <description></description>
              <display-name>SubscriberServlet</display-name>
              <servlet-name>SubscriberServlet</servlet-name>
              <servlet-class>com.ibn.servlets.SubscriberServlet</servlet-class>          
         </servlet>
         <servlet-mapping>
              <servlet-name>SubscriberServlet</servlet-name>
              <url-pattern>/SubscriberServlet</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
         </welcome-file-list>
    </web-app>If there is a mapping problem then the JSP should not work in tomcat as well, but it is. And i have just one servlet in the project and that is mapped my eclipse as above.

  • Web.xml configuration for initial servlet load

    Hi all,
    I have heard of entering some tag into web.xml file (deployement descriptor) if we need some servlets to be loaded wheneve the app server starts or restarts. can some body help me regarding what to write in web.xml.
    thanks in advance

    I am having some problems with the same issue although specifying the load-on-startup param is not working for.
    Here is snipet of the web.xml:
    <servlet id="Servlet_1206024889339">
    <servlet-name>ContentServer</servlet-name>
    <servlet-class>COM.FutureTense.Servlet.SContentServer</servlet-class>
    <init-param id="InitParam_1206024988781">
    <param-name>inipath</param-name>
    <param-value>/data/WebSphere/ContentServer</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    This however doesn't init the contentServer servlet. Is there anythign else i need to check? I am using websphere5-1.
    I saw somewhere you might have to specify a loadonstartup=true? Where is this set?
    I know the app is reading the right web.xml because i put in a bad value and saw the error being outputted in the startup log.
    There are some servlets being initialised on startup but not the ones I want. These servlets don't seem to be in the web.xml.
    [10/10/08 11:53:30:265 IST] 1e06de8 WebContainer A SRVE0169I: Loading Web Module: cs.war.
    [10/10/08 11:53:33:330 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: JSP 1.2 Processor: init
    [10/10/08 11:53:34:098 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: SimpleFileServlet: init
    [10/10/08 11:53:34:117 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: DirectoryBrowsingServlet: init

  • Jsp-file="/WEB-INF/index.jsp" cannot load

              Hi,
              I am defining a servlet in the web.xml file using the following syntax.
              <servlet>
              <servlet-name>TestServlet</servlet-name>
              <jsp-file>/WEB-INF/index.jsp</jsp-file>
              </servlet>
              Then when I tried to access this servlet, I get a 404 not found error. The weblogic.log
              file complains with the following message:
              java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp' in servlet context
              root '/home/dev/web/apps/MyApp'
              at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:922)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:886)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              My jsp file in located in /home/dev/web/apps/MyApp/WEB-INF/index.jsp, I know weblogic
              doesn't support jsp under WEB-INF, however, according to Sun's Servlet specification,
              anything under web-inf should be accessible to getResource and getResourceAsStream
              method, and it looks like that's what weblogic implementation is using (from the
              error message). So I am not sure whether this is weblogic issue or I am doing
              something wrong. By the way, the above config in web.xml is supported in Tomcat.
              

              What version of WebLogic will incorporate Servlet spec 2.4 and allow jsp under
              web-inf?
              Chris
              "Narayan Anand" <[email protected]> wrote:
              >Regarding S-12864 - It will not work as stated in the solution in any
              >of
              >the available releases of WLS.
              >Please ignore that. I already informed the concerned person to correct
              >the
              >solution.
              >
              >The story behind this is:
              >Our engineering team is already aware of the fact that the request
              >dispatcher calls (include/forward) for a jsp under the web-inf directory
              >works in other app server - Tomcat.
              >Our engineering team had a discussion with the servlet/jsp spec experts
              >group for clarifying the spec and the tomcat implementation.
              >So the servlet expert group has decided to explicitly state in the spec
              >that
              >RD.forward() and RD.include() should be allowed access to resources in
              >/WEB-INF and it will be included in servlet spec 2.4. For now, WLS works
              >as
              >per the current specification.
              >
              >So far the story is - WLS will implement this in our next major release
              >which will be compliance with servlet spec 2.4.
              >In all the currently available WLS releases, accessed to a jsp under
              >the
              >WEB-INF directory is prohibited.
              >
              >--
              >Best Regards,
              >Narayan Anand
              >Developer Relations Engineer
              >BEA Systems, Inc.
              >
              >
              >
              >
              >
              >
              >"Ming Fan" <[email protected]> wrote in message
              >news:[email protected]...
              >>
              >> Thanks for the explanation. So this means weblogic treats such mapped
              >servlet request
              >> as a direct request to the jsp under WEB-INF, instead of forwarding
              >it to
              >some
              >> JspCompiler servlet and let that compiler servlet use some resource
              >loader
              >to
              >> load the jsp and then compile. I believe that latter implementation
              >approach also
              >> conforms the Servlet spec (it's a different way of treating the request,
              >I
              >guess).
              >>
              >> Now here's another question. According to Web logic Customer Support
              >Solution
              >> ID S-12864 (WLS 6.x - Cannot access JSP under the WEB-INF directory),
              >the
              >servlet
              >> should be able to get a request dispatcher, and then forward the request
              >to the
              >> jsp under WEB-INF. I am still using WLS 5.1, so does the above solution
              >apply
              >> to 5.1 also? It doesn't seem to work with 5.1. So is this a 5.1 problem
              >and I
              >> should upgrade to 6.1?
              >>
              >> Thanks.
              >>
              >> "Narayan Anand" <[email protected]> wrote:
              >> >Hi Ming,
              >> >
              >> >It is legal to put files under WEB-INF directory. But as mentioned
              >in
              >> >the
              >> >spec, it will be available only to servlet code and not directly to
              >client
              >> >request.
              >> >Read the last statement of the same paragraph in section9.5.
              >> >"Since requests are matched to resource mappings case-sensitively,
              >client
              >> >requests for '/WEB-INF/foo', '/WEb-iNf/foo', for example, should not
              >> >result
              >> >in contents of the web application located under /WEB-INF being returned,
              >> >nor any form of directory listing thereof.".
              >> >
              >> >So in your case, when you access the servlet which gets mapped to
              >> >/WEB-INF/your-jspfile, under no condition it should result in display
              >> >of jsp
              >> >contents.
              >> >It is working as per the specification.
              >> >
              >> >I hope this helps.
              >> >
              >> >Regards,
              >> >Narayan Anand
              >> >Developer Relations Engineer
              >> >BEA WebLogic Support
              >> >
              >> >
              >> >
              >> >"Ming Fan" <[email protected]> wrote in message
              >> >news:[email protected]...
              >> >>
              >> >> Actaully there are other ways to solve my problem. But what I am
              >> >interested to
              >> >> know is under the Servlet specification 2.3, is it legal to put
              >jsp
              >> >under
              >> >WEB-INF,
              >> >> define it in <jsp-file> xml tag, and should the JSP compiler be
              >able
              >> >to
              >> >see this
              >> >> as a resource. Apparently, Tomcat allows this behavior, so does
              >this
              >> >mean
              >> >Tomcat
              >> >> conforms better to the Servlet spec, or Tomcat is wrong but Weblogic
              >> >conforms
              >> >> better? Can anyone let me know what's the correct interpretation
              >of
              >> >section 9.5
              >> >> in servlet spec 2.3?
              >> >>
              >> >>
              >> >> "Jerrie Pineda" <[email protected]> wrote:
              >> >> >Try moving it to a different dir. You normally don't place jsp
              >file
              >> >> >in the
              >> >> >WEB-INF dir.
              >> >> >
              >> >> >
              >> >> >"Ming Fan" <[email protected]> wrote in message
              >> >> >news:[email protected]...
              >> >> >>
              >> >> >> Hi,
              >> >> >>
              >> >> >> I am defining a servlet in the web.xml file using the following
              >> >syntax.
              >> >> >> <servlet>
              >> >> >> <servlet-name>TestServlet</servlet-name>
              >> >> >> <jsp-file>/WEB-INF/index.jsp</jsp-file>
              >> >> >> </servlet>
              >> >> >>
              >> >> >> Then when I tried to access this servlet, I get a 404 not found
              >> >error.
              >> >> >The
              >> >> >weblogic.log
              >> >> >> file complains with the following message:
              >> >> >> java.io.FileNotFoundException: no resource '/WEB-INF/index.jsp'
              >> >in
              >> >> >servlet
              >> >> >context
              >> >> >> root '/home/dev/web/apps/MyApp'
              >> >> >> at
              >weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:293)
              >> >> >> at
              >> >weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:227)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:
              >2
              >> >0
              >> >> >0)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.ja
              >v
              >> >a
              >> >> >:115)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
              >m
              >> >p
              >> >> >l.java:922)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextI
              >m
              >> >p
              >> >> >l.java:886)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletConte
              >x
              >> >t
              >> >> >Manager.java:269)
              >> >> >> at
              >> >>
              >>
              >>>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:380
              >)
              >> >> >> at
              >> >> >weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:268)
              >> >> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:129)
              >> >> >>
              >> >> >> My jsp file in located in
              >/home/dev/web/apps/MyApp/WEB-INF/index.jsp,
              >> >> >I
              >> >> >know weblogic
              >> >> >> doesn't support jsp under WEB-INF, however, according to Sun's
              >Servlet
              >> >> >specification,
              >> >> >> anything under web-inf should be accessible to getResource and
              >> >> >getResourceAsStream
              >> >> >> method, and it looks like that's what weblogic implementation
              >is
              >> >using
              >> >> >(from the
              >> >> >> error message). So I am not sure whether this is weblogic issue
              >> >or
              >> >> >I am
              >> >> >doing
              >> >> >> something wrong. By the way, the above config in web.xml is
              >supported
              >> >> >in
              >> >> >Tomcat.
              >> >> >
              >> >> >
              >> >>
              >> >
              >> >
              >>
              >
              >
              

  • JSP include through a web.xml configuration

    I have a website that has many JSP pages and I would like to add some logging lines to each jsp file. I would prefer not to have to edit each jsp file though (it would be time consuming). Is there a way through a configuration change in the webapp web.xml file to make each jsp page first "go through" a servlet (to perform some logic) and then have the servlet pass the request and response on to the jsp file. If so, I could add the logging logic to the servlet and effectively have the logic added to each jsp file.
    If anyone has done something like this, please give me some pointers on how to configure it.
    Thanks,

    It sounds like a servlet filter is what you are after.
    http://java.sun.com/products/servlet/Filters.html
    Its pretty much exactly what you had, just using a Filter interface instead of a servlet.
    Should be something along the lines of this (untested)
    In web.xml:
    <filter>
    <filter-name>jsplogger</servlet-name>
    <filter-class>dagger.servlet.JSPLoggerFilter</servlet-class>
    </filter>
    <filter-mapping>
    <filter-name>jsplogger</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>Filter class:
    public class JSPLoggerFilter implements Filter{
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws java.io.IOException, ServletException
      String s=request.getRequestURI();
      System.out.println(s+" "+request.getSession().getId());
      // pass it on down the chain
      chain.doFilter(request, response);
    }Cheers,
    evnafets

  • Configuring web.xml when using JSP as display technology

    Hi,
    I have a very simple HelloWorld style jsp.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <f:view>
      <html>
        <head>
          <title>
            JSF in Action - Hello, world!
          </title>
        </head>
        <body>
          <h:form id="welcomeForm">
            <h:outputText id="welcomeOutput" value="Welcome to JavaServer Faces!"
                           style="font-family: Arial, sans-serif; font-size: 24; color: green;"/>
            <p>
             <h:message id="errors" for="helloInput" style="color: red"/>
            </p>
            <p>
              <h:outputLabel for="helloInput">
                <h:outputText id="helloInputLabel"
                              value="Enter number of controls to display:"/>
              </h:outputLabel>
              <h:inputText id="helloInput" value="#{helloBean.numControls}"
                           required="true">
                <f:validateLongRange minimum="1" maximum="500"/>
              </h:inputText>
            </p>
            <p>
              <h:panelGrid id="controlPanel" binding="#{helloBean.controlPanel}"
                           columns="20" border="1" cellspacing="0"/>
            </p>
            <h:commandButton id="redisplayCommand" type="submit" value="Redisplay"
                             actionListener="#{helloBean.addControls}"/>
            <h:commandButton id="goodbyeCommand" type="submit" value="Goodbye"
                             action="#{helloBean.goodbye}" immediate="true"/>
          </h:form>
        </body>
      </html>
    </f:view>To get this working I had to use the following web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
      <display-name>JSFHelloWorld3</display-name>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
      </welcome-file-list>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>/faces/*</url-pattern>
      </servlet-mapping>
      <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
      </context-param>
      <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
      </context-param>
      <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
      </listener>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
    </web-app>When I go to:
    http://localhost:8080/MyApp/hello.jsp
    I get:
    org.apache.jasper.JasperException: An exception occurred processing JSP page /hello.jsp at line 23
    20: <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    21: <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    22:
    23: <f:view>
    24:   <html>
    25:     <head>
    26:       <title>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:419)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.RuntimeException: Cannot find FacesContext
         javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)
         javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)
         org.apache.jsp.hello_jsp._jspx_meth_f_005fview_005f0(hello_jsp.java:119)But when I go to:
    http://localhost:8080/MyApp/hello.faces
    Everything is ok?
    I am confused why?
    Any help appreciated.

    I believe this is a url pattern issue. You have one for *.jsf as opposed to *.jsp.
    <url-pattern>*.jsf</url-pattern>
    This likely any pattern containing "faces".
    <url-pattern>/faces/*</url-pattern>
    Add one for *.jsp and you should be OK.

  • Problem in Configuring web.xml or portlet.xml

    Hi all,
    We are developing an application on the VAP 7 using Portlets.
    Can some one tell me, how to trigger a servlet from the Portlet? Rather how do i configure the web.xml or the Portlet.xml to make it identify the servlet that has to be called on load of the jsp.
    I have tried this the regular jsp and xml way (i.e. without using the Portlets and calling it from the JSP)
    I have the web.xml where i have the mapping for the single jsp ( this has the call servlet within the SRC attribute of the IMG tag. ) , also with the mapping details for the servlet to be called and this way it works fine there.
    How do i do the same for Portlets.?

    are you very new to servlets..
    ok then.
        <servlet>
            <servlet-name>bittu1</servlet-name>
            <servlet-class>Library1</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>bittu1</servlet-name>
            <url-pattern>/lop1</url-pattern>
        </servlet-mapping>
    <servlet>
            <servlet-name>bittu2</servlet-name>
            <servlet-class>Library2</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>bittu2</servlet-name>
            <url-pattern>/lop2</url-pattern>
        </servlet-mapping> i think this will help you.

  • FRM-92101: Load Balancing Forms 10g with Web Cache

    Hi,
    I´m having some problems with Oracle Forms and Webcache 10g and I was wondering if you
    could help.
    Machines: (Pentium IV 2.6 GHz; 2GB RAM; 80GB HD)
    A. Red Hat Linux AS 2.1
    Oracle AS 10g - Infrastructure Installation
    B. Windows 2000 Server - Service Pack 4
    Oracle AS 10g - BI and Forms Installation (Using Infrastructure on machine A)
    C. Windows 2000 Server - Service Pack 4
    Oracle AS 10g - BI and Forms Installation (Using Infrastructure on machine A)
    I didn´t apply any Patchsets of Oracle AS 10g. My current version is 9.0.4.0 .
    Goal:
    Use Oracle Webcache 10g on machine B for Load Balancing an Oracle Forms Application
    on machines B and C.
    Facts:
    The Oracle AS 10g installation on the 3 machines was made without problems.
    The Forms Applications are running without problems on both Forms servers in machine B and C.
    Symptoms:
    I´m getting the following error when I try to acces the forms application through Webcache:
    FRM-92101: There was a failure in the forms server during startup.
    This could happen due to invalid configuration.
    Please look in the web-server log file for details.
    But, this error happens ONLY when BOTH OC4J_BI_Forms instances (machines B and C) are
    running.
    When just one of the OC4J_BI_Forms is running everything works fine.
    Webcache Configuration:
    I´ve followed Metalink note 207668.1: Configuring Web Cache as a Load Balancer for Application Servers
    step by step to make the configuration of the following components:
    1. Configuration of the origin servers
    2. Configuration of Site definitions
    3. Configuration of Site to server mapping
    After that, I´ve follwed the Metalink note 229900.1: Integrating and using Web Cache with Forms 9i for Load Balancing
    step by step to make the configuration of the following components:
    4. Session Binding
    Then I try to test the Load Balancing and I got the error FRM-92101 when both OC4J_BI_Forms
    instance were running.
    I´ve searched Metalink and found note 268830.1: Webcache Won't Load Balance 2 Forms Instances.
    Following the note instructions I did the following changes:
    Added these lines at the end of HTTPD.conf (machine B):
    CookieTracking On
    CookieName myformscookie1
    Added these lines at the end of HTTPD.conf (machine C):
    CookieTracking On
    CookieName myformscookie2
    In Webcache configuration:
    I´ve Changed the default session binding from JSESSIONID to "ANY SET COOKIE" for the
    site's session binding.
    But even after these changes I´m getting FRM-92101 error on the same conditions.
    How can I solve this problem ?
    Thank you in advance.
    Marcus Santos.
    ([email protected])

    Just ran into this problem last Tuesday, Nov.30 and applied the changes today.
    My configuration is similar to yours: 9.0.4 web cache on machine A, 9.0.4 10gAS forms and reports standalone on machine B and C (not a cluster, no infra).
    I appended the Cookie lines you mentioned in httpd.conf located in $ORACLE_HOME/Apache/Apache/conf in both machines B and C.
    One important thing you may have missed. After changing httpd.conf in each 9iAS instance, you need to make the change known to dcmctl so issue:
    dcmctl updateConfig -ct ohs
    Then do the following for each 9iAS instance and it should be ready for webcache:
    dcmctl stop
    dcmctl start
    Setup Any-set-Cookie in webcache instead of JSESSIONID and the whole thing should now work. You can run a form through machine A which will load balance to either machine B or C (which can both be up). Then, try shutting down 9iAS on machine B or C and run a form again. They now all work.
    HTH,
    Raffy

Maybe you are looking for

  • APPCRASH   iTunes.exe 12.0.1.26 Windows STOP

    Hi When I run Itunes, the application stops running, I cannot even navigate on the app, this is the version 64-bits ... my PC does not work with 32-bits version Problem Event Name: APPCRASH   Application Name: iTunes.exe   Application Version: 12.0.1

  • Open xfdf from htmldb

    Hallo, i have a pdf formular in the filesystem and a process (executed when button is pressed) which create a xfdf file for one dataset and stored also in the filesystem. When i open the file from the filesystem, everthing is ok. Now i want to open t

  • Check printing in APP

    Hello Gurus, I am not getting the check lot with non sequential chech numbers in the check lot no. list. Hence i am not able to assign the check lot. How to proceed? Thanks in advance Neeta

  • What's the problem with Adobe Downloader assistant? It's impossible to download a trial version of

    What's the problem with Adobe Downloader Assistant? It's making it impossible to download a trial version of PS 5 extended. I can see that I'm not the only one experiencing difficulties with this so........what's the story Adobe?!!!! If you don't wan

  • How do you cancel a download in iPhone4?

    I inadvertently clicked on a tune I had already downloaded. How do I cancel? thanks, bobbi