How to use JSTL varriable in to XML

1. how to use JSTL varriable into Xml Tag.
for example :
java value I am passing to XML.
<eztag:companytag pgm_sname="<%= strpgm_name%>" dbase="<%= strd%>"
dbpass="<%= strp%>" dburl="<%= stru%>" session="<%= session%>" />
After modified in JSTL
<eztag:companytag pgm_sname="${pgm_name}" dbase="${strd}"
dbpass="${strp}" dburl="${stru}" session="${session}" />
but its Not working. How to use this
2.How to use ArrayLIst in JSTL
For example
IN Java scriplet code in JSP
<%for(int i=0;i<alist.size();i++) {
String str = String.valueOf(alist.get(i));
String str1 = String.valueOf(alist.get(i+1));
%>
<TD>STR - <%=str%> </TD>
<TD>STR1 - <%=str1%> </TD>
<% } %>
This code How to Use in JSTL.
thanks in advance

thanks for reply
But in this article it describes how to passing the value of function.
I need how to assign the JSTL varriable to xml tag attribute.
for example
In my TLD File
<tag>
<name>companytag</name>
<tag-class>bas.CompanyTag</tag-class>
<attribute>
<name>dbase</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>dbpass</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>dburl</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>pgm_sname</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<name>session</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
</tag>
Html code
old code :
<%@ taglib uri="/ezerptags.tld" prefix="eztag" %>
<eztag:companytag pgm_sname="<%= strpgm_name%>" dbase="<%= strd%>"
dbpass="<%= strp%>" dburl="<%= stru%>" session="<%= session%>" />
After modified in JSTL
<%@ taglib uri="/ezerptags.tld" prefix="eztag" %>
<eztag:companytag pgm_sname="${pgm_name}" dbase="${strd}"
dbpass="${strp}" dburl="${stru}" session="${session}" />
but its Not working. How to use this
the "eztag" and "companytag" are the customtag. these tages available in eztaglib.tld file. I am passing the value through XML Tag.
Please suggest me . how to use.
is there any article describes how to pass jstl varriable to XML Tag attribute.
thanks in advance

