Issue with passing parameters from JSP to Backing bean

hi ,
I have an issue in passing parameters from my JSP to backing bean. I want to fetch the parameter from my URL in backing bean .This is how i am coding it right now. But the parameter companyID returns me null.
URL http://localhost:8080/admin/compadmin.jsp?companyID=B1234.
In my backing bean
FacesContext context = FacesContext.getCurrentInstance();
String companyID = (String)context.getExternalContext().getRequestParameterMap().get("CompanyID");
     public void setCompanyID(String companyID)
          this.companyID=companyID;
     public String getCompanyID()
          return this.companyID;
faces-config.xml :
   <managed-bean-name>admincontroller</managed-bean-name>
          <managed-bean-class>com.admin.controller.AdminController</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <property-name>companyadminbean</property-name>
               <property-class>com.admin.model.AdminBean</property-class>
               <value>#{companyadminbean}</value>
                     </managed-property>
                    <managed-property>
                             <property-name>companyID</property-name>
                          <value>#{param.companyID}</value>
                         </managed-property>Please let me know if iam missing something.Appreciate your help in advance
Thanks

Thanks very much for your input. I made changes to my bean accordingly. Actually the method getAdminType() is a not a getter of a property. It's just a method which iam calling in AdminController bean constructor to verify whether the person is System Admin or Client admin. So now the issue is inspite of making changes still the link "Copy Users" shows up for Client admin too which is incorrect.
My Administrator bean:
public class Administrator {
  boolean GSA=false;
  boolean SA=false;
  public Administrator(){}
public boolean isGSA()
    return GSA;
  public boolean isSA()
    return SA;
  public void setGSA(boolean value)
    this.GSA=value;
  public void setSA(boolean value)
    this.SA=value;
}My backing bean:
public class AdminController {
private AdminBean adminbean = new AdminBean();
public AdminController(){
int userID=1234;
this.getAdminType(userID);           
public void getAdminType(int userID)
         Administrator admin = new Administrator();
         if (userID<0) return;
         try{
             if(Rc.isGlobalSystemAdmin(userID)){
                  admin.setGSA(true);
                          }else if(Rc.isClientSystemAdmin(userID)){
                  admin.setSA(true); // i could see these values setup correctly in the admin bean when i print them
             adminbean.setAdmin(admin);
              } catch (Exception e){ }
Admin Bean:
public class AdminBean {
private Administrator admin; 
public Administrator getAdmin()
                    return this.admin;
          public void setAdmin(Administrator admin)
                    this.admin = admin;
faces-config.xml
<managed-bean>
          <managed-bean-name>admincontroller</managed-bean-name>
          <managed-bean-class>com.controller.AdminController</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <property-name>adminbean</property-name>
               <property-class>com.model.AdminBean</property-class>
               <value>#{adminbean}</value>
         </managed-property>
     </managed-bean>
     <managed-bean>
          <managed-bean-name>adminbean</managed-bean-name>
          <managed-bean-class>com.model.AdminBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
          <managed-property>
               <managed-property>
               <property-name>admin</property-name>
               <property-class>com.model.Administrator</property-class>
               <value>#{admin}</value>
                         </managed-property>
     </managed-bean>     My JSP:<h:outputLink id="ol1" value="/companyadmin/copyusers.jsp">
           <h:outputText id="ot1" value="Copy Users" rendered="#{adminbean.admin.isGSA}" /><f:verbatim><br/></f:verbatim>
           </h:outputLink>    so now the issue is thelink copy users is displayed even #{adminbean.admin.isGSA} is FALSE. please advise.
Thanks
Edited by: twisai on Oct 15, 2009 7:06 AM

Similar Messages

  • Issue with passing parameters through Java-JSP in a report with cross tab

    Can anyone tell me, if there's a bug in Java SDK in passing the parameters to a report (rpt file) that has a cross tab in it ?
    I hava report that works perfectly fine
       with ODBC through IDE and also through browser (JSP page)
    (ii)    with JDBC in CR 2011 IDE
    the rpt file has a cross tab and accpts two parameters.
    When I run the JDBC report through JSP the parameters are never considered. The same report works fine when I remove the cross tab and make it a simple report.
    I have posted this to CR SDK forum and have not received any reply. This have become a blocker and because of this our delivery has been postponed. We are left with two choices,
       Re-Write the rpt files not to have cross-tabs - This would take significant effort
    OR
    (ii)  Abandon the crystal solution and try out any other java based solutions available.
    I have given the code here in this forum posting..
    CR 2011 - JDBC Report Issue in passing parameters
    TIA
    DRG
    TIA
    DRG

    Mr.James,
    Thank you for the reply.
    As I stated earlier, we have been using the latest service pack (12) when I generated the log file that is uploaded earlier.
    To confirm this further, I downloaded the complete eclipse bundle from sdn site and reran the rpt files. No change in the behaviour and the bug is reproducible.
    You are right about the parameters, we are using  {?@Direction} is: n(1.0)
    {?@BDate} is: dt(d(1973-01-01),t(00:00:00.453000000)) as parameters in JSP and we get 146 records when we directly execute the stored procedure. The date and the direction parameter values stored in design time are different. '1965-01-01' and Direction 1.
    When we run the JSP page, The parameter that is passed through the JSP page, is displayed correctly on the right top of the report view. But the data that is displayed in cross tab is not corresponding to the date and direction parameter. It corresponds to 1965-01-01 and direction 1 which are saved at design time.
    You can test this by modifying the parameter values in the JSP page that I sent earlier. You will see the displayed data will remain same irrespective of the parameter.
    Further to note, Before each trial run, I modify the parameters in JSP page, build them and redeploy so that caching does not affect the end result.
    This behaviour, we observe on all the reports that have cross-tabs. These reports work perfectly fine when rendered through ODBC-ActiveX viewer and the bug is observable only when ran through Java runtime library. We get this bug on view, export and print functionalities as well.
    Additionally we tested the same in
        With CR version 2008 instead of CR 2011.
    (ii)   Different browsers ranging from IE 7 through 9 and FF 7.
    The complete environment and various softwares that we used for this testing are,
    OS      : XP Latest updates as on Oct 2011.
    App Server: GlassFish Version 3 with Java version 1.6 and build 21
    Database server ; SQL Server 2005. SP 3 - Dev Ed.
    JTds JDBC type 4 driver version - 1.2.5  from source forge.
    Eclipse : Helios along with crystal libraries directly downloaded from SDN site.
    I am uploading the log file that is generated when rendering the rpt for view in IE 8
    Regards
    DRG

  • Passing parameters from JSP to Batch file

    hi,
    i had a small problem regarding passing parameter from JSP to a batch file.
    My program is like this..........
    I wrote a batch file which opens and pings a remote system. Code looks like this......
    ping %1 -t
    which takes one argument and named this as "a.bat"
    The corresponding JSP page has lot of links which contains IP Addressess. From JSP page, i am calling "a.bat" so that it will open and start pinging corresponding IP Address. So i want to know how can i pass the corresponding IP from a JSP to batch file so that it start pinging remote machine........... can any body help me in this regard??
    Thanks in Advance.
    cheers,
    Sudhakar.

    it might be a permissions problem for the process itself. i once fought for some time with a java app that would mysteriously exit (no exceptions or any VM vomit) i finally discovered that the application was killed when the screen saver came on. just a regular screen saver mind you.
    at any rate i did see this issue and other strange ones like it reported here and there, i think i once say a bug report here on it but I can't seem to find it now. i believe this is fixed in 1.4.
    this of course may not be of much help to you.
    the two workarounds i found were 1) to turn off my screen-saver, 2) set up the program as an NT service. for the NT service i used this stuff http://www.kcmultimedia.com/
    so my suggestion for weird process permission problems on NT would be to try and make it into a service.

  • Passing parameters from JSP to JSP

    How can I pass parameters from one JSP to another JSP?
    JSP1 calls JSP2. I need to pass some values in JSP 1 to use in JSP 2.
    Please help.
    Thanks.

    use jsp:forward and param tags

  • Pass parameters from JSP Dyn Page to WDJ Application

    Hi,
    I am trying to pass parameters from my JSPDyn Page to WDJ Application.
    I am using NWDS 7.1 EHP1
    My code is :
    function to_WEBDYNHK()
          EPCM.relaxDocumentDomain();
          EPCM.doNavigate
        ('ROLES://pcd:portal_content/Himanshu.Himanshu/TestDynUIApp?DynamicParameter="hkparam%3Dqwertyuio"');
    This method is being called on click of a button.
    hkparam is the parameter in question.
    The JSPDyn page is an iView and the WDJ application is a page and both have been assigned to a role.
    In the properties of the WDJ Page, I have removed DymanicParameter from "Do not Forward These Parameters To Web Dynpro" property.
    However I am getting null as the value of hkparam in my WDJ application.
    The code used is :
    IWDRequest request = WDProtocolAdapter.getProtocolAdapter().getRequestObject();
           String param1= request.getParameter("hkparam");
    What seems to be missing here.
    Please help.
    I went through the documentation on SDN but it does not seem to help.
    TIA,
    Himanshu

    Hi Himanshu,
    Try this code.
    EPCM.doNavigate("ROLES:portal_content/Himanshu.Himanshu/TestDynUIApp?hkparam=Dmypass1123")
    if the parameter is hkparam and the value to be passed is Dmypass1123. You need not change any design time property of the WD page, and WDProtocolAdapter should retrive the parameter.
    Regards,
    Vishweshwara P.K.M.

  • Passing parameters from Trinidad Chart to Bean

    I am trying to pass two parameters with a trinidad chart, is that possible, I get
    setActionListener must be inside of a UIComponent tag.
    my jsp has
                        <tr:chart id="chart" inlineStyle="width:680px; height:400px;"
                                       value="#{iPIChartBean.value}" binding="#{iPIChartBean.component}">
                                       <tr:setActionListener from="HPI" to="ScenarioItemType"/>
                                       <tr:setActionListener from="3" to="ScenarioItemID"/>
                        </tr:chart>
    Bean code:
                   RequestContext context = RequestContext.getCurrentInstance();
                   Map map = context.getPageFlowScope();
                   ScenarioItemType = (String)map.get("ScenarioItemType");
                   ScenarioItemID = (Integer)map.get("ScenarioItemID");
                   _chartModel.setScenarioItemID(ScenarioItemID);
                   _chartModel.setScenarioItemType(ScenarioItemType);
    what am I doing wrong.
    I have tried the <f:param solution but get null when I use FaceContext to get the data.
    Regards,
    Sameer Jaffer

    hi,
    i am new to jsf . I have problem in passing value
    from jsf page to bean
    ere is my jsf page code.
    <h:dataTable value ="#{DatabaseBean.table}" var=
    "row">
    <h:column>
    <h:selectOneRadio>
    <f:selectItems value ="#{user.options}"/>
    </h:selectOneRadio>
    /h:coumn>
    I want to pass value #{row.Ans} to bean
    which I intend to use in getOptions method to
    populate the selectitems list.give me any possible
    solution.
    shilI think if I understand you correctly, you need access to the current row of the data table. In that case, use the binding attribute on the dataTable tag to bind the data table instance to a UIData attribute on your bean. Then within getOptions() you can invoke UIData.getRowData() to get the current item being iterated (i.e. the equivalent of "#{row}").

  • How to pass value from jsp to java bean

    I have huge problem . How to pass value from jsp value to java bean.Please replay me soon

    Use the <jsp:setProperty> tag. There are several ways to use it. The one you probably want is:
    <jsp:setProperty name="bean_name"  property="property_name"  value="the_value_you_want_to_set"/>

  • Passing Parameters from JSP with Drill Down Graphs

    Hello,
    I have 2 JSP's where when user clicks on the bar graph it drill down and goes to next JSP, it is hyperlink. How can I pass parameters using HttpPortletRendererUtil.portletParameter
    My JSP code is something like this which is pasted below.
    StandardCategoryURLGenerator("xy_chart.jsp","series","section")) is the function, I need to use for drill down.
    Kindly help me with this and any help is highly appreciable.
    Thanks
    ************ JSP**************
    CategoryAxis categoryAxis = new CategoryAxis("Site");
    ValueAxis valueAxis = new NumberAxis("Value");
    StackedBarRenderer3D rend = new StackedBarRenderer3D();
    StandardCategoryToolTipGenerator tt = new StandardCategoryToolTipGenerator();
    rend.setItemURLGenerator(new StandardCategoryURLGenerator("xy_chart.jsp","series","section"));

