Expressions not evaluating properly in jsp:plugin tag

Hi there, running OC4J as Oracle9iAS (1.0.2.2.1)
In the JSP1.1 spec dynamic expressions in the jsp:plugin <param> tag are clearly specified as below:
<jsp:params>
[ <jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" /> ]+ </jsp:params>
Unfortunately, attempting this in OC4J, the expression is simply displayed as a static String, for example the following JSP source:
     <jsp:params>
          <jsp:param name="rootSubAssembly" value="<%=rootSubAssembly%>" />
     </jsp:params>
Would output "<%=rootSubAssembly%>" as the parameter value, rather than the dynamic value specified in the JSP above.
Any ideas? We'd like to benefit from using the plugin tag over object/applet if at all possible.

Hi there, running OC4J as Oracle9iAS (1.0.2.2.1)
In the JSP1.1 spec dynamic expressions in the jsp:plugin <param> tag are clearly specified as below:
<jsp:params>
[ <jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" /> ]+ </jsp:params>
Unfortunately, attempting this in OC4J, the expression is simply displayed as a static String, for example the following JSP source:
     <jsp:params>
          <jsp:param name="rootSubAssembly" value="<%=rootSubAssembly%>" />
     </jsp:params>
Would output "<%=rootSubAssembly%>" as the parameter value, rather than the dynamic value specified in the JSP above.
Any ideas? We'd like to benefit from using the plugin tag over object/applet if at all possible.

Similar Messages

  • Is Tomcat 4's jsp:plugin tag hardwired to 1.2?

    Is Tomcat 4's <jsp:plugin > tag hardwired to version 1.2 of the JPI?
    I was absolutely horrified today at a job interview when, proudly navigating to the page containing the 1.4-demanding applet I embedded in the page using <jsp:plugin ...> the plugin installation dialogue came up -- asking whether they wanted to install the 1.2 plugin (up until recently, I had the applet's object tag embedded manually... switching to jsp:plugin was fairly recent).
    As it turns out, the <object> tag generated by Tomcat was specifying the download path for the 1.2 plugin, even though I specified jreversion="1.4" in the <jsp:plugin> tag:
    <OBJECT
       classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
       name="theApplet"
       width="550" 
       height="400" 
       align="middle" 
       codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">The "clsid" value can be changed in web.xml by changing the jsp servlet's "ieClassId" initParam, but as far as I can tell there's NO mechanism for changing the "codebase" value anywhere.
    Is the <jsp:plugin> tag (under Tomcat 4, at least) just useless for Applets that must have 1.4, or is there a configuration parameter somewhere to set the "codebase" value generated by the tag?
    I know I could always put the manually-specified code back in, but I'd prefer to stay with the <jsp:plugin> tag if possible just because it makes the jsp source cleaner. What's strange is that nobody seems to have complained about that problem on the usual places (Usenet/dejanews/Google, jguru.com, etc). Whether that's just because nobody writes applets that actually demand 1.4, or whether everybody who does just embeds the <object> tag manually, I'm not sure.
    In any case, I'm trying to figure out how to make <jsp:plugin> generate the right HTML for 1.4-using applets... or whether it's even possible.

    Sigh. I found it. It's actually specified as the "iepluginurl" property of the <jsp:plugin> tag.
    <emotion:frustration variation="anger">
    Now I just need to figure out what *$%!# value to use for it.
    The JPI's developer guide has to be the worst document I've ever seen from Sun. Normally, Sun's documents are good. Often, exceptionally so. But the JPI guide... well, after reading http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/using_tags.html multiple times, I'm still not sure what #$%^&* URL corresponds to "The newest released JPI equal to or newer than 1.4.0". The only URL on the whole page that they even imply works is hardwired to 1.4.0, and in the same breath they imply that every other codebase URL on the page is wrong, hypothetical, and shouldn't be used... oh, and for that matter, the 1.4_0 one shouldn't really be used ether, because it might change in the future. Grrrrr.
    If there's a pattern to the following URLs (all used on the same page) that's supposed to illustrate something besides abyssmally bad editing and apparent indecision, I haven't seen it yet:
    http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
    http://java.sun.com/products/plugin/1.4/jinstall-14-win32.cab#Version=1,4,0,mn
    http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,1,mn
    http://java.sun.com/products/plugin/autodl/jinstall-1_4_0-win.cabHmmm. Let's see here. They're all the same up to http://java.sun.com/products/plugin, but from that point one diverges into /1.4/, while the others continue into /autodl/. But even past that point, two imply that the filename follows the pattern jinstall-1_4-windows-i586.cab#Version=1,4,x,* ... but whether developers who really, truly, don't care about the specific maintenance release should use "0" or "mn" is left up in the air.
    Furthermore, the ONE URL on the entire page that they come halfway close to implying will work is the last one I listed above, which itself goes totally against whatever hypthetical pattern they were trying to imply with the other three. For now I'll probably stick the last one listed as the parameter because it's the only one they actually come out and say will work, but I suspect the first one is probably the "right" one.
    Of course, there's always the matter of Macintosh users running IE. Or Windows users running Mozilla (which is technically Netscape, but uses MSIE ActiveX plugins). Does Mozilla get fed the value of "iepluginurl", or the value of "nspluginurl"? Sigh.
    </emotion:frustration>

  • Weired behavior of jsp:plugin tag

    Hi.
    When I use <jsp:plugin type="applet".....></jsp:plugin> tag, jsp page shows a applet correctly in IE but not in mozilla(1.7). I've tried to solve this problem and found that if I use <applet></applet> tag it works fine both of them.
    Does anyone have idea? the reason of this, and isn't there anyway to use jps:plugin tag to work correctly in both browers?

    What version of Jdk are you using? The Java plugin is not consistent across browsers and browser versions.
    The jsp:plugin tag gets coverted to the OBJECT tag after compliation.
    Just go through this page to find out which tag suits your need.
    http://java.sun.com/products/plugin/versions.html
    This link might also be helpful to you.
    http://www.mail-archive.com/[email protected]/msg32719.html

  • EL expressions not evaluating after JSF 1.1 --- 1.2 upgrade.

    I am having a problem with EL expressions not evaluating in a JSF application that I just upgraded from Apache MyFaces JSF 1.1 to JSF-RI 1.2 and from Tomcat 5.5.25 to 6.0.26. After the upgrade the entire application is working fine except for EL expressions.
    I was wondering if I am missing a JAR file or something.
    Basically, I have prepopulated input text boxes that render the EL expression instead of its evaluated result. Example:
    INPUT [#{sessionBean.result}] instead of INPUT [tedsResult].
    Here are the JAR on my classpath:
    tomcat/lib:
    annotations-api.jar el-api-1.1.jar servlet-api.jar tomcat-i18n-fr.jar
    catalina-ant.jar jasper-el.jar sqljdbc.jar tomcat-i18n-ja.jar
    catalina-ha.jar jasper.jar tomcat-coyote.jar
    catalina.jar jasper-jdt.jar tomcat-dbcp.jar
    catalina-tribes.jar jsp-api.jar tomcat-i18n-es.jar
    and in my WEB-INF/lib:
    activation.jar hibernate-annotations.jar
    antlr-2.7.5H3.jar iText-2.1.3.jar
    asm-attrs.jar jakarta-oro.jar
    asm.jar jaxen-1.1-beta-8.jar
    avalon-framework-4.0.jar jaxrpc.jar
    avalon-framework-cvs-20020806.jar jdom.jar
    axis.jar jpdcFOP.jar
    batik.jar jpdc_web.jar
    cglib-2.1_3.jar jsf-api-1.2_12.jar
    commons-beanutils.jar jsf-impl-1.2_12.jar
    commons-codec.jar jstl.jar
    commons-collections.jar jta.jar
    commons-digester.jar jtds-1.2.jar
    commons-discovery.jar log4j-1.2.13.jar
    commons-el.jar logkit-1.0.jar
    commons-fileupload-1.2.jar mail.jar
    commons-io-1.3.1.jar openmap.jar
    commons-lang-2.3.jar saaj.jar
    commons-logging.jar standard.jar
    commons-logging-optional.jar tomahawk.jar
    cos.jar velocity-1.4.jar
    CVS velocity-tools-generic-1.1.jar
    dom4j-1.6.1.jar
    el-impl-1.1.jar versioncheck.jar
    ehcache-1.1.jar wsdl4j-1.5.1.jar
    ejb3-persistence.jar xalan.jar
    fop.jar xercesImpl.jar
    hibernate3.jar xmlParserAPIs.jar
    Any ideas what might be causing this problem? Thanks in advance for your help.
    Edited by: tsteiner61 on Apr 14, 2010 11:05 AM

    Hello tsteiner61,
    Did you find a solution for your problem? I am asking because I have to solve a somewhat similar problem. Our system admin updated Tomcat from version 6.0.20 to 6.0.26 and now my JSF application won’t evaluate EL expressions either.
    I was using “Mojarra JSF API Implementation 1.2_09-b02-FCS”. Trying “Mojarra JSF API Implementation 2.0.2-FCS” I get the following error:
    java.lang.UnsupportedOperationException
         javax.faces.context.ExternalContext.getResponseOutputWriter(ExternalContext.java:1228)
         com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:182)
         com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
         org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
         org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:197)
         javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
         org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:176)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
         com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    I am grateful for helpful advice.

  • How can I return some values from an applet invoked by jsp:plugin tag

    My JSP is something like that:
    <html>
         <head>
                 <title> . . . </title>
         </head>
         <script>
              function getValueFromApplet()
                   var src = document.pinApplet.checkPin();
                   document.myForm.j_username.value = document.pinApplet.tokenizeName(src);
                   alert(document.myForm.j_username.value);
                   document.myForm.j_password.value = document.pinApplet.tokenizePassword(src);
                   alert(document.myForm.j_password.value);
         </script>
            <body>
                    <jsp:plugin type="applet"
                          code="PinApplet.class"
                       codebase="/idp"
                       name="pinApplet"
                                width="300"
                                height="300">
                         <jsp:fallback> Authentication Form is not supported by the browser </jsp:fallback>
              </jsp:plugin>
                    <form action="https://xxx.xxx.xxx"
                   name="myForm"
                   method="post" onSubmit="return getValueFromApplet()">
              <table>
                   <td><input type="submit" value="OK" >
                   <td><input type="hidden" id="j_username" name="j_username" value=""></td>
                   <td><input type="hidden" id="j_password" name="j_password" value=""></td>
              </table>
              </form>
         </body>checkPin() returns "alice--alice"
    tokenizeName() returns the first token: alice
    tokenizePassword() returns the second token: alice
    When I test the applet in the IDE, it returns the values properly, but not in the JSP invokation.

    evnafets wrote:
    javascript will not be executing on the server. You can rule that one out.
    Is your Applet being initialised correctly?
    Where have you got the classes for it? I think the applet doesn't need any kind of initialization, because it doesn't have any variables and all the process is made in the method called by onsubmit()
    The applet is composed only by one class and I'm totally sure that the class is placed in the correct place.
    evnafets wrote:
    I would say put in a couple more alerts - one before the call to the applet, one after.
    put some logging statements in your applet to see if it gets there.In the javascript, there are two alerts between the three calls to the applet. Where do you advise me to put more alerts?
    I don't understand what do you refer when you say "logging statements"
    I am going to test again the call to the applet in order to find some kind of code that can be invalid or that can make the function to "crash"

  • Is the jsp:plugin tag supported in Weblogic 5.1?

    I am running Weblogic 5.1 and I can't get the <jsp:pluging> tag to work.
              The server is not even translating the tag to anything usefull. When I do a
              'View Source' in the browser, the tag is exactly as I wrote it in the page.
              Is this feature supported in 5.1. I've tried the phonebook example and it
              doesn't work either. All my other JSP pages work just fine.
              Any help would be appreciated...
              Steven Carter
              Senior Software Developer
              VideoSpheres Inc.
              Office: 613-270-9646 Ext. 3025
              FAX: 613-271-9442
              e-mail:[email protected]
              

    Thanks for your response! Yes it was a typo in the message :). Would you have any idea why it is not working for me? Any special configuration required? A property I don't have correctly set in the properties file? I've tried the phonebook example shipped with the product and it doesn't work.
              "Kumar Allamraju" <[email protected]> wrote in message news:[email protected]..
              I never tested it myself. But i think we do support
              in 5.1 . Shouldn't it be <jsp:plugin>
              Was it a typo?
              Steven Carter wrote:
              I am running Weblogic 5.1 and I can't get the <jsp:pluging> tag to work.
              The server is not even translating the tag to anything usefull. When I do a
              'View Source' in the browser, the tag is exactly as I wrote it in the page.
              Is this feature supported in 5.1. I've tried the phonebook example and it
              doesn't work either. All my other JSP pages work just fine.
              Any help would be appreciated...
              Steven Carter
              Senior Software Developer
              VideoSpheres Inc.
              Office: 613-270-9646 Ext. 3025
              FAX: 613-271-9442
              e-mail:[email protected]
              [att1.html]
              

  • Displaying Applet in JSP Using jsp:plugin tag

    The following code is not working eventhough i downloaded to JRE plug-in .Please help me to work the
    following code in JSP.
    <jsp:plugin code="mani.Clock2.class"
    codebase="/classes/" width=300 height=300
    jreversion="1.3"
    nspluginurl="http://java.sun.com/products/plugin/1.1.3/plugin-install.html"
    iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
    <jsp:fallback>
    <font color=#FF0000 size=10>Sorry Error While Loading Applet </font>
    </jsp:fallback>
    </jsp:plugin>

    why don't ypu just use the <applet> tag?

  • JSP Plugin tag for applets with codebase - WLS 6.1 sp2

              Could someone please tell me what I am doing wrong?
              I have the following Plugin tag in my JSP.
              <jsp:plugin type="applet"
              code="com.xxx.efm.frontend.view.EFMApplet"
              codebase="/lib"
              archive="applets/EFMFrontend.jar, EfmCommon.jar, TrimmedWeblogic.jar, dom4j-full.jar,
              /classes/"
              jreversion="1.3"
              nspluginurl="http://java.sun.com/products/plugin/1.3/plugin-install.html"
              iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-131-win32.cab">
                   <jsp:params>
                        <jsp:param name="Delimiter" value="<%=delimiter%>" />
                        <jsp:param name="ComponentMap" value="<%=componentMapValues%>" />
                        <jsp:param name="ServerConfig" value="<%=serverConfigValues%>" />
                        <jsp:param name="GUIConfig" value="<%=guiConfigValues%>" />
                   </jsp:params>
              </jsp:plugin>
              I am trying to load the JSP using Netscape 4.7. When I don't have a plug-in installed
              the page
              displays "Click here to get the plugin". On clicking on it the browser pops up
              a "Plugin not loaded" dialog.
              All this is fine except that the dialog says it can retrieve the plugin from "/lib".
              When I click on
              "Get the plugin" button the new browser window tries to load the URL: http://localhost:2002/lib/?application/x-java-applet;version=1.3.
              It totally ignores the netscape URL for plugin. Something similar happens with
              IE as well.
              I tried the same JSP without the codebase tag and all worked fine (except for
              my applets). Yeah, I can append a "/lib" to each of
              my jars in my archive and it just might work. But should I be doing anything different?.
              Any help is appreciated.
              Thanks,
              Gopal
              

    I am facing the same problem with netscape (4.7x). Gopal, did you find any
              solution?
              IE works fine for me. I use the foll pluginurl
              iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#V
              ersion=1,3,1,1"
              _Jp
              "Gopal" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Could someone please tell me what I am doing wrong?
              >
              > I have the following Plugin tag in my JSP.
              >
              > <jsp:plugin type="applet"
              > code="com.xxx.efm.frontend.view.EFMApplet"
              > codebase="/lib"
              > archive="applets/EFMFrontend.jar, EfmCommon.jar,
              TrimmedWeblogic.jar, dom4j-full.jar,
              > /classes/"
              > jreversion="1.3"
              >
              nspluginurl="http://java.sun.com/products/plugin/1.3/plugin-install.html"
              >
              iepluginurl="http://java.sun.com/products/plugin/1.3/jinstall-131-win32.cab"
              >
              >
              > <jsp:params>
              > <jsp:param name="Delimiter" value="<%=delimiter%>" />
              > <jsp:param name="ComponentMap" value="<%=componentMapValues%>" />
              > <jsp:param name="ServerConfig" value="<%=serverConfigValues%>" />
              > <jsp:param name="GUIConfig" value="<%=guiConfigValues%>" />
              > </jsp:params>
              > </jsp:plugin>
              >
              > I am trying to load the JSP using Netscape 4.7. When I don't have a
              plug-in installed
              > the page
              > displays "Click here to get the plugin". On clicking on it the browser
              pops up
              > a "Plugin not loaded" dialog.
              > All this is fine except that the dialog says it can retrieve the plugin
              from "/lib".
              > When I click on
              > "Get the plugin" button the new browser window tries to load the URL:
              http://localhost:2002/lib/?application/x-java-applet;version=1.3.
              > It totally ignores the netscape URL for plugin. Something similar happens
              with
              > IE as well.
              >
              > I tried the same JSP without the codebase tag and all worked fine (except
              for
              > my applets). Yeah, I can append a "/lib" to each of
              > my jars in my archive and it just might work. But should I be doing
              anything different?.
              > Any help is appreciated.
              >
              > Thanks,
              > Gopal
              

  • El Expression Not Evaluated

    can someone please tell me why the following EL expression does not get evaluated:
    $ { person.name }
    Person is a Java bean class. And here is the header of my web.xml file:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    </web-app>

    It seems you know the answer already.
    In order for EL expressions to work in a JSP page you need
    - a JSP2.0 container (eg Tomcat 5)
    - your web.xml must declare itself as version 2.4
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
    </webapp>The other way to do it for individual pages is with a page directive.
    <%@ page isELIgnored="false" %>
    But fixing web.xml does it for all pages in the application.
    Cheers,
    evnafets

  • If statement is not validating properly in JSP

    Actually i'm new to Java..
    The problem is when i take the parameter from another file which is an empty text box and i submit that. In the next jsp file i'am taking this value using getParameter("xxxx").
    if i send the empty or some value to this parameter, the if statement is not validating properly.
    here is my code in jsp....
    <%
    String bgcolor = request.getParameter("bgColor");
    out.println("Background Color = " + bgcolor);
    if (bgcolor == null)
    out.println("Hello Null");
    else
    out.println("Hello Not Null");
    %>
    Thanks in advance
    Kumar

    Hey there, you should know that Strings in Java are
    different from other types like int and double for
    example. Strings are objects so you cant check em
    with == but with the standard method .equals This is true but is not the problem here.
    @OP null and an empty length string are NOT the same thing. You probably want a check like
    if(bgColor.length()<1)And you might want to trim the String first to get rid of whitespace.

  • EL expressions not evaluated in custom tag attribute

    I'm writing a custom tag implementation where I need to have some attribute values
    dynamically evaluated using EL, such that I can write:
    <mytaglib:mytag id="${somevar}"/>
    I cannot seem to accomplish this, however. My taglib tag definition looks like this:
         <tag>
              <name>mytag</name>
              <tag-class>myclass</tag-class>
              <body-content>empty</body-content>
              <description>
    Foo
              </description>
              <attribute>
                   <name>articleId</name>
                   <required>true</required>
                   <rtexprvalue>true</rtexprvalue>
                   <type>java.lang.String</type>
              </attribute>
         </tag>
    The implementation of myclass extends TagSupport (since I need to get at the PageContext). The setArticleId() method looks like this:
    public void setArticleId(String idStr) throws JspException {
    if (logger.isDebugEnabled()) {
    logger.debug("idStr = " + idStr);
    try {
    /* XXX: Somehow, the evaluation should happen automagically, but
    * I can't figure out why that doesn't happen!
    String articleIdStr = (String)pageContext.getExpressionEvaluator().evaluate(
    idStr,
    java.lang.String.class, pageContext.getVariableResolver(), null);
    this.articleId = Integer.parseInt(articleIdStr);
    } catch (ELException e) {
    throw new JspException("Failed to parse article id expression");
    Why does it not work automagically?

    Make sure you are working with a JSP 2 container (like Tomcat 5). Also, you should make sure that your web.xml is configured to use the newest Servlet Spec. Read reply #6 on: http://forum.java.sun.com/thread.jspa?threadID=629437 to make sure it is set up properly.
    If you are not using a JSP 2.0 container, then you will not be able to use EL in your custom tag. See: http://forum.java.sun.com/thread.jspa?forumID=45&threadID=725503 for alternatives.

  • SQL command (with XPath) does not work properly with JSP

    Hello everyone,
    I try this SQL command on Oracle SQL Developer,
    select filename,
    extract(xml_col, '/Operation/Records/tabDetail/Vehicle_Level/text()') as Vehicle_Level,
    extract(xml_col, '/Operation/Records/tabDetail/Vehicles_Closed/text()') as Vehicles_ID
    from ope
    where upload_datetime in
    (select min(upload_datetime)
    from ope
    where (TO_DATE(TO_CHAR(upload_datetime, 'DD-MM-YYYY'),'DD-MM-YYYY'))
    between TO_DATE('01-01-2008','DD-MM-YYYY') and TO_DATE('01-07-2008','DD-MM-YYYY')
    HAVING (filename like '60-1-%')
    GROUP BY filename);
    It works properly, the result is :
    FILENAME --------------------- VEHICLE_LEVEL --------------------- VEHICLES_ID
    60-1-OPE-1.xml --------------------- 3 --------------------- 60-1-VEH-43
    But when I try this command on JSP, the result is :
    FILENAME --------------------- VEHICLE_LEVEL --------------------- VEHICLES_ID
    60-1-OPE-1.xml --------------------- null --------------------- null
    I don't want "null" value, but I don't know where is wrong. Please help me.
    Thank you very much.
    Orange Jasmin

    If you know that the videos and music have been working before and that the ID3 tags are correct I suggest that you try to reinstall the phone software using Update Service.
    http://www.sonymobile.com/gb/tools/update-service/
    Let me know if these problems remains after reinstall.
     - Community Manager Sony Xperia Support Forum
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Expression not evaluating

    Hi,
    I am creating a package and trying to evaluate an expression but it is not working.  Here is the code
    var package = new Package();
    package.Variables.Add("EmployeeId", false, "User", "1001");
    var v = package.Variables.Add("SelectQuery", false, "User", "");
    v.Expression = "SELECT * FROM Employees WHERE EmployeeId= @[User::EmployeeId]"; //This is evaluating to ""
    v.EvaluateAsExpression = true;
    var query = v.Value.ToString();  //Here the value is "";
    If I assign v.Expression = "@[User::EmployeeId"; //this is evaluating to the value 1001
    I need to create a package like this because programmatically later I am changing the EmployeeIdvariable value.
    I also tried v.Expression =  "SELECT * FROM Employees WHERE EmployeeId=" + "@[User::EmployeeId]";
    Venkat Sriramulu

    The example is not working, just showing you more code and how I am using the variable.  Pls note DataFlow option creation and Pipepline object etc is not included for simplicity.
    In the source component I want the query to be dynamically evaluated.
    var package = new Package();
    package.Variables.Add("EmployeeId", false, "User", "1001");
    var v = package.Variables.Add("SelectQuery", false, "User", "");
    v.Expression = "SELECT * FROM Employees WHERE EmployeeId= @[User::EmployeeId]"; //This is not working
    v.EvaluateAsExpression = true;
    IDTSComponentMetaData100 srcComponent = pipeline.ComponentMetaDataCollection.New();
    srcComponent.ComponentClassID = "DTSAdapter.OleDbSource";
    srcComponent.ValidateExternalMetadata = true;
    IDTSDesigntimeComponent100 srcDesignTimeComponent = srcComponent.Instantiate();
    srcDesignTimeComponent.ProvideComponentProperties();
    srcComponent.Name = "Employee";
    // Configure it to read from the given table
    srcDesignTimeComponent.SetComponentProperty("AccessMode", 2);
    srcDesignTimeComponent.SetComponentProperty("SqlCommandVariable", "User::SelectQuery"); //Variable is used here. But this is not working.  I hope I am using the variable right.
    srcComponent.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(connectionManager);
    srcComponent.RuntimeConnectionCollection[0].ConnectionManagerID = connectionManager.ID;
    // Retrieve the column metadata
    srcDesignTimeComponent.AcquireConnections(null);
    srcDesignTimeComponent.ReinitializeMetaData(); //getting Exception from HRESULT: 0xC0202009
    srcDesignTimeComponent.ReleaseConnections();
    After the package is build, I will want to change the EmployeeId variable value and the query should automatically get evaluated and work with the new employee id.
    Venkat Sriramulu

  • Format Expression not working properly in SSRS Report table cell

    Hello, for negative number format i am using the following format expression "#,##0,,;(#,##0,,)". For negative zero (negative values rounded to zero) the expression works fine in excel sheets(Format Cell expression) but not giving parenthesis for
    negative zero in SSRS Reports. 
    Please help me for this issue.
    Thanks in advance

    Can you try giving a custom format expression as below
    =IIF(Val(Fields!FieldName.Value)<0,"(#,##0,,)", "#,##0,,")
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Airport express not working properly

    Airport Express can't be found on my Powerbook G4. I'm right next to it so that's not the issue. Another pc in the house is connected and can pick it up no problems.
    I have tried resetting it to no avail. Tried the admin utility but can't do anything as can't find anything to do something with...(same with setup assistant) - I just returned from a week away and this is really frustrating.
    If anyone can offer some prectical insights they would move magically to the top of my friends list.
    Thanks in advance for your time.
    DK

    Managed to find an answer for others in the same situation. It seems to be something to do with another wireless network nearby using the same channel.
    I solved it by logging onto the admin utility with the PC that could access the network and manually change the channel.
    Works fine now.

Maybe you are looking for

  • Reading from file one at a time

    I am trying to read from an Excel file one cell at a time, and am having some trouble. I have included my VI. Any help would be greatly appreciated. Attachments: demo.vi ‏165 KB

  • Ugly spots on the back panel of my iPod :'(

    Has anybody encountered this ?? Looks very bad, especially when my ipod is just two months old... Just kept my iPod unused in a cover for two weeks, and this happened Apple-do-be-doo, where r u  

  • Amazon prime, iPad to tv.

    Amazon prime wont work with AirPlay even thought it's playing on the ipad2.  Does anyone know if it will work by connecting the tv to the iPad2 with an HMDI cable?

  • Iphoto Not keeping my imported photos

    When I import photos into iphoto from the SD card, once I exit/quit the application and reopen it. The photos are ANYWHERE in Iphoto, not even in the trash can, or in last import, last 12 months. I can't find them anywhere in Iphoto, they are been mo

  • ALV Insert Button Drop Down

    Hi all, Can any body please tell me that in ALV grid, how can i get the drop down for insert button in the tool bar with options "Add 1", "Add 2" ... inserting 1, 2 or 3 lines?? Thanks in advance, Kulwant