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

Similar Messages

  • Jspc jsps inside WEB-INF?

              jspc skipped jsps inside web-inf folder (eg /webapp/WEB-INF/index.jsp) if -compileAll
              is specified. Is there any way to compile all jsps in a webapp without compiling
              one by one?
              thanks
              

    How about a look into the doc?
    1) http://www.oracle.com/pls/topic/lookup?ctx=fmw121200&id=ADFFD21876
    2) http://www.oracle.com/pls/topic/lookup?ctx=fmw121200&id=ADFFD22049
    3) http://www.oracle.com/pls/topic/lookup?ctx=fmw121200&id=ADFFD1815
    Timo

  • Appc does not compile JSPs under WEB-INF

    Hi,
              We are using WLS 8.1 and I noticed that appc does not compile jsps that are
              under WEB-INF. Is this expected? If the jsps are outside of WEB-INF then
              appc works fine...
              Thanks!
              John
              

    Although the client is not allowed to directly access jsps under WEB-INF, it
              is perfectly acceptable (and often recommended) to use a front controller to
              forward to jsps. Often these jsps are "hidden" in the WEB-INF directory so
              that they can't be accessed directly by the client. This pattern works fine
              under 8.1 except that appc won't precompile the jsps under WEB-INF (the
              container does compile the jsps when they are called). I believe this is a
              bug... If jsps are allowed in WEB-INF then appc should compile them...
              John
              "Stjepan Brbot" <stjepan.brbot@@zg.hinet.hr> wrote in message
              news:[email protected]...
              > Yes, this is expected! Web container, or better to say it's web component,
              > does not serve content of WEB-INF directory directly mening you cannot
              > access jsp inside WEB-INF like
              http://host:port/WebApp/WEB-INF/something.jsp
              > hence there's no need for compiling JSP's in it! The content of WEB-INF
              > directory can be accessed only via internal links so it is mostly used for
              > referencing taglibs. JSPs, HTMLs, images and all other file type that has
              to
              > be accessible directly by client web-server (not container internally)
              > should be in application directory or one of it's subdirectories.
              >
              > "John Hampton" <[email protected]> wrote in message
              > news:[email protected]...
              > > Hi,
              > >
              > > We are using WLS 8.1 and I noticed that appc does not compile jsps that
              > are
              > > under WEB-INF. Is this expected? If the jsps are outside of WEB-INF
              then
              > > appc works fine...
              > >
              > > Thanks!
              > > John
              > >
              > >
              >
              

  • JSPs in WEB-INF

    Hi,
    i have two (basicly?) questions:
    1)
    i try to put my JSP under WEB-INF, like i am able to do in struts
    so in struts i have a URL: http://myhost/strutsApp/loadFile.do
    that triggers an action-class, doing something an returns ActionForward,
    which is my JSP under WEB-INF
    can i deal so in JSF?
    2)
    is it possible to add "actions" ?
    i need a "logical-access" before presenting my jsf-sites,
    a URL like this http://myhost/jsfApp/loadCarById?id=9876543
    so a class must load some data from database and convert it to a backbean in my jsfs
    any ideas?
    thanks for any comment!!!

    Ahh! Now I copy.
    Inside my backing bean I call java.sql based code. I got away from using jsp sql tags or the access to databases via the JNDI of tomcat. The java.sql based code I use comes from over the years and can connect to multiple databases. It is not based on javax.sql which I'm considering. I don't know if there is such an endeavor out there. Do you know of any? The javax.servlet.jsp.jstl.sql package does not look too useful. I have a sourceforge project where I could put this code if I thought it was useful.
    I do use PreparedStatement's and a parameter coming back from a component in a form could readily be set into a PreparedStatement and the result set put back into the HtmlDataTable for the table in a jsf form.
    Here is what I call during initialization and I'm trying to make the per session; just like the title is set into a PreparedStatement so can a parameter returned from a jsf form component.
    com.neuralworks.jdbc.Hub hub;
    //try
    hub=(com.neuralworks.jdbc.Hub)new com.neuralworks.jdbc.Hub();//java.beans.Beans.instantiate(null,"com.neuralworks.jdbc.Hub");
    hub.setPropertyFileName("com.hypernex.jsf.bundles.databases");
    hub.connectJDBCAdapter();
    //hub.setUrl(getString("URL2"));
    //hub.setUser(getString("User"));
    //hub.setPassword(getString("Password"));
    //hub.connectJDBCAdapter();
    com.hypernex.jordbc.CrystallographyDataModel.getInstance().setHub(hub);
    com.hypernex.jordbc.CrystallographyDataModel.getInstance().initialize();
    com.hypernex.jordbc.CrystallographyDataModel crystallographyDataModel=com.hypernex.jordbc.CrystallographyDataModel.getInstance();
    title=com.hypernex.jordbc.CrystallographyDataModel.getInstance().getMapName();
    //double[] xMap=crystallographyDataModel.getXMap();
    //double[] yMap=crystallographyDataModel.getYMap();
    //String[] patternName=new String[xMap.length];
    //String[] mapID=crystallographyDataModel.getMapID();
    dataTable=new HtmlDataTable();
    //dataTable.setRows(xMap.length);
    hub.prepareStatement("select X, Y, MAP_ID from MAP_LOCATIONS, MAP where MAP_LOCATIONS.MAP_PK = MAP.MAP_PK and MAP.NAME=? ORDER BY MAP_LOCATIONS_PK");
    hub.setObjectAt(1,title);
    java.sql.ResultSet resultSet=hub.executeQuery();
    dataTable.setValue(new ResultSetDataModel(resultSet));
    //dataTable.setRows(xMap.length);
    System.out.println("title="+title+" "+dataTable.getRowData());
    hub.prepareStatement("select NAME from MAP where REMOVE=0");
    java.util.Vector v=hub.vectorizeColumnQuery(1);
    for(int i=0; i < v.size(); i++)
    String recipe=(String)v.elementAt(i);
    recipes.add(new SelectItem(recipe, recipe, recipe));

  • Precompile JSP in WEB-INF

    Hi,
    We're using split-directory. Our jsps live inside of WEB-INF to protect them from
    direct accessing. Only the Servlet controller can access jsps. A few questions
    here:
    1. How can I precompile jsps at the compilation time? Appc doesn't work, since
    it assumes jsps always live outside of the WEB-INF.
    2. Where is the output directory that we should set if we can precompile. Our
    jsps are located in WEB-INF/jsps.
    3. Right now we leave the server compile them on fly. But where the compiled classes
    are stored on the server. We deploy the EAR to the server.
    Thanks!

    Hi,
    1) Thanks for pointing this out. Indeed appc & jspc (8.1) don't compile jsps
    under WEB-INF and the CR associated with this bug is CR133172. Please
    contact [email protected] to obtain a patch for this issue.
    2) If appc were used on a split directory ear, the .class files for the
    jsps are copied into the destination directory of the split dir (more
    specifically into the webapp module's WEB-INF/classes being compiled)
    3) When compiled at runtime, the default outputDirectory is under the server
    temp dirs : .wlnotdelete/extract/<server-name>_<app/ear-name>_<module-name>/
    --Nagesh
    "Kelly" <[email protected]> wrote in message
    news:40771782$[email protected]..
    >
    Hi,
    We're using split-directory. Our jsps live inside of WEB-INF to protectthem from
    direct accessing. Only the Servlet controller can access jsps. A fewquestions
    here:
    1. How can I precompile jsps at the compilation time? Appc doesn't work,since
    it assumes jsps always live outside of the WEB-INF.
    2. Where is the output directory that we should set if we can precompile.Our
    jsps are located in WEB-INF/jsps.
    3. Right now we leave the server compile them on fly. But where thecompiled classes
    are stored on the server. We deploy the EAR to the server.
    Thanks!

  • Crystal Report Images Not Showing - JSP inside /WEB-INF folder

    Hi Experts,
    I am using Crystal report for Eclipse and also using Struts2 and tiles framework combination.
    The problem is when viewing the report all I've got is red X on all images and the graph image also not showing. This is when I use tiles and my jsp is inside the web-inf folder.
    This is my struts link: href="s:url value='/report/reportOpen.action?report=1'
    I've checked that the path to the viewer generated HTML is not correct. see code below.
    src="../../../crystalreportviewers/js/crviewerinclude.js"
    But when I test to access a simple jsp viewer that resides on the web root folder, this works fine but of course this is not what I want to have. I need to have my banner and menus on top of the report page (using tiles)
    This is my jsp link: href="s:url value='/ReportViewer.jsp?report=1'
    Viewer generated HTML below.
    src="crystalreportviewers/js/crviewerinclude.js"
    This might be a common problem and that you can share to me your solution.
    Note: I removed the script tags because I can't submit this entry.
    Thank you  in advance,
    Regards,
    Rulix Batistil
    Crystal Report Images Not Showing - JSP inside /WEB-INF folder

    Hi Saravana,
    After a few experimentation from your idea i was able to figure out the problem and now it is working.
    I don't have to copy the folder to where my jsp resides but still maintains it in the root location:  web/crystalreportviewers
    The changes should always be in web.xml.
    1st: change the crystal_image_uri value to ../crystalreportviewers
    2nd: change crystal_image_use_relative value to "web"
    Change to "web" instead of webapp because that is what I named my web root folder.
    <context-param>
              <param-name>crystal_image_uri</param-name>
              <param-value>../crystalreportviewers</param-value>
         </context-param>
         <context-param>
              <param-name>crystal_image_use_relative</param-name>
              <param-value>web</param-value>
         </context-param>
    Thank you. You showed me the way on how to solve the 3 day problem.
    BTW, my next problem is when clicking on any buttons prev/next/print/export, I got this error HTTP Status 404.
    Well, at least for now I can view my initial report.  I just need to figure out the next issue and with the help of the great people here in the forum.
    Thanks a lot.
    Regards,
    Rulix
    Edited by: Rulix Batistil on Nov 26, 2008 7:27 AM

  • SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'

    I'm trying to get Tiles to work with Struts on my server. I'm running a local instance of Tomcat v5.5. Development environment is Eclipse. I"ve looked everywhere on the web and can't find any solutions that work. I've been working on this for several days now. It shouldn't be this hard...
    I appreciate any help or suggestions people might have. I would really like to get beyond the configuration $#!^ and start coding.
    Thanks in advance!!!
    Jim
    Here are snippets from the pertinent files:
    web.xml:
    <?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>
         admin</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>action</servlet-name>
              <servlet-class>
                   org.apache.struts.action.ActionServlet
              </servlet-class>
              <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/struts-config.xml</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>          
         </servlet-mapping>
         <jsp-config>
              <taglib>
                   <taglib-uri>struts-bean</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/struts-bean.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>struts-logic</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/struts-logic.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>struts-html</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/struts-html.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>struts-tiles</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/struts-tiles.tld</taglib-location>
              </taglib>
              <!-- The following tag library info was added for JSTL libraries. -->
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/fmt-rt.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/c.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/c-rt.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/sql.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/sql-rt.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/x.tld</taglib-location>
              </taglib>
              <taglib>
                   <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
                   <taglib-location>/WEB-INF/tlds/x-rt.tld</taglib-location>
              </taglib>
         </jsp-config>
    </web-app>
    struts-config.xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
    "/WEB-INF/dtds/struts-config_1_2.dtd">
    <struts-config>
         <!-- ============================================ Data Source Configuration -->
         <data-sources />
         <!-- ================================================ Form Bean Definitions -->
         <form-beans>
         </form-beans>
         <!-- ========================================= Global Exception Definitions -->
         <global-exceptions />
         <!-- =========================================== Global Forward Definitions -->
         <global-forwards />
         <!-- =========================================== Action Mapping Definitions -->
         <action-mappings>          
              <action path="/foobar" forward="/createAccount.jsp" />
         </action-mappings>
         <!--
         ============================================= Controller Configuration
         <controller contentType="text/html; charset=UTF-8" />
         ======================================== Message Resources Definitions
         <message-resources
              parameter="com.xilinx.web.registration.struts.res.ApplicationResources" />
         =============================================== Plug Ins Configuration -->
         <!--======================================================= Tiles plugin -->
         <!--
              This plugin initialize Tiles definition factory. This later can takes some
              parameters explained here after. The plugin first read parameters from
              web.xml, thenoverload them with parameters defined here. All parameters
              are optional.
              The plugin should be declared in each struts-config file.
              - definitions-config: (optional)
              Specify configuration file names. There can be several comma
              separated file names (default: ?? )
              - moduleAware: (optional - struts1.1)
              Specify if the Tiles definition factory is module aware. If true
              (default), there will be one factory for each Struts module.
              If false, there will be one common factory for all module. In this
              later case, it is still needed to declare one plugin per module.
              The factory will be initialized with parameters found in the first
              initialized plugin (generally the one associated with the default
              module).
              true : One factory per module. (default)
              false : one single shared factory for all modules
              - definitions-parser-validate: (optional)
              Specify if xml parser should validate the Tiles configuration file.
              true : validate. DTD should be specified in file header (default)
              false : no validation
              Paths found in Tiles definitions are relative to the main context.
         -->
              <plug-in className="org.apache.struts.tiles.TilesPlugin" >
              <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
              <set-property property="definitions-debug" value="2" />
              <set-property property="definitions-parser-details" value="2" />
              <set-property property="definitions-parser-validate" value="true" />
              </plug-in>
         <!-- =================================================== Validator plugin
         <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
              <set-property property="pathnames"
                   value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
         </plug-in>
         -->
    </struts-config>
    tiles-defs.xml (in the WEB-INF directory as are the other xml files...):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"     
                                                 "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
         <definition name="Tiles.register" page="/tiles/template.jsp">
              <put name="header" value="/tiles/header.jsp" />          
              <put name="body" value="/register.jsp" />
              <put name="footer" value="/tiles/footer.jsp" />
         </definition>
    </tiles-definitions>
    Console output when starting the server:
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
    Jul 7, 2006 11:36:41 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.xmlDefinition.I18nFactorySet initFactory
    SEVERE: null : Can't find file '/WEB-INF/tiles-defs.xml'
    Jul 7, 2006 11:36:43 AM org.apache.struts.tiles.TilesPlugin initDefinitionsFactory
    SEVERE: Can't create Tiles definition factory for module ''.
    Jul 7, 2006 11:36:43 AM org.apache.struts.action.ActionServlet init
    SEVERE: Unable to initialize Struts ActionServlet due to an unexpected exception or error thrown, so marking the servlet as unavailable. Most likely, this is due to an incorrect or missing library dependency.
    javax.servlet.ServletException: null : Can't find file '/WEB-INF/tiles-defs.xml'
         at org.apache.struts.tiles.TilesPlugin.initDefinitionsFactory(TilesPlugin.java:233)
         at org.apache.struts.tiles.TilesPlugin.init(TilesPlugin.java:137)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:869)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:336)
         at javax.servlet.GenericServlet.init(GenericServlet.java:211)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3917)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4201)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
    Jul 7, 2006 11:36:43 AM org.apache.catalina.core.ApplicationContext log
    INFO: Marking servlet action as unavailable
    Jul 7, 2006 11:36:43 AM org.apache.catalina.core.StandardContext loadOnStartup
    SEVERE: Servlet /admin threw load() exception
    javax.servlet.UnavailableException: null : Can't find file '/WEB-INF/tiles-defs.xml'
    I have the following jars in my Web App Libraries (WEB-INF/lib):
    standard.jar
    commons-fileupload.jar
    antlr.jar
    struts.jar
    commons-beanutils.jar
    commons-logging.jar
    commons-validator.jar
    myswl-connector-java-3.1.12-bin.jar
    struts-el.jar
    jstl.jar
    commons-digester.jar
    Struts is version: 1.2.9.
    JRE / JDK: 1.5.0_06 (Program files shows I have JRE 1.5.0_05 in the tree as well)
    Note: Struts will work if I comment out the tiles plug-in in the struts-config.xml file.

    you don�t call o files-defs.xml in jsp?

  • File "/WEB-INF/struts-bean" not found

    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: File "/WEB-INF/struts-bean" not found
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:105)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:430)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:180)
         at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:354)
         at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:381)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:795)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:122)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:227)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)

    Thanks for the reply.This is what the jsp has:
    <%@ taglib uri="struts-bean" prefix="bean" %>
    <%@ taglib uri="struts-html" prefix="html" %>
    <html:html locale="true">
    <head>
    <title>Untitled Document</title>
    </head>
    <body bgcolor="#0080FF" text="#000000">
    <html:form action="/Address">
    <html:errors/>
    <!--<form method="POST" action="http://localhost:8084/sru/registration">-->
    <p> </p>
    <p>:
    <label></label>.....
    If it needs struts-bean.tld where should i copy it.I have already done trying to copy it into a folder named tags under
    my directory as such: webapps\sru\WEB-INF\tags\struts-bean.tld.
    Let me know if this is correct or not.
    Edited by: srujan on Apr 1, 2008 7:43 AM

  • Org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not foun

    hi
    i have developed small stuts sample using eclipse.When i tried to run the sample its giving following error..
    org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
         org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160)
         org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:424)
         org.apache.jasper.compiler.Parser.parseDirective(Parser.java:493)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)
         org.apache.jasper.compiler.Parser.parse(Parser.java:127)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    But i ahve placed the tld files inside WEB-INF.
    please anybosy help me why i am getting this error?
    regards
    shruthi

    Hello,
    Were you able to find out the cause of the problem you were having with the "/WEB-INF/struts-html.tld" error?
    I'm stuck for a while on this problem, your input would help a great deal.
    Thanks,
    -Rick

  • Jsps under WEB-INF

    Hello,
    i've moved my jsps from outside WEB-INF to WEB-INF directory
    /web-inf/jsp/private/home.jspBut now i can't receive the home.jsp page. what do i have to do to see the home.jsp in the browser? Do i have to change my faces-config.xml ?
    thanks

    Files in WEB-INF and META-INF are not public accessible. You may create kind of a servlet which serves those files using an absolute path. But that's just a nasty workaround for kind of a workaround. What are you trying to achieve? Why have you moved the files to the WEB-INF?

  • JSP in WEB-INF gives deny-existence

    I am trying to forward to a JSP in the WEB-INF subdirectory and it gives me a deny-existence. I would like to store my jsps in the WEB-INF to prevent users from accessing them directly. How can I stop the deny-existence error?

    Hi,
    The check-acl function specifies an Access Control List (ACL) to use to check whether the client is allowed to access the requested resource.
    Regardless of the order of PathCheck directives in the object, check-acl functions are executed first. They cause user authentication to be performed, if required by the specified ACL, and will also update the access control state.
    Create a seperate ACL file for the server to restrict the JSP pages in the WEB-INF file.Else you can edit the default ACL file at the server instance location file named generated.https-<hostname>.acl for the users to read the content.Specity in the ACL file who are all can access the file.
    Thanks
    Selva

  • Can WebLogic have JSPs in WEB-INF?

    I believe that in older releases, there was no practical way to have JSPs in the WEB-INF tree. I also believe that as of either 9.x or 10.x, this was allowed, either by default, or by setting a configuration parameter. I can't easily find information about this in the doc tree. Does anyone know of any details about this?
    Note that this would be in the context of an application that does not facilitate direct references to JSPs from the client, like in Struts. The only accesses to JSPs are through forwards from actions.

    I actually thought this was allowed (by default) in 8.1, but I can't point you at any definitive refs...

  • JSP file extension: other than .jsp

    Is it possible with Tomcat to have a JSP file with an extension any other than .jsp? If it is what should I do to make it possible?
    Please point me to the right direction.
    Cheers,
    Alexei

    In the default web.xml the.jsp extension is mapped to the jsp servlet. You can override this or add your own mapping:
      <!-- The mapping for the JSP servlet -->
      <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
      </servlet-mapping>Change the url-pattern to what you want and add to the web app's web.xml.

  • Access jsp pages in WEB-INF directory

    Hi,
    I've a problem with my jsp web project;
    practically I've created a web project that uses jsp pages and servlet.
    I never use links to jsp pages, directly in my web pages, but I call always first servlet;
    the servlet call jsp pages.
    My project is completed and works fine, but any user can access to my jsp pages directly simply writing the url.
    So I've tried to move my jsp pages in the WEB-INF directory, but now I doesn't manage in accessing index.jsp page;
    how must I do to access index.jsp page?
    I've tried to modify web.xml like this
    <welcome-file-list>
              <welcome-file>WEB-INF/index.jsp</welcome-file>
         </welcome-file-list>
    but doesn't work;
    besides also servlet calls to jsp pages doesn't work anymore.
    How can I solve?
    Thank you in advance
    MargNat

    ok, so first you have to implement the Filter interface, with 3 methods,
    the main method u have to put logic in is doFilter()
    public class YourClass implements javax.servlet.Filter {
    doFilter(ServletRequest req, ServletResponse res, FIlterChain chain) throws ... {
    //check first if is HTTP, if in this case permission is not granted as well
    if(req instanceof HttpServletRequest{
    HttpServletRequest httpReq = (HttpServletRequest)req;
    //now check if its called for index.jsp
    if(!httpReq.getRequestURI().toLowerCase().endsWith("index.jsp"))
       throw new ServletException("access permitted");
    else
      chain.doFilter(req,res); //go on with processing
    }else
    throw new ServletException("only HTTP requests allowed");
    }and of course you have to register that filter in your web.xml doing
      <filter>
        <filter-name>yourFilter</filter-name>
    <filter-class>yourFilterClass</filter-class>
      </filter>
      <filter-mapping>
        <filter-name>yourFilter</filter-name>
        <url-pattern>/**.jsp</url-pattern>
      </filter-mapping>actually that's it

  • Storing .jsp files in the web-inf directory

    Has anyone ever heard about storing JSP files in the web-inf directory instead of the web app root directory.
    Apparently it improves security.
    If this is so, how is the user suppose to access the jsp file since I thought that users were not able to access what is stored in the web-inf directory.
    Any thoughts
    Thanks
    Nat

    I didn't tyr this but I think it is possible. You can do it using <servlet-mapping/> as you do with any other servlet.
    For example include lines below, in web.xml of web-inf,
    <servlet>
    <servlet-name>ReportRouter</servlet-name>
    <jsp-file>/web-inf/jsp/ReportRouter.jsp</jsp-file>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReportRouter</servlet-name>
    <url-pattern>/myrouter</url-pattern>
    </servlet-mapping>
    This may work. Don't you think so?
    Sudha

Maybe you are looking for

  • Any suggestions how can I delete or archive items with DocTitle as *.html ?

    Any suggestions how can I delete or archive items with DocTitle as *.html ? These are the email templates checked in by Fusion Apps, and all I know are the DocTitles. Archive servervice seems a better way to delete items at same time keep a backup. b

  • Invoice and proforma invoice

    what is the difference between invoice and proforma invoice?

  • Error on BR*TOOLS

    Hi, Please find the log file and help me out in fixing this issue INFO      2008/04/13 09:46:20   [Setup] SAP BR*Tools Studio Setup INFO      2008/04/13 09:46:20   [Setup] Version 7.10 (2) INFO      2008/04/13 09:46:20   [Setup] Initializing... INFO 

  • Problem with opening an excel spreadsheet

    Hello, I need to open an excel sheet when the user clicks on a link. When I run the code I get SAVE/ DOWNLOAD dialog box. Is it possible to get around the SAVE/DOWNLOAD dialog and open the excel sheet directly. In other words, is it possible to downl

  • Identity Insert with SQLOLEDB from Perl

    I have a simple code sample here which throws an error on the SQL INSERT statement. It creates a table with a single integer identity column and then tries to force a value into it. My real world problem is more complex, but this distills the error I