Mapping Servlet to Directory

Is it in any way possible to map a servlet only to a directory, but not to the files of that directory. So I could map a servlet to "/", but not to "/*". As it is now a mapping on "/" and "/*" is exactly the same; both map on the whole webapp.
If this is not possible yet, is there any RFE which requests this behaviour for future versions of the servlet-specs?

You can map a request just to a specfic directory:
<servlet>
<servlet-name>controller</servlet-name>
<servlet-class>acme.ControllerServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>/catalog/</url-pattern>
</servlet-mapping>
In your web app you can still have a directory /catalog/test.jsp
A request for /catalog/test.jsp will return that page.
A request for /catalog or /catalog/ will call the servlet.
There is a good set of examples in the Servlet Speciffication 2.4 in section SRV.11.2.2.
Keep in mind welcome files may change your expected behavior. Welcome files have been updated in the latest servlet 2.4 specfication. Welcome files have been updated in servlet 2.4 to allow you to map requests to a set of ordered list (which may include servlets) defined in the web.xml. See SRV.9.10 for more details.

Similar Messages

  • 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

  • Parameters in a mapped servlet in Tomcat

    I am using Tomcat 4.0.2/JDK 1.3.1 running on Solaris. I have the following servlet called foo.Bar, named FooBar in the web.xml file for my webapp.
    <servlet>
    <servlet-name>FooBar</servlet-name>
    <display-name>FooBar</display-name>
    <description></description>
    <servlet-class>foo.Bar</servlet-class.
    </servlet>
    I can access this servlet from the following url:
    http://localhost/webappname/servlet/FooBar ,
    also:
    http://localhost/webappname/servlet/FooBar/param1/param2
    works as well.
    But, if I put a servlet-mapping in the web.xml file:
    <servlet-mapping>
    <servlet-name>FooBar</servlet-name>
    <url-pattern>/foo</url-pattern>
    </servlet-mapping>
    The following URL does not work:
    http://localhost/webappname/foo/param1/param2.
    Is this a problem in Tomcat? Or is there another section of the web.xml file to tell the url parser to stop at the end of the servlet mapping?
    Thanks.
    C

    This is not a bug. The servlet spec says
    "In the web application deployment descriptor, the following syntax is used to define
    mappings:
    � A string beginning with a �/� character and ending with a �/*� postfix is used
    for path mapping.
    � A string beginning with a �*.� prefix is used as an extension mapping.
    � A string containing only the �/� character indicates the "default" servlet of the
    application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
    � All other strings are used for exact matches only."
    Sounds like you need a pattern of /foo/*

  • Re: mapping of a directory containing JSP files

    Thanks for the quick response..
              but i want some other root directory other than the DefaultWebApp where i
              can put my jsp files...either under DefaultWebApp or preferably some where
              else....
              Is that possible ?
              Pankaj
              "Deepak Vohra" <[email protected]> wrote in message
              news:[email protected]...
              > JSPs do not require specific mappings as do HTTP servlets.
              > Place your Jsps, for example configureJsp.jsp, in the
              DefaultWebApp/presentation
              > directory.
              >
              > In a web browser, request the JSP file using the following URL:
              > http://localhost:7001/presentation/configureJsp.jsp
              >
              > Pankaj Bansal wrote:
              >
              > > Hi,
              > > Iam using weblogic 6.1, SP2.
              > >
              > > I have created a web application with the DefaultWebApp directory
              where
              > > u can put ur jsp files for them to be available automatically..
              > >
              > > Can someone tell me is there a way to map jsp files to some other
              directory
              > > ?
              > > Or can i make some subdirectory under DefaultWebApp like 'presentation'
              and
              > > keep my jsp files in that and not be required to write the directory
              name
              > > ( presentation) for accessing my files.
              > >
              > > In short is it possible in some way to map some directory where i put my
              jsp
              > > files and they are readily accessible, other than the DefaultWebApp
              > > directory.
              > >
              > > thanks,
              > > --
              > >
              > > Pankaj
              >
              

              how to To install a jsp under another Web Application in wls 7.0.1? and i just
              don't want to deploy jar,ear,war... file.
              It seems there are many differences between wls7 and wls7.0.1.
              Deepak Vohra <[email protected]> wrote:
              >Pankaj
              >
              >DefaultWebApp is the default Web application. To install a jsp under
              >another Web
              >
              > Application,create a new Web Application, for example ConfigJspWebApp.
              >Install
              >the
              >new Web Application. Place Jsp, for example configJsp.jsp in the
              > ConfigJspWebApp/presentation directory.
              >
              >
              >In a web browser, request the JSP file using the following URL:
              >http://localhost:7001/ConfigJspWebApp/presentation/configJsp.jsp
              >
              >
              >Pankaj Bansal wrote:
              >
              >> Thanks for the quick response..
              >> but i want some other root directory other than the DefaultWebApp where
              >i
              >> can put my jsp files...either under DefaultWebApp or preferably some
              >where
              >> else....
              >> Is that possible ?
              >>
              >> --
              >>
              >> Pankaj
              >>
              >> "Deepak Vohra" <[email protected]> wrote in message
              >> news:[email protected]...
              >> > JSPs do not require specific mappings as do HTTP servlets.
              >> > Place your Jsps, for example configureJsp.jsp, in the
              >> DefaultWebApp/presentation
              >> > directory.
              >> >
              >> > In a web browser, request the JSP file using the following URL:
              >> > http://localhost:7001/presentation/configureJsp.jsp
              >> >
              >> > Pankaj Bansal wrote:
              >> >
              >> > > Hi,
              >> > > Iam using weblogic 6.1, SP2.
              >> > >
              >> > > I have created a web application with the DefaultWebApp directory
              >> where
              >> > > u can put ur jsp files for them to be available automatically..
              >> > >
              >> > > Can someone tell me is there a way to map jsp files to some other
              >> directory
              >> > > ?
              >> > > Or can i make some subdirectory under DefaultWebApp like 'presentation'
              >> and
              >> > > keep my jsp files in that and not be required to write the directory
              >> name
              >> > > ( presentation) for accessing my files.
              >> > >
              >> > > In short is it possible in some way to map some directory where
              >i put my
              >> jsp
              >> > > files and they are readily accessible, other than the DefaultWebApp
              >> > > directory.
              >> > >
              >> > > thanks,
              >> > > --
              >> > >
              >> > > Pankaj
              >> >
              >
              

  • Mapping of a directory containing JSP files

    Hi,
              Iam using weblogic 6.1, SP2.
              I have created a web application with the DefaultWebApp directory where
              u can put ur jsp files for them to be available automatically..
              Can someone tell me is there a way to map jsp files to some other directory
              Or can i make some subdirectory under DefaultWebApp like 'presentation' and
              keep my jsp files in that and not be required to write the directory name
              ( presentation) for accessing my files.
              In short is it possible in some way to map some directory where i put my jsp
              files and they are readily accessible, other than the DefaultWebApp
              directory.
              thanks,
              Pankaj
              

    JSPs do not require specific mappings as do HTTP servlets.
              Place your Jsps, for example configureJsp.jsp, in the DefaultWebApp/presentation
              directory.
              In a web browser, request the JSP file using the following URL:
              http://localhost:7001/presentation/configureJsp.jsp
              Pankaj Bansal wrote:
              > Hi,
              > Iam using weblogic 6.1, SP2.
              >
              > I have created a web application with the DefaultWebApp directory where
              > u can put ur jsp files for them to be available automatically..
              >
              > Can someone tell me is there a way to map jsp files to some other directory
              > ?
              > Or can i make some subdirectory under DefaultWebApp like 'presentation' and
              > keep my jsp files in that and not be required to write the directory name
              > ( presentation) for accessing my files.
              >
              > In short is it possible in some way to map some directory where i put my jsp
              > files and they are readily accessible, other than the DefaultWebApp
              > directory.
              >
              > thanks,
              > --
              >
              > Pankaj
              

  • No value mapping in Integration Directory, but they are in the cache

    Hi,
    I recently got acquainted with the fabulous world of value mappings in PI. Until now, FixValues did the trick for me, but now I have to modify the errors in someone else's work.
    I read this article:
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/00ee347e-aabb-2a10-b298-d15a1ebf43c5&overridelayout=true
    and a bunch of other help.sap.com stuff and I still don't get a very specific thing in our system. When I check the cache from the runtime workbench, the values, agencies and what have you are all ok. However, when I go to Integration Directory, disregarding the fact that I don't have any values on the search helps for Agency and Scheme, which is quite weird, when I put the correct Agencies and Schemes, I don't get any value displayed, just blanks.
    Why does this happen? Is it something wrong in the PI configuration or something that I don't see any value mapping there, altough they are in the cache?
    Thanks in advance and best regards,
    George

    Hi ,
    1. Create Value Mapping directly in ID (this cannot be seen in RWB, it can be only seen in ID)  
        *Just a corection we can see the value mappings created in Integration directory in RWB in cache monitoring.*
    Just follow these steps to refresh your cache. you will no longer be able to see deleted Val mappings and newly created entries will also shown immediately.
    1) Go to integration builder -- > Administration  --> click on Runtime tab --> cache overview
    You will find 2 things over there :
    Value Mapping Group Cache
    Value Mapping Value Cache
    Refresh both of them. I hope it will work as it always work for me :).
    Thanks
    Inder

  • Context Directory Agent maps the Active Directory Anti-Virus user

    Hi,
    Today I was able to join a couple of CDA's to our Active Directory domain (2008 R2 DC's) using a non-privileged account and the CDA maps (most) users to IP addresses.
    I would like to use the CDA solely for building up firewall policies based on AD details whenever possible
    as maintaining granular firewall policies on 8 different ASA's is too time consuming as we are not a large IT organization.
    But, after deploying the first "AD Group" based rule, it turned out, that the AD user-account mapped to the IP address of my PC was actually a domain user, running the local anti-virus engine, and not my own.
    It makes total sense that the the anti-virus user is logged on to the PC before any user, so it can do "its thing",
    but my own user-account is never mapped. 
    CDA was able to map certain users to an IP address, even though the anti-virus user is actually logged on to the PC before them.
    Has anyone deployed Identity Based Firewalling and experienced something which resembles this scenario and were you able to do any workarounds?
    I looked into filtering out the logon events (for the Sophos user-account) from the Windows Security logs,
    so the CDA will not be able to map these, but it seems a bit far fetched, and would probably violate a security policy or two :)
    Cheers, Søren Elleby Sørensen

    I opened a case and they refer me to bug CSCun10631.
    (CDA doesn't support 2012R2).
    the good news is that a new patch (3) should be release this month (July) and will include support.

  • Servlet home directory

    Hello,
    I am trying to create file using java servlet, but i don't know where it is located after it is created.
    i tried to get the path and i get this path : /usr/local/jakarta/apache-tomcat-5.5.28/bin/hishamww.html
    But i didn't find the file hishamww.html which i was trying to create it.
    I tried to get the home directory in which my servlet is running and i got the following: /home/tomcat
    and i searched for this directory but i didn't find it on my server!
    This is the code that i am using to create the file:
    File file = new File("hishamww.html");
    if (file.createNewFile()) {
    processRequest(request, response,"file created:"+file.getAbsolutePath()); //This gave me this path: /usr/local/jakarta/apache-tomcat-5.5.28/bin/hishamww.html
    } else {
    FileWriter fstream = new FileWriter(file);
    BufferedWriter out = new BufferedWriter(fstream);
    out.write("hisham");
    out.close();
    I want to create this file in a directory that i can access in order to get it by http request like: www.mySite.com/fileName.html
    Regards,
    Hisham

    What do you mean by "myApplicationName", do you mean that it is the name of the servlet that i am running?What on earth do you think I mean? Is it ambiguous? Isn't it blindingly obvious?
    or tomcat?Tomcat doesn't have a name. So it can't be that, can it? Not much left, is there?
    because i tried to write the name of the servlet that i am running but i got 404 error.Sigh. OK. Tell us:
    1. The hostname and port of Tomcat.
    2. The context name, i.e. the name of the application in Tomcat, i.e. the name of its .war file without the .war, or the name of the directory under webapps in which it is deployed.
    3. The name of the file.
    Then I will tell you the correct URL of the file which you have created via getRealPath("/hishamww.html");
    In fact I will tell you anyway. It is http://hostname:port/application/hishamww.html. Where you have to make the appropriate substitutions as above.

  • How to map directory not under "document root" directory?

    In Weblogic (5.1.0), how do you map one URL "directory" to a filesystem
    directory that is not a subdirectory of the regular document root
    directory?
    This is, I want some URL "http://xxx.com/some/subset" to map to local
    directory "/x/y" instead of mapping to a subdirectory "some/subset"
    under the document root directory (the directory to which
    "http://xxx.com/" maps).
    How do you do this in Weblogic (using Weblogic as the HTTP server,
    not using it plugged in to some other HTTP server)?
    (In Apache, this would be the "Alias" directive.)
    Thanks,
    Daniel
    Daniel Barclay
    Digital Focus
    [email protected]

    [REPLY TO NEWSGROUP ------- This followup was posted to
    weblogic.support.install and a copy was sent to the cited author.]
    Default registration for the file servlet is:
    weblogic.httpd.register.file=weblogic.servlet.FileServlet
    weblogic.httpd.initArgs.file=defaultFilename=index.html
    So do this:
    weblogic.httpd.register.some/subset=weblogic.servlet.FileServlet
    weblogic.httpd.initArgs.some/subset=defaultFilename=index.html,docHome=d:
    /foo/bar/baz
    mbg
    In article <[email protected]>,
    [email protected] says...
    >
    In Weblogic (5.1.0), how do you map one URL "directory" to a filesystem
    directory that is not a subdirectory of the regular document root
    directory?
    This is, I want some URL "http://xxx.com/some/subset" to map to local
    directory "/x/y" instead of mapping to a subdirectory "some/subset"
    under the document root directory (the directory to which
    "http://xxx.com/" maps).
    How do you do this in Weblogic (using Weblogic as the HTTP server,
    not using it plugged in to some other HTTP server)?
    (In Apache, this would be the "Alias" directive.)
    Thanks,
    Daniel
    ==================================================
    NewsGroup Rant
    ==================================================
    Rant 1.
    The less info you provide about your problem means
    the less we can help you. Try to look at the
    problem from an external perspective and provide
    all the data necessary to put your problem in
    perspective.

  • Servlet mapping with Apache + Tomcat

    I'm trying to set up my servlet with apache + Tomcat(3.2.3), and i'm using mod_jk as the Tomcat-Apache plug-in.
    The HelloWorld servlet that comes with the examples app worked fine at: http://localhost/examples/servlet/HelloWorldExample,
    but how do I change the configurations, so that it can be invoked at:
    http://localhost/examples/HelloWorldExample ?
    It appears to me that '/servlet/' is the default prefix for Tomcat's RequestInterceptor, there is no way to get around that.
    Any insights will be greatly appreciated, thanks!
    Elaine

    hi
    Try this:
    add below code in web.xml file in examples/WEB-INF
    F directory
    <servlet-mapping>
    <servlet-name>
    HelloWorldExample
    </servlet-name>
    <url-pattern>
    /HelloWorldExample
    </url-pattern>
    </servlet-mapping>
    Thanks for the reply, the web.xml is already set up this way, in fact, I'm able to invoke the servlet through tomcat(running on port 8080): http://localhost:8080/examples/HelloWorldExample,
    tomcat reads the web.xml without any problems.
    The problem comes from Apache(port 80), http://localhost:80/examples/HelloWorldExample wouldn't work, only http://localhost:80/examples/servlet/HelloWorldExample works.
    It appears to me that when requests are relayed from Apache to tomcat, you need to tell tomcat that you intend to invoke a servlet by prefixing '/servlet/', if you look in the server.xml, it has
    <RequestInterceptor
    className="org.apache.tomcat.request.InvokerInterceptor"
    debug="0" prefix="/servlet/" />
    I've tried to change this to something else, it didn't seem to make any difference.

  • Order of servlet mapping in web.xml

    Hello,
    is the order of multiple <servlet-mapping> in web.xml important? Or it doesn't matter in which order they are declared?
    For example, if i have two controllers, one is
    <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    and the second:
      <servlet>
        <servlet-name>FrontController</servlet-name>
        <servlet-class>servlets.FrontController</servlet-class>
      </servlet>
    and the mapping are:
       <servlet-mapping>
        <servlet-name>FrontController</servlet-name>
        <url-pattern>/jsf/*</url-pattern>
      </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>where /jsf/ contains jsp pages containing jsf components.
    is the order important?
    And may second question is:
    if i call the jsp page test.jsf in /jsf/test.jsp , which controller is responseble? Faces servlet or Frontcontroller?

    Here is what the 2.4 specification says on the matter (section SRV.11.1):
    >
    The path used for mapping to a servlet is the request URL from the request
    object minus the context path and the path parameters. The URL path mapping rules below are used in order. The first successful match is used with no further matches attempted:
    1. The container will try to find an exact match of the path of the request to the
    path of the servlet. A successful match selects the servlet.
    2. The container will recursively try to match the longest path-prefix. This is done by stepping down the path tree a directory at a time, using the �/� character as a path separator. The longest match determines the servlet selected.
    3. If the last segment in the URL path contains an extension (e.g. .jsp), the servlet container will try to match a servlet that handles requests for the extension. An extension is defined as the part of the last segment after the last �.� character.
    4. If neither of the previous three rules result in a servlet match, the container will attempt to serve content appropriate for the resource requested. If a "default" servlet is defined for the application, it will be used.
    The container must use case-sensitive string comparisons for matching.
    It also notes that in prior versions of the specification these were only a suggestion so if you are on servlet 2.3 or prior, you need to consult the documentation for your container.
    So, to answer your questions, no, order in the descriptor is not important.
    Also, based on the rules above, using your mappings, any URL starting with /jsf will be handled by FrontController including /jsf/test.jsp and /jsf/test.jsf.

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

  • Moving in directory structure through servlet

    Hi everyone,
    I am currently using this directory structure and have 2 web applications "myweb1" and "myweb2".
    /myweb1/jsp pages
    /myweb1/WEB-INF
    /myweb1/WEB-INF/classes
    /myweb1/WEB-INF/classes/myservlet
    /myweb1/WEB-INF/lib
    /myweb2/display.jsp
    /myweb2/WEB-INF
    /myweb2/WEB-INF/classes
    /myweb2/WEB-INF/lib
    I have a servlet named "myservlet" in WEB-INF/classes directory(myweb1 application) as shown above. I have following entries in my web.xml file of "myweb1" webapplication.
    <servlet>
    <servlet-name>myservlet</servlet-name>
    <display-name>myservlet</display-name>
    <servlet-class>com.abc.servlet.myservlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>myservlet</servlet-name>
    <url-pattern>/myservlet</url-pattern>
    </servlet-mapping>
    This whole application is running fine. Now I need to forward user from "myservlet" to "display.jsp" page in myweb2 application.
    I am using this line in "myservlet" file.
    getServletConfig().getServletContext().getRequestDispatcher("../myweb2/display.jsp").forward(request, response);
    however this line is not working. Can anyone suggest me how to access display.jsp file from myservlet.
    Thanks.
    Rahul

    As long as everything is running within the same application server instance, you should be able to access both contexts. The key is using the getContext(String URI) method of the ServletContext. From the servlet in webapp1:RequestDispatchter dispatch =
        getServletContext().getContext("/webapp2").getRequestDispatcher("display.jsp");You may have to fiddle with the value in the getContext call (it should be the application context of webapp2) but you should be able to get this to work.

  • Overriding default jsp servlet mapping

    I want to override the default jsp servlet mapping under a specific directory. I have the following entries in my application's web.xml file:
    <servlet>
    <servlet-name>CMS</servlet-name>
    <jsp-file>/template/main.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>CMS</servlet-name>
    <url-pattern>/raw/*.html</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>CMS</servlet-name>
    <url-pattern>/raw/*.jsp</url-pattern>
    </servlet-mapping>
    When I call up the page /raw/test.jsp, it is processed as a normal jsp page instead of by the custom mapping. Calling up the page /raw/test.html works as expected.
    I am using the embedded server under JDeveloper 10.1.2.1.0.
    Isn't an entry in the application's web.xml file meant to override system wide mappings?
    Thanks for any help.
    Martin

    I'm no expert on this but I have a hunch. 1st of all, your using a servlet mapping for a JSP. That's good and well but it seems that the container is complaining that there is no servlet named org.apache.jsp.jsp.info.ContactUs_jsp. In other words it looks like the JSP has not been compiled. At least not yet. Maybe try two things. Visit the JSP once with a browser at it's actual path "http://localhost:8080/<webapp>/jsp/info/ContactUs.jsp" the coerce a page compile. Then try it with your new mapped path. You see, just telling the container that there is a servlet mapped to the new URL doesn't force the container to generate the class. Something or someone must generate the servlet class file.
    Honestly, I'm not sure of what your end goal is but maybe you might consider using a JSP pre-compiler? Or even better, register a servlet at the mapped path that fowards all requests into the desired folder.
    Cliff

  • A problem with servlet  mapping , using a servlet to produce some chart in

    Hi
    Thank you for reading my post.
    My problem is about using a Chart library which works well in jsf application but it does not works in JSF portlets.
    I think i find the problem but i do not know the solution.
    to use this charting library we should add a servlet to web.xml
    something like :
    <servlet>
    <servlet-name>Jenia internal servlet</servlet-name>
    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Jenia internal servlet</servlet-name>
    <url-pattern>/jenia4faces/*</url-pattern>
    </servlet-mapping>
    so , when we try to load a chart , it will make the chart image source
    something like
    http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png
    in the above sample , adv is the name of web application which is
    deployed in a servlet container.
    and filter applied to make the chart render-able.
    to use the chart library in jsf portlet , i add the servlet
    description as i did for web application , so i add
    <servlet>
    <servlet-name>Jenia internal servlet</servlet-name>
    <servlet-class>org.jenia.faces.util.Servlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Jenia internal servlet</servlet-name>
    <url-pattern>/jenia4faces/*</url-pattern>
    </servlet-mapping>
    to my portlet web.xml file.
    when we have portlet , the url to access that portlet (which indeed is a
    web application) changes
    for example
    url for a sample portlet with same web application name
    will be like
    http:// localhost:28080/pluto/portal/Adv/
    as you can see there are some prefix to web application name in the url
    , but when i use chart component to show
    same chart , it still look for the chart in url like :
    http://localhost:28080/Adv/jenia4faces/chart/OAReport.jspBarChart3d_id0.png
    As you may already sugest , the image will not render because browser is
    looking in wrong place.
    now i
    think if i find some way to map that servlet to correct url
    pattern it will works.
    my question is :
    1-what will be new servlet url pattern ?
    2-is my assumption correct ?
    Thank you very much for reading such a long post

    i wrote an app i.e servlet which would select the data from the database and retrive the data.but i want to send this data to normal java file(which is not a servlet) and i want to display results in the normal java file.
    can any body help this concept........
    send me mail:[email protected]

Maybe you are looking for

  • Can no longer connect to Time Machine as a server

    Have been using an external drive connected to the Time Machine to store my iTunes media files.  All of a sudden, the computers on my home network can no longer access the drive as they now have problems connecting to the Time Machine server.  Howeve

  • HP HSC 950 Printer "Press to Align Cartridges" loop - how do I get it to print?

    Hi, I have a HP HSC 950 All-In-One printer that always returns to the display message "press enter to align print cartridges", even after a complete print alignment is performed and looks fine.   I can't get past this to print anything.   I've wasted

  • Function module to get the payment details for PO

    Hi, Is there any standard function modlue to get the payment details for specific purchase order  or is there any table where we can get the payment details till date. My requirement is purchase order wise how much already paid to vendor  and what is

  • Need Help ASAP. Cannot Transfer Photos

    Hi, I have been able to transfer photos from a SanDisk Extreme IV CompactFlash in a Canon 50D all week, until tonight. I'm using EOS utility to do the transfer. The photos are coming up blank when I try to open them with Preview. It comes up "the fil

  • Muse Anchor Issue -- Is This a Bug?

    When I name an anchor with a period in the name [ essay.anchor ] weird things happen; anchor fails, shifting elements. Is the period a restricted symbol? Anyone else experience this?