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);

Similar Messages

  • Build a web gallery with amazing flash slideshows with dynamic XML files

    Build a web gallery with amazing flash slideshows with dynamic XML files
    Screenshot:
    Features
    Features
    Transitions, zooming and panning effect You can  choose from  Random, Wipe from Left, Fade to White, Cross Expansion and  other 60-plus  transition effects. Zooming and panning effect is  optional for advanced flash  templates.
    XML-driven This flash slideshow are XML-driven. The XML  document allows more personalized controls over the flash.
    Auto-playback and repeat mode The flash slideshow will play  automatically after preloading, and it can repeat playback.
    Dynamic customization Besides XML control, the  advanced  templates provide many more custom options, so that you can  create slideshow  that fits into your existing web design: width ,  height, border color,  background color, thumbnail size, etc. More about  dynamic customization
    Usage and demo visit: http://webdesigndevelopment.blog.com...swf-xml-files/

    Please excuse the bump...
    Anyone with a LR flash gallery that starts with slideshow in play mode?
    Can it even be set to do this?
    The only code in the style.xml that looks like it might be realted is line 12 <playOptions playMode="pause"/>, changing that to "play" does nothing.
    Thanks,
    Donnie

  • Dynamic attribute file name

    Hi All,
              I am trying to use dynamic attribute file name using UDF in message mapping:
    <i>String filename = null;
    filename = "Yahoo";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://seeburger.com/xi/common" , "dtSubject");
    conf.put(key1,filename);
    return "";</i>
    But its just giving me the name on the receiver side as in the sender side.
    I have checked FileName in Dynamic attributes in the reciever adapter.
    Regards,
    XIer

    your return statement looks like <i>return "";</i>
    Return the filename that you have assigned inside the UDF and can be achieved by
    conf.put(key1,filename);
    <b>return filename;</b>
    Do refer this blog as well
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

  • 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

  • Include directive with import tags how to

    I mostly the same classes throughout many of my jsp pages. If I use the include directive to import the classes - it doesn't work. What is the proper directive / way / tag to include those tags? Sorry if I am not wording this properly. Here's an example:
    most of my classes use the following classes so I use the @import tag:
    <%@page import="web.urls.DisplayUrls"%>
    <%@page import = "web.beanObjects.display.DisplayPage"%>
    <%@page import="web.db.admin.TypesDbHandler"%>
    <%@page import="web.db.admin.CategoryDbHandler"%>
    I would like to put all of those in one file and only have one line of code so I don't have to cut & paste into every jsp page whenever there's a change:
    <%@include file="/include/imports.jsp"%>
    Unfortunately this isn't working, it's not recognizing the classes...
    Thanks!

    hi,
    since both the files are located in the same folder, why don't you try the following:
    <%@ include file="hello.jsp" %>
    hope this helps

  • How to create a data connection with dynamic XML file?

    Thanks for all reply first!
    I have formatted the submitted data into an XML file on the server side,this file can be import to PDF form correctly.
    I try to send this XML file to the user to let him can review what he has submitted.
    I guess that I should create a data connection to the XML file so that it can be reviewed by the user.
    But the question is that the XML file is dynamic generated.
    How can i do?
    give me some clus or examples,please.
    thanks,
    Jasper.

    Hi Jasper,
    To show user back the result, you can use PDF instead of XML. You can store the PDF template in server and you can merge XML data with PDF template by Livecycle Form Data Integration service.
    We, as KGC, can generate huge number of Adobe Livecycle forms in small periods. Also we give consultancy on Adobe Livecycle ES products and Adobe Livecyle Designer. In case of any need, do not hesitate to contact us.
    Asiye Günaydın
    Project Consultant
    KGC Consulting Co.
    www.kgc.com.tr

  • A variable in the include directive

    Hello,
    I'm trying to store a part of the name of the file to include in a variable like this:
    <%@ include file=templatepath + "settings.jsp" %>
    but it doesn't work. Can someone tell me if there is a working way to do something similar
    Thanks,
    Store

    You can use the jsp:include tag to specify the page to include dynamically.
    <jsp:include page="templatepath + "settings.jsp" flush="true"/>You can't use the include directive to dynamically specify a page since the page is included at compile time, rather than run time.

  • Dynamic Receiver file name in AS2 adapter

    Hi Experts,
    How to get dynamic receiver file name in AS2 adapter. We need receiver file name same as of sender file name.
    We tried selecting dynamic attributes file name but we are getting followin error in CC.
    Message processing failed. Cause: javax.resource.ResourceException: Fatal exception: com.seeburger.xi.connector.queue.TaskBuildException: Mandatory attribute dtAS2FileName is not present in XI message., Mandatory attribute dtAS2FileName is not present in XI message.
    Thanks,
    Hari

    hi hari,
    You can't do it manually. As both adapter are in different context.
    You can go with UDF to slove ur problem.
    Just extract the input file name using Dynamic configuration
    Store that in some variable.
    Use same name in the dynamic file name in AS2 receiver. Below code might be useful.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://seeburger.com/xi/common/dtAS2FileName", "DYNFILENAME");
    conf.put(key,strfilename);
    Thanks
    Jai
    Edited by: Jaideep Baid on Apr 9, 2010 9:16 AM

  • Deferred EL in dynamic attributes

    According to the Sun Java EE 5 tutorial, using deferred EL ( #{} syntax) is forbidden for usage in a tag's dynamic attributes.
    What's the exact use of making this illegal? (what problem does this rule solve?)
    Anyway, I'm asking since I have developed lots of JSF 1.1 components with dynamic attributes that accept EL expressions. Technically it's not a problem. In the tag handler, I just itterate over all collected attributes, check if they're EL using the JSF API and if so create a value binding for them.
    However, in JSP 2.1/JSF 1.2 the container prevents the "#{...}" string from reaching my tag handler code. This is very nasty. I can of course disable container evaluation for the entire page, but this is quite an ugly solution.
    Is there any neat workaround for this problem?

    When in doubt, check
    the 2.1 spec. I'm guessing that the tutorial has a
    doc error.You're right, I checked the (may 2006) JSP 2.1 spec, and on page 2-72, section 3 it says:
    Dynamic attributes must be considered to accept request-time expression values
    as well as deferred expressions.So, the tutorial is definitely wrong.
    Maybe someone should notify Sun about this? It seems most people would resort to reading tutorials first instead of wading through the spec. Especially if a Sun tutorial states something, many people will probably consider it 'official'. Perhaps even the Tomcat folks have read said tutorial instead of the spec. Using an EL value in a dynamic attribute in Tomcat 6 causes a translation error.
    Btw, I'm not 100% sure how to interpret this note from the spec:
    Note that passing a String literal as a dynamic attribute will never be considered
    as a deferred expression.What other way is there to pass a deferred expression than through a String litteral?

  • Fixed values of dynamic attributes are not displayed for bid response

    Hi
    I have created a bid with dynamic attributes and have weighted the options with fixed values. I publish the Rfx (bid) and all is ok. The problem is that the fixed values are not displaying when doing a bid response.
    We are using SRM 7.0
    Can anyone help?

    No. Not yet. I think it is a bug. You should create an OSS message to SAP and ask them to pay special attention to the following code block:
    Class: /SAPSRM/CL_CH_WD_DODM_DYNATTR
    Method: /SAPSRM/IF_CLL_MAPPER~REFRESH
    At the end of the method, look for code context:
    IF lv_object_type = c_qte.
    *Set the Fixed Values Table to Invisible
        lv_visible = abap_false.

  • Dynamic attributes in Bid

    Hi friends,
    I need to know / confirm dyanamic attributes manual evaluation process.
    1. A purchaser creates a bid invitation with dynamic attribute for "text". Evaluation
        for this attribute is "Manual"
    2. Bidder puts his comments against this attribute & submit bid
    3. Purchaser opens vendor bid and has to give weighings to the bidder comments.
        Purchaser clicks on "change" mode
    4. Purchaser goes to "weighing" tab
    5. Under valuation column, I am able to put valuation figure, but there is no option
        to save the same.. because of which i am not able to consider this attribute for
        bid evaluation analuysis.
    Please let me know if this is the right way of doing manual valuation of dynamic attributes or there is some other way. If its the right way, how can I save the valuation figures?
    Your response will be highly appreciated and point will be awrded for appropriate responses.
    Best regards,

    Hi
    It seems to be a bug in the system.
    <b>Please go through the followin SAP OSS Notes, which will definitely help -></b>
    Note 850054 - Text value in the weighting set is not updated
    Note 965519 - Dynamic attributes: fixed values not updated
    Note 836931 - Bid invitation: Manual valuation of default fields
    Note 1061034 - RFx functional issues
    Note 904152 - Error/termination for units of measurement of attributes
    Note 1021976 - Dynamic attribut with fixed values not saved
    Note 769942 - Deleted dynamic attributes are not taken into account
    Note 921195 - Unit of measure is not converted on weighting screen
    Note 876525 - Weighting for the "PRICE" default field is active by default
    Note 873297 - Multiple quotation work areas are created in cFolder
    Note 789687 - DynAttr. Enhancement of description length to 60 characters
    <u>Other related SAP OSS Notes -></u>
    Note 912891 - Dynamic attributes displayed without fixed values
    Note 1036584 - SRM bid invitations: header / item flag in dynamic attribute
    Note 1016042 - BBP_BID_INV: Back Button is not displayed in Attributes
    Do let me know.
    Regards
    - Atul

  • After Effects won't close/Problems with dynamic links

    When I quit After Effects the icon still shows up and it says that it is still open, even force quit will not work. Also having problems with dynamically linked files between after effects and Premiere pro. Rendering in Premiere doesn't work unless I go to AE, save the project, then go back to Premiere. I have OSX Mavericks 10.9.2, a late 2012 mac pro, and AE CC 12.2.1.5

    Kevin: would appreciate further thoughts on this.
    I am using Pr2014, version 8.0.0 I am using AE2014, version 13.0.2.3. When I was on earlier versions of each, I had no problem importing AE comps into Pr. I'd choose import in Pr, then select the AE project, then select the comp. But with my new and improved versions of AE and Pr, I keep getting "importer reported a generic error."
    I also tried to go the other way. I selected in Pr the clips I wanted to work on in AE, and then tried "replace with AE comp" but got the "generic error" message again..
    Finally, I attempted to create a Dynamic Link from Pr via the File menu, but with each of the options from there, I got "failed to connect to AE Dynamic Link"
    Any advice you can share, would be most welcome.

  • Difference between jsp:forward sendRedirect and jsp include directive

    Am very much confused, please explain me the difference between
    jsp:forward sendRedirect and jsp include directive with a suitable example.
    I'll be very gratefull. Its very urgent.

    One basic difference. The include executes in the .jsp servelet created. The redirect transfers "control" by redirecting the client request to another destination. In other words, the current .jsp is no longer in charge or in the calling chain in any way.

  • Dynamic file parameter with include directive

    I would like to include the file path contained in a string variable with the include directive.
    I'm trying to do the following:
    <%
    String var_fileToInclude = "inc/topnav_" + var_sectionType + ".jsp";
    include file=var_fileToInclude;
    %>
    I get the following error:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the jsp file: /news/special_reports/climate/inc/topnav_includer.jsp
    include cannot be resolved to a type
    3: String var_fileToInclude = "inc/topnav_" + var_sectionType + ".jsp";
    4: out.println( "var_fileToInclude = " + var_fileToInclude );
    5:
    6: include file=var_fileToInclude;
    7:
    8: %>
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:317)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    Any help is greatly appreciated.
    -- Ryan Chapin

    hello,
    Are you able to print the file name. if you are able to print the file name properly then try to include the file as below
    <jsp:include page="<%=filevariablenema%>" flush="true" />
    I hope this will help. Let me know on the same.
    Thanks
    Suresh

  • Assigning file dynamically in Include directive?

    Is it possible to dynamically assign the file in Include directive?
    If posibble how? The code below does not work.
    <%
         String page_name = request.getParameter("num_id");
         if(page_name == null) page_name = "/body/that.html";
         if(page_name == "1") page_name = "/body/that.html";
         if(page_name == "4") page_name = "/body/that.html";
         if(page_name == "5") page_name = "/body/comment.html";
    %>
    <jsp:include page = "<%=page_name%>" />
    If not any alternative on doing this?
    More power!!!

    There's always this...... and you know, of course, that you do'nt compare strings with ==, right?
    <%
    String page_name = request.getParameter("num_id");
    if(page_name == null) {
    %>
    <jsp:include page = "/body/that.html" />
    <%
    } else if(page_name.equals("1")) {
    %>
    <jsp:include page = "/body/that.html" />
    <%
    } else if(page_name.equals("4")) {
    %>
    <jsp:include page = "/body/that.html"" />
    <%
    } else if(page_name.equals("5")) {
    %>
    <jsp:include page = "/body/comment.html" />
    <%
    %>

Maybe you are looking for