JSP:  Include file paths

Hi;
I'm using Tomcat 3.2.
I am trying to use the path "../common/copyright.html" for an include
path. It isn't working.
For some reason it seems you can't "go backwards" with a file path
with Tomcat 3.2/JSP include file paths.
Is there a way around this or does anyone know anything about it?
( I read the specs, they weren't of much help and I couldn't find
much be searching google.)
Thanks in advance
Steve

Try using the full (or absolute) path. If that does not work, then talk to Tomcat developers. If it does, then look at where the JSP pages lies in relation to the path you are trying to use the "../" method on.
Example:
JSP path: www.you.com/jsp/pages/hello.jsp
Include path: ../jsp/pages/open.jsp
This will cause an error becuase the path of the JSP page does not exist within the include path.

Similar Messages

  • Variables defined in JSP include files.

    hi..
    i was wondering how to access the variable defined in a JSP include file from the page where it is included.

    If you are thinking of scriptlets, then you would do it in the same manner that you would access variables local to your jsp. A word of caution - jsp pre-compilation may not work.
    A neater solution would be store it as an attribute in 'page' scope.
    cheers,
    ram.

  • Jsp( %@ include file )

    suppose
    abc.jsp
    <% ! x=4 ; %>
    xyz.jsp
    <%@ include file = "abc.jsp" %>
    < % x=4; %>
    < % System.out.println ' x' =+x %>
    what will happen ?

    sorry zodak,
    i cant close my eyesWell, maybe you could turn off your monitor?
    Anyway, do people misspell my name as an insult? because they can't type? I don't understand. It is 5 letters. (I don't know why it intrigues me but they always switch the a and the o)

  • Reloading a jsp include file

    Lets say I have a container,
    <div id="mindmapcontainer">and within this container, I have a jsp include
    <%@ include file="mindmap.jsp"%>and within the parent page there is a flash map. I have manipulated the css in such a way that this container (and its include file) will not show unless the user clicks on a country (using visibility hidden/visible). I understand that the external file loads on the server side when the parent page loads,despite it being hidden.
    Now the problem is, I'm missing some fancy effects that is shown only when the external jsp first loads. Is there any way I can make it reload onClick?
    I'm using ammap and js-mindmap btw.

    nope using window.location.reload() will reload the entire page.and i dont want that because it will get me back to my flash map screen and not the mindmap screen.thanks for your answer anyway.is there is a way to make it reload a div only or a jsp include?

  • Structure of jsp:include file?

    When using the jsp:include action, what should the format of the included file be, ie, what tags, if any, should exist in the file that is to be included? Should it just be the raw source?
    Further to this, if I want to encapsulate all code for a common function into a file that I'm going to be using in an include call, what if it uses a javascript file - can I include the reference to that in the file too?

    I understand the difference between the 2 options, I'm wondering more about the structure of the file that would be 'included' in either case and how I would specify the inclusion of a javascript (.js) file in the file - should there be html, head, body, etc tags in it or is it raw code?
    My scenario is that we use 'bubble help' in our web app to display tips to the users, so I want to encapsulate all the code for the bubble help in a single file that I will just include on all the pages that need it, hopefully the reference to the Javascript file would be in there as well

  • AFP Logs don't include file path

    Is there a way to get AFP logging to include the path to the files being referenced? Possibly a hidden property in com.apple.AppleFileServer.plist or a 3rd party logging solution?
    Currently, and as it appears even in Snow Leopard Server, AFP only logs the names of the files being accessed, created, and deleted. Since there are numerous files with the same name on most servers, like .DS_Store, the path is required to make the logs really useful.

    On a Leopard Server, com.apple.AppleShareClient.plist already has AFP debugging enabled with the following properties set; afpdebuglevel 6, afpdebugsyslog YES. All thats left is to create a place for the debug records to be dropped.
    Unfortunately this doesn't add any useful information on the server side of things, at least not specific to who opens which Document1.doc.
    It is odd that the standard AFP log doesn't include the file's path. Who wouldn't want to know which .DS_Store was opened or where that 'Untitled Folder' was created?

  • Apex 4 static files names include file path

    Hello,
    I am using Apex 4 with the latest patch.
    When I go into Shared Components and upload Static Files or CSS it is including the full file path as the name of the file when it is uploaded. Apex 3 did not do this, it simply used the file name.
    For example, if I want to upload a file called "mystyles.css" and it is located in "C:\css\app1\work" the file when uploaded will be called: C:\css\app1\work\mystyles.css
    When I want to reference this file in Apex code I need to call it C:\css\app1\work\mystyles.css instead of just mystyles.css.
    Is there a way to make it use only the file name and not the file path?

    Which browser and version are you using?
    If it's IE, check the config for “Include local directory path when uploading files” security settings.
    {message:id=4169405}
    http://blogs.msdn.com/ie/archive/2009/03/20/rtm-platform-changes.aspx

  • Jspf (jsp include file) not recognized

              It looks like weblogic doesn't recognize the jspf extension as belonging to "fragments
              of JSP code that will be incorporated using a static include" as recommended by
              the JSP 1.2 spec. That means that such included files are treated as static text,
              not compiled.
              Does anyone know how to teach wls about this extension?
              Ray
              

              Nothing in the JSP Specification indicates that jspf extensions should be used for
              static includes, it only address the naming convention. I think it's relevant to
              point out that a dynamiclly included jspf-ragment is not a top level page.
              In Tomcat 4.x this is achived by adding a servlet mapping from *.jspf to the jspservlet
              in the default web.xml file.
              Where can I add an extra mapping from *.jspf to whatever *.jsp is mapped to in Weblogic
              6.1sp1?
              Thanks // Torben
              Robert Patrick <[email protected]> wrote:
              >..jspf files are pieces of a jsp and are never inteneded to be translated
              >
              >into a JSP outside the context of another JSP file. Therefore, .jspf
              >files should only be included using static includes (like #include in
              >C/C++). A dynamic include means that the included page is compiled and
              >
              >executed as a stand-alone JSP and its output is included in the output
              >stream of the including JSP.
              >
              >Hope this helps,
              >Robert
              >
              >Ray Schnitzler wrote:
              >
              >> What about dynamic includes? Should I expect them to be treated as jsp?
              >>
              >> "Alex Worden" <[email protected]> wrote:
              >>
              >>>If you statically include any file into a top-level .jsp file, its contents
              >>>will be treated as JSP. That includes .jspf files. So, this is supported
              >>>since WLS5.1 !
              >>>
              >>>Why are you not seeing this behavior I wonder? Static includes are just
              >>>in-lined into the including page and compiled as JSP code....
              >>>
              >>>Can you send me an example that doesn't work for you?
              >>>
              >>>Thanks,
              >>>
              >>>Alex
              >>>
              >>>
              >>><[email protected]> wrote in message news:[email protected]...
              >>>
              >>>>WLS 6.x supports the JSP 1.1 spec. ( see below). For JSP 1.2 see WLS
              >>>>
              >>>7.x
              >>>see
              >>>
              >>>>below) . The JSP 1.2 final release is very new and I am sure keeping
              >>>>
              >>>up
              >>>with the
              >>>
              >>>>constantly evolving space is difficult for any product.
              >>>>--------------------
              >>>>
              >>>>http://e-docs.bea.com/wls/docs61/jsp/intro.html
              >>>>http://e-docs.bea.com/wls/docs70/jsp/intro.html#49347
              >>>>---------------------------
              >>>>"Ray Schnitzler" <[email protected]> wrote:
              >>>>
              >>>>>It looks like weblogic doesn't recognize the jspf extension as belonging
              >>>>>to "fragments
              >>>>>of JSP code that will be incorporated using a static include" as
              >>>>>
              >>>recommended
              >>>
              >>>>>by
              >>>>>the JSP 1.2 spec. That means that such included files are treated
              >>>>>
              >>>as
              >>>
              >>>>>static text,
              >>>>>not compiled.
              >>>>>
              >>>>>Does anyone know how to teach wls about this extension?
              >>>>>
              >>>>>Ray
              >>>>>
              >>>>>
              >>>
              >>
              >
              

  • Change include file paths

    change include file paths

    Hi Palm566,
    Thank you for posting in MSDN forum.
    About you issue, could you please tell me more detail message about your issue?
    For example, where did you want to change the file path?
    What file you want to change the path?
    To further help you solve this issue, I suggest you can share more message about your issue.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How To Access JSP Image file Path inside JavaBean Class

    In my Webapplication,i have jsp and javabeans files. i need to send one image file path contains in Image folder to JavaBean[MyBean.java].
    From MyBean i am trying to display that image using PdfGen Application[JAR] in a new PDF Document.
    The Web Application Structure is as
    MyWebApp
    Image
    \ mypic.gif
    JSP
    \myjsp.jsp
    WEB-INF
    classes
    \pack.MyBean.java
    My Question :
    Inside the webapplication[JSP] the image file is accessed as a URL.(like http://localhost:7001/mywebapp/Image/mypic.gif). but From JavaBean: How To access this file? becz inside javabean it needs a complete system path..How to solve this problem? plz send me any solutions related to my problem....Thank U.

    Dear Madruguinha!
    Thank you very much for your tips.
    but i find another one method for accessing the image.
    // Inside Servlet or JSP
    String realPath=getServletContext().getRealPath("Image"+"/pic1.gif");
    Now we can send this exact system path variable to any java beans or java class that needs the image path as "drivename:\foldername\filename" like "c:\myflolder\mypic.gif" and not web context path.

  • How to include file path in footer

    I need to add file paths to a pdf I have created.  Does anyone know how?  I know that there are JavaScript ways, but I am not even sure what a Java Script is.
    Thanks for any insight!

    If you do not know how to use JavaScript, there is this option: Custom-made Adobe Scripts: Acrobat/Reader -- Advanced Add Header/Footer Text (but it's not free).

  • Sometime dreamweaver updates included file path somtime not

    Hi,
    I use server side include file in Dreamweaver. Sometimes I
    move the included file to another folder, dreamweaver updates all
    the links that use that file. But sometime not.
    I need to know why sometimes not, and why dreamweaver updates
    just some link but not all the links.

    RunRunforest posted in macromedia.dreamweaver:
    > Hi,
    Howdy,
    > I use server side include file in Dreamweaver. Sometimes
    I move
    > the included file to another folder, dreamweaver updates
    all the
    > links that use that file. But sometime not.
    >
    > I need to know why sometimes not, and why dreamweaver
    updates
    > just some link but not all the links.
    I have no answer (nor have I seen this symptom), but have a
    suggestion
    that may/may not help.
    You might try rebuilding the site cache prior to moving the
    file(s).
    Also, are any of these links embedded in JavaScript? I don't
    know
    whether DW updates those links or not - just a wild guess.
    Mark A. Boyd
    Keep-On-Learnin' :)

  • Tomcat Vs Weblogic .. jsp/html file path issue..

    Tomcat gurus, please help !!!
    Development Env. :
    OS: Window NT 4.0 SP6
    Web Server: Tomcat 4.1.12
    Sun JDK 1.3.1
    IDE : Eclipse 2.1
    Deployment/Testing/Prod Env:
    OS: Sun Solaris 2.8
    Web Server: Weblogic 5.1 SP 12
    Sun JDK 1.3.1 IDE : N/A
    Confession: New to Tomcat world.
    Note: Reason why I'm using Tomcat for development though I can use Weblogic, Eclipse IDE with Tomcat plugin provides debuging functionality, thus the problem. I have an enterprise application being built and kind of stepped into a problem. I have a Servlet that marshals all the calls and process them through java beans ( about 50+ ) and content displayed through JSPs.
    Here is the directory structure,
    /AppContext
    | +- src
    | +- com.xyz.wfservices
    +- jsp
    main.jsp
    +- WEB-INF
    |
    + classes
    + com.xyz.wfservices ( compiled classes )
    For Weblogic: It has 2 parameters to specify where the compiled code is and where the docs are,
    => weblogic.httpd.servlet.classpath=c:/wfservices/WEB-INF/classes
    => weblogic.httpd.documentRoot= c:/wfservices/src/html
    and to register instance,
    weblogic.httpd.register.WfServices=com.xyz.wfservices.WfSvcsController
    weblogic.httpd.initArgs.WfServices=\
         main.properties=c:/wfservices/src/properties/wfservices.properties
    But, I looked at Tomcat it is quite different.. it has <Context path="/wfs" docBase="L:\app_services\wfservices" workDir="L:\app_services\wfservices\work" /> Servlet def in web.xml
    <servlet>
    <servlet-name>WfServices</servlet-name>
    <servlet-class>com.xyz.wfservices.WfSvcsController</servlet-class>
    <init-param>
    <param-name>main.properties</param-name>
    <param-value>c:\wfservices\properties\config.properties</param-value>
    </init-param>
         <servlet-mapping>
              <servlet-name>WfServices</servlet-name>
              <url-pattern>/WfServices</url-pattern>
         </servlet-mapping>
    </servlet>
    Probem: Accessing JSP/Html ... documents. weblogic accessing / calling jsp ..
         rd = req.getRequestDispatcher("/main.jsp");      //req is HttpRequest
         if (rd != null)
              rd.forward(req, resp);
    The same does not work under Tomcat because it can find files relative to the context, thus it fails. I have to change the code like below to make it work.
         rd = req.getRequestDispatcher("/src/jsp/main.jsp");
         if (rd != null)
              rd.forward(req, resp);
    It is a nightmare now to maintain two different environments and more over changing all the references and and its internal references is not feasible. The question is, is there a way to configure docBase in tomcat so that I won't need a code change.
    Any help or inputs are greatly appreciated.
    Thanks
    Meher

    I ran into this same problem before, so I created a utility class that would map out a URI or URL given a relative path. It's nice because it will detect and include non-standard ports for both the HTTP and HTTPS protocols. If you access a servlet/jsp using HTTP, it will return a URL for the HTTP protocol and the same for HTTPS. So, that means you don't need any code changes to access things through HTTP or HTTPS :) Here it is, hope it helps you out:
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ContextMapper
        private static final int HTTP_PORT = 80;
        private static final int HTTPS_PORT = 443;
         * This method will return a URI to access a resource given its relative
         * path.  Please note that the relative path should start in the directory
         * where the web application is deployed to.
         * @param HttpServletRequest request
         * @param HttpServletResponse response
         * @param String relativePath
         * @return String
        public static String getUri (HttpServletRequest request, HttpServletResponse response, String relativePath)
            return request.getContextPath() + relativePath;
         * This method will return a URL to access a resource given its relative
         * path.  Please note that the relative path should start in the directory
         * where the web application is deployed to.  Also, the protocol will be
         * automatically detected from the request.  Supported protocols include
         * HTTP and HTTPS.  For all other protocols, the relative path will be
         * returned unmodified.
         * @param HttpServletRequest request
         * @param HttpServletResponse response
         * @param String relativePath
         * @return String
        public static String getUrl (HttpServletRequest request, HttpServletResponse response, String relativePath)
            if (request.getProtocol().startsWith("HTTP/") == true)
                switch (request.getServerPort())
                    case HTTP_PORT:
                        return "http://" + request.getServerName() + request.getContextPath() + relativePath;
                    default:
                        return "http://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + relativePath;
            else if (request.getProtocol().startsWith("HTTPS/") == true)
                switch (request.getServerPort())
                    case HTTPS_PORT:
                        return "https://" + request.getServerName() + request.getContextPath() + relativePath;
                    default:
                        return "https://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + relativePath;
            else
                return relativePath;
    }Here are a few examples of using this class:
    String uri = ContextMapper.getUri(request, response, "/css/basic.css");
    String url = ContextMapper.getUrl(request, response, "/css/basic.css");
    String uri = ContextMapper.getUri(request, response, "/images/image.gif");
    String url = ContextMapper.getUrl(request, response, "/images/image.gif");
    String uri = ContextMapper.getUri(request, response, "/jsp/HelloWorld.jsp");
    String url = ContextMapper.getUrl(request, response, "/jsp/HelloWorld.jsp");
    String uri = ContextMapper.getUri(request, response, "/servlet/HelloWorld");
    String url = ContextMapper.getUrl(request, response, "/servlet/HelloWorld");

  • Jsp taglibs in include files not detected, throws errors, no code insight

    I have a jsp which is included in all the other jsp. it looks something like this
    taglibs.jsp
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    test.jsp
    <%@ include file="/jsp/menu/taglibs.jsp"%>
    <html>
         <head>
              <title>Tours</title>
         </head>
         <body>
    <form:form commandName="testCommand">
                   <form:hidden path="tour.firstname" id="tour.firstname" />
    and so on.
    I am having 2 problems
    1. the jsp editor show errors all over the place saying
    element path not expected
    element commandName not expected etc.
    2. no code insights.
    but if i include the taglib def in test.jsp it dosn't show any error and also provides code insights. but seldom do people include all taglibs in all jsps.
    is there a way for Jdeveloper to show code insights in jsp pages which includes a jsp or like xml schemas could be added at some place(tools-pref-xml schemas) and when used anywhere, would provide code insights.

    am not sure, try with this
    <jsp:include   .../>

  • JSP tag spanning @include files

    Weblogic 5.1 sp 9
              Windows 2000
              inc1.inc:
              <x:customtag>
              inc2.inc:
              </x:customtag>
              body.jsp:
              <%@ include file='inc1.inc' %>
              ...[body stuff here] ...
              <%@ include file='inc2.inc' %>
              hitting this page gives:
              java.lang.RuntimeException: Could not parse embedded JSP code:
              weblogic.utils.ParsingException: Could not complete parsing, unmatched tags:
              customtag
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1079)
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1057)
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1050)
              Why is this not valid? Other JSP engines allow this. Doesn't the @include
              directive just pull in code at .java source generation time?
              Thanks,
              j
              

    This does look like a bug. I have tried it too with SP6. Contact support with
              the same problem. [email protected]
              Shiva.
              Jason Collins wrote:
              > Weblogic 5.1 sp 9
              > Windows 2000
              >
              > inc1.inc:
              > <x:customtag>
              >
              > inc2.inc:
              > </x:customtag>
              >
              > body.jsp:
              > <%@ include file='inc1.inc' %>
              > ...[body stuff here] ...
              > <%@ include file='inc2.inc' %>
              >
              > hitting this page gives:
              >
              > java.lang.RuntimeException: Could not parse embedded JSP code:
              > weblogic.utils.ParsingException: Could not complete parsing, unmatched tags:
              > customtag
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1079)
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1057)
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1050)
              > ...
              >
              > Why is this not valid? Other JSP engines allow this. Doesn't the @include
              > directive just pull in code at .java source generation time?
              >
              > Thanks,
              > j
              

Maybe you are looking for