JSP include directive not working with Tomcat 5.0

Hi.
I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
       version="2.0">
<jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
<%@ include file="/jsp/panelpage_header.inc" %>
     <h:outputText value="Welcome!"/>
<%@ include file="/jsp/panelpage_footer.inc" %>
</jsp:root>However, when I try to load the page, a compilation error occurrs:
org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
     org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
Did anyone see this kind of error before?

Ok, the solution with jsp:directive.include works,
if header.inc and footer.inc themselves are well
formed too. If I understood the concept right this is
because header and footer are processed during
request time and therefore interpreted as
'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
>
But: What can I do when these two files define a tag
that should enclose my current page (for example,
header opens a panelGrid-Tag, and footer closes it).
For this case I thought the use of the
@include-directive would be neccessary to combine the
three pages during compilation. By this the resulting
page would be well-formed although header and footer
are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else.

Similar Messages

  • Jsp:include doesn't work with Tomcat & IIS

    Hi, Guys,
    I installed IIS4.0 and Tomcat in my windows NT system. http://localhost/examples/jsp/index.html works fine.
    When I load http://localhost:8080/about.jsp, it's also working fine. But when I load http://localhost/about.jsp, it will ignore the part which the line is display as
    <%String topName = "/servlet/topServlet";%>
    <jsp:include page="<%=topName%>" flush="true"/>
    The other part will work just as a html file. And I didn't get any error message.
    Would can tell me how to figure out this problem. Thank in advanced very much!

    Oh, God, why not tell me earlier!!!!!! I do use tomcat 3.1 and it just support servlet. I have no way out but modify all my jsp:include to encoding into a servlet page. I almost re-do all my work. But anyway, thank you! Next time I will know.

  • RequestDispatcher is not working with Tomcat 4.1

    This is JSP's path
    http://localhost:8080/myApp/Date.jsp
    from this jsp i am calling below Servlet
    this is my servlets path
    http://localhost:8080/examples/servlet/SampleServlet
    from the servlet i am trying to forward request to other JSP
    but it sees like RequestDispatcher is not working with Tomcat
    but i can able to call JSP using
    response.sendRedirect("http://localhost:8080/myApp/Date.jsp");
    OR
    response.sendRedirect("/myApp/Date.jsp");
    both works fine , but no combination is working with RiquestDispatcher.forword();
    Any Guess ???.

    yes i have tried with ("/Date.jsp") also .
    it gives me 404 error
    Error description is
    " The requested resource (/Date.jps) is not available"
    i am getting same error for all possible combinations of URL iam giving
    some of other URL's i have tried..
    /examples/Date.jsp
    /myApp/Date.jsp (myApp is my war file name deployed in webapps directory)
    and many more
    thanks for help.

  • JSP: work with TomCat 5.5.9 and NOT work with TomCat 6.0.16

    Hi all,
    I'm Antony and I have a problem with a .JSP page of my server.
    In my server there are 2 users: "u1" and "u2"; there are 2 TomCat, version 5.5.9 and version 6.0.16. There is Apache WebServer version 2. The 2 TomCat servers have the same configuration files: server.xml and web.xml (in the dir /conf of the main server's root). They not work simultaneously.
    When the user "root" launch the TomCat 5.5.9 all work fine: the server will show correctly the JSP pages of "u1" and the pages of "u2".
    When the user "root" launch the TomCat 6.0.16 the JSP pages of "u1" work fine but the JSP pages of "u2" not work: it seems that there are problems with the path where the server want to search the pages of u2.
    In the server.xml there is this code (for the handle of u2's site):
    <Host name="u2site.com" appBase="/home/u2/public_html/">
      <Alias>www.u2site.com</Alias>
      <Context path="" reloadable="false" docBase="/home/u2/public_html/" debug="0"/>
              <Context path="/manager" debug="0" privileged="true"
                  docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
              </Context>
    </Host>and this code (for the u1's site)
    <Host name="u1site.com" appBase="/home/u1/public_html/">
      <Context path="" reloadable="false" docBase="/home/u1/public_html" debug="1"/>
              <Context path="/manager" debug="0" privileged="true"
                  docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
              </Context>
    </Host>The problems with the JSP pages of u2 are one of the following:
    org.apache.jasper.JasperException: /login2.jsp(4,0) The value for the useBean class attribute com.u2.beans.access.Autenticator is invalid.and this one that appear with the pages that have the inclusion of another JSP page
    /u2page.jsp(3,0) File "/../support/_formatting.jsp" not foundI think that the TomCat know how to find the page that the browser request to Apache WebServer (and that the webserver request to Tomcat by the connector) 'cause for pages that haven't inclusion or call to method in packages all work fine...but the TomCat have problems to locate the pages included or the method located in a JAR (the jars are located in WEB-INF/lib/ of the u2's site).
    How I can resolve this problem with TomCat 6.0.16? I repeat that with TomCat 5.5.9 all work fine...same configuration!
    Any ideas?
    Thank you very much,
    Antony.

    Hi stevejluke, 'cause in the page "/supporto/_formatting.jsp" there are only the definition of some variables it's normal that the output at the browser it's a blank page.
    The problem it's that Tomcat 6.0.16 cannot know how "navigate" the pages beginning from one...it know where is the "x.jsp" page requested directly by Apache WebServer, where is "y.jsp" request directly by Apache, where is "z.jsp" requested directly by Apache but if "x.jsp" request, includes, "y.jsp" Tomcat cannot know where "y.jsp" is located. There is some file where I can "say" this to Tomcat?
    The page "/mostre/elenco_mostre.jsp" includes directly the "/supporto/_formatting.jsp".
    Another thing: in /mostre/elenco_mostre.jsp there is an inclusion directive for /supporto/_formatting.jsp that is so:
    <%@ include file="../supporto/_formatting.jsp"%>you can see that the included file is "../supporto/_formatting.jsp" and NOT "/../supporto/_formatting.jsp"...the "/" at the begin of the path is included by Tomcat!
    In the catalina.out there are this lines, when the page is called:
    Jul 6, 2008 3:15:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: /elenco_mostre.jsp(3,0) File "/../supporto/_formatting.jsp" not found
      In catalina.out before server start there are this lines:
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '1' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
    Jul 6, 2008 1:43:49 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 358 ms
    Jul 6, 2008 1:43:49 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jul 6, 2008 1:43:49 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
    Jul 6, 2008 1:43:52 AM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/23  config=null
    Jul 6, 2008 1:43:52 AM org.apache.catalina.connector.MapperListener registerEngine
    WARNING: Unknown default host: localhost
    Jul 6, 2008 1:43:52 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2512 msThe file "web.xml" is located in "$Tomcat_home/conf" and it's:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <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">
      <servlet>
        <servlet-name>jsp</servlet-name>
        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
        <init-param>
          <param-name>fork</param-name>
          <param-value>false</param-value>
        </init-param>
        <init-param>
          <param-name>xpoweredBy</param-name>
          <param-value>false</param-value>
        </init-param>
        <load-on-startup>3</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jsp</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.jspx</url-pattern>
      </servlet-mapping>
      <session-config>
        <session-timeout>30</session-timeout>
      </session-config>
      <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
    </web-app>there are not web.xml file in /WEB-INF/ of the web application.
    Maybe the problem it's that Tomcat want the conf file in "Server/Service/Engine/Host/Context" ? I must move the block HOST of the server.xml file in this path?
    Good Sunday and thank you!
    Antony.

  • JDBC not working with Tomcat

    Please help,
    I have tried all the database example and they work great locally, until I deploy to my Tomcat server. Tomcat is display Java Studio Creator 2 pages without issue not binding to data.
    all I am trying to do is a basic sql connection to see how Java Studio Creator 2 connects.
    Dev enviroment:
    1. sql server: localhost
    2. user: tester
    3. password: Stealth1
    4. SQL table: doc
    I would really apreaciate if someone could walk me thru a simple table databind ~ now remember the local databind and run works without issues - export to a war and implement to Tomcat 5.5.15
    Here is what I have
    <tomcat_install>\common\lib ~ dropped in: msbase.jar,mssqlserver.jar, msutil.jar, jstl.jar, standard.jar
    Exported war name:simple
    <tomcat_install>\webapps\simple ~ Page1.jsp
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <ui:page binding="#{Page1.page1}" id="page1">
                <ui:html binding="#{Page1.html1}" id="html1">
                    <ui:head binding="#{Page1.head1}" id="head1">
                        <ui:link binding="#{Page1.link1}" id="link1" url="/resources/stylesheet.css"/>
                    </ui:head>
                    <ui:body binding="#{Page1.body1}" id="body1" style="-rave-layout: grid">
                        <ui:form binding="#{Page1.form1}" id="form1">
                            <ui:staticText binding="#{Page1.staticText1}" id="staticText1" style="position: absolute; left: 72px; top: 72px" text="Testing label"/>
                            <ui:table augmentTitle="false" binding="#{Page1.table1}" id="table1" style="left: 72px; top: 96px; position: absolute; width: 360px"
                                title="Table" width="240">
                                <script><![CDATA[
    /* ----- Functions for Table Preferences Panel ----- */
    * Toggle the table preferences panel open or closed
    function togglePreferencesPanel() {
      var table = document.getElementById("form1:table1");
      table.toggleTblePreferencesPanel();
    /* ----- Functions for Filter Panel ----- */
    * Return true if the filter menu has actually changed,
    * so the corresponding event should be allowed to continue.
    function filterMenuChanged() {
      var table = document.getElementById("form1:table1");
      return table.filterMenuChanged();
    * Toggle the custom filter panel (if any) open or closed.
    function toggleFilterPanel() {
      var table = document.getElementById("form1:table1");
      return table.toggleTableFilterPanel();
    /* ----- Functions for Table Actions ----- */
    * Initialize all rows of the table when the state
    * of selected rows changes.
    function initAllRows() {
      var table = document.getElementById("form1:table1");
      table.initAllRows();
    * Set the selected state for the given row groups
    * displayed in the table.  This functionality requires
    * the 'selectId' of the tableColumn to be set.
    * @param rowGroupId HTML element id of the tableRowGroup component
    * @param selected Flag indicating whether components should be selected
    function selectGroupRows(rowGroupId, selected) {
      var table = document.getElementById("form1:table1");
      table.selectGroupRows(rowGroupId, selected);
    * Disable all table actions if no rows have been selected.
    function disableActions() {
      // Determine whether any rows are currently selected
      var table = document.getElementById("form1:table1");
      var disabled = (table.getAllSelectedRowsCount() > 0) ? false : true;
      // Set disabled state for top actions
      document.getElementById("form1:table1:tableActionsTop:deleteTop").setDisabled(disabled);
      // Set disabled state for bottom actions
      document.getElementById("form1:table1:tableActionsBottom:deleteBottom").setDisabled(disabled);
    }]]></script>
                                <ui:tableRowGroup binding="#{Page1.tableRowGroup1}" id="tableRowGroup1" rows="5" sourceData="#{Page1.docsDataProvider}" sourceVar="currentRow">
                                    <ui:tableColumn binding="#{Page1.tableColumn1}" headerText="LeafName" id="tableColumn1" sort="LeafName">
                                        <ui:staticText binding="#{Page1.staticText2}" id="staticText2" text="#{currentRow.value['LeafName']}"/>
                                    </ui:tableColumn>
                                    <ui:tableColumn binding="#{Page1.tableColumn2}" headerText="DirName" id="tableColumn2" sort="DirName">
                                        <ui:staticText binding="#{Page1.staticText3}" id="staticText3" text="#{currentRow.value['DirName']}"/>
                                    </ui:tableColumn>
                                </ui:tableRowGroup>
                            </ui:table>
                        </ui:form>
                    </ui:body>
                </ui:html>
            </ui:page>
        </f:view>
    </jsp:root>Folders <tomcat_install>\webapps\simple\
    Tree listing
    | Page1.jsp
    |
    +---META-INF
    | MANIFEST.MF
    |
    +---resources
    | stylesheet.css
    |
    \---WEB-INF
    | faces-config.xml
    | managed-beans.xml
    | navigation.xml
    | web.xml
    |
    +---classes
    | \---simple
    | ApplicationBean1.class
    | Bundle.properties
    | Page1.class
    | RequestBean1.class
    | SessionBean1.class
    |
    \---lib
    appbase.jar
    commons-beanutils.jar
    commons-collections.jar
    commons-digester.jar
    commons-fileupload-1.0.jar
    commons-logging-1.0.4.jar
    dataprovider.jar
    defaulttheme.jar
    errorhandler.jar
    jsf-api.jar
    jsf-impl.jar
    jsfcl.jar
    jstl.jar
    msbase.jar
    mssqlserver.jar
    msutil.jar
    portlet.jar
    rowset.jar
    sqlx.jar
    standard.jar
    webui.jar

    Help ~
    I will summarize what I have done
    SQL query written from scratch works in Tomcat.
    When using Java studio creator 2 it works in its native server environment ~ until exported, restart Tomcat, access page getting face value errors.
    Please note any work that is done at the company I work for, has to work in Tomcat as the finally product. Please don�t explain how to make this work in the Java Studio Creator 2 ~ I have already can do that.
    Two other developers are using this product for testing and are having similar issues.
    The way Java Studio Creator 2 registers the drives is the hang up
    Here is my paths so that no one inserts put files here or there ~ they can see if a file is missing.
    Folder PATH listing
    C:.
    | LICENSE
    | list.txt
    | NOTICE
    | ratrobot.war
    | RELEASE-NOTES
    | RUNNING.txt
    | SESSIONS.ser
    | tomcat.ico
    | Uninstall.exe
    |
    +---bin
    | bootstrap.jar
    | catalina.bat
    | catalina.sh
    | commons-daemon.jar
    | commons-logging-api.jar
    | cpappend.bat
    | digest.bat
    | digest.sh
    | jmx.jar
    | jsvc.tar.gz
    | service.bat
    | SESSIONS.ser
    | setclasspath.bat
    | setclasspath.sh
    | shutdown.bat
    | shutdown.sh
    | startup.bat
    | startup.sh
    | tcnative-1.dll
    | tomcat-juli.jar
    | tomcat5.exe
    | tomcat5w.exe
    | tool-wrapper.bat
    | tool-wrapper.sh
    | version.bat
    | version.sh
    |
    +---common
    | +---classes
    | | logging.properties
    | |
    | +---endorsed
    | | xercesImpl.jar
    | | xml-apis.jar
    | |
    | +---i18n
    | | tomcat-i18n-en.jar
    | | tomcat-i18n-es.jar
    | | tomcat-i18n-fr.jar
    | | tomcat-i18n-ja.jar
    | |
    | \---lib
    | commons-el.jar
    | jasper-compiler-jdt.jar
    | jasper-compiler.jar
    | jasper-runtime.jar
    | jsp-api.jar
    | jstl.jar
    | msbase.jar
    | mssqlserver.jar
    | msutil.jar
    | naming-factory-dbcp.jar
    | naming-factory.jar
    | naming-resources.jar
    | servlet-api.jar
    | standard.jar
    |
    +---conf
    | | catalina.policy
    | | catalina.properties
    | | context.xml
    | | context.xml.orig
    | | jk2.manifest
    | | jk2.properties
    | | jkconf.ant.xml
    | | jkconfig.manifest
    | | logging.properties
    | | server-minimal.xml
    | | server.xml
    | | server.xml.orig
    | | shm.manifest
    | | tomcat-jk2.manifest
    | | tomcat-users.xml
    | | uriworkermap.properties
    | | web.xml
    | | web.xml.orig
    | | workers.properties
    | | workers.properties.minimal
    | | workers2.properties
    | | workers2.properties.minimal
    | |
    | \---Catalina
    | \---localhost
    | host-manager.xml
    | manager.xml
    +---logs
    | admin.2005-05-30.log
    | admin.2006-03-11.log
    | admin.2006-03-17.log
    | catalina.2005-05-30.log
    | catalina.2006-03-11.log
    | catalina.2006-03-17.log
    | host-manager.2005-05-30.log
    | host-manager.2006-03-11.log
    | host-manager.2006-03-17.log
    | jakarta_service_20060311.log
    | jakarta_service_20060317.log
    | localhost.2005-05-30.log
    | localhost.2006-03-11.log
    | localhost.2006-03-17.log
    | manager.2005-05-30.log
    | manager.2006-03-11.log
    | manager.2006-03-17.log
    | stderr_20060311.log
    | stderr_20060317.log
    | stdout_20060311.log
    | stdout_20060317.log
    |
    +---server
    | +---classes
    | +---lib
    | | catalina-ant-jmx.jar
    | | catalina-ant.jar
    | | catalina-cluster.jar
    | | catalina-optional.jar
    | | catalina-storeconfig.jar
    | | catalina.jar
    | | commons-modeler.jar
    | | ratrobot.jar
    | | servlets-cgi.renametojar
    | | servlets-default.jar
    | | servlets-invoker.jar
    | | servlets-ssi.renametojar
    | | servlets-webdav.jar
    | | tomcat-ajp.jar
    | | tomcat-apr.jar
    | | tomcat-coyote.jar
    | | tomcat-http.jar
    | | tomcat-jkstatus-ant.jar
    | \-- tomcat-util.jar
    |
    +---shared
    | +---classes
    | \---lib
    | appbase.jar
    | commons-beanutils.jar
    | commons-collections.jar
    | commons-digester.jar
    | commons-fileupload-1.0.jar
    | commons-logging-1.0.4.jar
    | dataprovider.jar
    | defaulttheme.jar
    | errorhandler.jar
    | jsf-api.jar
    | jsf-impl.jar
    | jsfcl.jar
    | portlet.jar
    | ratrobot.jar
    | rowset.jar
    | sqlx.jar
    | webui.jar
    |
    +---sites
    | | Webapp Setup.htm
    | |
    | \---Webapp Setup_files
    | homecow.gif
    | java.css
    | javaphonebook.gif
    | pollhandler.css
    | site.js
    | website.css
    |
    +---temp
    | bugzilla37035-safeToDelete.tmp
    |
    +---webapps
    | | blankTest.war
    | | ratrobot.war
    | | simple.war
    | |
    | +---balancer
    | | +---images
    | | +---META-INF
    | | | context.xml
    | | |
    | | \---WEB-INF
    | | | web.xml
    | | |
    | | +---config
    | | | rules.xml
    | | |
    | | \---lib
    | | catalina-balancer.jar
    | |
    | +---blankTest
    | | | myApp.jsp
    | | | Page1.jsp
    | | |
    | | \---WEB-INF
    | | | faces-config.xml
    | | | managed-beans.xml
    | | | myApp.xml
    | | | navigation.xml
    | | | sun-web.xml
    | | | web.old
    | | | web.xml
    | | |
    | | \---lib
    | | appbase.jar
    | | bootstrap.jar
    | | commons-beanutils.jar
    | | commons-collections.jar
    | | commons-digester.jar
    | | commons-fileupload-1.0.jar
    | | commons-logging-1.0.4.jar
    | | commons-logging-api.jar
    | | dataprovider.jar
    | | defaulttheme.jar
    | | errorhandler.jar
    | | jsf-api.jar
    | | jsf-impl.jar
    | | msbase.jar
    | | mssqlserver.jar
    | \-- msutil.jar
    |
    | +---jsp-examples
    | | | index.html
    | | | source.jsp
    | | |
    | | +---cal
    | | | cal1.jsp
    | | | cal1.jsp.html
    | | | cal2.jsp
    | | | cal2.jsp.html
    | | | calendar.html
    | | | Entries.java.html
    | | | Entry.java.html
    | | | JspCalendar.java.html
    | | | login.html
    | | | TableBean.java.html
    | | |
    | | +---checkbox
    | | | check.html
    | | | checkresult.jsp
    | | | checkresult.jsp.html
    | | | CheckTest.html
    | | | cresult.html
    | | |
    | | +---colors
    | | | clr.html
    | | | ColorGameBean.html
    | | | colors.html
    | | | colrs.jsp
    | | | colrs.jsp.html
    | | |
    | | +---dates
    | | | date.html
    | | | date.jsp
    | | | date.jsp.html
    | | |
    | | +---error
    | | | er.html
    | | | err.jsp
    | | | err.jsp.html
    | | | error.html
    | | | errorpge.jsp
    | | |
    | | +---forward
    | | | forward.jsp
    | | | forward.jsp.html
    | | | fwd.html
    | | | one.jsp
    | | | two.html
    | | |
    | | +---images
    | | | code.gif
    | | | execute.gif
    | | | read.gif
    | | | return.gif
    | | |
    | | +---include
    | | | foo.html
    | | | foo.jsp
    | | | inc.html
    | | | include.jsp
    | | | include.jsp.html
    | | |
    | | +---jsp2
    | | | +---el
    | | | | basic-arithmetic.html
    | | | | basic-arithmetic.jsp
    | | | | basic-arithmetic.jsp.html
    | | | | basic-comparisons.html
    | | | | basic-comparisons.jsp
    | | | | basic-comparisons.jsp.html
    | | | | functions.html
    | | | | Functions.java.html
    | | | | functions.jsp
    | | | | functions.jsp.html
    | | | | implicit-objects.html
    | | | | implicit-objects.jsp
    | | | | implicit-objects.jsp.html
    | | | |
    | | | +---jspattribute
    | | | | FooBean.java.html
    | | | | HelloWorldSimpleTag.java.html
    | | | | jspattribute.html
    | | | | jspattribute.jsp
    | | | | jspattribute.jsp.html
    | | | | shuffle.html
    | | | | shuffle.jsp
    | | | | shuffle.jsp.html
    | | | | ShuffleSimpleTag.java.html
    | | | | TileSimpleTag.java.html
    | | | |
    | | | +---jspx
    | | | | basic.html
    | | | | basic.jspx
    | | | | basic.jspx.html
    | | | | svgexample.html
    | | | | textRotate.html
    | | | | textRotate.jpg
    | | | | textRotate.jspx
    | | | | textRotate.jspx.html
    | | | |
    | | | +---misc
    | | | | coda.jspf
    | | | | coda.jspf.html
    | | | | config.html
    | | | | config.jsp
    | | | | config.jsp.html
    | | | | dynamicattrs.html
    | | | | dynamicattrs.jsp
    | | | | dynamicattrs.jsp.html
    | | | | EchoAttributesTag.java.html
    | | | | prelude.jspf
    | | | | prelude.jspf.html
    | | | |
    | | | +---simpletag
    | | | | book.html
    | | | | book.jsp
    | | | | book.jsp.html
    | | | | BookBean.java.html
    | | | | FindBookSimpleTag.java.html
    | | | | Functions.java.html
    | | | | hello.html
    | | | | hello.jsp
    | | | | hello.jsp.html
    | | | | HelloWorldSimpleTag.java.html
    | | | | repeat.html
    | | | | repeat.jsp
    | | | | repeat.jsp.html
    | | | | RepeatSimpleTag.java.html
    | | | |
    | | | \---tagfiles
    | | | displayProducts.tag.html
    | | | hello.html
    | | | hello.jsp
    | | | hello.jsp.html
    | | | helloWorld.tag.html
    | | | panel.html
    | | | panel.jsp
    | | | panel.jsp.html
    | | | panel.tag.html
    | | | products.html
    | | | products.jsp
    | | | products.jsp.html
    | | | xhtmlbasic.tag.html
    | | |
    | | +---jsptoserv
    | | | hello.jsp
    | | | jsptoservlet.jsp
    | | | jsptoservlet.jsp.html
    | | | jts.html
    | | | servletToJsp.java.html
    | | |
    | | +---num
    | | | numguess.html
    | | | numguess.jsp
    | | | numguess.jsp.html
    | | |
    | | +---plugin
    | | | | plugin.html
    | | | | plugin.jsp
    | | | | plugin.jsp.html
    | | | |
    | | | \---applet
    | | | Clock2.class
    | | | Clock2.java
    | | |
    | | +---security
    | | | \---protected
    | | | error.jsp
    | | | index.jsp
    | | | login.jsp
    | | |
    | | +---sessions
    | | | carts.html
    | | | carts.jsp
    | | | carts.jsp.html
    | | | crt.html
    | | | DummyCart.html
    | | |
    | | +---simpletag
    | | | foo.html
    | | | foo.jsp
    | | | foo.jsp.html
    | | |
    | | +---snp
    | | | snoop.html
    | | | snoop.jsp
    | | | snoop.jsp.html
    | | |
    | | +---tagplugin
    | | | choose.html
    | | | choose.jsp
    | | | choose.jsp.html
    | | | foreach.html
    | | | foreach.jsp
    | | | foreach.jsp.html
    | | | howto.html
    | | | if.html
    | | | if.jsp
    | | | if.jsp.html
    | | | notes.html
    | | |
    | | +---WEB-INF
    | | | | tagPlugins.xml
    | | | | web.xml
    | | | |
    | | | +---classes
    | | | | | servletToJsp.class
    | | | | | servletToJsp.java
    | | | | |
    | | | | +---cal
    | | | | | Entries.class
    | | | | | Entries.java
    | | | | | Entry.class
    | | | | | Entry.java
    | | | | | JspCalendar.class
    | | | | | JspCalendar.java
    | | | | | TableBean.class
    | | | | | TableBean.java
    | | | | |
    | | | | +---checkbox
    | | | | | CheckTest.class
    | | | | | CheckTest.java
    | | | | |
    | | | | +---colors
    | | | | | ColorGameBean.class
    | | | | | ColorGameBean.java
    | | | | |
    | | | | +---compressionFilters
    | | | | | CompressionFilter.class
    | | | | | CompressionFilter.java
    | | | | | CompressionFilterTestServlet.class
    | | | | | CompressionFilterTestServlet.java
    | | | | | CompressionResponseStream.class
    | | | | | CompressionResponseStream.java
    | | | | | CompressionServletResponseWrapper.class
    | | | | | CompressionServletResponseWrapper.java
    | | | | |
    | | | | +---dates
    | | | | | JspCalendar.class
    | | | | | JspCalendar.java
    | | | | |
    | | | | +---error
    | | | | | Smart.class
    | | | | | Smart.java
    | | | | |
    | | | | +---examples
    | | | | | ExampleTagBase.class
    | | | | | ExampleTagBase.java
    | | | | | FooTag.class
    | | | | | FooTag.java
    | | | | | FooTagExtraInfo.class
    | | | | | FooTagExtraInfo.java
    | | | | | LogTag.class
    | | | | | LogTag.java
    | | | | | ShowSource.class
    | | | | | ShowSource.java
    | | | | |
    | | | | +---filters
    | | | | | ExampleFilter.class
    | | | | | ExampleFilter.java
    | | | | | RequestDumperFilter.class
    | | | | | RequestDumperFilter.java
    | | | | | SetCharacterEncodingFilter.class
    | | | | | SetCharacterEncodingFilter.java
    | | | | |
    | | | | +---jsp2
    | | | | | \---examples
    | | | | | | BookBean.class
    | | | | | | BookBean.java
    | | | | | | FooBean.class
    | | | | | | FooBean.java
    | | | | | |
    | | | | | +---el
    | | | | | | Functions.class
    | | | | | | Functions.java
    | | | | | |
    | | | | | \---simpletag
    | | | | | EchoAttributesTag.class
    | | | | | EchoAttributesTag.java
    | | | | | FindBookSimpleTag.class
    | | | | | FindBookSimpleTag.java
    | | | | | HelloWorldSimpleTag.class
    | | | | | HelloWorldSimpleTag.java
    | | | | | RepeatSimpleTag.class
    | | | | | RepeatSimpleTag.java
    | | | | | ShuffleSimpleTag.class
    | | | | | ShuffleSimpleTag.java
    | | | | | TileSimpleTag.class
    | | | | | TileSimpleTag.java
    | | | | |
    | | | | +---listeners
    | | | | | ContextListener.class
    | | | | | ContextListener.java
    | | | | | SessionListener.class
    | | | | | SessionListener.java
    | | | | |
    | | | | +---num
    | | | | | NumberGuessBean.class
    | | | | | NumberGuessBean.java
    | | | | |
    | | | | +---org
    | | | | | \---apache
    | | | | | \---jsp
    | | | | | | source_jsp.class
    | | | | | |
    | | | | | +---cal
    | | | | | | cal1_jsp.class
    | | | | | | cal2_jsp.class
    | | | | | |
    | | | | | +---checkbox
    | | | | | | checkresult_jsp.class
    | | | | | |
    | | | | | +---colors
    | | | | | | colrs_jsp.class
    | | | | | |
    | | | | | +---dates
    | | | | | | date_jsp.class
    | | | | | |
    | | | | | +---error
    | | | | | | errorpge_jsp.class
    | | | | | | err_jsp.class
    | | | | | |
    | | | | | +---forward
    | | | | | | forward_jsp.class
    | | | | | | one_jsp.class
    | | | | | |
    | | | | | +---include
    | | | | | | foo_jsp.class
    | | | | | | include_jsp.class
    | | | | | |
    | | | | | +---jsp2
    | | | | | | +---el
    | | | | | | | basic_002darithmetic_jsp.class
    | | | | | | | basic_002dcomparisons_jsp.class
    | | | | | | | functions_jsp.class
    | | | | | | | implicit_002dobjects_jsp.class
    | | | | | | |
    | | | | | | +---jspattribute
    | | | | | | | jspattribute_jsp.class
    | | | | | | | shuffle_jsp$shuffle_jspHelper.class
    | | | | | | | shuffle_jsp.class
    | | | | | | |
    | | | | | | +---jspx
    | | | | | | | basic_jspx$basic_jspxHelper.class
    | | | | | | | basic_jspx.class
    | | | | | | | textRotate_jspx.class
    | | | | | | |
    | | | | | | +---misc
    | | | | | | | config_jsp.class
    | | | | | | | dynamicattrs_jsp.class
    | | | | | | |
    | | | | | | +---simpletag
    | | | | | | | book_jsp.class
    | | | | | | | hello_jsp.class
    | | | | | | | repeat_jsp$repeat_jspHelper.class
    | | | | | | | repeat_jsp.class
    | | | | | | |
    | | | | | | \---tagfiles
    | | | | | | hello_jsp.class
    | | | | | | panel_jsp$panel_jspHelper.class
    | | | | | | panel_jsp.class
    | | | | | | products_jsp$products_jspHelper.class
    | | | | | | products_jsp.class
    | | | | | |
    | | | | | +---jsptoserv
    | | | | | | hello_jsp.class
    | | | | | | jsptoservlet_jsp.class
    | | | | | |
    | | | | | +---num
    | | | | | | numguess_jsp.class
    | | | | | |
    | | | | | +---plugin
    | | | | | | plugin_jsp.class
    | | | | | |
    | | | | | +---security
    | | | | | | \---protected_
    | | | | | | error_jsp.class
    | | | | | | index_jsp.class
    | | | | | | login_jsp.class
    | | | | | |
    | | | | | +---sessions
    | | | | | | carts_jsp.class
    | | | | | |
    | | | | | +---simpletag
    | | | | | | foo_jsp.class
    | | | | | |
    | | | | | +---snp
    | | | | | | snoop_jsp.class
    | | | | | |
    | | | | | +---tag
    | | | | | | \---web
    | | | | | | displayProducts_tag.class
    | | | | | | helloWorld_tag.class
    | | | | | | panel_tag.class
    | | | | | | xhtmlbasic_tag.class
    | | | | | |
    | | | | | +---tagplugin
    | | | | | | choose_jsp.class
    | | | | | | foreach_jsp$1.class
    | | | | | | foreach_jsp$10.class
    | | | | | | foreach_jsp$2.class
    | | | | | | foreach_jsp$3.class
    | | | | | | foreach_jsp$4.class
    | | | | | | foreach_jsp$5.class
    | | | | | | foreach_jsp$6.class
    | | | | | | foreach_jsp$7.class
    | | | | | | foreach_jsp$8.class
    | | | | | | foreach_jsp$9.class
    | | | | | | foreach_jsp.class
    | | | | | | if_jsp.class
    | | | | | |
    | | | | | \---xml
    | | | | | xml_jsp.class
    | | | | |
    | | | | +---sessions
    | | | | | DummyCart.class
    | | | | | DummyCart.java
    | | | | |
    | | | | +---util
    | | | | | HTMLFilter.class
    | | | | | HTMLFilter.java
    | | | | |
    | | | | \---validators
    | | | | DebugValidator.class
    | | | | DebugValidator.java
    | | | |
    | | | +---jsp
    | | | | | debug-taglib.tld
    | | | | | example-taglib.tld
    | | | | |
    | | | | \---applet
    | | | | Clock2.java
    | | | |
    | | | +---jsp2
    | | | | jsp2-example-taglib.tld
    | | | |
    | | | +---lib
    | | | | jstl.jar
    | | | | standard.jar
    | | | |
    | | | \---tags
    | | | displayProducts.tag
    | | | helloWorld.tag
    | | | panel.tag
    | | | xhtmlbasic.tag
    | | |
    | | \---xml
    | | xml.html
    | | xml.jsp
    | | xml.jsp.html
    | |
    | +---mydev
    | | | blankTest.war
    | | | ratrobot.war
    | | |
    | | +---balancer
    | | | +---images
    | | | +---META-INF
    | | | | context.xml
    | | | |
    | | | \---WEB-INF
    | | | | web.xml
    | | | |
    | | | +---config
    | | | | rules.xml
    | | | |
    | | | \---lib
    | | | catalina-balancer.jar
    | | |
    | | +---blankTest
    | | | | Page1.jsp
    | | | |
    | | | \---WEB-INF
    | | | | faces-config.xml
    | | | | managed-beans.xml
    | | | | navigation.xml
    | | | | sun-web.xml
    | | | | web.xml
    | | | |
    | | | \---lib
    | | | appbase.jar
    | | | bootstrap.jar
    | | | commons-beanutils.jar
    | | | commons-collections.jar
    | | | commons-digester.jar
    | | | commons-fileupload-1.0.jar
    | | | commons-logging-1.0.4.jar
    | | | commons-logging-api.jar
    | | | dataprovider.jar
    | | | defaulttheme.jar
    | | | errorhandler.jar
    | | | jsf-api.jar
    | | | jsf-impl.jar
    | | |
    | | +---jsp-examples
    | | | | index.html
    | | | | source.jsp
    | | | |
    | | | +---cal
    | | | | cal1.jsp
    | | | | cal1.jsp.html
    | | | | cal2.jsp
    | | | | cal2.jsp.html
    | | | | calendar.html
    | | | | Entries.java.html
    | | | | Entry.java.html
    | | | | JspCalendar.java.html
    | | | | login.html
    | | | | TableBean.java.html
    | | | |
    | | | +---checkbox
    | | | | check.html
    | | | | checkresult.jsp
    | | | | checkresult.jsp.html
    | | | | CheckTest.html
    | | | | cresult.html
    | | | |
    | | | +---colors
    | | | | clr.html
    | | | | ColorGameBean.html
    | | | | colors.html
    | | | | colrs.jsp
    | | | | colrs.jsp.html
    | | | |
    | | | +---dates
    | | | | date.html
    | | | | date.jsp
    | | | | date.jsp.html
    | | | |
    | | | +---error
    | | | | er.html
    | | | | err.jsp
    | | | | err.jsp.html
    | | | | error.html
    | | | | errorpge.jsp
    | | | |
    | | | +---forward
    | | | | forward.jsp
    | | | | forward.jsp.html
    | | | | fwd.html
    | | | | one.jsp
    | | | | two.html
    | | | |
    | | | +---images
    | | | | code.gif
    | | | | execute.gif
    | | | | read.gif
    | | | | return.gif
    | | | |
    | | | +---include
    | | | | foo.html
    | | | | foo.jsp
    | | | | inc.html
    | | | | include.jsp
    | | | | include.jsp.html
    | | | |
    | | | +---jsp2
    | | | | +---el
    | | | | | basic-arithmetic.html
    | | | | | basic-arithmetic.jsp
    | | | | | basic-arithmetic.jsp.html
    | | | | | basic-comparisons.html
    | | | | | basic-comparisons.jsp
    | | | | | basic-comparisons.jsp.html
    | | | | | functions.html
    | | | | | Functions.java.html
    | | | | | functions.jsp
    | | | | | functions.jsp.html
    | | | | | implicit-objects.html
    | | | | | implicit-objects.jsp
    | | | | | implicit-objects.jsp.html
    | | | | |
    | | | | +---jspattribute
    | | | | | FooBean.java.html
    | | | | | HelloWorldSimpleTag.java.html
    | | | | | jspattribute.html
    | | | | | jspattribute.jsp
    | | | | | jspattribute.jsp.html
    | | | | | shuffle.html
    | | | | | shuffle.jsp
    | | | | | shuffle.jsp.html
    | | | | | ShuffleSimpleTag.java.html
    | | | | | TileSimpleTag.java.html
    | | | | |
    | | | | +---jspx
    | | | | | basic.html
    | | | | | basic.jspx
    | | | | | basic.jspx.html
    | | | | | svgexample.html
    | | | | | textRotate.html
    | | | | | textRotate.jpg
    | | | | | textRotate.jspx
    | | | | | textRotate.jspx.html
    | | | | |
    | | | | +---misc
    | | | | | coda.jspf
    | | | | | coda.jspf.html
    | | | | | config.html
    | | | | | config.jsp
    | | | | | config.jsp.html
    | | | | | dynamicattrs.html
    | | | | | dynamicattrs.jsp
    | | | | | dynamicattrs.jsp.html
    | | | | | EchoAttributesTag.java.html
    | | | | | prelude.jspf
    | | | | | prelude.jspf.html
    | | | | |
    | | | | +---simpletag
    | | | | | book.html
    | | | | | book.jsp
    | | | | | book.jsp.html
    | | | | | BookBean.java.html
    | | | | | FindBookSimpleTag.java.html
    | | | | | Functions.java.html
    | | | | | hello.html
    | | | | | hello.jsp
    | | | | | hello.jsp.html
    | | | | | HelloWorldSimpleTag.java.html
    | | | | | repeat.html
    | | | | | repeat.jsp
    | | | | | repeat.jsp.html
    | | | | | RepeatSimpleTag.java.html
    | | | | |
    | | | | \---tagfiles
    | | | | displayProducts.tag.html
    | | | | hello.html
    | | | | hello.jsp
    | | | | hello.jsp.html
    | | | | helloWorld.tag.html
    | | | | panel.html
    | | | | panel.jsp
    | | | | panel.jsp.html
    | | | | panel.tag.html
    | | | | products.html
    | | | | products.jsp
    | | | | products.jsp.html
    | | | | xhtmlbasic.tag.html
    | | | |
    | | | +---jsptoserv
    | | | | hello.jsp
    | | | | jsptoservlet.jsp
    | | | | jsptoservlet.jsp.html
    | | | | jts.html
    | | | | servletToJsp.java.html
    | | | |
    | | | +---num
    | | | | numguess.html
    | | | | numguess.jsp
    | | | | numguess.jsp.html
    | | | |
    | | | +---plugin
    | | | | | plugin.html
    | | | | | plugin.jsp
    | | | | | plugin.jsp.html
    | | | | |
    | | | | \---applet
    | | | | Clock2.class
    | | | | Clock2.java
    | | | |
    | | | +---security
    | | | | \---protected
    | | | | error.jsp
    | | | | index.jsp
    | | | |

  • Jsp:include does not work in 8.1 SP3?

    Hi all,
              I need to include a local file (external to the app) in jsp code. The external file includes an image map which changes very so often. So in order to avoid doing a build everytime, I thought about keeping the image map in a file which can be "included" in the jsp file, making it very dynamic to a change.
              So I have a servlet which will read this file and output the contents to response.getWriter(), which will be included in calling jsp code.
              But the jsp file does not seem to call the servlet at all.
              Here is the code in the jsp file:
              <%
              String sFileUrl = "/Prj/RenderReport?file=OrgChart.html";
              %>
              <jsp:include page="<%=sFileUrl%>" />
              What am I doing wrong? Is this not possible at all?
              Thank you all in advance.

    hi pjoshi,
              <jsp:include page="hello.jsp" /> tag is working fine in weblogic 8.1 sp3.
              I think it might be syntax error in your jsp page.
              This is the syntax to including dynamic files in jsp using <jsp:include page="" />tag as given below.
              <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
              go through the below link and you will find exact information how to include dynamic files in jsp using <jsp:include page=""/>
              http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html
              --Anilkumar kari                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • jsp:include is not working on weblogic

    I have a problem I write the following code
    html>
    <head>
    <script LANGUAGE="javascript" SRC="js/tab.js"></script>
    <LINK href="stylesheets/global.css" type=text/css rel=stylesheet>
    <title>JobSpinner Status</title>
    </head>
    <body class="bodymargin" onload="setpage(1)">
    <jsp:include flush="true" page="JobSpinnerTab.jsp"></jsp:include>
    <form id="loginForm" action="/jobspinner/JobStatus.faces" method="post">
    <input type="hidden" name="loginForm" value="loginForm" />
    <nobr>
    It is working fine on four to five PC we have checked .
    But the problem is that it is not working on a particular weblogic Server 8.1 SP2 .
    Can someone help me .
    Regs
    Amit Verma

    Are other JSP tags working on the page?
    eg
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>
    Java home = <%= System.getProperty("java.home") %><br>Your page might be being interpreted as HTML rather than passed through the JSP engine.

  • Filters not working with Tomcat 5

    Hi,
    I've attempted to implement a filter in my JSP program. Below is the web.xml I'm using and the filter implementation.
    The problem is doFilter simply isn't being called. init is called because when I do an ant reload it print my error into the log but doPost never prints anything anywhere. Please help!!! I'm completely foxed.
    I thought it might be something to do with the FilterConfig as I don't understand how its set or called but as I don't understand, I don't know?
    <?xml version="1.0" encoding="UTF-8"?>
    <!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>
        <description>themoves.co.uk Content Management System</description>
        <display-name>themoves.co.uk CMS</display-name>
        <filter>
             <filter-name>authFilter</filter-name>
             <filter-class>uk.co.themoves.AuthenticationFilter</filter-class>
        </filter>
        <filter-mapper>
             <filter-name>authFilter</filter-name>
             <url-pattern>/Controller</url-pattern>
        </filter-mapper>
        <servlet>
            <servlet-name>Controller</servlet-name>
            <servlet-class>uk.co.themoves.Controller</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>Controller</servlet-name>
            <url-pattern>/Controller</url-pattern>
        </servlet-mapping>   
        <session-config>
            <session-timeout>15</session-timeout>
        </session-config>
        <welcome-file-list>
            <welcome-file>/WEB-INF/welcome.jsp</welcome-file>
        </welcome-file-list>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
          <taglib-location>/WEB-INF/fmt.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
          <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
          <taglib-location>/WEB-INF/c.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
          <taglib-location>/WEB-INF/c-rt.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
          <taglib-location>/WEB-INF/sql.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
          <taglib-location>/WEB-INF/sql-rt.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
          <taglib-location>/WEB-INF/x.tld</taglib-location>
        </taglib>
        <taglib>
          <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
          <taglib-location>/WEB-INF/x-rt.tld</taglib-location>
        </taglib>
    </web-app>Filter implementation
    package uk.co.themoves;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.io.IOException;
    public class AuthenticationFilter implements Filter{
         private static final String LOGIN_PAGE = "/login.jsp";
         private FilterConfig config = null;
         private Connection db = null;
         public void init(FilterConfig _config) throws ServletException{
              System.err.println("init successful");
              this.config = _config;
              //do a database connection here
              if(db == null){
                   try{
                        Class.forName("org.gjt.mm.mysql.Driver");
                        this.db = DriverManager.getConnection("jdbc:mysql://localhost:3306/themoves", "cwaig", "UUyGiRPE");
                   } catch (Exception e){
                        System.out.println("error Connecting to themoves DB: " + e.toString());
         public void doFilter(ServletRequest _req, ServletResponse _res, FilterChain _chain) throws IOException, ServletException{
              System.err.println("doFilter");
              //cast the Servlet to a httpServlet
              HttpServletRequest httpReq = (HttpServletRequest) _req;
              HttpSession session = httpReq.getSession();
              String uid = httpReq.getParameter("uid");
              String password = httpReq.getParameter("pass");
              //if action is login then login else check
              String action = (String) httpReq.getParameter("action");
              if(action.equals("login")){
                   //check the username and password
                   UserManager userManager = new UserManager(this.db, uid, password);
                   if(userManager.auth()){
                        //set session variable and carry on
                        session.setAttribute("uid", uid);
                        _chain.doFilter(_req, _res);
                   } else {
                        //go back to the login page
                        RequestDispatcher rd = httpReq.getRequestDispatcher(LOGIN_PAGE);
                        rd.forward(_req, _res);
              } else {
                   //check the session to make sure they are logged in
                   String session_uid = (String) session.getAttribute("uid");
                   if(session_uid == null){
                        RequestDispatcher rd = httpReq.getRequestDispatcher(LOGIN_PAGE);
                        rd.forward(_req, _res);     
                   } else {
                        //set session variable and carry on
                        session.setAttribute("uid", uid);
                        _chain.doFilter(_req, _res);
         public void destroy(){
              this.config = null;
              //clean up the database connection here
    }

    First of all this is not correct:
    <filter-mapper>
             <filter-name>authFilter</filter-name>
             <url-pattern>/Controller</url-pattern>
    </filter-mapper>It is:
    <filter-mapping>
             <filter-name>authFilter</filter-name>
             <url-pattern>/Controller</url-pattern>
    </filter-mapping>
    Also note that with this mapping configured onlt Servlets/JSPs called using the URL <your_domain>/<your_context>/Controller will be called.
    Any other urls will not be subject to the filter.
    I don't know all there is to know about filters, but I would be concerned that maybe your connection object is not thread safe being defined in the scope that it is.

  • Include directive not working in eclipse

    Hello All,
    I am using eclipse dynamic web project. I have the main project by the name of JSPEXAMPLE and then i have intro.jsp under web-inf folder for JSPEXAMPLE. i am trying to include a Header.html file. where do i need to save this html file ? i mean in which folder? JSPEXAMPLE? or WEB-INF? i tried to save the sttaic html file in Web-INF and while running my jsp file it gives me an error.
    intro.jsp
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <%@ page session="false" %>
    <%@ page import="java.util.Calendar" %>
    <%@ include file="/Header.html" %>
    <%
         out.println("The time is now " + Calendar.getInstance().getTime());
    %>
    <%@ include file="Footer.html" %>Here is the Header.html and Footer.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>WellCome</title>
    </head>
    <body>Footer.html
    </body>
    </html>While runing i get an error that file Header.html is not found but why? i mean i can see it under JSPEXAMPLES/WEB-INF folder
    org.apache.jasper.JasperException: /intro.jsp(5,0) File "/Header.html" not found
    Can anyone help? Thanks
    Message was edited by:
    lrngjava

    I don't know the rules, but in our app we use paths
    that start with "/WEB-INF" for our includes. ie:
    <%@ include
    file='/WEB-INF/a/b/c/partialpage.jspf' %>Presumably it looks for files starting from the base
    directory, not the current directory of your jsp.
    Message was edited by:
    hunter9000thanks for the reply hunter. i tried /WEB-INF/Header.html still gives me error while running on tomcat. i have been searching on google for a while now no success.

  • JSP PRECOMPILER IS NOT WORKING WITH WEBLOGIC 6.1 SERVICE PACK 5

              When i compile JSPs using JSP PreCompiler in weblogic 6.1
              ( Service Pack 4 ) , compilation is perfect.
              But when i precompile the same JSPs with weblogic 6.1 (Service Pack 5 )
              , i get compilation error.
              Variable Not Found error comes in service pack 5. But the same code works
              well with service pack 4.
              Could anyone help me ?
              [java] C:\CVSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WE
              NF\classes\jsp_servlet\_secure\__confirmation.java:280: cannot resolve symbol
              [java] symbol : variable yesLinkPageText
              [java] location: class jsp_servlet._secure.__confirmation
              [java] htmllink0.setPage(yesLinkPageText); //[ /secure/co
              rmation.jsp; Line: 32]
              [java] ^
              [java] C:\CVSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WE
              NF\classes\jsp_servlet\_secure\__confirmation.java:378: cannot resolve symbol
              [java] symbol : variable noLinkPageText
              [java] location: class jsp_servlet._secure.__confirmation
              [java] htmllink0.setPage(noLinkPageText); //[ /secure/con
              mation.jsp; Line: 37]
              [java] Error: compilation of jsp file /secure/confirmation.jsp (java file C
              VSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WEB-INF\classes
              p_servlet\_secure\__confirmation.java failed):
              [java] ^
              [java] null
              [java] 2 errors
              [java] Error: [jspc]: 1 file(s) failed:
              [java] /secure/confirmation.jsp
              [java] java.io.IOException: Compiler failed executable.exec(java.lang.String
              

    Can you post the jsp page or a example which doesnt compile in sp5. It seems
              difficult to guage what the problem could be from looking at the error.
              --Nagesh
              "george vargeese" <[email protected]> wrote in message
              news:40c56502$1@mktnews1...
              >
              > When i compile JSPs using JSP PreCompiler in weblogic 6.1
              > ( Service Pack 4 ) , compilation is perfect.
              >
              > But when i precompile the same JSPs with weblogic 6.1 (Service Pack
              5 )
              > , i get compilation error.
              >
              > Variable Not Found error comes in service pack 5. But the same code
              works
              > well with service pack 4.
              >
              > Could anyone help me ?
              >
              >
              > [java]
              C:\CVSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WE
              > NF\classes\jsp_servlet\_secure\__confirmation.java:280: cannot resolve
              symbol
              >
              > [java] symbol : variable yesLinkPageText
              > [java] location: class jsp_servlet._secure.__confirmation
              > [java] htmllink0.setPage(yesLinkPageText); //[
              /secure/co
              > rmation.jsp; Line: 32]
              > [java] ^
              > [java]
              C:\CVSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WE
              > NF\classes\jsp_servlet\_secure\__confirmation.java:378: cannot resolve
              symbol
              >
              > [java] symbol : variable noLinkPageText
              > [java] location: class jsp_servlet._secure.__confirmation
              > [java] htmllink0.setPage(noLinkPageText); //[
              /secure/con
              > mation.jsp; Line: 37]
              > [java] Error: compilation of jsp file /secure/confirmation.jsp (java
              file C
              >
              VSMessageRouter\platform-apps\2notify\webapp\consoleapp\.\web\WEB-INF\classe
              s
              > p_servlet\_secure\__confirmation.java failed):
              > [java] ^
              > [java] null
              > [java] 2 errors
              > [java] Error: [jspc]: 1 file(s) failed:
              > [java] /secure/confirmation.jsp
              > [java] java.io.IOException: Compiler failed
              executable.exec(java.lang.String
              >
              >
              

  • Wifi direct not working with other brands

    Is it not possible to to uae wifi direct with other brands like Samsung S3,5,6 or others? Because im trying to copy some huge file using wifi direct but it was unsuccessful.

    I am able to connect to my tesco hudl and my MxQ tv box.

  • Works with tomcat not with bea

    hai i am madav
    when i was working with tomcate it was fine but when i deploy in bea portal server with proper additions i am gettin java.io.FileNotFoundException: Response: '401:
    Unauthorized xxx' for url: 'http://feedsind3.cricinfo.com/live/index.xml'
    for below code
    Authenticator.setDefault(new MyAuthenticator());
    URL url = new URL"http://feedsind3.cricinfo.com/live/index.xml");
                   is=url.openStream();
    File f1=new File("c:\\hai2.xml");
              br = new BufferedReader(new InputStreamReader(is));
              bw1 = new BufferedWriter(new FileWriter(f1),5000);
              while((scoresFileUrl=br.readLine())!=null)
                   System.out.println(scoresFileUrl);
                   bw1.write(scoresFileUrl);
                   bw1.flush();
                   bw1.newLine();
                   bw1.close();
                   br.close();
                   is.close();
                   }catch(Exception e){
                   System.out.println(" exception raised in writeToFile "+e);
         RequestDispatcher rd=req.getRequestDispatcher("/livecric.jsp");
    rd.forward(req,res);     
    exception raised in writeToFile java.io.FileNotFoundException: Response: '401:
    Unauthorized xxx' for url: 'http://feedsind3.cricinfo.com/live/index.xml'

    Exactly my problem too. I read somewhere that JDK 1.5 has modified its Authenticator class but I am not able to find an example of how to handle a website that prompts you for userid/password.
    But I scaled back from JDK 1.5 to JDK 1.4 on Weblogic 8.1.5 but that does not work still. So I sense some issues with Weblogic server.
    Can someone help please? Moderators?

  • You must have connected the Time Capsule with a router that does not work with my direct cable from my ISP

    you must have connected the Time Capsule with a router that does not work with my direct cable from my ISP

    I tried to answer in your other post.. please stick to one thread ..
    What method of internet do you have.. is this fibre install.. if so the TC should just plug in and use dhcp in router mode.. press and hold the reset and it will go back to router mode by default.

  • Help pls ! JSP not working in tomcat

    Hi techies,
    I have a problem in executing jsp files thru tomcat on windows
    The problem is i have my jsp files in a directory, i use virtual directory concept by setting up context in server.xml file to access my jsp, servlets and html files and some jsp files are working properly, but certain jsp files are not working...
    It gives an error saying " jsp file not found.." even though the file is in the directory
    Can anyone help to come-out of this problem.
    Rgds
    sathish

    Hi,
    if you are trying to map a short name to a jsp page, you should do that in the web.xml file not in the server.xml i think...
    Hope this help...

  • JSP Not Working with Thin Driver

    My JSP is not working with Oracle thin driver but it is working with Oracle OCI driver.
    From my jsp i am calling a stored procedured and passing 170 parameters to the procedure. This JSP works with Oracle OCI Driver configured as thrid party drivers in iAS6.0 SP2, but not working with Oracle Thin Driver configured as third party drivers in iAS6.0. My thin driver JDBC Connection URL is as follows:
    jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = MAPDBI01)(PORT = 1521)))(CONNECT_DATA =(SID = MAPS))).
    I have to give this URL because my production server deployment consists of iWS4.1 SP5 and iAS6.0 SP2 in different solaris boxes and Oracle 8.1.7 Database server in another Solaris Box. There is a pool of proxy servers between iAS6.0 box and the oracle box.

    Wim,
    I'd really appreciate it if you could provide some sample code. A complete, small, simple java class that I could copy and try out would be wonderful -- if it's not too much trouble.
    Thanks heaps (in advance :-),
    Avi.

Maybe you are looking for

  • How to keep the WBS & Order in account assignment tab of SD contract item?

    Hi Experts, If I remove the plant from the shipping tab in the contract item (the contract type is WV), I will be able to enter the WBS or Order in accounting assignment tab. However, if I enter the plant (in order to determine the tax in pricing), t

  • Using Texture3D!?

    Hi all, I've been trying without success to get a simple Texture3D working and for the life of me cannot figure why it's showing up white. I get no errors, but no texture either. I've found very little good documentation about how this texture works;

  • Tomcat / opening a modal window from jaavscript

    Hi all, Don't know if it's the best place for this question but let me try. I have different servlets and when I try to open modal windows from an hyper link on pages produced by my servlets and processed by tomcat (port:8080), the status bar and add

  • Oracle left join

    e.g. i have 2 table table_a subject math phy chem bio table_b subject member math peter phy peter phy john bio tim 1) i create a view as follow: create or replace view view_test (subject, member) as select a.subject, b.member from table_a a left oute

  • Flagging mail as junk that containes a specific attachment

    Is there a way to flag mail as junk that contains a certain attachment?   Mac OS X (10.4.8)