Similar Messages

  • How to use Xerces to validate an XML file against a DTD

    Hi, can anybody tell me how to use Xerces to validate an XML file against a DTD. its urgent. post some sample code. it would be helpful for my project. isupposed to use SAX parser(Xerces)
    Thanx in advance

    Come on, I googled "xerces validate" and the first link is the Xerces FAQ:
    http://xerces.apache.org/xerces-j/faq-general.html
    And of course "how to validate" is a Xerces FAQ. Help yourself by doing a little research instead of waiting for other people.

  • How to use XMLEncoder to save Complicated XML??

    I think I posted in an improper forum: java programming, so repost here. Please excuse me.
    Dear friends, good weekend and happy thanksgivings.
    I met a problem when I use XMLEncoder to generate a complicated XML like following:
    <?xml version="1.0"?>
    <messages>
      <note ID="501">
        <to>Tove</to>
         <DeliveryAddress>
              <Street>12345</Street>
              <City>Parsinpany</City>
              <County>ABC</County>
              <State>NJ</State>
              <Country>USA</Country>
             </DeliveryAddress>
         <ContactID>
              <CompanyID>
                   <Address>12345</Address>
                   <City>Alnomre</City>
                   <County>BBB</County>
                   <State>TX</State>
                   <Country>USA</Country>
                  </CompanyID>
              <phone>1800-1234567</phone>
              <fax>123-456-7890</fax>
             </ContactID>
        <from>Jani</from>
        <heading>Reminder</heading>
        <body>Don't forget me this weekend!</body>
      </note>
      <note ID="502">
        <to>Jani</to>
        <from>Tove</from>
        <heading>Re: Reminder</heading>
        <body>I will not!</body>
      </note>
    </messages>How to use XMLEncoder to generate abobe XML or one that has namespaces in it??
    I can use simple
    XMLEncoder o = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(filename)));
                                  o.writeObject(mm.getBounds());     //get all position;
    but cannot generate above complicated XML.
    What is the right way to do it??
    any good example??
    Thanks

    My question is also how to use XMLEncoder to create attributes and and namespace, add child nodes to its parent, or remove nodes from their parent etc
    Thanks

  • How to use JSTL create a dynamic table according to a database???

    How to use JSTL create a dynamic table according to a database in a web page? Who can help me? Thanks.

    How to use JSTL create a dynamic table according to a
    database in a web page? Who can help me? Thanks.???
    Could you rephrase your quesion?
    Do you want to display records by reading from a table in DB?

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • How to use method POST to send XML using utl_http?

    Hi,
    I am trying to work out how to use the POST method to mimic submitting data from a HTML form, using utl_http.
    I cannot use SOAP for this as the people I am sending the data to are just expecting an XML document to be sent to a standard CGI script running on their web server.
    There is a lot of documentation on how to submit data using the POST method (using Utl_Http.Write_Text etc), but I cannot find anything that tells me how to submit form variables.
    The examples on OTN say this:
    "Alternatively use method => 'POST' and Utl_Http.Write_Text to
    build an arbitrarily long message"
    but don't tell me how to actually place the data into the required input parameters of the CGI program I am hitting.
    I need to hit a URL such as
    www.asite.com/cgiprogram
    and pass in a parameter, eg
    in_param="test+data"
    I am currently doing this as a GET, which works, but the XML document I am passing in could potentially be bigger than the GET method will allow.
    Any help would be greatly appreciated.
    Thanks,
    Leon.

    Please try the PL/SQl forum

  • How to use jstl in weblogic 8.1

    I tried to use JSTL in my jsp file and I add
              <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> at the top line. But the server reported
              java.lang.NoClassDefFoundError: javax/servlet/jsp/el/VariableResolver
              how to solve this problem?

    WebLogic 8.1 supports JSP 1.2, which doesn't natively implement the JSTL or the expression language. If you download the Jakarta Taglibs implementation of the JSTL (for JSP 1.2, not JSP 2.0), then you can use the JSTL taglib as a normal taglib. Note that this doesn't give you the ability to use the other JSP 2.0 tag features, like using the expression language in body content.
              Make sure that you use the uri value specified in the tld that you're using. I believe the values are different between the JSP 1.2 and JSP 2.0 versions.

  • How to use JSTL for vectors

    I am using vectors in my bean class.I am using traditional scriptlet code to get Vector in jsp using
    <jsp:usebean id="tds" class="com.TrainBean" />
    and i get vector like this from Bean
    Vector v=tds.getName();
    and i use scriptlet to print values of vector like
    <%
    for(int i=0;i< v.size() ;i++){                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Vishal_Fichadiya wrote:
    ya i had tried using <C:forEach but it didnt work
    can u plz give me an example so tht i can use it
    wit array list and can use JSTL in thtSee this [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL3.html]

  • How to use 2 vo's in xml publisher pdf genarate report from oaf--urgent

    Hi Guru's,
    i am integrating xml publisher report from oaf. I found one good artical published by prabaker in apps2fusion site and i implemented the same. But it is used onley one view object to generate pdf. But in my case i want to use 4 view objects to generate report as pdf. So, kindly suggest me how to resolve this issue.
    below i mentioned the site name whihc i follwed to implement my requirement.
    http://apps2fusion.com/at/51-ps/260-integrating-xml-publisher-and-oa-framework.
    pls help me as i am not getting , how to solve this issue.
    Thanks in advance.
    Keerthana

    Hi,
    When we develop simple XML report also we used to get single data source either generated either from RDF or PL/SQL, in OAF XML data is coming from VO and XML Publisher API’s will process that data.
    This approach works fine if you are having one VO, but if you are having two VOs then it is not possible (As per my understanding and comparing this scenario with simple XML publisher report).
    I also faced same problem few months back, on my form I was having two VOs one for header and other for Lines and I have generate Report to show the data for both Headers and Lines. In my case I created a separate VO that was containing both Header and Line details and I was passing header Id to query that. I used query this VO only when someone clicks on “Print” button and it worked fine for me.
    Regards,
    Mahesh B.

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • How to use the 'next' softkey in XML Directory - SPA504G

    I have the basic XML Directory stuff working (CiscoIPPhoneDirectory) on the SPA504G. However I realise I can only display 32 entries and I note that there is a "next" softkey enabled, however it seems to not do anything. How can I link this button press to fetching a new url with the next page of 32 results - I am ok dealing with the server side of this.
    Looking at the xsi_dev_guide (which I am not sure is applicable to the SPA504G), talks about adding a Refresh HTTP Header, however it is a bit vague and whenever I add it to the HTTP response, the spa504 barfs (invalid response).
    Do I need to program the next softkey to send a URL or something?

    Do I need to program the next softkey to send a URL or something?
    Yes, definitely. The "Next" soft key is not magic key of any kind. It just standard "request a page from HTTP server" key. It should issue a HTTP request for next page.  Like "Prev" key is asking for previous page content.
    So you need something like:
    <SoftKeyItem>
    <Name>Next</Name>
    <URL>https://.../Cisco/Directory.php?page=2</URL>
    <Position>3</Position>
    </SoftKeyItem>
    Note that you should NOT claim Next key on last page. Phone will choke on empty CiscoIPPhoneDirectory (e.g. no entry). For same reason you should not declare Prev key on first page.
    Looking at the xsi_dev_guide (which I am not sure is applicable to the SPA504G), talks about adding a Refresh HTTP Header, however it is a bit vague and whenever I add it to the HTTP response, the spa504 barfs (invalid response).
    Yes, xsi_dev_guide apply to SPA504G as well. Although Refresh is not claimed by a formal standard, it's de-facto standard recognized by many browsers already. Thus it's not documented in detail heres. In the context of example above you should emit ...
    Refresh: 0; url=https://.../Cisco/Directory.php?page=2
    ... header here.
    Rate useful advices. It will help others to found solutions.

  • How to use cursor function for nested xml

    Hi,
    i have a query for XMLQuery like
    select * from bills where bill_id=????
    it results in something like
    <bills>
    <bill>
    <city>london</city>
    <amount>44</amount>
    </bill>
    <bill>
    <city>london</city>
    <amount>988</amount>
    </bill>
    <bill>
    <city>new york</city> <amount>59</amount> </bill>
    </bills>
    but i want xml output to be sorted for city names adding one more level location like
    <bills>
    <location city="london">
    <bill>
    <amount>44</amount>
    </bill>
    <bill>
    <amount>988</amount> </bill>
    </location>
    <location city="new york">
    <bill>
    <amount>59</amount> </bill>
    </location>
    </bills>
    it should be possible to iterate through the same table to gather informaton with the help of cursor function, but never used CURSOR before.
    any idea?

    sreese wrote:
    p_desig works as a comma delimited string without the NVL function, that's not the issue.
    It IS the issue .. you need to provide  a SAMPLE so we can see what you're doing ..
    How are you "passing it in" ?
    option A:
    procedure ( in_var  in  VARCHAR2 )
    AS
    and nvl(sn.c_attribute1,'x@#$%') in nvl(in_var,'x@#$%')
    option B:
    and nvl(sn.c_attribute1,'x@#$%') in nvl(&1,'x@#$%')
    .. or some other method?

  • How to use oracle TRIM functionality in XML messages

    When i am selecting data from XML message as per below query, it is returing values correctly.
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS><EMPID>2482</EMPID><NAME>SMITH</NAME><SALARY>4854</SALARY><LOC>CHENNAI</LOC></DETAILS>'),'/DETAILS'))) x;
    But when i am selecting data by using below query some additional spaces also coming with column values
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS>
                   <EMPID>
                             2482
                             </EMPID>
                             <NAME>
                             SMITH
                             </NAME>
                             <SALARY>
                             4854
                             </SALARY>
                             <LOC>
                             CHENNAI
                             </LOC>
                             </DETAILS>'),'/DETAILS'))) x;
    Please suggest how to remove additional spaces by using second query.
    Thanks
    Vikrant Jain.

    It appears that the ability to use XPath functions in the PATH expression doesn't work prior to 11g :
    Connecté à :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> var xmldoc varchar2(4000)
    SQL> begin :xmldoc := '<DETAILS>
      2  <EMPID>
      3  2482
      4  </EMPID>
      5  <NAME>
      6  SMITH
      7  </NAME>
      8  <SALARY>
      9  4854
    10  </SALARY>
    11  <LOC>
    12  CHENNAI
    13  </LOC>
    14  </DETAILS>';
    15  end;
    16  /
    Procédure PL/SQL terminée avec succès.
    SQL> SELECT emp_id, emp_name, emp_sal
      2    FROM XMLTable('/DETAILS'
      3                  PASSING XMLTYPE(:xmldoc)
      4                  COLUMNS
      5                  emp_id     NUMBER        PATH 'normalize-space(EMPID)',
      6                  emp_name   VARCHAR2(20)  PATH 'NAME',
      7                  emp_sal    VARCHAR2(20)  PATH 'SALARY');
    SELECT emp_id, emp_name, emp_sal
    ERREUR à la ligne 1 :
    ORA-31011: Echec d'analyse XML
    ORA-19202: Une erreur s'est produite lors du traitement la fonction XML (
    LPX-00601: Invalid token in: '/*/normalize-space(EMPID)')Using it in XQuery will work though :
    SQL> SELECT *
      2  FROM XMLTable(
      3   'for $i in /DETAILS
      4    return element r
      5    {
      6     for $j in $i/*
      7     return element {local-name($j)} {normalize-space($j)}
      8    }'
      9   PASSING XMLTYPE(:xmldoc)
    10   COLUMNS
    11     emp_id     NUMBER        PATH 'EMPID',
    12     emp_name   VARCHAR2(20)  PATH 'NAME',
    13     emp_sal    NUMBER        PATH 'SALARY'
    14  );
        EMP_ID EMP_NAME                EMP_SAL
          2482 SMITH                      4854

  • How to use WebRowSet to convert to XML??

    Dear all,
    I have a ResultSet, but I how can I use WebRowSet to convert it to XML?
    Greatly appreciated if anybody can giveme a clue.
    Thank you
    Kevin

    Hi,
    see http://fork.ru/tutor/developer/rowset-docs/sun/jdbc/rowset/WebRowSet.html
    It's the javadoc of the Class WebRowSet
    intressting method for you are :
    - setXmlWriter(XmlWriter writer); / writeXml(java.io.Writer writer)
    or
    - writeXml(java.sql.ResultSet rs, java.io.Writer writer)
    Hope that it can help you.
    S�b

  • How to use jstl variable in a jsp page

    Hi all,
    I am new to JSTL and i want to access the value of jstl in jsp.
    when i use the tag like below it is displaying the value ""
    <c:out value="${ack}"/>
    But as ack is string, i want to convert it into int. and i have written like
    <c:set var="ackvalue" value="${ack}"/>
    and int ack = Integer.parseInt(ackvalue);
    But it is showing error like varialbe can not be resolved: ackvalue
    can anybody please help me regarding this?
    Waiting for your warm response.
    Thanks in advance

    Hi,
    Thanks for your immediate reply.
    I am able to display the ackvalue when i am using
    <c:set var="ackvalue" value="${ack}"/>
    and <c:out value="${ackvalue}"/>
    But my actual requirement is to use the ack value in
    switch statement. if i can assign the value to a
    String variable, then it si easy for me to proceed.
    Please help me in this regard.
    Thanks,You can use the c:choose, c:when and c:otherwise tags
    <c:choose>
        <c:when test = "${ackvalue == 1}">
               //do stuff
        </c:when>
        <c:when test = "${ackvalue == 2}">
               //do some other stuff
        </c:when>   
       <c:otherwise>
              //stuff
        </c:otherwise>
    </c:choose>ram.

Maybe you are looking for

  • Can dbms_lob.instr have end position?

    I am extracting data from xml using dbms_lob utility and the pattern in XML is as below. <Atag> <Btag> <Ctag>value</Ctag> </Btag> <Btag> <Ctag>value</Ctag> <Dtag>value</Dtag> </Btag> <Btag> <Ctag>value</Ctag> <Dtag>value</Dtag> </Btag> </Atag> I want

  • Regarding invalid characters

    HAI I have data in Oracle tables which contain so many special characters. now im loading Attributes for one characteristic. I have 15 atrributes for one characteristic . Im writing ABAP code for each Infoobject or field in Transfer Rules .It needs a

  • Approval workflow with multiple approvers in sharepoint

    Hi All, I have created a sequential workflow using visual studio 2012 for sharepoint 2013. I have multiple approvers for approving a document. I am able to create individual tasks for each approver by code my problem here is tasks should be created b

  • I have an add-on that is keeping me from opening my email, please advise

    I cannot open my godaddy email any more

  • Disabling Internet Explorer Information Bar

    After disabling Internet Explorer Information Bar in dreamweaver using the "Insert Mark of the Web" my links on the page no longer works even though there is a hand displaying showing that there is a link to *.pps, *.wmv, *.flv there but it would not