Invalid web.xml

I am having a problem within Tomcat (v. 3.3 or 4.0) where the
web.xml for the webapps.war file give an error.
The error is:
At Invalid element 'servlet' in content of 'web-app', expected
elements '[error-page, taglib, resource-ref, security-onstraint,
login-config, security-role, env-entry, ejb-ref]'.
I have also had problems within the web.xml file with regards to
tag-lib
Anyone expiriencing similar problems.

i hope , you problem is already solved by now.
you should be using the url pattern as
<url-pattern>*.jsp</url-pattern>
remove the leading "/" character

Similar Messages

  • Javac: invalid flag: C:\XML\web.xml

    Hi,
    I created a file web.xml in JCreator. When I tried to compile the file, it showed:
    javac: invalid flag: C:\XML\web.xml.
    Does any know how to solve the problem?
    Thanks in advance.
    Dan

    The following is the full message showed after the compiling. It also happened to *.jsp files.
    --------------------Configuration: <Default>--------------------
    javac: invalid flag: C:\XML\web.xml
    Usage: javac <options> <source files>
    where possible options include:
    -g Generate all debugging info
    -g:none Generate no debugging info
    -g:{lines,vars,source} Generate only some debugging info
    -nowarn Generate no warnings
    -verbose Output messages about what the compiler is doing
    -deprecation Output source locations where deprecated APIs are used
    -classpath <path> Specify where to find user class files
    -cp <path> Specify where to find user class files
    -sourcepath <path> Specify where to find input source files
    -bootclasspath <path> Override location of bootstrap class files
    -extdirs <dirs> Override location of installed extensions
    -endorseddirs <dirs> Override location of endorsed standards path
    -d <directory> Specify where to place generated class files
    -encoding <encoding> Specify character encoding used by source files
    -source <release> Provide source compatibility with specified release
    -target <release> Generate class files for specific VM version
    -version Version information
    -help Print a synopsis of standard options
    -X Print a synopsis of nonstandard options
    -J<flag> Pass <flag> directly to the runtime system
    Process completed.

  • 10.1.3 - OEM Deployment generating invalid orion-web.xml

    Hi,
    I've playing around with OracleASjms resource adapters, JMS Connector, etc - with some good results. I noticed that one of my test applications, when deployed (via OEM) gets an orion-web.xml which is not according to the XML schema and am wondering whether this is designed behavior.
    In my servlet I'm using some logical names for javax.jms.ConnectionFactory and javax.jms.Destination, which I specify in the web.xml. Deploying the ear file I get the change to resolve environment references to 'physical' JNDI locations. I map the logical javax.jms.ConnectionFactory to an OracleASjms resource adapter connection factory (which in turn is pointing to an JMS ConnectionFactory) and the javax.jms.Destination I map to an OracleASjms Administered resource.
    The applications deploys and works fine, however I have a question with respect to the orion-web.xml that Oracle is generating based. More specifically I see (<....> are replaced with actual values):
       <message-destination-ref-mapping
             name="<logical name>"
             location="<OracleAsjms/Administerered Object>"/>The element message-destination-ref-mapping isn't declared in the XML schema for orion-web.xml, but still it works, how come?

    http://www.oracle.com/technology/oracleas/schema/index .html
    http://www.oracle.com/technology/oracleas/schema/orion-web-10_0.xsd
    Thanks, jvissers. It seems that orion-web-10_0.xsd is outdated. It is probably that it was posted for the 10.1.3 preview. When the 10.1.3 production release is available, at least that schema is not updated. Hmm, all things that are changing but kept at different places are just very susceptible to inconsistency. Hmm, OracleAs team should probably make automated tests to make sure that they are in sync. (I am just thinking loudly). Let me try to communicate to someone who can further take care of this matter of outdated schemas. Thanks again, jvissers.
    Where did you look?Inside my oc4j installation! oc4j will not go to the web to download the oc4j-specific schemas in case of need. The orion-web-10_0.xsd is at OC4J_HOME/j2ee/home/lib/schemas.jar!META-INF/orion-web-10_0.xsd. That is where I looked. So the orion-web.xml generated by OEM is indeed valid.

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

  • Problem in Web.xml.........

    Hi to All,
    I installed the eval version of Crystal Reporst XI, created an example report with it and now I want to call my report from JSF Page.i followed the crxi_startup_guide_for_j2ee.i got the error in 'web.xml' file.the error is:
    "cvc-complex-type.2.4.a: Invalid content was found starting with element 'env-entry-value'. One of '{"http://java.sun.com/xml/ns/j2ee":env-entry-type}' is expected"
    here i shows my entry in web.xml file:
    <env-entry>
    <env-entry-name>jdbc/mydatabase name</env-entry-name>
    <env-entry-value>!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:odbc:mydatabase name</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    im unable to get what was the problem.my environment is Tomcat 5.0.28,SQL2000.
    i created that report using ODBC connection.is it correct?suppose if i have to connect using JNDI means how to achive this?
    can any one get me out of this please!!
    Thanks in Advance,
    --RK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    This is my web.xml file........
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <env-entry>
    <env-entry-name>jdbc/IMDB</env-entry-name>
    <env-entry-value>!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:odbc:IMDB</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>crystalreportviewers11</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    </web-app>
    Thnx,
    Rk

  • Taglib element not allowed in web.xml conforming to web-app_2_4.xsd ?

    Hello,
    I want to configure taglibs in my web.xml file.
    The beginning of the file looks like this:
    <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">I placed the following:      
    <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>element just after the welcome-file-list element. When I "validate XML" in Netbeans I get :
    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. [53]
    cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element-only. [71]
    XML validation finished.Indeed, looking at the web-app_2_4.xsd I cannot find a description for the taglib element.
    Where should a put taglibs ? Is it enough to include them in every JSP so I don't need to place them in web.xml ?
    Thank you.
    Vlad.

    web.xml 2.4 uses a <jsp-config> to enclose the
    <tag-lib>
    <jsp-config>
    <tag-lib>
    </tag-lib>
    </jsp-config>I believe that is the syntax. I will check when I get
    to my server comp.You are right. That's how it's done. Thanks a lot for the reply.
    I hope there were good reasons to break compatibility with the old format. There are a lot of examples out there that use the old one. Without knowing the reason for such a change, I find it very annoying.
    Thanks again
    Vlad.

  • Question on defining taglib in  web.xml

    I am using netbeans to develop a j2ee5 web application.
    I created a web application project using the wizard.
    When I defined a <taglib> in the web.xml, it detected an error.
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":distributable, "http://java.sun.com/xml/ns/javaee":context-param, "http://java.sun.com/xml/ns/javaee":filter, "http://java.sun.com/xml/ns/javaee":filter-mapping, "http://java.sun.com/xml/ns/javaee":listener, "http://java.sun.com/xml/ns/javaee":servlet, "http://java.sun.com/xml/ns/javaee":servlet-mapping, "http://java.sun.com/xml/ns/javaee":session-config, "http://java.sun.com/xml/ns/javaee":mime-mapping, "http://java.sun.com/xml/ns/javaee":welcome-file-list, "http://java.sun.com/xml/ns/javaee":error-page, "http://java.sun.com/xml/ns/javaee":jsp-config, "http://java.sun.com/xml/ns/javaee":security-constraint, "http://java.sun.com/xml/ns/javaee":login-config, "http://java.sun.com/xml/ns/javaee":security-role, "http://java.sun.com/xml/ns/javaee":env-entry, "http://java.sun.com/xml/ns/javaee":ejb-ref, "http://java.sun.com/xml/ns/javaee":ejb-local-ref, "http://java.sun.com/xml/ns/javaee":service-ref, "http://java.sun.com/xml/ns/javaee":resource-ref, "http://java.sun.com/xml/ns/javaee":resource-env-ref, "http://java.sun.com/xml/ns/javaee":message-destination-ref, "http://java.sun.com/xml/ns/javaee":persistence-context-ref, "http://java.sun.com/xml/ns/javaee":persistence-unit-ref, "http://java.sun.com/xml/ns/javaee":post-construct, "http://java.sun.com/xml/ns/javaee":pre-destroy, "http://java.sun.com/xml/ns/javaee":message-destination, "http://java.sun.com/xml/ns/javaee":locale-encoding-mapping-list}' is expected.
    Here is my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <welcome-file-list>
    <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>/mytag</taglib-uri>
    <taglib-location>/WEB-INF/mytag.tld</taglib-location>
    </taglib>
    </web-app>

    As of servlet 2.4 (jsp 2.0), you'll have to move the taglib declarations inside a <jsp_config> element.
    <jsp-config>
        <taglib> ..........your stuff
    </jsp-config>ram.

  • Web.xml + taglib

    I am getting the following error when I compile my project. The project has both an http session listener and a taglib. This error comes when I have a <%@ taglib....%> directive in a JSP page. Any suggestions?
    Error(29,12): Invalid element 'listener' in content of 'web-app', expected elements '[servlet-mapping, session-config, mime-mapping, welcome-file-list, error-page, taglib, resource-env-ref, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref, ejb-local-ref]'.

    Have you found a solution to your problem.
    I've been removing the <listener> tag entries from the web.xml file when I'm compiling the jsp's because I get the same error. I have listeners for the construction of listeners and the application context. I have to re-insert them back into the web.xml file and make the file read only to execute the project. Pain in the you know what :) if not does anyone else have a solution to this. I'm using JDev 9.0.2 and upgrading to 9.0.3 is not a solution...
    Thanks
    Will

  • 9.0.3, web.xml, context-param

    Using documentation found on oracle's website, where I needed to have a specific initialization parameter, I setup a context-param in web.xml. In 9.0.2, I got a warning (and posted here but got no response) but was able to continue. In 9.0.3 I can't run my project when I include this parameter.
    Here's what I add to web.xml
    <context-param>
    <param-name>ReportServerURL</param-name>
    <param-value>http://localhost:8888/reports/rwservlet</param-value>
    </context-param>
    when trying to compile, I get:
    Error(76,18): Invalid element 'context-param' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    Any ideas?
    Thanks,
    Jeff

    If only you would see web-app.dtd you could know that context-param must be enclosed in web-app and be at certain place. See that (from web-app.dtd):
    <!ELEMENT web-app (icon?, display-name?, description?, distributable?,
    context-param*, filter*, filter-mapping*, listener*, servlet*,
    servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?,
    error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*,
    login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*)>

  • Invalid Web service URL

    Hi All,
    While creating a model in VC7.0 based on an external webservice(ex: http://api.google.com/GoogleSearch.wsdl), I ended-up with Invalid Web service URL error.
    Note: When I access the same  WSDL URL using browser it didn't ask me for user authentication, the XML file was opened neatly.
    Please assist.
    FYI- Portal Version is NW2004s SP16.
    Kind regards,
    Vijay

    Hi Fabien,
    Thanks for your feedback.
    Yes, I had tried with simple and local one, and found success in that as well.
    But, this time I would like to create a model based on the some 3rd party webservice available in internet.
    If you know few simple 3rd party webservice available in internet as like the one I have mentioned in my initial post, that would be helpful to me.
    Many thanks.
    Kind regards,
    Vijay

  • Eclipse editor gives error for web.xml for jsp-config

    Hi All,
    I am using following web.xml . Eclipse europa editor gives warning if <jsp-config> is added. Is anyone have idea about it.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>     
         <display-name>Cart</display-name>               
         <servlet>
    <servlet-name>RequestHandler</servlet-name>
    <servlet-class>com.amazon.helper.LoginListener</servlet-class>
    </servlet>      
         <servlet-mapping>
    <servlet-name>RequestHandler</servlet-name>
    <url-pattern>cart.loginUser</url-pattern>
    </servlet-mapping>
    <jsp-config>
         <jsp-property-group>
         <url-pattern>*.jsp</url-pattern>
                   <scripting-invalid>true</scripting-invalid>
         </jsp-property-group>
    </jsp-config>
    </web-app>

    Your web.xml file is out of date.
    You have a DTD there for the Servlet 2.2 spec.
    The jsp-config tag was introduced to web.xml as of the Servlet 2.4 specification - which is why it is complaining in your editor.
    Seeing as you have Tomcat 6, I would recommend you change your web.xml to look like this
    - removed the DTD
    - change the web-app tag to include schema information
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
    <display-name>Cart</display-name>
    <servlet>
    <servlet-name>RequestHandler</servlet-name>
    <servlet-class>com.amazon.helper.LoginListener</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>RequestHandler</servlet-name>
    <url-pattern>cart.loginUser</url-pattern>
    </servlet-mapping>
    <jsp-config>
    <jsp-property-group>
    <url-pattern>*.jsp</url-pattern>
    <scripting-invalid>true</scripting-invalid>
    </jsp-property-group>
    </jsp-config>
    </web-app>Cheers,
    evnafets

  • Question on web.xml and login

    Hi all
    I am doing a web-based project, registered user need to log in before they view the member area pages.
    I have created a directory, called "client", in the Tomcat 4.1.24/webapps/ROOT/client I have put a index.html in the client directory. This index.html only can be viewed by the client after log in.
    For the best of my knowledge in Tomcat, in order to do this, I have created a web.xml in Tomcat_home/webaggs/ROOT/WEB-INF/web.xml, in the url-pattern section, I put /client/* to tell the tomcat server that index.html in client directory is the first page after user login.
    The problem is, I couldnt see the member welcome page after I login as a member, the browser gave me the error: HTTP status 400 - Invalid direct reference to form login page. However, if I specified the address http://localhost:8080/client/index.html , it show me the login page and after I input the username and password I can see the member welcome page.
    I dont know whether is something wrong with the web.xml or I should do other thing to let the server know which is the first page after member login.
    Thank you very much
    Kelvin
    =====================================================
    <web-app>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Security</web-resource-name>
    <url-pattern>/client/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>administrator</role-name>
         <role-name>client</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
    <form-login-page>/login.html</form-login-page>
    <form-error-page>/login_error.html</form-error-page>
    </form-login-config>
    </login-config>
    </web-app>
    =====================================================

    Wow, you really are in the wrong place with this query, its not really even java ;o) This is the new to java forum! Perhaps you would be better off (in fact I know for a FACT that you will be as I have seen answers to identical problems there) in the Tomcat-user list...
    Go HERE:
    http://www.mail-archive.com/[email protected]/
    and search

  • Defining error-page in web.xml

    Hi,
    We are using oracle 9iAS with oc4j container. I have defined error-page for redirecting 404 error-code in web.xml. It works fine with all browsers except internet explorer 5.5 and higher, IE ignores and displays 'page cannot be displayed' page. Can anybody help me on this, but on the otherhand if I send response.sendError(404);, it recognizes and invokes page.
    Thanks for the advice

    Hi,
    Thanks for your reply to me.
    I am doing something wrong but I can't find it.
    I add the following code to my WEB-INF/web.xml file under the web-app tag, using jdeveloper.
    <error-page>
    <error-code>404</error-code>
    <location>notFound.html</location>
    </error-page>
    then all of my jsp's in my project have this error message when I buit them.
    -Error(1): oracle.xml.parser.v2.XMLParseException: Invalid element 'error-page' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    Can yo help me???
    thanks in advence...

  • Error deploying when web.xml contains similiar security-constraint elements

    I am receiving an error when I include similiar security constraints in my web.xml descriptor.  I actually have many security-constraint elements defined but I have narrowed it down to the following two that appear kind of similiar which are causing the problem:
    <security-constraint>
    <web-resource-collection>
         <web-resource-name>ProcessesPosts</web-resource-name>
         <url-pattern>/processPost/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    <security-constraint>
    <web-resource-collection>
         <web-resource-name>Processes</web-resource-name>
         <url-pattern>/process/*</url-pattern>
    </web-resource-collection>
    </security-constraint>
    The error I receive is:
    #1#com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Exception during generating components of sap.com/s25qoie_1_SAP application in servlet_jsp container.
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:512)
         at com.sap.engine.services.deploy.server.application.DeployUtilTransaction.commonBegin(DeployUtilTransaction.java:248)
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.begin(DeploymentTransaction.java:215)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesOnOneServer(ApplicationTransaction.java:371)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhases(ApplicationTransaction.java:405)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.makeGlobalTransaction(DeployServiceImpl.java:2298)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.deploy(DeployServiceImpl.java:286)
         at com.sap.engine.services.deploy.server.DeployServiceImplp4_Skel.dispatch(DeployServiceImplp4_Skel.java:2636)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:253)
         at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:109)
         at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:841)
         at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:125)
         at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:59)
         at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
         at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:168)
    Caused by: java.lang.IllegalArgumentException: Invalid prefix pattern in URLPatternList
         at javax.security.jacc.URLPatternSpec.setURLPatternArray(URLPatternSpec.java:329)
         at javax.security.jacc.URLPatternSpec.<init>(URLPatternSpec.java:106)
         at javax.security.jacc.WebResourcePermission.<init>(WebResourcePermission.java:188)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.JACCRulesGenerator.generatePermissionsUnchecked(JACCRulesGenerator.java:311)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.JACCRulesGenerator.generateAndAddPermissionsIntoPolicyConfiguration(JACCRulesGenerator.java:132)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.SecurityConstraintParser.processAllSecurityConstraints(SecurityConstraintParser.java:151)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.jacc.SecurityConstraintParser.createSecurityResourcesJACC(SecurityConstraintParser.java:57)
         at com.sap.engine.services.servlets_jsp.server.deploy.util.SecurityUtils.createSecurityResources(SecurityUtils.java:122)
         at com.sap.engine.services.servlets_jsp.server.deploy.DeployAction.initXmls(DeployAction.java:722)
         at com.sap.engine.services.servlets_jsp.server.deploy.DeployAction.deploy(DeployAction.java:276)
         at com.sap.engine.services.servlets_jsp.server.deploy.WebContainer.deploy(WebContainer.java:181)
         at com.sap.engine.services.deploy.server.application.DeploymentTransaction.makeComponents(DeploymentTransaction.java:506)
         ... 14 more
    Has anyone seen anything like this?  Have I defined something wrong in my web.xml?  The exact same web.xml file does work in several other application servers.

    Hi Jay,
    I am not aware of such document for the preview release.
    About the concrete problem your investigation was enough detailed so we managed to reproduce and fix it.
    Thanks and regards

  • Generated JSP reports and context-param in web.xml

    I have what I believe to be a problem when using .jsp files generated from reports builder (actually, it looks as if the problem is in the reports tag library. When adding a context-param to web.xml, I get an error when compiling the following line:
    <%@ taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw" %>
    Error(1): oracle.xml.parser.v2.XMLParseException: Invalid element 'context-param' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'.
    Note that I can read the context param and no other JSP pages seem to care, just those with the Reports Tag library.
    Regards,
    Jeff

    Ben -
    There can be init params for the servlet or for the servlet context. For the servlet, this looks like:
    <servlet>
    <servlet-name>InitServlet</servlet-name>
    <servlet-class>package1.InitServlet</servlet-class>
    <init-param>
    <param-name>message</param-name>
    <param-value>Hello From Initialization Parameter</param-value>
    </init-param>
    </servlet>
    in the web.xml file, and is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message = config.getInitParameter("message");
    For a servlet context init param, you define it as you did using the web.xml settings editor:
    <context-param>
    <param-name>hello</param-name>
    <param-value>hi</param-value>
    </context-param>
    This is accessed using:
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    message1 = config.getServletContext().getInitParameter("hello");
    Hope this helps,
    Lynn
    Java Tools Team

Maybe you are looking for

  • QAAWS error message "not a valid query"

    Hi, When I'm trying to connect to QAAWS I get this error message: "not a valid query. FWB 00025". Does anyone know how to solve this problem? The server where the BOE is installed on has been restarted a couple of times but it doesn't help. Universe

  • Message RSAR245 - Error Code 6

    Hi, While loading the data from non sap systems i.e oracle, we are getting an following error. The only changes what we had done is that we applied the BW Support Pack 8 and ABAP Support 8. After applying these patches, we are not able to upload any

  • HELP! Muse CC 2014 Keeps crashing

    I'm not very techy so i'm hoping someone can help me, I can open muse no problem but as soon as I start to work it crashes and I get this message every time, Its getting very frustrating now as I can't get on with what I need to do. I've uninstalled

  • How to deploy servlets with struts in weblogic61sp2 ?

              I success to config a web app with struts framework via welogic61 admin console,but           I only saw the first page but I cannot sumit to next page. (Of course,it's right           if I set struts.jar's classpath and web app jar in my s

  • Social media module

    I have purchased the ecommerce level with 10 users. I need to insert a facebook and twitter module on my pages. I can get all the code in place and the buttons show, but when I try to follow the instructions to build the modules by going to Site Mana