Help about wls8.1 servlet url-pattern

In WLS8.1, I get 404 error when url-pattern is "/*.jsp"; it is ok when url-pattern is "*.jsp". why? Thanks a lot!

Could it be that the leading forward slash is telling the web server that you mean the context root, and the jsp files you are trying to map to are almost certianly not at the context-root of your application.

Similar Messages

  • PLEASE HELP Can't run my servlet url-pattern with Tomcat

    Hi I'm trying to run servlet with Tomcat.
    I have don the servlet with tomcat ide abd its runnig ok with Forte with the internal Tomcat
    When I'm runing it with external Tomacat its not running at the url that I have given in the web.xml
    web.xml file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>ClaimsServlet</servlet-name>
    <servlet-class>ild.claims.ClaimsServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>LoginServlet</servlet-name>
    <servlet-class>ild.claims.LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ClaimsServlet</servlet-name>
    <url-pattern>/ild/claims/claims</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>LoginServlet</servlet-name>
    <url-pattern>/ild/claims/LoginServlet</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    90
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>
    default.jsp
    </welcome-file>
    <welcome-file>
    index.html
    </welcome-file>
    <welcome-file>
    index.htm
    </welcome-file>
    </welcome-file-list>
    </web-app>
    if I runnig the url: /ild/servlet/ild/claims/ClaimsServlet
    its running
    but //ild/claims/claims
    I got: The requested resource (/claims/claims) is not available.
    Thanks for help
    Snir

    Do you have to use <url-pattern>/ild/claims/claims</url-pattern>
    or you can use <url-pattern>/claims</url-pattern> ?

  • Different url-patterns for same servlet running in 2 different environments

    Hi All,
    I have a question about url mappings in my web.xml file and I hope somebody can help. The situation is that I�m putting together a web app using a combination of JSPs and servlets. I can�t develop on the machine that it will be hosted on, so I�m working and testing on my own machine and will transfer to the host machine when finished. However, the host machine is set up to map serlvets to http://�/servlet/MyServlet but the copy of tomcat I have installed locally maps to http://�/MySerlvet. My question is, when I get ready to transfer my application do I have to go through all my code and find serlvet references and insert the �servlet/� path info required by the hosting service, or can I just change the url patterns for the servlet mappings of the web.xml file on the host machine ? In other words:
    Local install of Tomcat where servlets are accessed at http://�/MyServlet
    <servlet-mapping>
    <servlet-name> MyServlet </servlet-name>
    <url-pattern>/MyServlet </url-pattern>
    </servlet-mapping>
    Host machine install of Tomcat where servlets are accessed at http://�/servlet/MyServlet
    <servlet-mapping>
    <servlet-name> MyServlet </servlet-name>
    <url-pattern>/servlet/MyServlet </url-pattern>
    </servlet-mapping>
    I guess my thinking is that it would be better/easier to have a remote and local version of the web.xml file that reflects the environment each one resides in and have only one codebase rather than 2 codebases and 1 web.xml file. Am I thinking about this in the right way, or have I misunderstood something?
    Thanks,
    Peter

    What you�re suggesting is logical, but won�t that
    effect all the other stuff I�ve got running on my
    local Tomcat install that expects servlets to be
    accessed at http://.../ServletName ?
    in web.xml, you decide of your mapping, so you could use the /servlet/ServletName pattern for your application that needs to be remote, and /ServletName for the rest of your stuff. You can even define more than one mapping for a servlet...
    In fact, you should probably put your whole application that is going to be on a remote server in it's own context, and to be ahead of dufymo :-) , learn to put it a war file for deployment.

  • How to specify  a servlet mapping as the url pattern with in the security constraints

    Hi ,
    Weblogic 6.0 documentation says the following:-
    Define which resources in the Web Application the security constraint applies to using the <url-pattern> element that is nested inside the <web-resource-collection> element. The <url-pattern> can refer to either a directory, filename or a <servlet-mapping>.
    To apply the security constraint to the entire Web Application, use the following <url-pattern>:
    <url-pattern>/*</url-pattern>
    Could any one let me know how to specify servlet mapping as the url pattern.
    I tried various combination and it doesn't seem to work and any help in this regard will be greatly appreciated.
    Thanks
    kannan

    The answer is posted here:
    Unapproved User Flag in UME

  • Mapping an url-pattern to a servlet in a hosted environment

    This may not be exactly the right place for this, but I thought someone may have had similar experiences and be able to suggest something...
    My JSP/Servlet application runs fine in a Tomcat -standalone environment, however there are certain mappings (hrefs and what-not) that do not function when I upload it to the hosted environment I am using. For example, the index page contains a link to something like /xyz. /xyz is an url-pattern specified in my web.xml that is then mapped to a servlet. The hosted application gets an Apache 404 when following such a link, because (the hosting help desk tell me) by default the only requests that Apache forwards to Tomcat are /*.jsp, /*.xml and /servlet/*, as defined in their httpd.conf.
    Are any of the following possible?
    1. They introduce somes line into the Tomcat section of their httpd.conf forwarding requests like myHostedSite/xyz to my instance of Tomcat (and so not forwarding theirOtherHostedSites/xyz).
    2. (My preferred shot-in-the-dark) They introduce a line into their httpd.conf that, for my site, then references another configuration file (on my part of the system), in which I could maintain a list of mappings that Apache should forward to Tomcat.
    Otherwise, I guess, I am left to change all refences in my code and pages from /xyz to /servlet/xyz which is ugly and feels like a kludge.
    Any hints, tips, help or advice (or even directions to a better place to post this) gratefully received.

    For Point 2, surely they are using a Virtual Host for your app on tomcat? this means they should be able to configure ALL requests to Tomcat based on your Virtual Host. Unless of course your using thier host name and utilising only the context path???
    The httpd.conf should have something like:<VirtualHost your.domainName.com:80>
        ServerAdmin [email protected]
        DocumentRoot /path/to/your/app
        ServerName your.domainName.org
        ErrorLog /path/to/error/log
        CustomLog /path/to/custom/log
        JkMount /*.jsp worker1 //your worker.properties file
        JkMount /*.html worker1 //your worker.properties file
    </VirtualHost>With the DocumentRoot set it should default all your gifs, jpegs etc but route htmls, jsps and servlets through to your tomcat instance as configured with your worker.properties file.
    I have to admit, Apache to Tomcat integration can be a nightmare and the Apache httpd.conf file is a monster but the above code should work provided you have yout own domain name.
    Regards,
    Anthony

  • Servlet Filters/url patterns with WLS 8

    Hello,
    I am trying to use filters to do some pre processing before my web service
    is invoked. It seems the doFilter() method does not seem to be getting invoked.
    The init() method is getting invoked as I see print statements in the log file.
    I am not sure if the url-pattern is correct and I am enclosing the web.xml file
    here along with relevant lines from web-services.xml and application.xml.In access.log
    I do see HTTP calls to the web service.
    Any help would be appreciated.
    <web-app>
    <filter>
    <filter-name>l10nWebServiceFilter</filter-name>
    <filter-class>com.globalsight.dotNet.L10nWebServiceFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>l10nWebServiceFilter</filter-name>
    <url-pattern>/l10nWebService/*</url-pattern>
    </filter-mapping>
    </web-app>
    From web-services.xml -
    web-service useSOAP12="false" targetNamespace="http://localhost:7001/L10nWebServiceEJB"
    name="L10nWebServiceEJB" style="rpc" uri="/L10nWebServiceEJB">
    and from application.xml -
    <application>
    <display-name></display-name>
    <module>
    <web>
    <web-uri>l10nWebService.war</web-uri>
    <context-root>l10nWebService</context-root>
    </web>
    </module>
    <module>
    <ejb>cap_ssb.jar</ejb>
    </module>
    </application>

    Hi Aswin,
    I think the problem may be in your Servlet Filter code :-)
    The last line in your doFilter() method should be:
    filterChain.doFilter(servletRequest, servletResponse);
    I have attached a small zip that uses a ServletFilter to get around situations,
    where the WLS web services stack/tools has problems dynamically generating the
    WSDL I want to present to the "outside world". It (the zip) contains a web.xml
    that illustrates how to set the <url-pattern>. This web.xml goes with the web-services.xml
    in the web services' .war, but the ServletFilter is "generic" :-)
    HTH,
    Mike Wooten
    "Aswin Dinakar" <[email protected]> wrote:
    >
    Changing the url-pattern to /* solved the problem and the doFilter()
    method is
    being called. However the webservice is not being invoked now. Is there
    any changes
    to web-services.xml that I need to make that after the doFilter() code
    is invoked
    the webservice methods would be invoked ?
    Thanks,
    Aswin.
    "Aswin Dinakar" <[email protected]> wrote:
    Hello,
    I am trying to use filters to do some pre processing beforemy
    web service
    is invoked. It seems the doFilter() method does not seem to be getting
    invoked.
    The init() method is getting invoked as I see print statements in the
    log file.
    I am not sure if the url-pattern is correct and I am enclosing the web.xml
    file
    here along with relevant lines from web-services.xml and application.xml.In
    access.log
    I do see HTTP calls to the web service.
    Any help would be appreciated.
    <web-app>
    <filter>
    <filter-name>l10nWebServiceFilter</filter-name>
    <filter-class>com.globalsight.dotNet.L10nWebServiceFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>l10nWebServiceFilter</filter-name>
    <url-pattern>/l10nWebService/*</url-pattern>
    </filter-mapping>
    </web-app>
    From web-services.xml -
    web-service useSOAP12="false" targetNamespace="http://localhost:7001/L10nWebServiceEJB"
    name="L10nWebServiceEJB" style="rpc" uri="/L10nWebServiceEJB">
    and from application.xml -
    <application>
    <display-name></display-name>
    <module>
    <web>
    <web-uri>l10nWebService.war</web-uri>
    <context-root>l10nWebService</context-root>
    </web>
    </module>
    <module>
    <ejb>cap_ssb.jar</ejb>
    </module>
    </application>
    [webservice_servlet_filter.zip]

  • Need help with ACE Load Balancing Base on URL pattern

    This is the first time for me trying to configure something like this on the ACE load balancer.  I need help configuring a load balancing policy base on URL pattern.  URL https://ineedhelp.com base on /willuhelpme and /imlost
    Key: ineedhelp_key
    cert:  ineedhelp_cert
    serverfarmA
    serverA 10.1.1.1 443
    serverfarmB
    serverB 10.1.1.2 443
    ineedhelp.com/willuhelpme-------serverfarmA
    ineedhelp.ocm/imlost---------------serverfarmB

    This is the first time for me trying to configure something like this on the ACE load balancer.  I need help configuring a load balancing policy base on URL pattern.  URL https://ineedhelp.com base on /willuhelpme and /imlost
    Key: ineedhelp_key
    cert:  ineedhelp_cert
    serverfarmA
    serverA 10.1.1.1 443
    serverfarmB
    serverB 10.1.1.2 443
    ineedhelp.com/willuhelpme-------serverfarmA
    ineedhelp.ocm/imlost---------------serverfarmB

  • Help me with this servlet....

    Hi guys,
    excuse me if i repeat a my old post,but now i have more clear ideas about problems.
    I've developed an authorization filter in my jsf application that when a page is loaded try to find a visit object in the session,if it doesn't find show login page.
    It's simple as concept,but in my application my filter doesn't start!
    Can you help me?
    My filter is very simple
    package giu;
    import java.io.IOException;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class AuthorizationFilter implements Filter
      FilterConfig config = null;
      ServletContext servletContext = null;
      public AuthorizationFilter()
      public void init(FilterConfig filterConfig) throws ServletException
        config = filterConfig;
        servletContext = config.getServletContext();
      public void doFilter(ServletRequest request, ServletResponse response,
                           FilterChain chain) throws IOException, ServletException
        Utils.log(servletContext, "Inside the filter");
        HttpServletRequest httpRequest = (HttpServletRequest)request;
        HttpServletResponse httpResponse = (HttpServletResponse)response;
        HttpSession session = httpRequest.getSession();
        String requestPath = httpRequest.getPathInfo();
        Visit visit = (Visit)session.getAttribute("visit");
        if (visit == null)
          session.setAttribute("originalTreeId", httpRequest.getPathInfo());
          Utils.log(servletContext, "redirecting to " + httpRequest.getContextPath() +
                    "/faces/Login.jsp");
          httpResponse.sendRedirect(httpRequest.getContextPath() +
                    "/faces/Login.jsp");
        else
          session.removeAttribute("originalTreeId");
          String role = visit.getUser().getRole();    }
        Utils.log(servletContext, "Exiting the filter");
      public void destroy()
    }my Login.jsp and index.jsp pages are in WebContent folder,while the other pages are in the Webcontent/protected.
    What i miss?
    Here is my web.xml, i thing the error is here,it's how filter doesn't intercept the requests...can you help me?
    <?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>
    <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
    </context-param>
    <filter>
      <filter-name>AuthorizationFilter</filter-name>
      <filter-class>giu.AuthorizationFilter</filter-class>
    </filter>
    <filter-mapping>
      <filter-name>AuthorizationFilter</filter-name>
      <url-pattern>/faces/protected/*</url-pattern>
    </filter-mapping>
    <servlet>
      <servlet-name>FacesServlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
      <servlet-name>FacesServlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>FacesServlet</servlet-name>
      <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <resource-ref>
      <description>DB Connection</description>
      <res-ref-name>jdbc/nomedb</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>and index.jsp
    <jsp:forward page="/Login.jsf"/>

    Thanks....
    i've moved all the jsp pages in /pages/protected except Login.
    I've added to web.xml
    <filter-mapping>
    <filter-name>AuthorizationFilter</filter-name>
    <url-pattern>/pages/protected/*</url-pattern>
    </filter-mapping>
    and so filter acts,but when i logged in i see Menu,i select a choice and all the next pages are ever blank!!
    I stop the filter and each page compares!
    Why?
    Can you help me?
    A second question is:
    what does mean an url like /faces/*?
    Each .jsf requests?Or faces is seen as a folder ?
    Thanks very much

  • Help needed in Mapping servlet in web.xml file

    Hi Can anyone please tell me what am doing wrong here. I can't see this servlet in my url. Please help.
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
         <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>/com/jci/fi/application/eems/HelloWorld/*</url-pattern>
    </servlet-mapping>
    package com.jci.fi.application.eems;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<body>");
    out.println("<head>");
    out.println("<title>Naveen Wants to goto TollyWood......!</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello World!</h1>");
    out.println("</body>");
    out.println("</html>");

    your web.xml shoould be something like this...
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>com.jci.fi.application.eems.HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>HelloWorld</url-pattern>
    </servlet-mapping>
    Hope this helps..
    CK

  • Using security-constraint in web.xml; not recognizing url-pattern tag

    I am creating a very simple jsp application within JDeveloper 10.1.3.1. I have 2 jsp files...a readData.jsp and a maintainData.jsp. I would like to deploy this application to Oracle Application Server 10.1.2.2. I would like to use Oracle Internet Directory with Single Sign on enabled. The deployment to OAS works fine. For the security, I would like an administrator user to get to both pages...and a user to only be able to see the readData.jsp. I used the security constraints on the properties of the web.xml file within JDeveloper. Here is my web.xml file:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!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>Empty web.xml file for Web Application</description>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>adm_full_access</web-resource-name>
    <url-pattern>*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>adm_all</role-name>
    </auth-constraint>
    </security-constraint>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>usr_access</web-resource-name>
    <url-pattern>readData.jsp</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>usr_all</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    </login-config>
    <security-role>
    <role-name>usr_all</role-name>
    </security-role>
    <security-role>
    <role-name>adm_all</role-name>
    </security-role>
    </web-app>
    When I deploy to OAS I added an OID account to the adm_all role...this works fine I can log on as that user and get to both jsps. But, when I add my user to the usr_all role within OAS I try to log on to the app...I then enter my SSO username and password and I get Access Denied errors from my browser when trying to access either page. I am confused about the <url-pattern> tag...is that relative to a directory within my deployment? Most of the examples I have seen use servlets...so I was wondering if I can even use the <url-pattern> tag to restrict/allow access to individual jsps? If someone could point me to some documentation on this set-up I would appreciate it!
    Thank you.

    I was able to get this to work. By doing the following:
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>adm_full_access</web-resource-name>
    <url-pattern>*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>adm_all</role-name>
    </auth-constraint>
    </security-constraint>
    I was restricting access to all other groups by uisng <url-pattern>*</url-pattern>. Any other security-constraints set-up after that will not work. So saying * requires usr_all will restrict ALL webpages to ONLY adm_all, regardless of what future constraints say. So, my first security-constraints lists all directories or pages that every user can access. My next security-constraint then list resources that only my admins (adm_all) can acess. Any other security constraints then are set-up for each user role that I have...if adm_all should have access to these then the <role-name>adm_all</role-name> is added to each security constraint.

  • Help required in First Servlet

    Hey Guys.....I have read the above thread all posts and as this is also my first Servlet so I am also getting
    java.lang.ClassNotFoundException: servlets.HelloWorldServlet
    Now in my Apache tomcat folder C:\apache-tomcat-6.0.16\webapps\ServletExamples I have the WEB-INF folder.....which has the web.xml....
    Web.xml is something like this...
    <?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">
         <servlet>
              <servlet-name>HelloWorldServlet</servlet-name>
              <servlet-class>servlets.HelloWorldServlet</servlet-class>
         </servlet>
         <servlet>
              <servlet-name>LoginServlet</servlet-name>
              <servlet-class>servlets.LoginServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>HelloWorldServlet</servlet-name>
              <url-pattern>/HelloWorldServlet</url-pattern>
         </servlet-mapping>
         <servlet-mapping>
              <servlet-name>LoginServlet</servlet-name>
              <url-pattern>/LoginServlet</url-pattern>
         </servlet-mapping>
    </web-app>The HelloWorldServlet.java is
    package servlets;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class HelloWorldServlet extends HttpServlet{
         public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
              PrintWriter pw = response.getWriter();
              pw.println("<html>");
              pw.println("<head>");
              pw.println("</head>");
              pw.println("<body>");
              pw.println("<h3>Hello World as a Servlet</h3>");
              pw.println("</body>");
              pw.println("</html>");
    }and this is what I am writing on the url......
    http://localhost:8080/ServletExamples/HelloWorldServlet
    and I am assuming that the problem is coming in the <servlet-class> in the fully qualified name....
    So I decided to make a classes folder in the WEB-INF folder and copy all my .class files and .java files in it.....
    after this I am still getting the same error....
    java.lang.ClassNotFoundException: servlets.HelloWorldServlet
    and when I refresh it again it gives me a different error....which is
    type Status report
    message Servlet HelloWorldServlet is not available
    description The requested resource (Servlet HelloWorldServlet is not available) is not available.
    So how can anybody help me out in starting my carrier in the servlets...
    Thanks in advance
    Regards
    ISI

    Please can anyone suggest any good tutorials which can help me in this.....I am following this one but I am unable to overcome this error...
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    Regards
    ISI

  • About wls6.0 servlet mapping

              I do the wls6.0 servlet,I copy wls example helloservletExample in
              the mydomain\application\DefaultWebApp_myserver\web-inf\clsses\
              and modify the xml file
              <?xml version="1.0" ?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>
              HelloWorldExample
              </servlet-name>
              <servlet-class>
              HelloWorldExample
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              HelloWorldExample
              </servlet-name>
              <url-pattern>
              quickstart
              </url-pattern>
              </web-app>
              but when I run it http://localhost:7001/HelloWorldExample
              it said not found ,how can I resolve it,can anybody help me?
              

    1) Make sure you specified the correct class file name. If you copied from
              our examples directory it should be
              examples.servlets.HelloWorldServlet.
              2) Also your url-pattern was set to quickstart. So you should point y our
              browser to http://localhost/HelloWorldExamples/quickstart
              Read our docs
              Kumar
              blackwhites wrote:
              > I do the wls6.0 servlet,I copy wls example helloservletExample in
              > the mydomain\application\DefaultWebApp_myserver\web-inf\clsses\
              > and modify the xml file
              > <?xml version="1.0" ?>
              > <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              > 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              > <web-app>
              > <servlet>
              > <servlet-name>
              > HelloWorldExample
              > </servlet-name>
              > <servlet-class>
              > HelloWorldExample
              > </servlet-class>
              > </servlet>
              > <servlet-mapping>
              > <servlet-name>
              > HelloWorldExample
              > </servlet-name>
              > <url-pattern>
              > quickstart
              > </url-pattern>
              > </web-app>
              > but when I run it http://localhost:7001/HelloWorldExample
              > it said not found ,how can I resolve it,can anybody help me?
              

  • url-pattern working?

    Greet the sun all,
              Question, does anybody know if <url-pattern> in the web.xml file is
              working for file patterns? I try to map file pattern *.xyz to a servlet
              and it does not work. I have tried this under Tomcat and it works fine.
              Perry Hoekstra
              Consultant
              Talent Software Services
              [email protected]
              

    Perry Hoekstra <[email protected]> wrote in message
              news:[email protected]..
              > Question, does anybody know if <url-pattern> in the web.xml file is
              > working for file patterns? I try to map file pattern *.xyz to a servlet
              > and it does not work. I have tried this under Tomcat and it works fine.
              I can't get it to work either. My webapplication looks like this:
              /WEB-INF
              /public.html
              /guarded.html
              /login.html
              /error.html
              ...and my web.xml has a <url-pattern> element in it that looks like this:
              <url-pattern>/guarded.html</url-pattern>
              ...that is, in accordance with the Servlet 2.2 specification, I'm trying to
              get my web application to declare that that particular security constraint
              should apply only to the guarded.html page and nothing else. I'm using FORM
              based login.
              Can anyone from BEA comment on the brokenness or lack thereof of the
              <url-pattern> element and how it should be used? I've of course read all
              the documentation about it because there isn't much. :-)
              Cheers,
              Laird
              

  • url-pattern syntax

    I am trying to deploy a jsp (adf) application to tomcat 5.2 but I am getting errors because of the filter-mapping tags I am using. This is the relevant part of my web.xml file:
    <!-- OK -->
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <servlet-name>jsp</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>LoginCheckFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <!-- OK -->
    <!— NOT OK -->
    <filter-mapping>
    <filter-name>CheckUnosRole</filter-name>
    <url-pattern>admin.do</url-pattern>
    </filter-mapping>
    <!— NOT OK -->
    Tomcat complains about the part marked with NOT OK. It says that the url-pattern has syntax error. Mapping the filter to: .do, .jsp or jsp (as in the OK part) works fine. But, I need to map some filters to specific actions, like myAction.do. How am I supposed to do that?
    I have deployed the same application to oc4j and there it works fine.

    I am trying to deploy a jsp (adf) application to tomcat 5.2 but I am getting errors because of the filter-mapping tags I am using. This is the relevant part of my web.xml file:
    <!-- OK -->
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>ADFBindingFilter</filter-name>
    <servlet-name>jsp</servlet-name>
    </filter-mapping>
    <filter-mapping>
    <filter-name>LoginCheckFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <!-- OK -->
    <!— NOT OK -->
    <filter-mapping>
    <filter-name>CheckUnosRole</filter-name>
    <url-pattern>admin.do</url-pattern>
    </filter-mapping>
    <!— NOT OK -->
    Tomcat complains about the part marked with NOT OK. It says that the url-pattern has syntax error. Mapping the filter to: .do, .jsp or jsp (as in the OK part) works fine. But, I need to map some filters to specific actions, like myAction.do. How am I supposed to do that?
    I have deployed the same application to oc4j and there it works fine.

  • Same URL Pattern error

    A colleague of mine has generated a web service stub (is that the correct term) using netbeans and he has it deployed on his local host using Glassfish. I have tried to to the same by taking his source code and building it. I successfully buld the service, but when I try and run it I get the following error:
    SEVERE: Servlet [BVTAFMessageInboxService] and Servlet [TiNA] have the same url pattern: [/BVTAFMessageInboxService]
    SEVERE: Exception while deploying the app
    java.lang.IllegalStateException: Servlet [BVTAFMessageInboxService] and Servlet [TiNA] have the same url pattern: [/BVTAFMessageInboxService]at org.glassfish.apf.AnnotationInfo@10acb9bHe does not receive this error. The only difference is I am running on Linux and he is running Windows, but I don't think this is the issue. I am new to Java so the error is a little confusing, can any one help me?
    Thanks,
    LITW

    Yes I did say he was using GlassFish earlier, but after asking to see his project's properties:
    Right click project--->Properties--->Run
    His details said:
    Server: Tomcat
    Java EE version: Java EE 5
    Now, as you maybe able to tell I am no expert with this, my aim is to get the service running locally and for the moment that is all. He doesn't remember doing anything particular to getting it running on Tomcat and he assumed I could just checkout the source, build and run.
    I have also created an endorsed directory here:
    /usr/lib/jvm/java-6-sun-1.6.0.15/jre/lib/endorsedand added webservices-api.jar. This was done to remove errors that occurred during compilation.
    Another thing I have done, at the advice of [this blog post|http://blogs.sun.com/sreekanth/entry/servlet_activationcoordinatorporttypeimpl_and_servlet_registrationporttypeimpl] , is to add webservices-osgi.jar from:
    ../../sges-v3/glassfish/modules/endorsed/to the projects compile time libraries without packaging them to the war file, which has not made a lot of difference.
    I also realised another difference was that I was using open jdk, so I downloaded and installed the Sun JDK. But even when I clean and compile using the Sun JDK, when I run the application I get exactly the same error.
    So this is a little mystery...If you have any ideas, I would be very grateful.
    LITW

Maybe you are looking for

  • Can i use my iphone 5 charger for the ipad air

    Can I use my iphone 5 charger for the ipad air?

  • 15" Apple Studio Display Shutting Off

    My Apple Studio Display (LCD 15", purchased 2000) visual display is intermittently shutting off. Audio remains functional, and I can still type while the display is absent and when it comes back what I typed (ie, on a word doc) is there. The screen s

  • Reciever comm channel configuration  for ftp

    Hi all I have configured the comm ch in reciever nfs content conversion parameters Name.fieldNames                 FIRSTNAME,LASTNAME,SALARY Name.fieldSeparator         , Name.processConfiguraion    FromConfiguration Name.endSeparator        'nl' sen

  • Displaying photo's vertically from slideshow to appleTV

    When I start a slideshow from photo's on my iphone and airplay to my apple TV, the pictures are mostly sideways, but if I just swipe through photo's they seem to be all displaying just fine. Do I need to configure something on my iphone?

  • I can't buy book on iphoto

    after i hit the buy book button the program takes me to a screen where i need to enter the zip code.  the buy book button is not longer highlighted and i have iphoto 11.