Finding filename of an include

Hello,
I've got a jsp that has an include. I would like to be able to get the name of the outer jsp and the name of the includes. How can I do this. I've got the sampledebug.jsp like this:
<%
System.out.println("session:" session.getId() "page:" + this.getServletName() + ":Start");
%>
<%@ include file="sampledebug2.jsp" %>
<%
System.out.println("session:" session.getId() "page:" + this.getServletName() + ":End");
%>
But if I put the same statements in sampledebug2.jsp it still sends me the name of sampledebug.jsp. Please help, I'm sure I'm missing something obvious

It is working exactly as intended.
A <%@ include> effectively copies and pastes the jsp code from sampledebug2 into your main jsp.
It then compiles the sampledebug.jsp as if the code was on its own page.
So if you are using <%@ include %> you can't tell which file it was from dynamically at runtime. You would have to hardcode something into the included file.
By contrast a <jsp:include> would invoke the page seperately, and include the result of running that page into the result of running the outer one, which is what you seem to be intending.
So the behaviour is explained by the difference between the static include <%@ include %> , and the dynamic inclue <jsp:include>

Similar Messages

  • How to find out  number of includes for a given program dynamically

    Hi all
    I have a requirement in which, I have to find out  number of includes and their names for a given  user defined program dynamically
    if u know the answer pls let me know
    Thanks in advance
    Devi

    Hi rama,
    1. use this FM - RS_GET_ALL_INCLUDES_FOR_PRTAB
    regards,
    amit m .

  • How to find payroll results using includes

    hi all,
          I have a requirement to get the payroll results of number of data clusters using includes not by using function modules.
    I know by using function modules.
          How to find out the exact include for given data cluster. If there is any path please let me know.
    thanks & regards,
        sekhar.

    Hi,
    You can define macros in the program and call depending on the cluster you need.
    For Eg  for B2 cluster,
    rp-imp-c2-b2.
    before calling macros,
    You should fill the key
    move pernr  to b2-key-pernr.
      move year         to b2-key-pabrj.
      move period       to b2-key-pabrp.
      move '1'          to b2-key-cltyp.
    rp-imp-c2-b2.
    For payroll
    RP-IMP-C2-RU
    Regards,
    Manoj.

  • Converting an include filename prior to including

    Hi,
    I have several include files that have the .shtml extension
    in the filename. The .shtml files, however, only contain simple
    html. I need to use the shtml file extension because of a
    requirement from my host. Long story.
    Anyway, I use the following entry for the include in my
    news.php file: <?php include('franchise_header.shtml'); ?>
    When the news.php file is uploaded to the server and
    processed, php finds the ***.shtml file and wants to process it as
    a SSI file. Once that happens, I get errors. What I need to achieve
    is to get php to see the file as 'franchise_header.txt'. Once the
    includes have the .txt file extension everything works fine since
    php see the txt extension and drops the html into the area I need
    it without further processing. But I don't want to physically
    change the file names on the includes.
    ***Question: Is there a way, through php, to take the .shtml
    file extension and convert it to .txt dynamically and then run the
    include command after that?
    thanks!!! I couldn't find any information via web
    research.

    Server-side includes require at least two files -
    1. The parent file - the one that calls the include.
    2. The include file - the one being included.
    The parent file MUST be named with an extension that triggers
    a server
    parse. If the include is an ordinary HTML include, that
    extension can be
    *.shtm(l), or *.asp, or, if your host has enabled server
    parsing for all
    file extensions, then it doesn't matter what you name it.
    The include file has no naming restriction - you could name
    it
    'foo.monkeybutt' if you wanted, and it would still work.
    Now that we have that out of the way, does this mean that
    your host wants
    you to name the include file with this extension?
    > I need to use the shtml
    > file extension because of a requirement from my host.
    If so, the host is a moron. Otherwise, I am sure you have
    misinterpreted
    the host's requirements.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "proxyfilter" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi,
    >
    > I have several include files that have the .shtml
    extension in the
    > filename.
    > The .shtml files, however, only contain simple html. I
    need to use the
    > shtml
    > file extension because of a requirement from my host.
    Long story.
    >
    > Anyway, I use the following entry for the include in my
    news.php file:
    > <?php
    > include('franchise_header.shtml'); ?>
    >
    > When the news.php file is uploaded to the server and
    processed, php finds
    > the
    > ***.shtml file and wants to process it as a SSI file.
    Once that happens,
    > I get
    > errors. What I need to achieve is to get php to see the
    file as
    > 'franchise_header.txt'. Once the includes have the .txt
    file extension
    > everything works fine since php see the txt extension
    and drops the html
    > into
    > the area I need it without further processing. But I
    don't want to
    > physically
    > change the file names on the includes.
    >
    > ***Question: Is there a way, through php, to take the
    .shtml file
    > extension
    > and convert it to .txt dynamically and then run the
    include command after
    > that?
    >
    > thanks!!! I couldn't find any information via web
    research.
    >

  • Is there a way to find what projects are included into aproject through

    Greetings All,
    I've been wondering if there is a way to find out what projects have a
    "Project" included? I would think that there is some undocumented TOOL code
    that does this or a undocumented fscript command that does it. Does anybody
    know about this or a way to find this out?
    Thanks!!
    Michael J Schumacher
    Systems Analyst
    Carlson Hospitality Worldwide - Reservation Center
    Phone: 402.491.6195
    Fax: 402.498.9166
    Email: michael.schumachercarlson.com

    No.

  • Help in finding out error in include ---se37

    Hello everyone,
    This is regarding the include in the function module .
    Where we define constants , i have to define like this
    If plant EQ 'ita' OR plant EQ 'del' OR plant EQ 'net' .
            c_form LIKE itcta-tdform VALUE 'form1' .
            ELSE .
            c_form LIKE itcta-tdform VALUE 'form2' .
            ENDIF .
    The error that i get while activating is "unable to interpret PLANT -possible causes -incorrect spelling or comma error".
    I am not able to find out where i am going wrong .
    Can anyone help me find out the error or where and what i missed out .
    Any help will be appreciated .
    Thanks
    Sumit

    Hi,
    U have not defined the varibale PLANt.
    Defin ethe same in   Tcode = SE37
    Give the function module name and clcik on change.
    Use menu GOTO----
    >GLOBAL DATA.  define the plant here as below.
    data: plant type werks.
    Regards,
    Pravin

  • How to find a BMP file included with Applicatio​n in LabView?

    I have a VI that I would like to build into an application (.EXE).  The VI has a Picture indicator, whose source is a BMP on my local hard drive.  Using "Read BMP File.vi" and a Path constant, it's relatively easy to read the BMP and display it in the indicator.  I know how to include the file with the distribution (Build App or DLL -> Installer Settings -> Files), but how does one determine the location of the file after users install the EXE? I tried using just the filename of the picture in the path constant, hoping it would look in it's current directory, but I received an error.  With the full path in the path constant, everything works just fine.
    Thank you,
    ...jerry

    You can reconstruct the path. Use the "Current VI's path" to get the
    path of the caller VI. Then use the "Build path" and Strip path" to
    build the path to your file.
    Note that in an executable, the VIs path includes the executable, like
    the following:  C:\directory_name\my_exec.exe\main.vi
    The attached code (image) should do it (or at least give you a start).
    Regards;
    Enrique
    www.vartortech.com
    Attachments:
    path_to_file.gif ‏2 KB

  • How can I open my file after 'cannot find -filename-' error message?

    OK, the bottom line is, InDesign crashes and I cannot recover my file. I get a 'Cannot find file' error message when I try to open the file.
    I am using CS6 on a MacBookAir, OS X Yosemite.
    I have tried finding the 'InDesignFileRecovery' folder, I cannot find it anywhere, it's not in my Library or Caches folder.
    However, I do work in dropbox, so I just headed over to dropbox to recover from their 'previous versions'. It starts to get weird. There are lots of previous versions (I save very regularly) but when I download a previous version (that I know was fine) it downloads with a indd.txt extension. So I remove the txt extension and keep the indd and everything looks fine, but then that recovered file gives the same message. I tried renaming the recovered file and opening that, same 'cannot find file' error message.
    I can open InDesign and open the file from the day before, but none of the dropbox earlier versions of that day's work. I am SO sick of this happening. It happened to me last week to, so far I have lost 20 hours work :-(
    I have tried quitting InDesign and restarting the Mac, doesn't help. The only thing I can think of is to 'save as' every couple of hours, at least then hopefully I only lose 2 hours work.

    Thanks, when you say 'hidden by default' then how does one find it? I have already tried the path you mention and there is no sign of a cache folder with Adobe files. Spotlight doesn't reveal anything either.

  • IPhoto 08: why Finder search does not include pictures in `iPhoto Library`?

    If I try and search with Finder for all the images in my HD, there is apparently no way to make it show the pictures contained in the iPhoto Library directory...why?
    Of course, if I start search INSIDE the iPhoto Library it will show them.......
    It seems like the iPhoto Library directory is somehow 'different' and kept hidden, forcing you to use iPhoto directly.
    Any hint on this and possibile workaround in finder?
    thank you
    Panoma

    Just got my new MacPro a week ago and had not yet launched iPhoto 08, so I just now did that, authorized it to update the iPhoto stuff already in my account, then dinked around with some things. Changed one photo, deleted some stuff, and so on. Then quit the program. I just did a Spotlight seach on the photo I had altered and it showed up just fine. A command click on the title in the Spotlight results opened up the folder the photo is now in:
    "/Users/francine/Pictures/iPhoto Library/Modified/2007/Pine Lake Resort/titlePLRF_2.psd"
    Must admit I was a bit startled by the fact that the iPhoto Library is no longer showing as a folder. Nonetheless its contents do seem to be updated--I imported two photos from an external drive, and they immediately showed up in Spotlight as being in the iPhoto Library.
    So the only thing I can suggest is that you try to get Spotlight to re-index your iPhoto Library. You do this by opening the Spotlight pane in System Preferences. Make sure there is a check mark in front of Images, the click the Privacy tab and add your iPhoto Library to the list, you can just drag and drop it into the list. Wait a minute, then select it in the Privacy list and click the minus button to remove it. Spotlight should start re-indexing it.
    Francine
    Francine
    Schwieder

  • Finder filenames represent adjacent file - whats happening

    New tech problem for me:
    In either of the vertical stacked file listing (list and columns view) finder is mis-representing the file by showing the icon with the name to the adjacent file. It is also occasionally naming the adjacent file by the same name.
    So for instance I could either have "myfile_1" next to "myfile_2" (when their names are swapped);
    or
    myfile listed twice (representing 2 files), 'myfile' just above 'myfile'.
    Another trick is that their names could be reversed. When unzipping an audio plug-in file, I find that one will have a zipped icon and the other unzipped. And when I move what I think is the unzipped one into the Library/Audio/Sounds/Banks, the name revert to what they should be. . . but only after about 30 seconds.
    For normal files, clicking on the name causes it to adjust, but only the clicked on file, not both that file and the misindicated one.
    The other would have to be clicked on to fix it. And I could click my way up the list and watch the name above the clicked file get messed up. . . until I click it and so on it goes to the top of the listing.
    Thanks for your help.

    For what it's worth,
    In hindsight, my suspicion is that the monitor refresher was lagging, owing to a background running process, that when ended hours later, the symptoms went away. Pretty extreme effect on what I was looking at in any case, since nothing else seemed to be lagging.
    If anyone knows something about my original question, please chime in. But I'm going to mark this as answered and forget about it.
    I get paranoid about spyware.

  • Finding all photos that include a particular person whether their face appears or not

    Faces is a great way to locate all photos where someone's face appears.  But what about photos that the person is in, but their face is not (e.g., the photo was taken from behind the person)?  What's the best way to tag photos so that I'll be able to have all photos that contain Person X together, whether their face is in the photo or not?  (Note: I know I could use Faces to add a face to the back of someone's head - that would get that picture to appear in Faces for that person, but would likely mess up the face recognition for that person).
    My current thought is to use keywords to tag those photos with the names of people who appear in photos without their face showing.  I could then create a Smart Album that includes all photos that contain a Face or Keyword for Person X.  Is there a better way to accomplish this?

    (Note: I know I could use Faces to add a face to the back of someone's head - that would get that picture to appear in Faces for that person, but would likely mess up the face recognition for that person).
    That will not mess up the face recognition. iPhoto will only use the faces that have been automatically found by iPhoto to learn the parameters for the recognition of the person. So you can include any part of the person to get the photot in the Faces stack on the cork board.
    My current thought is to use keywords to tag those photos with the names of people who appear in photos without their face showing.  I could then create a Smart Album that includes all photos that contain a Face or Keyword for Person X.  Is there a better way to accomplish this?
    That is fine, but does not give you access by using the Faces view.

  • Finding filenames in a specefik directory

    Hi There
    I would like to find all files in a specifik windows directory, an I would like to sort them on the base of the timestamp in the "Modified" colom in the windows Explorer.
    Can this be done and if so them how?
    Whit my debest respect to all
    Regards
    Tolstrup

    Member xraynaud has the right idea however I believe he meant to use the File class's lastModified method. In any event his implementation (subtracting the two longs) looses precision and will subsequently not return a properly sorted array. See attached sample working code that also uses a FileFilter to only return files (excluding directories) from the specified directory.
    import java.io.*;
    import java.util.*;
    public class SortByDate
    public static void main(String args[])
      File[] files = new File("c:/").listFiles(new FileFilter() {
       public boolean accept(File pathname) {
        return !pathname.isDirectory();
      Arrays.sort(files, new Comparator() {
       public int compare(Object obj1, Object obj2) {
        long l1 = ((File) obj1).lastModified();
        long l2 = ((File) obj2).lastModified();
        return l1 > l2 ? 1 : (l1 < l2 ? -1 : 0);
      for (int i = 0; i < files.length; i++)
       System.out.println(files[i] + "\t" + new Date(files.lastModified()));

  • Airport utility can't find Apple wireless devices including Time Machine

    I have a comcast high speed internet modem that is working, connected by Ethernet to a Time Machine. The Time Machine was working fine until this morning when I tried to reconnect to the internet wirelessly on my PowerBook G4. The Time Machine network wanted a WPA password but wouldn't accept the current password. I then tried to set up Time Capsule in the Time Machine dialog box, but it invoked the airport utility which says it can't find any Apple wireless devices. My Time Machine is now blinking amber at me, and I have tried unplugging, resetting, etc. I am on the internet via hardwire Ethernet connect through the Time Machine to the modem, but cannot get Time Machine to show green and cannot see any wireless devices in airport utility. Any suggestions, please?

    set the TC to N+B/G do that using airport Utility. once done power off modem and the router. power on modem first then the router.

  • Finder stuck, can't find all desktop files including HD and eternal drives

    Just installed the new Leopard. When I turn the computer on it brings the screen up minus all desktop files. Can't find any icon for Stack. I can access email and Safari (internet) but my Firefox won't work.
    I tried putting in the Leoaprd installation disk again but with Finder spinning nothing happens. I can find some new icons in the dock (Downloads, Documents and Time Machine).
    I have a backup copy of my files on an external drive but without Finder I can't access them.
    Any suggestions?
    Max

    I'm having the same problem except I have access to everything for 30 seconds, then everything disappears except the new background image. Nothing I click seems to change anything. I've wiped the drive with an archive and install to see if that fixes the issue.

  • Cant find tag libraries from included pages

    Hello,
    I have many jsp pages that reference a "header" jsp page. This "header" includes all the taglibs I want to use on every page.
    How can I get workshop to notice them on the pages that include the header file, not just the header files themselves?
    I am attaching screenshots of my environment so you can see the issue:
    Tags found:
    http://img173.imageshack.us/img173/4954/tagsfound3bw.gif
    Tags not found:
    http://img340.imageshack.us/img340/1452/tagsnotfound5nc.gif

    I don't know what I did but this issue has resolved itself somehow :(

Maybe you are looking for