Dynamic  include file question

I need to use dynamically generated file names in my <%@ include file="" %> directive.
I am using objects (such as database connection) in the files included which I created in my base JSP file. For this reason, I cannot use the jsp:include tag (since these objects are not defined in these files, the servlet doesn't compile).
Are there any ways of using these dynamic names in this directive?

If you are dymically generating the file, then store it in a string and then include it?
String dynamicallyGeneratedFileName = (however you are generating the file name);
<%@ include file="<%=dynamicallyGeneratedFileName%>" %>

Similar Messages

  • Dynamic include file?

    In my application we are using an include. I want to choose which include file to use automatically. For example, I know a variable is pagelang = "english". So I want to display:
    <%@ include file="includes/english.jsp"%>
    Sometimes the variable is chinese, japanese, etc. I was wondering if I can do something like:
    <%@ include file="includes/" & lang & ".jsp"%>
    This dies every time, but is there a way to do this properly?
    Thanks in advance.

    <%
      String includePage = new String();
      //control flow statements go over here.
      //assign appropriate values to the variable
      RequestDispatcher dispatcher = request.getRequestDispatcher(inlcudePage) ;
      dispatcher.include(request, response);
    %>

  • Dynamic include file in JSP page

    <span class="value">Hi
    i have index.jsp , this page can include jsp
    pages dynamically by passing the name of the page to be included to the
    index page with out .jsp , so if i want to include page "code.jsp" i
    put: .../index.jsp?page=code , this have to include code.jsp page
    i made the following code , but it did not find the file
    so can any one help plz ?
            String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    File f=new File(request.getParameter("page")+".jsp");
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
            <%
                    }else{
                            out.print("file not exist");
         

    What does the file existing or not really have to do with it?
    You can try it like this:
    String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    String webPath = pg + " .jsp";
                    String realPath = request.getRealPath(webPath);
                    File f=new File(realPath);
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%= webPath %>" />
            <%
                    }else{
                            out.print("file not exist");
            }Alternatively you could try using a request dispatcher:
    RequestDispatcher rd = request.getRequestDispatcher(webPath);
    if (rd == null){
      // doesn't exist
    }

  • Include the file dynamicly by file name

    in my jsp,I want include another jsp dynamicly
    <%@ include file="thefile.jsp" %>
    thefile.jsp should be dynamic like:
    <%=String filename=="thefile.jsp" %>
    <%@ include file=filename%>
    I know above is not working since file only take static name.
    is there any way to include the file dynamicly by file name?

    String path = "..."; // to the ressource to include
    javax.servlet.RequestDispatcher dispatcher
              = getServletContext().getRequestDispatcher(path);
    dispatcher.include(request,response);

  • INCLUDE File Concept Questions

    Hello All!
    I am extremely new to ABAP development; most of my experience is in Windows Programming.
    While building a Local Class Hierarchy in an INCLUDE file, I ran into a few "quirks". Hopefully, answers to these questions will help me understand the inter-op between REPORT files and INCLUDE Files much better as well.
    **NOTE** I have searched through SAP Library, this forum (admittedly, I may have missed older threads) and Googled each topic for each of these issues and not found information that satisfactorily answered my questions. I'm hoping the experts here may shed some light on my questions.
    My questions are in regard to the linking between a REPORT and an INCLUDE file. When I created the INCLUDE file, I started a new instance of SE38 and went through the option dialogs to establish the file as an INCLUDE. Then, UML in hand, I started coding. Since I am new to ABAP, I run Syntax checks regularly (Finally getting used to those periods!!!). Not suprisingly, I couldn't run a Syntax check on the include. I decided to start another instance of SE38 and open the REPORT file this INCLUDE is being built for (initially). I added the INCLUDE statement and ran a Syntax Check, Success! Ever since that point however, the quirks have been appearing.
    For instance, I would like to define Text Elements local to the include file; however, when I bring up the Text Elements Screen (from the INCLUDE file), the Text Elements from the REPORT are loaded in. Is it possible to define Text Elements Local to an INCLUDE file? If not, are INCLUDE files really intended to be used by multiple REPORTs? It would seem not since it looks to be tightly coupled to the REPORT I have it included in; # this could lead to naming conflicts with Text Elements as well #.
    I think I may have thought of a reason for the other quirk, but would like to run it by you all to see if I am on the mark. When I have the INCLUDE file open and attempt to activate it, if a syntax error is in the active version of the report due to the include file (i.e. Tables declared more then once), it will warn me before activating. I believe this is due to the fact that SAP will try make sure existing applications will not be harmed by changes to an include file. If this is true, then INCLUDE files must be fairly closely coupled with each REPORT they are included in. Is this correct?
    Thank you for your time and consideration.
    I look forward to the day I know enough to begin helping each of you as well.
    Steven Coolbaugh
    Edited by: Steven Coolbaugh on Jan 20, 2009 6:21 PM - Clarifying a Thought - # Delimited.

    Hi
    U should considere the INCLUDE is just like a box can be inserted in a program (REPORT), the include can't exist without a report (the main program).
    The include can be used to arrange the program: several thounsends of abap code lines can be in a program, if you split them in several includes, it'll be easier to read and manage the program.
    It can group components of the same type (for example the data declaration, the routine definitions,....) into the same include, in this way it'll be easier to manage the program for the maintenaces in the future.
    An include can be used by different programs, so if u need to use certain definations for many program, u can insert them in a include once and then call the include in all program u need: in this way if you update that include you'll update all program using that include.
    So you'll need to insert the corrections in the include just once instead of to repeate it for every program.
    Anyway all text elements used in include belongs to main program, not to the include, so u need to define it again for every program.
    Max

  • Include directive with dynamic attribute file

    Hello, currently I'm wrestling with the following problem. I want to include a certain file in a JSP and I'm receiving the filename to be included from the request as a parameter.
    This is my code so far.
    <%-- Include dynamical path settings --%>
    <% java.lang.String envJsp=request.getParameter("envJsp");%>
    <%@ include file="<%=envJsp%>" %>
    <%-- End Include dynamical path settings --%>
    This results in the following error:
    org.apache.jasper.JasperException: Bad file argument to include
         java.lang.Throwable(java.lang.String)
         java.lang.Exception(java.lang.String)
         javax.servlet.ServletException(java.lang.String)
         org.apache.jasper.JasperException(java.lang.String)
         void org.apache.jasper.compiler.JspParseEventListener.handleDirective(java.lang.String, org.apache.jasper.compiler.Mark, org.apache.jasper.compiler.Mark, java.util.Hashtable)
         void org.apache.jasper.compiler.DelegatingListener.handleDirective(java.lang.String, org.apache.jasper.compiler.Mark, org.apache.jasper.compiler.Mark, java.util.Hashtable)
         boolean org.apache.jasper.compiler.Parser$Directive.accept(org.apache.jasper.compiler.ParseEventListener, org.apache.jasper.compiler.JspReader, org.apache.jasper.compiler.Parser)
         void org.apache.jasper.compiler.Parser.parse(java.lang.String, java.lang.Class [])
         void org.apache.jasper.compiler.Parser.parse(java.lang.String)
         void org.apache.jasper.compiler.Parser.parse()
         boolean org.apache.jasper.compiler.Compiler.compile()
    Has anyone experience with this, or isn't it possible at all perhaps???
    All suggestions are more than welcome.
    Greetings, Johan

    try with requestDispatcher, e.g.
    RequestDispatcher requestDispatcher = request().getRequestDispatcher( request.getParameter("envJsp" );
    requestDispatcher.include(request,response);

  • How to dynamically include jsp files using jsf el in include tag ?

    Hi,
    I'm trying to get the jsp file name from my backing bean to use it in an include tag but I can't make it work
    When using this piece of code I can get the generated path
             <h:outputText value="/_partial/#{myBean.jspName}.jsp"/>whereas in this code the jsf el is not replaced by this value.
            <%@ include file="/_partial/#{myBean.jspName}.jsp" %> Have you any idea of how to solve this ? I'm currently developing for J2EE 1.4 platform.     
    Thanks for your help,
    Regards.

    If you're using JSF 1.2 and JSTL 1.2 at a JSP 2.1 environment, then you can just use <jsp:include> with unified EL.
    If you're using JSF 1.1, then you may find this article useful [http://balusc.blogspot.com/2007/01/dynamic-jsf-subviews.html]

  • How can I do a dynamic include of a page fragment?

    I have a technical support website with a lot of simple html pages. What I want to do is hyperlink from the index page to another page, which would display these html pages as a page fragment, dynamically based on a session bean set by the hyperlink.
    I basically want to do this, if it was possible:
    <jsp:directive.include file="#{SessionBean1.pageToDisplay}"/>
    Now the FAQ's has a topic "How can I do a dynamic include of a page fragment?", which would seem to answer my question.
    But this is all it says, and it makes no sense to me. Could someone please translate? :)
    "Using a page fragment file (but using instead of the usual Creator approach) will accomplish a dynamic include."

    Here is 1 solution:
    First add this to the jsp:root tag:
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    Then surround the page fragment directive with something like this:
                            <div style="position: absolute; left: 24px; top: 408px">
                                <c:if test="${SessionBean1.count > 0}">
                                    <jsp:directive.include file="testPF.jspf"/>
                                </c:if>
                            </div>

  • ASP Include File issue

    I have been trying to use a form as an include file.
    I created the file as a separate asp page, and then tried to
    add it as an
    include, the page fails when I try in on my testing server.
    If I create the
    form within the page I get no problems!!
    Also when the page displays in the design view I get the
    </Head> tag showing
    within the include file of the page.
    Anyone any suggestions to fixing these issues.
    Thanks
    Lez

    The way to think of it is that the server reads original
    page, and if it has
    an include, it grabs that and throws it in the code where you
    told it to be.
    What you get is one compiled page that goes to the browser.
    So any CSS or
    other info at the top of your calling page will affect
    everything in the
    page. Look at your page in a browser, then check out "View
    Source" and
    you'll see that it looks like one page. The browser doesn't
    know, or care,
    whether it was assembled from several parts or is just one
    whole page from
    the get go.
    So yes, it can go...as long as that CSS call is in the top of
    the calling
    page! Which I don't think it is (but it should be).
    MD
    "Lez" <[email protected]> wrote in message
    news:[email protected]...
    > Do I not need to leave the CSS link in, or will it pick
    up from the main
    > page ?
    >
    > "Mad Dog" <[email protected]> wrote
    in message
    > news:[email protected]...
    >> You still have one stray line in the include that
    doesn't belong there:
    >>
    >> <link href="standard.css" rel="stylesheet"
    type="text/css" />
    >>
    >> As to the next question, you need to set the ACTION
    to go to a forms
    >> handler. That's what will process it and send an
    email with the info they
    >> filled in to someone. The easiest thing, is to check
    with whoever is
    >> hosting the site. They usually have a forms handler
    in place (such as
    >> formmail) along with an FAQ and instructions on how
    to set it up and use
    >> it.
    >>
    >> MD
    >>
    >>
    >> "Lez" <[email protected]> wrote in
    message
    >> news:[email protected]...
    >>> OK have changed and saved the page as ASP and
    now seems to work
    >>> fine....do you know How I can send a mail to an
    email address advising
    >>> when this has been completed...have had a real
    problem sorting that one
    >>> out?
    >>> Lez
    >>>
    >>>
    >>> "Lez" <[email protected]> wrote
    in message
    >>> news:[email protected]...
    >>>> The 'INCLUDE' form page has the asp
    extension, does the main page also
    >>>> require to be an ASP, as these pages will be
    done by someone else?
    >>>>
    >>>> Thanks
    >>>> Lez
    >>>>
    >>>> "Nancy - Adobe Comm. Expert"
    <[email protected]> wrote in message
    >>>> news:[email protected]...
    >>>>> An ASP page has to have an ASP
    extension. Your page has an html
    >>>>> extension.
    >>>>>
    >>>>>
    >>>>> --
    >>>>> Nancy Gill
    >>>>> Adobe Community Expert
    >>>>> Author: Dreamweaver 8 e-book for the DMX
    Zone
    >>>>> Co-Author: Dreamweaver MX: Instant
    Troubleshooter (August, 2003)
    >>>>> Technical Editor: Dreamweaver CS3: The
    Missing Manual,
    >>>>> DMX 2004: The Complete Reference, DMX
    2004: A Beginner's Guide
    >>>>> Mastering Macromedia Contribute
    >>>>> Technical Reviewer: Dynamic Dreamweaver
    MX/DMX: Advanced PHP Web
    >>>>> Development
    >>>>>
    >>>>> "Lez"
    <[email protected]> wrote in message
    >>>>>
    news:[email protected]...
    >>>>>> Sorry if I sounded off hand, I
    followed the help file that does not
    >>>>>> say remove any surrounding tags, I
    have now removed them and the page
    >>>>>> looks OK, however, the submit button
    does not submit the form. On
    >>>>>> hovering the button it displays the
    <% ==MM_editAction %> and fails
    >>>>>> to complete the insert as it should
    do.
    >>>>>>
    >>>>>> the testing URL is
    >>>>>>
    >>>>>>
    http://millmaxnetwork.com/Copy%20of%20SpecificInv_GNT_1.html
    >>>>>>
    >>>>>> Regards
    >>>>>> Lez
    >>>>>>
    >>>>>>
    >>>>>> "Mad Dog"
    <[email protected]> wrote in message
    >>>>>>
    news:[email protected]...
    >>>>>>> What I said could very likely be
    helpful. Without seeing the pages
    >>>>>>> online or the files it's
    impossible to know for sure, but since you
    >>>>>>> said you could "get the
    </Head> tag showing within the include file
    >>>>>>> of the page" in Design View, it
    sounds like you might have more in
    >>>>>>> the include page than you
    should. As I said, an include should not
    >>>>>>> have anything other than the
    "guts" of the page. Does your include
    >>>>>>> file have any <header>,
    <body> or other "top of the page" elements
    >>>>>>> included? If so, that could be
    the culprit. From your description, I
    >>>>>>> would expect it might only
    include the area from <form> to </form>.
    >>>>>>> If this isn't being helpful and
    you already have it stripped down, I
    >>>>>>> apologize and hope you'll post a
    URL where we can see it or include
    >>>>>>> the code so someone can look at
    it.
    >>>>>>>
    >>>>>>> MD
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>> "Lez"
    <[email protected]> wrote in message
    >>>>>>>
    news:[email protected]...
    >>>>>>>>
    >>>>>>>> If you can't add anything
    helpful ....why reply ?
    >>>>>>>>
    >>>>>>>>
    >>>>>>>> "Mad Dog"
    <[email protected]> wrote in message
    >>>>>>>>
    news:[email protected]...
    >>>>>>>>> For starters, the
    include file should have nothing but the actual
    >>>>>>>>> body of the code. No
    header, no <head> tag, no <body> tag. Just
    >>>>>>>>> the guts.
    >>>>>>>>>
    >>>>>>>>> MD
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>> "Lez"
    <[email protected]> wrote in message
    >>>>>>>>>
    news:[email protected]...
    >>>>>>>>>>I have been trying to
    use a form as an include file.
    >>>>>>>>>>
    >>>>>>>>>> I created the file
    as a separate asp page, and then tried to add
    >>>>>>>>>> it as an include,
    the page fails when I try in on my testing
    >>>>>>>>>> server. If I create
    the form within the page I get no problems!!
    >>>>>>>>>>
    >>>>>>>>>> Also when the page
    displays in the design view I get the </Head>
    >>>>>>>>>> tag showing within
    the include file of the page.
    >>>>>>>>>>
    >>>>>>>>>> Anyone any
    suggestions to fixing these issues.
    >>>>>>>>>>
    >>>>>>>>>> Thanks
    >>>>>>>>>> Lez
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>
    >>
    >>
    >

  • How do I find dynamically related files where Wordpress is not involved

    There are lots of posts about "Dynamically-related files could not be resolved because the site definition is not correct for this server" but they all seem to relate to Wordpress or other blogging software.
    I have recently had to upgrade from DW8 to DW CS5.5 running on Windows 7 64bit. and get this error on lots of pages but there is no help about fixing it.  The local testing server is localhost set up to run PHP with iis7 on virtual folders.
    What do I have to do to get the dynamically related files to be found?
    Thanks

    I think I've  cracked it - nothing to do with databases, that was a red
    herring.
    I had a hundred or so sites on an XP machine running Dreamweaver 8 and used
    the export facility to save their settings when I moved to a Windows 7
    system.  Win7's directory structure is different but the testing server
    location stored in the export file doesn't take account of this and part of
    the path may now include directories that are viewed as shortcuts.  Once the
    locations are reset in Win7 terms, the errors go away.
    Regards
    Steve
    Steve and Diana Kimpton
    The Word Pool
    http://www.wordpooldesign.co.uk/
    http://www.wordpool.co.uk/
    http://www.ukchildrensbooks.co.uk/
    http://www.contactanauthor.co.uk <http://www.contactanauthor.co.uk/

  • How to access a variable from a dynamically included JSP page

    I have a jsp (say main.jsp) using the following in its code :
    <jsp:include page="menu.jsp" flush="true" />
    I have a variable in menu.jsp which I would like to use in my main.jsp.
    How do I get the value of the variable defined in menu.jsp ?
    I called this variable in menu.jsp, Public, but this didnot help me use the value of that variable in main.jsp
    Any help is highly appreciated.. thnks a lot

    I do notice the variable var1 has the value populated - in menu.jsp - (from View -->
    Source in the browser) but for some reason not able to use it in main.jspI'm not quite sure of the way your jsps are structured from your code snippet but I think there is something to be aware of here that may be part of your problem, namely the difference between the include directive and the include action.
    You are currently using the include action, this treats the included resource as a dynamic object - i.e. a request is sent to that resource and the resulting response is included in your page. So when you think of what there is no java variable actually included - you'll just get the resulting HTML that is generated by menu.jsp
    The include directive, as in <%@include file=�menu.jsp � %>, on the other hand treats the resource as a static object. This means the actual bytes in the included resource are inserted into the including jsp and then the result of that is compiled and processed, effectively you are cutting and pasting the menu.jsp into your calling jsp. In this case the variable would be available to the calling jsp.
    However this approach does bring other difficulties that may break your current code, you'll just have to try it and see what happens.
    Hope that's relevant to your problem,
    Matt

  • Failure in Precompilation of JSPs  due to include file in WL6.1 SP2

    Hi
              We are getting the following error when we try to do precompilation of JSPs using
              precompile param to true in weblogic.xml
              We are deploying our application as war files.
              eagerly waiting for your help
              sincerely
              Ramesh
              Issue description and StackTrace:
              Issue:
              Precompilation of JSPs fail while using precompile param to true in weblogic.xml and deploy it as War file. It is througing "failure pre-compiling JSP's
              weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              xception: Could not include index.jsp" exception.
              OS: Windows 2000
              Jdk: Sun Jdk1.3.1
              Weblogic: 6.1 SP2
              ***Stacktrace*************
              <Dec 17, 2002 1:05:51 PM CST> <Error> <HTTP> <[WebAppServletContext(3961036,AdvW
              eb,/AdvWeb)] failure pre-compiling JSP's
              weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              xception: Could not include index.jsp
              at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1025)
              at weblogic.servlet.jsp.JspParser.doit(JspParser.java:80)
              at weblogic.servlet.jsp.JspParser.parse(JspParser.java:183)
              at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255
              

    Ramesh,
              We experienced this sympton as well. In our JSPs, we converted
              <%@ include file="xyz.jsp"%> (static include, source time) to
              <jsp:include page="licensedQuote.jsp"/> (dynamic include, run time)
              and the problem went away.
              We still use static includes at the very start of the JSPs. It seems the problem only occurs when the static include is inside of a tag whose body does JSP evaluation.
              -Charlie
              "Ramesh Danala" <[email protected]> wrote in message news:[email protected]...
              > Hi
              > We are getting the following error when we try to do precompilation of JSPs using
              > precompile param to true in weblogic.xml
              > We are deploying our application as war files.
              > eagerly waiting for your help
              > sincerely
              > Ramesh
              >
              > Issue description and StackTrace:
              > Issue:
              >
              > Precompilation of JSPs fail while using precompile param to true in weblogic.xml and deploy it as War file. It is througing "failure pre-compiling JSP's
              > weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              > xception: Could not include index.jsp" exception.
              >
              > OS: Windows 2000
              > Jdk: Sun Jdk1.3.1
              > Weblogic: 6.1 SP2
              >
              > ***Stacktrace*************
              >
              > <Dec 17, 2002 1:05:51 PM CST> <Error> <HTTP> <[WebAppServletContext(3961036,AdvW
              > eb,/AdvWeb)] failure pre-compiling JSP's
              > weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              > xception: Could not include index.jsp
              > at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1025)
              > at weblogic.servlet.jsp.JspParser.doit(JspParser.java:80)
              > at weblogic.servlet.jsp.JspParser.parse(JspParser.java:183)
              > at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              > at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255
              > )
              

  • Need help with Dynamic Excel File Name please.

    I am try to output an excel file with dynamic date. 
    Here what I done.
    I am using SQL 2012.
    Create Execute SQL Task Connect Type: Excel
    Create Data Flow Task set to DelayValidation: True
    Create OLE DB Sourc
    Create Data Converstion
    Excel Destination
    Excel Connection, Expression, select ExcelFilePath
    @[User::sXLFilePath] +  @[User::sFileName] + RIGHT("0" + (DT_WSTR, 2) DATEPART("DD", GETDATE()), 2)+ RIGHT("0" + (DT_WSTR, 2) DATEPART("MM", GETDATE()), 2) + RIGHT((DT_WSTR,
    4) DATEPART("YYYY", GETDATE()), 2) +".csv"
    C:\ExcelOutPut\SOX_CAM_SQL_Report_010215.xls
    What I try to accomplish is output the file with each day append to it, date must be DDMMYY.
    I google it and found many samples, tested it, and none of them is work for me. 
    Any suggestions or some examples to share is greatly appreciate. 
    I am new to SSIS.  I found one poster have similar issue and inside the posted below, there was one suggestion to create variable and connection string but how do I bind that variable to Excel Connection manger.
    Please help.
    Thank you so much in advance.
    Ex: SOX_CAM_SQL_Report _020215.csv
           SOX_CAM_SQL_Report _030215.csv
    --Similar issue:
    https://social.msdn.microsoft.com/Forums/en-US/bda433aa-c8f8-47c9-9e56-efd20b8354ac/creating-a-dynamic-excel-file?forum=sqlintegrationservices
    Suggestion in the above posted but where can bind this to Excel Connection Manger. 
    Please help provide step by step.  Thanks.
    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\" + "ExcelTarget" + (DT_WSTR,4)DATEPART("yyyy",GETDATE())  +
    ".xls" + ";Extended Properties=\"EXCEL 8.0;HDR=YES\";"
    And yes, as you were intimating, the delay validation on the dataflow should be set.

    Hi NguyenBL,
    According to your description, you created ssis package to export data from database to excel, when the package runs, you want to create new excel and name the file with time stamp. If that is the case, we can achieve the goal by following steps:
    Create a script task used to create excel files.
    Create a data flow task to export data from database to excel.
    Add OLE DB source to data flow task.
    Add Excel Destination to data flow task.
    Create connection manager for OLE DB and Excel.
    Click Excel Connection Manager, in Properties window, click (…) button next to Expressions, then set ExcelFilePath with expression like below:
    "C:\\ETL Lab\\CreateNewExcel\\ExportData_"+REPLACE((DT_STR, 20, 1252)(DT_DBTIMESTAMP)@[System::StartTime], ":", "")+".xls"
    For detail information, please refer to the document:
    https://sqljourney.wordpress.com/2013/01/12/ssis-create-new-excel-file-dynamically-to-export-data/
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Trying to dynamic include HTML into a JSP

    All,
    I am trying to include an HMTL file into a JSP file. I wish to do this dymanically. So, the following is not an option:
    <%@ include file="relativeURL" %>
    So, I am forced to resort to such measures as the following:
    <jsp:include page="<%=myPath%>"/>
    However, I get the following error:
    java.lang.IllegalStateException: Response has already been committed
         at java.lang.Throwable.fillInStackTrace(Native Method)
         at java.lang.Throwable.fillInStackTrace(Compiled Code)....
    I tried it like this:
    <jsp:include page="<%=myPath%>" flush="true"/>
    I encoutered the same result. I have JSP 1.2 running Tomcat 3.1 with Apache 1.3.14, all on SunOS. Thanks in advance for any help.
    Nicholas

    One of the worst error messages you can get is the IllegalStateException. It simply means that an attempt has been made to forward or include but only a portion of the include was sent. In a situation like this the best way to handle the dynamic page content is to include it from a Servlet by sending the information you need through beans. Including the Servlet rather than the dynamic path would clear those errors right up. One thing to keep in consideration is that you can't just get the page and display it, you have to buffer it in so the state can be kept alive without timing out like it does with the dynamic include.
    Hope that helps. Been there, done that, I know how frustrating the error was.

  • Dynamic include in a custom tag, called from a jsp

    Hello, I would like to be able to dynamically include other jsp's from within a custom tag that I create. is this possible?
    in a jsp page i would just write <%@ include file="file.jsp" %> and all would be ok... but if i do an out.println( "<%@ include file=\"file.jsp\" %>" ); inside a custom tag bean then it doesn't work. it just prints out the command to the page as plain text.
    I do understand why this is happening, but can anyone offer me a way around this problem?
    Thanks in advance,
    Randy

    That's actually the same result as you get with a normal include - The method I suggested is a dynamic include similar to the <jsp:include> tag, not the <%@ include %> tag.
    When you use a dynamic include, the included page is compiled and 'invoked' as serarately, and the result is what gets included, not the actual source. To get the behaviour you want would require an include directive (the <%@ include %> tag) which I don't think has an equivalence you can use inside a custom tag.
    What you can do is pass attributes from the tag class like this:
    pageContext.setAttribute(<name>, <object>, pageContext.REQUEST_SCOPE);
    and then remove them after the include using pageContext.removeAttribute.
    I'm not certain, but this implies that if you declare your variables with a <jsp:usebean> tag with request scope, instead of normal Java variable declarations, you should be able to use them in the page included by the custom tag.
    *** in the jsp ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <% myVar = "Something"; %>
    // Now call the tag which uses the pageContext.include() mehtod.
    *** end ***
    *** in the include ***
    <jsp:useBean id="myVar" scope="request" class="java.lang.String" />
    <%= myVar + " something else" %>
    *** end ***
    Let me know if it works.

Maybe you are looking for

  • SSRS 2008 FIPS error

    Hello, We've installed SQL Server 2008 and Reporting Services 2008 on a Windows Server 2008 Enterprise box. I could initially access the Report Server at the default URL, but when I attempted to access the Report Manager, I got a 500 Internal Server

  • How to install Oracle 8i and Form 6i / Reports 6i on same machine

    Hi All I have installed Oracle 8i on my machine, now i wants to install the forms 6i and reports 6i. Please advise me the steps as it is asking for seperates home folder. also tell me about the version of oracle / Developer forms & reports i can inst

  • How do I change NTFS settings for my external hard drive in Mac and PC

    I recently purchased an external hard drive SAMSUNG (Model No NM-0802) when i plug the USB cable it will not display on the desktop of my mac I operate on MacBook Pro and Mac OS X Lion On the other hand, It is detected in the Disk Utilities pane and

  • Itunes cannot find an active Internet connection

    Hello I've tried several times to activate my Itunes, and its radio stations. But I get an error message stating to check my network is active. It is active. I can get on the Internet with Safari. I even downloaded the new Itunes upgrade 8.01(12) and

  • What is the purpose and benefit of a firmware update?

    Solved! Go to Solution.