    Trenton,
    One way to pass parameters to other portlets on the page while using a form is to create a hidden form field and assign it the value that you need to pass to it. If the hidden field has an unqualified name (i.e. not created by using the portletParameter method) then it will be seen by all portlets on the page.
    Since all the form fields are passed on to the query string as part of the URL, you can then use request.getParameter(paramName) to take different actions in your portlets.
    You could use different techniques where based on the values you pass on to parameters of the portlets, some portlets make specific updates to themselves. Though the whole page would be refreshed, you could allow portlets to decide based on the incoming parameter value whether they need to change or not.
    So given the functionality you desire - here's something you might try.
    1) Create hidden form field that gets populated when you select values from the drop-down lookup.
    One way to do this would be to add a onChange ="populateMyHiddenParam(this.form)" to your form item that changes.
    And you could add a small JavaScript function that populates the parameter.
    e.g.
    function populateMyHiddenParam(thisForm){
    thisForm.myHiddenParam.value=thisForm.elements[4].value;
    2)In the other JSP portlet (on the same page) where you need to populate a table based on the value selected, just get the parameter value passed by using request.getParameter("myHiddenParam").
    Since you want this parameter to be read by other portlets, you need to create it as an unqualified parameter. So dont call the HTTPPortletRendererUtil.portletParameter while assigning the name to the form component for the hidden field.
    Hope this helps.

  • Crystal Report - problem with passing parameters from J2EE app

    i'm trying to pass a few parameters from my java application to a crystal report using the code below:
    ParameterField pfield1 = new ParameterField();
    ParameterField pfield2 = new ParameterField();
    Values vals1 = new Values();
    Values vals2 = new Values();
    ParameterFieldDiscreteValue pfieldDV1 = new ParameterFieldDiscreteValue();
    ParameterFieldDiscreteValue pfieldDV2 = new ParameterFieldDiscreteValue();
    pfieldDV1.setValue("1056");//dform.getSelectedPeriod());
    pfieldDV1.setDescription("termId");
    vals1.add(pfieldDV1);
    pfield1.setReportName("");
    pfield1.setName("@p_termId");
    pfield1.setCurrentValues(vals1);
    fields.add(pfield1);
    // check here for null condition otherwise will throw nullpointerexception
    pfieldDV2.setValue("elect");
    pfieldDV2.setDescription("allocType");
    vals2.add(pfieldDV2);
    pfield2.setReportName("");
    pfield2.setName("@p_allocType");
    pfield2.setCurrentValues(vals2);
    fields.add(pfield2);
    this report calls a stored procedure (sql server). the report displays the data but the same is not the case when i call ity from my java application. with a single parameter it works fine (even though i get a "Some parameters are missing values" ERROR on the console. But when i pass, say 2 parameters, it give me the above error first and then "JDBC Error: Parameter 2 not set or registered for output"
    Can anyone bail me out of this one?
    thanks,
    ptalkad

    I don't know about naming conventions, but could the @ signs in the variable names cause a problem?
    How have you set up the mapping in Crystal?
    Is this parameter 2 an "out" parameter returning a value?
    What version of Java are you using?
    Version of Crystal?
    What JDBC driver?

  • Issue with passing parameters to an applet?

    Hi,
    I have an apex page which is a popup page. I am passing parameters to the applet and then reading them in from my java code.
    Here is my applet code
    <SCRIPT>
      function getStatus(retStatus) {
        $s("P3_MESSAGE", ''||retStatus||'')
    </SCRIPT>
    <APPLET ARCHIVE="/i/bin/offline_load.zip" CODE="offline_load.class"  STATUSMSG WIDTH=0 HEIGHT=0>
    <PARAM name="username" value="&APP_USER.">
    <PARAM name="dbuser" value="&P3_DBUSER.">
    <PARAM name="dbpassword" value="&P3_DBPASSWORD.">
    <PARAM name="dbserver" value="&P0_DBSERVER.">
    <PARAM name="dbport" value="&P3_DBPORT.">
    <PARAM name="dbsid" value="&P3_DBSID.">
    </APPLET>P3_DBUSER, P3_DBPASSWORD, etc are all defined on page zero as hidden and protected items
    My applet code
    public void init() {
        CallableStatement load_stmt = null;
        String userName = this.getParameter("username");
        String dbUser = this.getParameter("dbuser");
        String dbPass = this.getParameter("dbpassword");
        String dbServer = this.getParameter("dbserver");
        String dbPort = this.getParameter("dbport");
        String dbSid = this.getParameter("dbsid");
        try {
          System.out.println("init(): loading OracleDriver for applet created at " + created.toString());
          Class.forName("oracle.jdbc.driver.OracleDriver");
          System.out.println("init(): getting connection");
          conn = DriverManager.getConnection("jdbc:oracle:thin:@" + dbServer + ":" + dbPort + ":" + dbSid, dbUser, dbPass);
        } // end tryThe odd thing is I have gotten this working twice then unexpectedly it just stops working when I make a change to the java applet code.
    And the changes have absolutely nothing to do with the above code it can be anything the first time was error handling I added
    to another section and the second I modified a stored procedure call.
    Anyone have any idea why this might be occurring as this is driving me completely insane :(
    Thanks in advance

    Hi,
    In your init() code, you have a "try" block - do you have a "finally" block to close the connection? Something like:
    finally {
      try {
        conn.close();
      catch (Exception ignore) {
    }Could it be that you have reached the limit of the number of available open connections?
    Your code looks ok as far as I can see (based on examples at: http://www.orafaq.com/wiki/JDBC )
    Also, in your new bits of code, have you added try/catch/finally blocks? Does the code compile fully (ie, no warnings)? Have you added new imports that may conflict with existing code such that you have to fully qualify existing objects/classes (eg, you may now have two DriverManager classes or CallableStatement objects)?
    Andy

  • How to pass object from JSF to backing bean

    Hi,
    I have a JSF page using repeater and RichFace Toolbar:
            <h:form id="professional-profile">
                <a4j:repeat value="#{profilesBean.profiles}" var="lang" binding="#{profilesRepeaterBean.repeater}">
                    <rich:togglePanel styleClass="data-input-panel" switchType="client" stateOrder="closed, opened">
                        <f:facet name="closed">
                            <rich:toolBar>
                                <rich:toggleControl switchToState="opened">
                                    <h:graphicImage style="border-width:0" value="../Images/open_btn.gif" />
                                    <rich:toolTip value="#{pp_msg.tooltipOpensPanel}" direction="top-right" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
                                </rich:toggleControl>
                                <h:outputText value="#{lang.language}"/>
                            </rich:toolBar>
                        </f:facet>
                        <f:facet name="opened">
                            <h:panelGrid style="width: 100%" columns="1">
                                <rich:toolBar>
                                    <rich:toolBarGroup location="left">
                                        <rich:toggleControl switchToState="closed"
                                                            onclick="if(!ConfirmUnsavedForAction('#{common_msg.unsavedDataWarning}')){return false;}">
                                            <h:graphicImage style="border-width:0" value="../Images/close_btn.gif" />
                                            <rich:toolTip value="#{pp_msg.tooltipClosesPanel}" direction="top-right" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
                                        </rich:toggleControl>
                                        <h:outputText value="#{lang.language}"/>
                                        <font class="counterColor">
                                        (#{pp_msg.remainingChars}:</font><h:outputText class="counterColor" id="charsCounter" value="${config.profestionalProfileMaxLength-fn:length(lang.profile)}"/>
                                        <font class="counterColor">)</font>
                                    </rich:toolBarGroup>
                                    <rich:toolBarGroup location="right">
                                        <a4j:commandLink id="submit"
                                                         action="#{cvData.editUsr}"                           <<<<<<<<<<<<<<<<<< THIS LINE
                                                         value="#{common_msg.buttonSave}"
                                                         messagePlace="textarea"
                                                         onclick="CommandOnClick(#{rich:element('textarea')},'#{common_msg.dataSaving}','#{common_msg.dataSaved}');"
                                                         data="#{facesContext.maximumSeverity.ordinal ge 2}"
                                                         oncomplete="CommandOnComplete(#{rich:element('textarea')},data,1500); DataSaved();">
                                        </a4j:commandLink>
                                    </rich:toolBarGroup>
                                </rich:toolBar>
                                <h:inputTextarea
                                    id="textarea"
                                    rows="10"
                                    styleClass="professional-profile-input-area"
                                    binding="#{profilesRepeaterBean.profileInput}"
                                    value="#{lang.profile}"
                                    label="#{pp_msg.header}"
                                </h:inputTextarea>
                            </h:panelGrid>
                        </f:facet>
                    </rich:togglePanel>
                    <br/>
                </a4j:repeat>
            </h:form>Currently all data are stored for all panels at "Save" button click. I want to change it to save only changed panel. For each toolbar an instance of "lang" object is created which i want to send to backing bean where I planned to merge with JPA.
        public void SaveCVProfile(ICvProfileLang profile) {
            cvData.editChangedProfile(profile);
        }All combinations I try gave me just String as parameter value, not an Object reference.
    Any ideas?

    Thanks BalusC,
    I must have messed up my previous tries.
    I used you hint with "f:setPropertyActionListener ".
    <a4j:commandLink id="submit"
                     value="#{common_msg.buttonSave}"   <<<<<< "action"  - REMOVED
                     messagePlace="textarea"
                     onclick="CommandOnClick(#{rich:element('textarea')},'#{common_msg.dataSaving}','#{common_msg.dataSaved}');"
                     data="#{facesContext.maximumSeverity.ordinal ge 2}"
                     oncomplete="CommandOnComplete(#{rich:element('textarea')},data,1500); DataSaved();">
        <rich:toolTip value="#{pp_msg.tooltipButtonSave}" direction="top-left" showDelay="${config.toolTipDelay}" styleClass="tool-tip"/>
        <f:setPropertyActionListener target="#{profilesBean.saveCVProfile}" value="#{lang}" />
    </a4j:commandLink>I removed "action" from commandLink and passed the object to action listener.
    It works as intended now, even without using UIData#getRowData().

  • Pass Parameters from JSP to PL/SQL

    I have a JSP portlet which consists of a few pages.
    Meaning, I move from one page to the next by using the "next_page" param from the JPDK.
    In one of my JSP pages, in its <form> tag, I have the action set to call a PL/SQL procedure
    (in the form of "pls/portal30.portal30.myPackage.myProcedure").
    The procedure is called, and everything works just fine.
    However, now I want to recieve some of the parameters I set in the URL in my PL/SQL.
    Meaning, just like I can do in the JSP "myRequest.getAttribute('itemID')", I want to do the same in PL/SQL.
    The way I'm doing it right now is not too great: in my JSP form I have a hidden field which, using javascript ("location.href") contains the current URL.
    Then, when the JSP is submitted, I start parsing the URL for the parameters I need.
    There MUST be a better way!
    Oh, and also, a very similar question -- what I've asked above speaks about passing the params through a "get" request to the PL/SQL. Can I also pass params in a "post?" Meaning, get session variables that were set in JSP context, into a PL/SQL procedure?
    Thanks,
    Dan

    Dan,
    mod_plsql enables you to pass any number of parameters to a PL/SQL procedure. The procedure should 'expect' the parameters (by having the right signature). You can use both GET and POST methods to pass the parameters.
    I'd pass the plain portal page URL (pr.getRenderContext().getPageURL() or something like this) in a hidden field, just like you do (but wouldn't use the JavaScript). All the additional parameters (you have at the end of the page URL as a result of the JavaScript) can be passed through hidden (or not hidden) fields.
    I'm not sure about the last paragraph of your question... The only way you can pass any information to the PL/SQL procedure is using parameters. So the JSP should read the session store and put the values into hidden fields of your form.
    Hope this helps a bit,
    Peter

  • Passing parameters from jsp to xslt

    Hi all,
    I am trying to pass a variable string from a jsp to xslt .
    This is the code in the jsp which passes the variables .
    <c:set var="xsl">
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:import href="<%= "service_attribute.xsl" %>"/>
    <xsl:variable name="ItemId"><%= ItemId %></xsl:variable>
    <xsl:variable name="pos"><%= pos %></xsl:variable>
    <xsl:variable name="lineInfoTn"><%= lineInfoTn %></xsl:variable>
    </xsl:stylesheet>
    </c:set>
    <x:transform xmlSystemId="foo.xml" xslt="${xsl}">
    <%= FM.getOrderBean().getXml("ActivationRequest") %>
    </x:transform>
    In the service_attribute.xsl I would like to be able to check the lineInfoTn variable for content .
    something like this .
    <xsl:if test="$lineInfoTn='10pt'">
    <!-- Do something -->
    <xsl:value-of select="$lineInfoTn"/>
    </xsl:if>
    The first problem is that it complains that the $lineInfoTn is not declared .
    So I added the variable as a global variable .
    <xsl:param name="lineInfoTn">10pt</xsl:param>
    Note I have been switching between variables and parameters to try and get this working .
    I can use the itemId variable like this and I dont have a problem .
    <xsl:for-each select="q:RequestItem/q:ItemId[text() = $ItemId]/..">
    Any ideas on how to get this working .
    Thanks for your help

    Thanks for the input

  • Problem with passing parameters from HTML

    Im unsure as to where to turn next with this problem. What is making it all the more infuriating is that I have had this code working previously and now cant for the life of me figure out how I did it.
    What Im trying to do is I have a HTML page with two buttons on, one called "Submit Application" and the other "Submit Resource" and when I click on one I want a JSP page to be called and a certain piece of SQL to be executed, likewise when I click on the other "Submit Application" button I want a separate bit of SQL to be executed. (I know in this example both bits of SQL are identical but that is just while I get the functionality correct).
    Whats happening is that the first bit of SQL will execute if I click the "Submit Resource" button, however when I click the "Submit Application"
    button I get a "Error 500:" displayed. Im at the end of my tether as to what to do next and as I say it makes it all the more infuriating in that I had it working before. So any help would be greatly appriciated.
    The code is as follows, I have highlighted the two IF statements :-
    <HTML>
    <FORM>
    <BODY>
    <%@ page import="java.util.*" %>
    <%@ page import="java.text.*" %>
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.sql.*" %>
    <%@ page import="javax.naming.*" %>
    <HTML>
    <HEAD>
    <TITLE>Resource Level Report</TITLE>
    <table width="200" border="1" align="center">
    <tr>
    <th scope="row"><img src="color_teradata_logo.gif"> </th>
    <td></td>
    <td><img src="lloydslogo.gif"></td>
    </tr>
    </table>
    <br>
    </HEAD>
    <BODY leftmargin=0 topmargin=0 marginwidth="0" marginheight="0">
    <%
    String dbURL="jdbc:oracle:thin:@lloyds.unitedkingdom.ncr.com:1521:smacdev";
    String dbUSER="agents";
    String dbPW="smac_us";
    String Resrce = request.getParameter("Resrce"); String Appln = request.getParameter("app"); String Subres = request.getParameter("Submit Resource"); String Subapp = request.getParameter("Submit Application"); Connection con = null;
    if (!Subres.equals (null)) {
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    con = DriverManager.getConnection(dbURL, dbUSER, dbPW); } catch(SQLException e) { System.err.println("Failure to connect " + e.getMessage()); }
    if (!Subres.equals (null)) {
    try
    String sqlstring = "Select app.application, res.resorce, res.system, res.status, res.unitofworkname, res.unitofworkvalue, res.capturetimestamp from agents.Resorce res, agents.applicationresource app where res.resorce = app.resorce and res.system = app.system and upper(res.resorce) = upper('"+ Resrce + "') order by 3";
    //out.println(sqlstring);
    //out.println(Subapp);
    //out.println(Subres);
    //commented this out, but enable you to see SQL that is been executed !!!
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery(sqlstring);
    int count =0;
    %>
    <table width ="380" border="0" align="center">
    <h1 align="center">Resource Level Reporting</h1>
    </table>
    <br>
    <table width="200" border="6" align="center" >
    <th bgcolor="#FF9933">System<th bgcolor="#FF9933">Resource<th
    bgcolor="#FF9933">Application<th bgcolor="#FF9933">Unit Of Work Name<th
    bgcolor="#FF9933">Timestamp <th bgcolor="#FF9933">Unit Of Work Value<th
    bgcolor="#FF9933">Status<tr>
    <%
    while (res.next()){
    String app= res.getString(1);
    String resorce = res.getString(2);
    String system = res.getString(3);
    String status = res.getString(4);
    String unitofworkname = res.getString(5);
    String unitofworkvalue = res.getString(6);
    String capturetimestamp = res.getString(7);
    String timestampmod = capturetimestamp.substring (0,19);
    String status1 = status.trim();%>
    <% if (status1.equals ("SYNC")) { %>
    <tr>
    <td bgcolor="#00FF33">
    <%out.print(system);%>
    <td bgcolor="#00FF33">
    <%out.print(resorce);%>
    <td bgcolor="#00FF33">
    <%out.print(app);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkname);%>
    <td bgcolor="#00FF33">
    <%out.print(timestampmod);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="#00FF33">
    <%out.print(status);%>
    <% }
    else if (status1.equals ("OOS")) { %>
    <tr>
    <td bgcolor="red">
    <%out.print(system);%>
    <td bgcolor="red">
    <%out.print(resorce);%>
    <td bgcolor="red">
    <%out.print(app);%>
    <td bgcolor="red">
    <%out.print(unitofworkname);%>
    <td bgcolor="red">
    <%out.print(timestampmod);%>
    <td bgcolor="red">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="red">
    <%out.print(status);}%>
    <%
    res.close();
    stmt.close();%>
    <tr>
    </table>
    <%
    catch (SQLException e) {
    out.println("Sql error here " + e.getMessage());
    finally {
    con.close();
    %>
    <%
    if (!Subapp.equals (null)) {
    try
    String sqlstring = "Select app.application, res.resorce, res.system,
    res.status, res.unitofworkname, res.unitofworkvalue, res.capturetimestamp
    from agents.Resorce res, agents.applicationresource app where res.resorce =
    app.resorce and res.system = app.system and upper(res.resorce) = upper('"+
    Resrce + "') order by 3";
    //out.println(sqlstring);
    //out.println(Subapp);
    //out.println(Subres);
    //commented this out, but enable you to see SQL that is been executed !!!
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery(sqlstring);
    int count =0;
    %>
    <table width ="380" border="0" align="center">
    <h1 align="center">Resource Level Reporting</h1>
    </table>
    <br>
    <table width="200" border="6" align="center" >
    <th bgcolor="#FF9933">System<th bgcolor="#FF9933">Resource<th
    bgcolor="#FF9933">Application<th bgcolor="#FF9933">Unit Of Work Name<th
    bgcolor="#FF9933">Timestamp <th bgcolor="#FF9933">Unit Of Work Value<th
    bgcolor="#FF9933">Status<tr>
    <%
    while (res.next()){
    String app= res.getString(1);
    String resorce = res.getString(2);
    String system = res.getString(3);
    String status = res.getString(4);
    String unitofworkname = res.getString(5);
    String unitofworkvalue = res.getString(6);
    String capturetimestamp = res.getString(7);
    String timestampmod = capturetimestamp.substring (0,19);
    String status1 = status.trim();%>
    <% if (status1.equals ("SYNC")) { %>
    <tr>
    <td bgcolor="#00FF33">
    <%out.print(system);%>
    <td bgcolor="#00FF33">
    <%out.print(resorce);%>
    <td bgcolor="#00FF33">
    <%out.print(app);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkname);%>
    <td bgcolor="#00FF33">
    <%out.print(timestampmod);%>
    <td bgcolor="#00FF33">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="#00FF33">
    <%out.print(status);%>
    <% }
    else if (status1.equals ("OOS")) { %>
    <tr>
    <td bgcolor="red">
    <%out.print(system);%>
    <td bgcolor="red">
    <%out.print(resorce);%>
    <td bgcolor="red">
    <%out.print(app);%>
    <td bgcolor="red">
    <%out.print(unitofworkname);%>
    <td bgcolor="red">
    <%out.print(timestampmod);%>
    <td bgcolor="red">
    <%out.print(unitofworkvalue);%>
    <td bgcolor="red">
    <%out.print(status);}%>
    <%
    res.close();
    stmt.close();%>
    <tr>
    </table>
    <%
    catch (SQLException e) {
    out.println("Sql error here " + e.getMessage());
    finally {
    con.close();
    %>
    </BODY>
    </FORM>
    </HTML>
    I think the error messages I am getting are :-
    [15/09/04 12:38:36:535 BST] 45b5f97b WebGroup I SRVE0180I: [SMAC Web Front End] [smac] [Servlet.LOG]: /JSP/Resreports.jsp: init
    [15/09/04 12:39:08:510 BST] 7abd7978 WebGroup I SRVE0180I: [SMAC Web Front End] [smac] [Servlet.LOG]: /JSP/Resreports.jsp: init
    [15/09/04 12:39:15:273 BST] 7abd7978 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
         at org.apache.jsp._Resreports._jspService(_Resreports.java:117)
         at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet$JspServletWrapper.service(JspServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.serviceJspFile(JspServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.jsp.servlet.JspServlet.service(JspServlet.java(Compiled Code))
         at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
         at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
         at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
         at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
         at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.invoke(CacheableInvocationContext.java(Compiled Code))
         at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
         at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
         at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
         at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))

    You make your comparisons like this:
    if (!Subapp.equals (null))
    Well, what happens if Subapp IS equal to null. The .equals method call will be called from a NULL and you will get a NullPointerException.
    When testing for null you do:
    if (Subapp == null) (or if (Subapp != null)
    This is okay when dealing objects even with the mantra of 'don't use == to compare objects, because what you are really testing is if the reference points anywhere, and == will compare the reference.
    Also, next time you post, make sure to use the [code] tags as described in the [Formatting Help] link. It will make it easier to read.
    Also, you should try to remove the SQL from the JSP. Move it into a Servlet which builds a List that forwards to another JSP for display, or use a bean. Using java classes like Servlets and JavaBeans makes it easier to debug, and makes your JSP code easier to manage.

  • Help with passing parameters from a servlet to an applet

    dear all
    i m working on a application which will check weather a file is present in a server (webserver) if it is present then it will take the file name and put it into a drop down list and there is a button on click of which i m taking the call to an applet and then on that i need the file name if it is there then i use it to draw a graph
    i m struck on how to take parameter from Servlet -> Applet
    thanks
    Nakul

    hi,
    I understood your question,The context "servlet" cannot communicate to
    an applet becoz applet runs at clients browswer, rather you can communicate from an applet to servlet(HTTPURLCONNECTION class).
    Well coming to the problem, this is how i have understood your problem,
    basically uou get the list of files from the server using normal servelt programing and you will display in an html LIst box and then click the button to view the graph or chart ,
    then you just want to pass the filename which is there in the listbox to an applet and applet will display some image.
    As we know all that using <PARAM NAME=XX VALUE=YY> WE CAN GET THE VALUE IN APPLET BY USING GETPARAMTER() METHOD. and Im very sure that you are not asking that question. your question is like " both the applets and
    the listboxes will be loaded at once and when he selects one of the file from the list box then without refreshing the page , how to display the graph.
    Im i right?
    If so i guess you have to use javascript to do that stuff, and i think its like gave an id for the tag shown <applet id="yes">
    then in the javascript , you can call the Java applet methods (I have never tried before but seen some demos(i dont have that links- google it for inf))
    but i can give clue like.. trying the <PARAM VALUE=""> IF POSSIBLE
    CHAING THE HTML CONTENT IS POSSIBLE IN IE which is again through javascript by calling yes.innerHTML="<PARAM><PARAM><PARAM><PARAM>..."
    Im sure that you can call Java methods from javascript but i never tried and even you can pass an arguments to it.. Let me check out like
    becoz even im interested to know abt it
    bye
    with Regars
    Lokesh T.C

Maybe you are looking for

  • Hard drive is running out of space!!  HELP!!

    I just purchased a new macbook pro with retina 4 days ago.  I've noticed that the hard drive is almost out of space already.  I removed all pics and music to external drive and still have "backups and other" that are taking up 75% of HD.  How do I cl

  • Sound on ichat video not working

    my friend just recently got herself a macbook and we decided to try the video on ichat but the problem is, i can hear her but she can't hear me and i don't know what's wrong. what dshould i do?

  • Problem with output string to command

    hey i have no idea why this aint working its a simple output string to command. what it is supposed to do is make a new directory given by the input string e.g. mkdir /home/luke/dep thanks for the help //methods input save files      saveFile = JOpti

  • Problem installing the .ipa development app

    I'm trying to install the development app to test it before submiting to apple, but everytime I try to sync it from iTunes i gets an error saying that the installation has failed. Also, testing the app run on iPhone, but the folios aren't displaying

  • Where is the brush tool associated with tablets gone to in CS6?

    I have a problem right now. Do you know that icon which is next to the brush size icon once you select the brush tool? That icon once you insert a drawing tablet in so that your drawings can be better with how much pressure you put into it? I forgot