Trobule with web.xml jsp-config

Hi,
I'm using Tomcat 6.0.26. How do I write a jsp-config such that I can apply a header and footer to a group of JSPs in a certain folder and a different header and footer to all other JSPs? Right now, I have ...
     <jsp-config>
          <jsp-property-group>
               <url-pattern>/WEB-INF/views/*</url-pattern>
               <url-pattern>/WEB-INF/error-pages/*</url-pattern>
               <include-prelude>/WEB-INF/includes/header.jspf</include-prelude>
               <include-coda>/WEB-INF/includes/footer.jspf</include-coda>
          </jsp-property-group>
          <jsp-property-group>
               <url-pattern>/WEB-INF/views/accommodations/includes/*</url-pattern>
               <include-prelude>/WEB-INF/includes/blank.jspf</include-prelude>
               <include-coda>/WEB-INF/includes/blank.jspf</include-coda>
          </jsp-property-group>
     </jsp-config>But what I'm finding is that the JSPs in the second property group (/WEB-INF/views/accommodations/includes/*), are getting both headers and footers included, which I guess makes sense, since technically, both patterns match.
However, I only want one group included. Any advice is appreciated, - Dave

Check out the JSP Specification Section JSP.3.3.5.
>
When more than one jsp-property-group applies to a JSP page, the corresponding includeprelude
elements will be processed in the same order as they appear in the JSP
configuration section of web.xml
>
It is working exactly as advertised. Because it matches both groups, it includes both preludes/codas.
To exclude one, you have to make it not match the pattern defined in your jsp-property-group.
cheers,
evnafets

Similar Messages

  • Web.xml + jsp-config element missing in definition?

    Hi,
    I have problem with jsp-config element definition in web.xml - I checked web-app_2_5.xsd it's reffering to javaee_5.xsd - but it's missing there
    from web xsd:
    <xsd:element name="jsp-config"
              type="javaee:jsp-configType"/>
    There is no javaee:jsp-configType. Is jsp-config deprecated? I couldnt find it in 1.4 as well. Please advice.
    Thanks
    Y

    ok - there are includes in web-add_2_5.xsd to jsp_2_1.xsd ... missed that - sorry
    <xsd:include schemaLocation="javaee_5.xsd"/>
    <xsd:include schemaLocation="jsp_2_1.xsd"/>
    Y

  • SJSC2u1 JSP accessing web.xml session-config session-timeout

    What is the best way of accessing web.xml session-config session-timeout from JSP page ?
    I wish to have this on the JSP page and also have it count down automatically.
    I did this by creating a propery in the session bean and then used javascript to count it down.
    Is there a better way ? Simpler Way ?
    /Roger

    What is the best way of accessing web.xml session-config session-timeout from JSP page ?
    I wish to have this on the JSP page and also have it count down automatically.
    I did this by creating a propery in the session bean and then used javascript to count it down.
    Is there a better way ? Simpler Way ?
    /Roger

  • Problem with web.xml

    Hello,
    I have a big problem with web.xml.
    i can run the servlet demos with the default web.xml, but when i try to user a costum web.xml files, i receive a 404 page not found on a link.
    i have some dificulty to post here. but can somebody help my with my web.xml files?
    thanks for your help.
    have a nice day!

    Be careful with the place of your files and folders. It's possible that you've just mentioned the cause of your problem.
    My web.xml is
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>gco</display-name>
    <description>gco webapplicaties</description>
    <servlet>
    <servlet-name>MopoController</servlet-name>
    <servlet-class>org.gertcuppens.controller.MopoController</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>MopoController</servlet-name>
    <url-pattern>/MOPO</url-pattern>
    </servlet-mapping>
    </web-app>
    When I want to call my web application locally, I use the URL http://localhost:8080/gco/MOPO.
    The http://localhost:8080 calls Tomcat. With /gco, Tomcat knows it should look for a folder gco inside the webapps folder. This one should contain a WEB-INF/web.xml folder for further instructions.
    With /MOPO Tomcat knows, having read the web.xml files of all webapps folders at start, it should look for a servlet with the name MopoController. And this MopoController points to the class org.gertcuppens.controller.MopoController. So, Tomcat knows where to find everything.
    Try to see whether your Tomcat can find everything inside the folders using your web.xml file.

  • Problem with web.xml in jsp

    is there any api in jsp to retreive the path of web.xml

    request.getRealPath() is deprecated.
    Instead you should be using the method in ServletContext.
    In a JSP the servletContext is exposed as the implicit variable "application"
    In a Servlet you can get hold of it like:
    ServletContext application = getServletConfig().getServletContext();
    String path = application.getRealPath("/WEB-INF/web.xml");

  • Problem with web.xml, while migratig application from JBOSS 5.0 to JBOSS5.1

    Hi ,
    Earlier my application was running fine on JBOSS 5.0 .
    In that web.xml was like
    <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_4.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
         id="WebApp_ID" version="2.4">
         <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>
         <!-- Timer Details -->
         <servlet>
              <servlet-name>perfMonCollector</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonitorCollector</servlet-class>
              <load-on-startup>4</load-on-startup>
              <init-param>
                   <param-name>cronExpr</param-name>
                   <param-value>0 0 0 */1 * ?</param-value>
                   <!--<param-value>0 */10 * * * ?</param-value> -->
              </init-param>
         </servlet>
         <servlet>
              <servlet-name>TransAnalysisCollector</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.TransAnalysisCollector</servlet-class>
              <load-on-startup>3</load-on-startup>
              <init-param>
                   <param-name>cronExprTransAnalysis</param-name>
                   <param-value>*/30 * * * * ?</param-value>
              </init-param>
         </servlet>
         <!-- Timer Details -->
         <!-- PerfMonPoints Cache Generation on Server Startup -->
         <servlet>
              <servlet-name>perfMonGenerator</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonPointsGenerator</servlet-class>
              <load-on-startup>2</load-on-startup>
         </servlet>
         <!-- PerfMonPoints Cache Generation on Server Startup -->
         <!-- Standard Action Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <!-- The Usual Welcome File List -->
         <welcome-file-list>
              <welcome-file>jsp/index.jsp</welcome-file>
         </welcome-file-list>
    But now i have deployed my application on JBOSS 5.1 GA version.
    Now its giving exception.
    Caused by:
    org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref}' is expected. @ vfsfile:/local/dubeavi/jboss-5.1.0.GA/server/default/deploy/PerformanceMonitoringISE-1.0/WEB-INF/web.xml[28,15]
    at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
    ... 41 more

    My new web.xml is like..
    <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">
         <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>

  • Taglib tag doesn't work with web.xml 2.4 ?

    That is, I switched to the 2.4 version of web.xml and now none of the taglib elements I have in there work.
    I get the following excpetion
    org.apache.jasper.JasperException: File "/tags/struts-html" not found
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.jav a:105)
    I've been surfing a good portion of the day looking for some documentation on this but to no avail. I did find that I should wrap the taglib elements in a jsp-info. I'm runing tomcat 5.0.19.
    In any event here is my web.xml:
    <web-app 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 web-app_2_4.xsd"
    version="2.4">
    <display-name>Struts Examples Application</display-name>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>com.jacent.admin.servlet.init.InitServlet</servlet-clas s>
    <init-param>
    <param-name>log4j</param-name>
    <param-value>/WEB-INF/log4j.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class&g t;
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <!-- module configurations -->
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- The Usual Welcome File List -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <jsp-config>
    <taglib>
    <taglib-uri>/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-nested</taglib-uri>
    <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/struts-tiles</taglib-uri>
    <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/datetime</taglib-uri>
    <taglib-location>/WEB-INF/datetime.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/tabs-taglib</taglib-uri>
    <taglib-location>/WEB-INF/tabs-taglib.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/tags/admin-widgets</taglib-uri>
    <taglib-location>/WEB-INF/admin-widgets.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
    <taglib-location>http://java.sun.com/jsp/jstl/core</taglib-location> ;
    </taglib>
    </jsp-config>
    </web-app>
    In addition Eclipse is complaining about web-app element not able to be found.
    Thanks for anyone's help!
    John

    #1 programmers excuse: It works for me. You must be doing something wrong.
    Finding out what is the trick.
    I have Tomcat 5.0.28, but I don't think it would make THAT much difference.
    What version of Java are you running?
    You shouldn't need the entry for the JSTL library c. That works without an entry in web.xml, provided you use the correct URI.
    First step: make a test page that only uses that one taglib - eg an html:base tag.
    Confirm that it breaks with the current setup.
    Backup web.xml, and start it from scratch with an absolute minimal one - only import the struts-html library.
    Does that work?
    Slowly copy and paste in the different bits of web.xml until you find what breaks it.
    Hope this helps,
    evnafets

  • Help with web.xml

    <web-app 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" version="2.4">
    <display-name>Comerica RPM - Relationship Pricing Model</display-name>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <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>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- The Usual Welcome File List -->
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/WEB-INF/tags/struts-bean</taglib-uri>
    <taglib-location>/WEB-INF/tags/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tags/struts-html</taglib-uri>
    <taglib-location>/WEB-INF/tags/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tags/struts-logic</taglib-uri>
    <taglib-location>/WEB-INF/tags/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tags/struts-nested</taglib-uri>
    <taglib-location>/WEB-INF/tags/struts-nested.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tags/struts-tiles</taglib-uri>
    <taglib-location>/WEB-INF/tags/struts-tiles.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/tags/displaytag-12</taglib-uri>
    <taglib-location>/WEB-INF/tags/displaytag-12.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/fmt</taglib-uri>
    <taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>http://java.sun.com/jstl/xml</taglib-uri>
    <taglib-location>/WEB-INF/tlds/x.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>
    </web-app>
    Showing red x mark beside file name.
    According to tooltip
    Invalid content was found starting with element taglib.
    one of {"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display name, ...................
    What wrong in here?
    I just modified
    <webapp>
    to
    <web-app 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" version="2.4">
    and added the JSTL taglibs at the end.
    thanks.

    Below is the error.
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected. [56]
    web.xml validation errors detected!

  • Problem with web.xml: getWebXmlParameter

    Hi,
    I've a problem with my web.xml.
    I need to work with tokens, for the different servers.
    For this, I normally use "getWebXmlParameter("...")", but now this doesn't work...
    My web.xml looks like this:
    <web-app>
       <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <init-param>
             <param-name>config</param-name>
             <param-value>/WEB-INF/faces-config.xml</param-value>
          </init-param>
          <init-param>
             <param-name>debug</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
             <param-name>detail</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_address</param-name>
               <param-value>@WEBAPP_ADDRESS@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_port</param-name>
               <param-value>@WEBAPP_PORT@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_schemaDb</param-name>
               <param-value>@WEBAPP_SCHEMA_DB@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_datasource</param-name>
               <param-value>@WEBAPP_DATASOURCE@</param-value>
          </init-param>
       </servlet>
       <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
       </servlet-mapping>
       <welcome-file-list>
          <welcome-file>Language.faces</welcome-file>
       </welcome-file-list>
    </web-app>Normally I've a servlet which extends GenericServlet. In this class, I can use getWebXmlParameter("..")...
    How can I solve this problem?
    Thx a lot...
    Ann

    Hi,
    thx for the reply, but it stil doesn't work.
    In my class I put the following lines, for receiving the properties:
    Properties     props = new Properties();
    String file = "oltb_webapp.properties";
    props.load(this.getClass().getClassLoader().getResourceAsStream(file));
    private String jndiHostName = props.getProperty("webapp.address");He doesn't finde the file.. If I change the file-name to "resources/oltb_webapp.properties", he still doesn't find it...
    What am I doing wrong? I use this code all the time, and normally this works perfect... But with my webapplication, I've a problem...
    Thx a lot
    Ann

  • Help with web.xml under WL5.1sp3

    Hello,
    I just started to explore Weblogic Server 5.1sp3 as part
    of setting it up for the JASIG uPortal project here at UBC.
    I'm unable to get web.xml to work for me. I've created the
    file, I know WL is seeing it and parsing it (through various
    typos during the installation process) but when my index.jsp page
    runs, getInitParameter() comes back with nothing.
    Any ideas what I could be missing?
    Thanks
    George
    [email protected] ITServices, UBC
    Programmer/Analyst
    phone: 604.822.4375 fax: 604.822.5116

    Please post this to the weblogic.developer.interest.servlet
    thanks
    mbg
    In article <[email protected]>, [email protected] says...
    Hello,
    I just started to explore Weblogic Server 5.1sp3 as part
    of setting it up for the JASIG uPortal project here at UBC.
    I'm unable to get web.xml to work for me. I've created the
    file, I know WL is seeing it and parsing it (through various
    typos during the installation process) but when my index.jsp page
    runs, getInitParameter() comes back with nothing.
    Any ideas what I could be missing?
    Thanks
    George
    ==================================================
    NewsGroup Rant
    ==================================================
    Rant 1.
    The less info you provide about your problem means
    the less we can help you. Try to look at the
    problem from an external perspective and provide
    all the data necessary to put your problem in
    perspective.

  • URGENT: Tomcat, Connection Pool - Issue with web.xml & server.xml

    Folks,
    I am trying to connect to a MS SQL database using Tomcat/JSP but having issues. The code that I am using is as follows:
    Context ic = new InitialContext();
    DataSource ds = (DataSource) ic.lookup("java:comp/env/jdbc/test");
    Connection conn = ds.getConnection();
    Statement stmt = conn.createStatement();
    I have added the following code to my Server.xml:
    <Resource name="jdbc/test" auth="Container" type="javax.sql.DataSource"
    maxActive="100" maxIdle="30" maxWait="10000"
    username="DB_AW_DATA" password="tester" driverClassName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
    url="jdbc:microsoft:sqlserver://192.168.0.1\\Newcastle"/>
    And the complete web.xml
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE web-app (View Source for full doctype...)>
    - <web-app>
    - <resource-ref>
    <description>Resource reference to java.sql.Connection factory defined in server.xml</description>
    <res-ref-name>jdbc/test</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    The error message that I am getting is as follows:
    java.sql.SQLException: Cannot load JDBC driver class 'null'
    What confuses me is that I have placed the following files in Tomcat\common\lib...
    mssqlserver.jar
    msbase.jar
    msutil.jar
    I think this is purely an issue with how I configured server.xml and web.xml
    In the Tomcat documentation it states to put the code in the server.xml - but nested inside the Context element. This is something that I have not done as I am clear what the Context should be..
    Can someone assist...
    <Context path="" docBase="ROOT" debug="0"> ???
    what should be the path and the docBase.
    I have deployed the following application:
    http://localhost:8080/SCWAPP/index.jsp
    THANKS IN ADVANCE FOR ALL SUPPORRT

    you should put the code you typed in server.xml into context.xml
    in the META-INF folder and this will fix your problem.
    the latest tomcat docs detail what to do.

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

  • Help with web.xml and deploying a servlet

    Hello,
    I've been tearing me hair out for the last few hours trying to get this to work... I've got a servlet org.fatbaob.servtest.Servtest that I want to deploy with Tomcat 4.0.4. It doesn't seem to mater what I put in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file c:\development\projects\servtest\WEB_INF\classes\org\fatboab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat conf\server.xml file:
    <!-- Servtest context -->
         <Context path="/servtest" docBase="C:\development\projects\servtest" debug="0" privileged="true" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_servtest_log." suffix=".txt" timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-class>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping> tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form action="/servtest/servlet/org.fatboab.servtest.Servtest" method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource (/servtest/servlet/org.fatboab.servtest.Servtest) is not available.
    Help!
    Cheers,
    Bob.

    Hello,
    I've been tearing me hair out for the last few hours
    trying to get this to work... I've got a servlet
    org.fatbaob.servtest.Servtest that I want to deploy
    with Tomcat 4.0.4. It doesn't seem to mater what I put
    in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file
    c:\development\projects\servtest\WEB_INF\classes\org\fa
    boab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat
    conf\server.xml file:
    <!-- Servtest context -->
    <Context path="/servtest"
    docBase="C:\development\projects\servtest" debug="0"
    privileged="true" reloadable="true">
    <Logger
    er className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_servtest_log." suffix=".txt"
    timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
    Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-
    lass>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping>
    tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form
    action="/servtest/servlet/org.fatboab.servtest.Servtest
    method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name"
    ="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email"
    "email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit"
    submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource
    (/servtest/servlet/org.fatboab.servtest.Servtest) is
    not available.
    Help!
    Cheers,
    Bob.Bob,
    Here an servlet definition I have defined in my web.xml...just plug in your values.
    <servlet>
    <servlet-name>AutoUpload</servlet-name>
    <servlet-class>com.lendleaserei.webservices.AutoUpload</servlet-class>
    <display-name></display-name>
    <description></description>
    </servlet>
    <servlet-mapping>
    <url-pattern>/webs</url-pattern>
    <servlet-name>com.lendleaserei.webservices.AutoUpload</servlet-name>
    </servlet-mapping>
    Hope this helps,
    Marco

  • Trouble aliasing with web.xml

    i am having trouble creating aliases for my servlets in the web.xml file. currently i have my servlets in packages and have to reference the complete package name.
    any ideas are appreciated,
    gary

    ps. - i am using tomcat 1.1.17

  • Changing the directory Structure of Jsp and web.xml files

    Hi,
    I am using the JDeveloper 11g preview. Can any one tell me how to change the Jsp and web.xml files ( not in WEB-INF directory of the application) to another directory.
    Thanks in Advance
    Gopal

    Hi Frank,
    Is it possible for me to change the folder structure which JDeveloper is providing for web project?
    By default JDeveloper is giving the following folder structure.
    In the project's root folder there is a public_html and src folder along with .jpr file.
    In public_html folder thre is an WEB-INF folder and a jsp file
    In WEB-INF folder there is an classes folder along with web.xml file.
    I need to have the following folder structure :
    The WEB-INF folder should be in root folder of project not in public_html folder
    src folder must be in WEB-INF folder.
    Thanks in Advance
    Anil Golla

Maybe you are looking for

  • Oracle 9i Install problem

    Hi I am installing (via vmware) Oracle 9i (9.2.0.1.0) on debian (kernel 2.4.18) the install went fine except for a few hitches which i fixed after a quick google search. However after the install the install window closed during the setup of services

  • Javascript alert box

    how to open a alertbox of javascript by actionscript i want show a popup when user click on button.

  • Explaination of Component palette in BPEL

    Hi , i am new to BPEL and have been asked to work on BPEL without any prior training :(. When i open Jdeveloper i find a component palette which has foll options 1. Code Snippets 2. Preferred Components 3. Proces activities 4. Services 5. XML Can som

  • Astronomy picture of day website won't open the picture but will with explorer

    site opens, but no pic...never had a prob before. i have mcafee installed.

  • Creating a brochure

    Hello folks, I have been ask to design a brochure for roofing company. They want it to be done in professional matter, so I am wondering whether iWork is design to produce professionally looking brochures and flyers? The idea is, that I would do the