Formatting a date inside a colum tag

Hi eveyone
I am trying to format the column of a table so that the date will display in a certain format.
The code that I use is doing nothing - apart from staring at me!!
This is the snippet...
<display:column property="departDate" sort="true"
         headerClass="sortable"
        paramId="departDate" paramProperty="departDate"
        title="Depart Date"
        class="departDate">
        <fmt:parseDate value="${departDate}" type="date" pattern="dd/mm/yyyy" var="parsed" />
        <fmt:formatDate value="${parsed}" type="date" dateStyle="full"/>       
    </display:column>Regards

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
public class DateFormatter {
     public static void main(String[] args) {
          Calendar calendar = new GregorianCalendar();
          double[] limits = {1, 2, 3, 4, 21, 22, 23, 24};
          String[] dateFormats = {"st", "nd", "rd", "th", "st", "nd", "rd", "th"};
          ChoiceFormat choiceFormat = new ChoiceFormat(limits, dateFormats);
          String dateFormat = "EEEEE dd''{0}'' MMMMM";
          MessageFormat messageFormat = new MessageFormat(dateFormat);
          messageFormat.setFormat(0, choiceFormat);
          Object[] msgArgs = {
               new Integer(calendar.get(Calendar.DATE))
          String message = messageFormat.format(msgArgs);
          System.out.println(message);
          SimpleDateFormat date = new SimpleDateFormat(message);
          System.out.println(date.format(calendar.getTime()));
}

Similar Messages

  • Struts - Formatting date in display:column tag

    Hi ,
    I am using the following code to format the date in my display tag
    <display:column headerClass="myclass" property="submittedDate" title="DATE SUBMITTED" decorator="org.displaytag.sample.LongDateWrapper" />     which displays the date like '12/22/2005 00:00'
    I don't need this format . Instead ,I want to extend the decorator and create my own . For that , I'm using
    import java.text.SimpleDateFormat;
    import org.displaytag.decorator.TableDecorator;
    public class DateDecorator extends TableDecorator{
         public DateDecorator(){          
              super();
              System.out.println("Date decorator constructor called...");
         public String getSubmittedDate(Object obj){
              SimpleDateFormat sdf = new SimpleDateFormat();
              sdf.applyPattern("MM/dd/yyyy");
              System.out.println("In getSubmittedDate()...");
              String date = sdf.format(obj);
              System.out.println("Formatted date is ::"+date);
              return date;
    but at runtime it gives me the classcast exception saying that
    class DateDecorator could not be loaded .
    Kindly guide me through it .
    Thanks

    Decorator class that you wrote is "DateDecorator" and the decorator class that you used in the tag is "LongDateWrapper".

  • Error When Refresh Formatted Data inside Excel Analyzer

    I have build a Excel template and load up this to the BI Publisher Server. When I call this template after the log in works fine. When I refresh the data normal it works also fine, but when I try to refresh formatted Data I get the error "Error: This report does not support HTML as an output format." I will not use html output inside Excel, I will use the original Excel template with refreshed data.

    Hi Tim,
    The Refresh Formatted Data works on MS Excel 2003.
    May need to check if its really supported on MS Office 2002.
    Btw another question, is it possible to create an excel template without using Excel Analyzer?
    Also when I used the generated excel file of Excel Analyzer as template, when the report is generated the data sheet sometimes is not filled with correct data or sometimes there is no data at all, even if the parameters used is the same as the one used in generating the original excel file using Excel Analyzer. This happens most of the time for reports with Concatenated Queries or SQL Queries using "CURSOR" to group a set of data. Note that on initial generation of excel file using Excel Analyzer, correct set of data is displayed. It is only when it is used as template and viewed/exported in Excel format that data is not properly loaded.
    Please advise.
    Thanks!
    Uniz

  • Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.

    Hi,
    I have written code for 'Export To Excel' in the visual web part as below
    //ascx file    
    <table>
        <tr>
            <td>From Date:</td>
            <td><SharePoint:DateTimeControl ID="dtFromDate" runat="server" DateOnly="True" /></td>
        </tr>
        <tr>
            <td>To Date:</td>
            <td><SharePoint:DateTimeControl ID="dtToDate" runat="server" DateOnly="True" TimeOnly="False" /></td>
        </tr>
        <tr>
          <td>Report Type:<asp:DropDownList ID="ddlreporttype" runat="server"><asp:ListItem>Consolidated</asp:ListItem><asp:ListItem>Question Wise</asp:ListItem></asp:DropDownList></td>
            <td>
                <br />               
                <asp:GridView ID="gvwikireport" runat="server">
                </asp:GridView>                   
            </td>
        </tr>   
        <tr>
            <td><asp:Button ID="btnExportToExcel" runat="server" Text="Export To Excel" OnClick="btnExportToExcel_Click"/></td>
        </tr>  
        </table>
    //cs file
    protected void Page_Load(object sender, EventArgs e)
                if (!Page.IsPostBack)
                    BindGridview();
    private void BindGridview()
                DataTable dt = new DataTable();
                dt.Columns.Add("UserId", typeof(Int32));
                dt.Columns.Add("UserName", typeof(string));
                dt.Columns.Add("Education", typeof(string));
                dt.Columns.Add("Location", typeof(string));            
                dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
                dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
                dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
                dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
                dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
                dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
                gvwikireport.DataSource = dt;
                gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
                Page.Response.ClearContent();
                Page.Response.Buffer = true;
                Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
                Page.Response.ContentType = "application/ms-excel";
                StringWriter sw = new StringWriter();
                HtmlTextWriter htw = new HtmlTextWriter(sw);
                gvwikireport.AllowPaging = false;
                BindGridview();
                //Change the Header Row back to white color
                gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
                //Applying stlye to gridview header cells
                for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
                    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
                gvwikireport.RenderControl(htw);
                Page.Response.Write(sw.ToString());
                Page.Response.End();            
    But after clicking the 'Export To Excel' button i am getting the below error
    Control 'ctl00_SPWebPartManager1_g_d4fb972b_26ec_4065_9c89_80b51b384492_gvwikireport' of type 'GridView' must be placed inside a form tag with runat=server.
    In case if i am modifying the code as below I am getting error as 'page can have only one server tag'.
    <form id="frmgrdview" runat="server">
     <asp:GridView ID="gvwikireport" runat="server">
                 </asp:GridView></form>
    So please share your ideas/thoughts on the same.
    Regards,
    Sudheer 
    Thanks & Regards, Sudheer

    Hi,
    According to your post, my understanding is that you fail to export to excel.
    I create a demo as below, it works well.
    <table>
    <tr>
    <td>
    <asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
    </td>
    <td>
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    </td>
    </tr>
    <tr>
    <td>
    <asp:GridView ID="gvwikireport" runat="server">
    </asp:GridView>
    </td>
    <td>
    <br />
    <asp:Button ID="btnExportToExcel" runat="server"
    onclick="btnExportToExcel_Click" Text="Export to excel" />
    </td>
    </tr>
    </table>
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Data;
    using System.IO;
    namespace Export_to_Excel.VisualWebPart1
    public partial class VisualWebPart1UserControl : UserControl
    protected void Page_Load(object sender, EventArgs e)
    if (!Page.IsPostBack)
    BindGridview();
    private void BindGridview()
    DataTable dt = new DataTable();
    dt.Columns.Add("UserId", typeof(Int32));
    dt.Columns.Add("UserName", typeof(string));
    dt.Columns.Add("Education", typeof(string));
    dt.Columns.Add("Location", typeof(string));
    dt.Rows.Add(1, "SureshDasari", "B.Tech", "Chennai");
    dt.Rows.Add(2, "MadhavSai", "MBA", "Nagpur");
    dt.Rows.Add(3, "MaheshDasari", "B.Tech", "Nuzividu");
    dt.Rows.Add(4, "Rohini", "MSC", "Chennai");
    dt.Rows.Add(5, "Mahendra", "CA", "Guntur");
    dt.Rows.Add(6, "Honey", "B.Tech", "Nagpur");
    gvwikireport.DataSource = dt;
    gvwikireport.DataBind();
    protected void btnExportToExcel_Click(object sender, EventArgs e)
    Page.Response.ClearContent();
    Page.Response.Buffer = true;
    Page.Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "WikiReport.xls"));
    Page.Response.ContentType = "application/Excel";
    StringWriter sw = new StringWriter();
    HtmlTextWriter htw = new HtmlTextWriter(sw);
    gvwikireport.AllowPaging = false;
    BindGridview();
    //Change the Header Row back to white color
    gvwikireport.HeaderRow.Style.Add("background-color", "#FFFFFF");
    //Applying stlye to gridview header cells
    for (int i = 0; i < gvwikireport.HeaderRow.Cells.Count; i++)
    gvwikireport.HeaderRow.Cells[i].Style.Add("background-color", "#df5015");
    gvwikireport.RenderControl(htw);
    Page.Response.Write(sw.ToString());
    Page.Response.End();
    The result is as below:
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Need help in formatting the Date - Date does not

    Need help in formatting the Date - Date does not formats and give Not a valid month error in the below scenario.
    select oc.ST_PGM_MGR, r.ag_dnum, get_major_work_type(r.perf_eval_rtng_id) "v_work_code", r.ag_dnum_supp "supp", r.intfinal, to_char(r.formdate,'MM/DD/YYYY') "formdate", to_char(r.servfrom,'MM/DD/YYYY') "srv_from", to_char(r.servto,'MM/DD/YYYY') "srv_to", descript, add_months(to_char
    --- Bellow line of Code on trying to format it to mm/dd/yyyy gives the error
    (r.formdate, 'DD-MON-YYYY'),12) "formdate2"
    from  table REdited by: Lucy Discover on Jul 7, 2011 11:34 AM
    Edited by: Lucy Discover on Jul 7, 2011 1:05 PM

    Your syntax is wrong - look at the post above where this syntax is given:
    to_char (add_months(r.formdate,12), 'MM/DD/YYYY') "formdate2"Look at the formula from a logical perspective - "inside out" to read what is happening -
    take formdate, add 12 months
    add_months(r.formdate, 12)then apply the to_char format mask - basic syntax
    to_char(date, 'MM/DD/YYYY')Compare to your syntax:
    to_char(add_months(r.formdate, 'MM/DD/YYYY'),12) "formdate2"You will see your format string inside the call to add_months, and your 12 inside the call to to_char.
    Good luck!

  • Is there any way to print  the data inside  the Notes field of MIR6 Report

    Hello Gurús.
    We need to include the data inside the Notes field in the report MIR6 - INVOICE OVERVIEW - report.
    Is there any way to print  the data inside (comments)  the Notes field as well in the Report  ?
    We found that the only way is to open the Notes and print it, but it takes time, any idea ?
    Rgds.
    MCM.

    There's nothing built-in that does that. If you only have text fields and they don't have any formatting or other property that would prevent it (e.g., Date, character limit), you can run a simple script to populate each field with the field name, and then print. A more complicated approach would be a script that adds text annotations near/over each field that shows the field name. This would just be for documentation purposes, but it's possible. Post again if you'd like help with the first. You'll probably have to pay someone for the second approach if you don't want to do it yourself.

  • Formatting a date according with user settings (user defaults)

    Hi All,
    I need to format a date I receive via JS in YYYYMMDD format according with user defaults <b>without</b> server side action (I know, this is not a good issue, but they want it).
    My solution is to write a JS function (there are a lot of it on WWW) which accepts two strings and formats the first according to the second, something like:
    userFormattedDate = formatDate('20060613','DD.MM.YYYY');
    paying attention to generate 'DD.MM.YYYY' string on server side, according to user settings.
    But if this isn't a weblog, where is the question? :-D
    The question is: is there a JS function (in DatePicker or dateNavigator BSP) provided by standard libraries which serves similar functionality?
    Does exist a JS public standard library?
    Thanks.
    Dany

    Hi Durairaj,
    Tags <% %> are for server side actions.
    The question is about obtaining the same effect, but client side.
    Thanks.
    Dany

  • Formatting a date in cfselect

    Assuming a query "meetingdate" that grabs a unique value of
    the 'meetingdate' field (a date/time field). In a form, that query
    is used to populate a cfselect command.
    The dropdown boxes now contain "yyyy-mm-dd hh:mm:ss" value
    (as in "2006-06-12 12:23").
    How do I format the drop-down values into 'mm/dd/yy", as in
    "06/12/06" ? Using the formatdate in the 'display' argument of the
    cfselect command returns an error.
    Or, should the query command contain some sort of formatdate
    function (and what would that be)?
    Thanks....Rick...

    Use appropriate SQL functions to format the field in the
    query, would
    depend on the DBMS system you are using (MSSql, MYSql,
    Access, Oracle, etc).
    OR
    Use <select> instead of <cfselect> where you can
    use a basic loop to
    populate the <option> tags and format the date in the
    loop.
    OR
    Use a Query of Query or manually build a query out of the
    original query
    modifying the format of the date string and use this new
    query in the
    <cfselect> tag.
    rhellewell wrote:
    > Assuming a query "meetingdate" that grabs a unique value
    of the 'meetingdate'
    > field (a date/time field). In a form, that query is used
    to populate a cfselect
    > command.
    >
    > The dropdown boxes now contain "yyyy-mm-dd hh:mm:ss"
    value (as in "2006-06-12
    > 12:23").
    >
    > How do I format the drop-down values into 'mm/dd/yy", as
    in "06/12/06" ? Using
    > the formatdate in the 'display' argument of the cfselect
    command returns an
    > error.
    >
    > Or, should the query command contain some sort of
    formatdate function (and
    > what would that be)?
    >
    > Thanks....Rick...
    >

  • Displaying a group of  data in different colums

    I have a problem with displaying a group of data in different colums. I want to display a group of data like this:
    Column 1 --- Column2 ----- Column3
    data1 data6 data11
    data2 data7 data12
    data3 data8 data13
    data4 data9 data14
    data5 data10 data15
    That is, the coulm headers must be at the same height of the page and data must be in paralell columns.
    My number of data is variable depending on a query result, and I want to start displaying my group on the first column and when it is full (the number of records per column is fixed), is must switch into the next one.
    In case there were more than 15 records, the 16th and the followings, must be displayed on the next page, with the same format as i have explained before.
    Thank you very much.

    Send me all files along with expected output at [email protected]

  • "Do not include a break inside the TD tag" is ignored

    In Edit | Preferences | Code Format in DW CS5, the setting "Do not include a break inside the TD tag" is ticked but DW is still putting a line break in the tag like this...
    <td> </td>
    Any idea why the setting is being ignored?
    Malcolm

    Artisan Internet wrote:
    Both fair comments, many thanks. The reason I want to remove the space is because it's impossible to have an empty row with a height of less than about 6 pixels (used as a spacer or for coloured divider lines of different thicknesses) when there's a space within the TD tag. The space counts as a character which means that the row can't be less than the height of a character.
    I know I could make a transparent spacer GIF, and create custom styles for different horizontal rules in the stylesheet, but it's always been a lot quicker to simply use a table row with a height.
    Looks like I'll just have to carry on deleting the spaces from the code.
    Malcolm
    Your best solution is to insert a transparent spacer.gif and give it the dimensions you want. That will overrule all the 'empty' defaults. Please remember, the spacer need only be in one cell of the row. All other cells, unless they have larger content, will follow suit... applies to rows and columns.
    (The 'height' attribute by itself, as you've discovered, is kind of dicey. So is the width.)

  • Java Experts please help - SimpleDateFormat.format reduces date by a day !!

    Hi,
    I am facing a very weird problem with SimpleDateFormat class. The input Date to SimpleDateFormat.format method is getting reduced by ONE DAY. This problem is happening at random and is not reproducible at will. Any help/pointers to resolve this issue is very much appreciated !!.
    Code is similar to the following code lines
    input = "2003-11-01 00:00:00.000000000";
    output = 31-Oct-2003 (strange !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.Timestamp;
    import java.text.DateFormatSymbols;
    import java.text.ParseException;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.Hashtable;
    import java.util.Locale;
    import java.util.TimeZone;
    import java.util.SimpleTimeZone;
    public class DateTester {
    /** Default constructor for Util.
    public DateTester() {
    private static String replace(String pattern, String from, String to) {
    return replace(pattern, from, to, null);
    private static String replace(String pattern, String from, String to, String notFrom) {
    StringBuffer sb = new StringBuffer();
    boolean finished = false;
    int index = pattern.indexOf(from);
    if (index < 0) return pattern;
    do {
    if (notFrom == null ||
    notFrom.length() + index > pattern.length() ||
    !pattern.substring(index, index + notFrom.length()).equals(notFrom)) {
    sb.append(pattern.substring(0, index));
    sb.append(to);
    sb.append(pattern.substring(index + from.length()));
    finished = true;
    } else index = pattern.indexOf(from, index + from.length());
    while (!finished && index >= 0);
    if (!finished) return pattern;
    return sb.toString();
    public static void main(String[] argv) {
              String pattern = "DD-MON-YYYY";
    System.out.println("original pattern =" + pattern);
    pattern = replace(pattern, "FM", "");
    pattern = replace(pattern, "AD", "G");
    pattern = replace(pattern, "A.D.", "G");
    pattern = replace(pattern, "BC", "G");
    pattern = replace(pattern, "B.C.", "G");
    pattern = replace(pattern, "AM", "a");
    pattern = replace(pattern, "A.M.", "a");
    pattern = replace(pattern, "PM", "a");
    pattern = replace(pattern, "P.M.", "a");
    pattern = pattern.replace('\"', '\t');
    pattern = pattern.replace('\'', '\"');
    pattern = pattern.replace('\t', '\'');
    pattern = replace(pattern, "DDD", "DDD");
    pattern = replace(pattern, "DAY", "dd");
    pattern = replace(pattern, "DD", "dd", "DDD");
    pattern = replace(pattern, "HH24", "HH");
    pattern = replace(pattern, "HH12", "KK");
    pattern = replace(pattern, "IW", "ww");
    pattern = replace(pattern, "MI", "mm");
    pattern = replace(pattern, "MM", "MM", "MMM");
    pattern = replace(pattern, "MONTH", "MMMMM");
    pattern = replace(pattern, "MON", "MMM");
    pattern = replace(pattern, "SS", "ss");
    pattern = replace(pattern, "WW", "ww");
    pattern = replace(pattern, "W", "W");
    pattern = replace(pattern, "YYYY", "yyyy");
    pattern = replace(pattern, "YYY", "yyy");
    pattern = replace(pattern, "YY", "yy");
    pattern = replace(pattern, "Y", "y");
    pattern = replace(pattern, "RRRR", "yyyy");
    pattern = replace(pattern, "RRR", "yyy");
    pattern = replace(pattern, "RR", "yy");
    pattern = replace(pattern, "R", "y");
    System.out.println("converted pattern =" + pattern);
    String origDate = "2003-11-01 00:00:00.000000000";
    System.out.println("original date =" + origDate);
    Timestamp origTimeStamp = Timestamp.valueOf(origDate);
    SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.getDefault());
    sdf.setLenient(false);
    String formattedDate = sdf.format((Date) origTimeStamp);
    System.out.println("formatted date =" + formattedDate);
    Thanks a lot for your time !

    Your code is too hard to read for me to look at it in great detail. When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read.
    However, I'm guessing it's a TimeZone issue. The midnight on 11/1 that you're setting is probably getting converted to GMT somewhere before the Date object is created. If you're in the U.S., then that's afternoon or evening on 10/31.
    Try:
    * Starting with a time that's later in the day on 11/1.
    * Formatting your date to include time and timezone when you print it. (Just for testing--you can put it back once you understand what's going on
    * Reading the Calendar, Timzone, Date, etc. APIs closely.
    * Reading any tutorials or texts you can find on the subject.
    * Writing a bunch of very small and simple tests to get an understanding of how this all fits together.
    Date/Time/TZ handling in Java is kinda tricky.

  • Printing data in  two colums

    Hi Friends,
    I got a scenario  like. Printing data in Two Colums.
    Ex:
    1        6
    2        7
    3        8
    4        9
    5       10
    Please help me to solve.
    thanks in advance.
    Regards,
    Kumar.

    Hi Nivas,
    Try this logic!!!
    Create a line type with 2 columns in table in your main window. I hope the no of rows has to be fixed for the 1st column (i.e. if data overflows from 1st column than only it has to print in 2nd column). Create 2 text elements for 2 columns respectively & pass same value in both the text elements( ex: &number&).
    Now set your condition accordingly in both the text elements condition tab. Create a program line inside your table loop and set a counter for every item. each time divide the counter by no of your max line items that can b printed in 1 column.
    I hope you got the logic now how to resolve this issue.
    Do appreciate if found helpful.
    BR,
    Vinit

  • ALSB automatically wrapping data in a CDATA tag

    I'm trying to route SOAP messages through ALSB. These messages work like this:
    1) Proxy service listens for incoming SOAP request
    2) Request is logged and routed to a business service (set up as "Any SOAP Service"), which queries the web service
    3) Web service response is logged and passed back to Proxy service and to caller.
    The problem we're having is that ALSB encodes one of the elements of the response XML in a CDATA tag. Without ALSB, there is no CDATA tag in the response.
    Our calling application cannot process the message with the CDATA tag. Why does ALSB do this, and how can I prevent it from doing so without doing an expensive (and annoying to write) XQuery transform that removes the CDATA tag manually?
    Thanks.

    Thanks for the response.
    Both the proxy service and the business service are set up as "Any Soap".
    Here is an example response from the service, as captured by TCPMonitor (before ALSB gets ahold of it):
    <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><findAccountsResponse xmlns="http://service.account.test.com"><findAccountsReturn><?xml version="1.0" encoding="UTF-8"?>
    <lt:Message xmlns:lt="http://xml.test.com/2006/01/common/Message"><lt:Header><lt:CallingApplicationId>AccountService1</lt:CallingApplicationId><lt:CallingApplicationName>Account Service</lt:CallingApplicationName><lt:CallingUser>SYSTEM</lt:CallingUser><lt:MessageId>58C4B701-1AD0-EF69-6A15-001D4D107AA9</lt:MessageId></lt:Header><lt:Body><qr:QueryResponse xmlns:qr="http://xml.test.com/2006/04/common/QueryResponse"><qr:MetaData><qr:ReturnedResults>1</qr:ReturnedResults><qr:MoreResultsExist>false</qr:MoreResultsExist></qr:MetaData><qr:Results><ac:Accounts xmlns:ac="http://xml.test.com/2006/04/Account"><ac:Account><ac:testId>111111</ac:testId><ac:Name>Test School</ac:Name><ac:Address><ac:Line1>Test Road</ac:Line1><ac:City>Hartland Cors</ac:City><ac:StateOrProvinceCode>VT</ac:StateOrProvinceCode><ac:PostalCode>05049 </ac:PostalCode><ac:Country>USA </ac:Country></ac:Address><ac:Programs><ac:Program><ac:Code>1</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>2</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>5</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>6</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>7</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>8</ac:Code><ac:Description>Test </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>9</ac:Code><ac:Description>Other - Unclassified </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>10</ac:Code><ac:Description> </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program></ac:Programs></ac:Account></ac:Accounts></qr:Results></qr:QueryResponse></lt:Body></lt:Message></findAccountsReturn></findAccountsResponse></soapenv:Body></soapenv:Envelope>
    Here's the contents of $body just after the business service receives the response:
    <
    soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="ht
    tp://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/e
    nvelope/">
    <findAccountsResponse xmlns="http://service.account.test.com">
    <findAccountsReturn><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
    <lt:Message xmlns:lt="http://xml.test.com/2006/01/common/Message"><lt:Header><lt:CallingApplicationId>AccountService1</lt:CallingApplicationId><lt:CallingApplicationName>Account Service</lt:CallingApplicationName><lt:CallingUser>SYSTEM</lt:CallingUser><lt:MessageId>58C4B701-1AD0-EF69-6A15-001D4D107AA9</lt:MessageId></lt:Header><lt:Body><qr:QueryResponse xmlns:qr="http://xml.test.com/2006/04/common/QueryResponse"><qr:MetaData><qr:ReturnedResults>1</qr:ReturnedResults><qr:MoreResultsExist>false</qr:MoreResultsExist></qr:MetaData><qr:Results><ac:A
    ccounts xmlns:ac="http://xml.test.com/2006/04/Account"><ac:Account><ac:Life
    touchId>111111</ac:testId><ac:Name>Test</ac:Name><ac:Address>
    <ac:Line1>Test</ac:Line1><ac:City>Hartland Cors</ac:City><ac:Stat
    eOrProvinceCode>VT</ac:StateOrProvinceCode><ac:PostalCode>05049     </ac:PostalC
    ode><ac:Country>USA  </ac:Country></ac:Address><ac:Programs><ac:Program><ac:Code
    1</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>2</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>5</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>6</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>7</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>8</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>9</ac:Code><ac:Description>Test             </ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program><ac:Program><ac:Code>10</ac:Code><ac:Description>Test</ac:Description><ac:Assignment>VJ</ac:Assignment></ac:Program></ac:Programs></ac:Account></ac:Accounts></qr:Results></qr:QueryResponse></lt:Body></lt:Message>]></findAccountsReturn></findAccountsResponse>
    </soapenv:Body>
    As you can see, ALSB is adding the CDATA tag. Our calling service can't translate the data inside of the CDATA tag.
    I sincerely appreciate your help!

  • Need to fill up Data into  the select Tag options value

    Hi ,
    This is my requirement . I am having two select tags inside my jsp page . one for country and one for state .Upon selecting a country the select tag for states should be filled up .
    Right now i need to fill up the data under country select Tag .I am using AJAX for this .On body onload i am calling a function to get Country data .
    //This is inside my servlet
    *               ResultSet res = st.executeQuery("SELECT * FROM countries );*
    *               StringBuffer sb = new StringBuffer();*
    *     sb.append("<countries>");*
    *               while (res.next())*
    *               String result = res.getString(1);*
    *               sb.append("<country>"+result+"</country>");*
    *               sb.append("</countries>");*
    *               response.getWriter().write(sb.toString());*
    This is Inside MY JSP
    if( xmlHttp.readyState==4 )
    if( xmlHttp.status==200 )
    xmlDoc=xmlHttp.responseXML;
    xmlDoc.getElementsByTagName("countries")
    <select name='countrsel' id="countrsel" onchange="call()">
    <option value="<%=%>"><%=%></option>
    </select>
    I am struck up here please help
    Edited by: RaviKIran on Nov 2, 2009 9:51 AM

    Hi ,
    This is my requirement . I am having two select tags inside my jsp page . one for country and one for state .Upon selecting a country the select tag for states should be filled up .
    Right now i need to fill up the data under country select Tag .I am using AJAX for this .On body onload i am calling a function to get Country data .
    //This is inside my servlet
    *               ResultSet res = st.executeQuery("SELECT * FROM countries );*
    *               StringBuffer sb = new StringBuffer();*
    *     sb.append("<countries>");*
    *               while (res.next())*
    *               String result = res.getString(1);*
    *               sb.append("<country>"+result+"</country>");*
    *               sb.append("</countries>");*
    *               response.getWriter().write(sb.toString());*
    This is Inside MY JSP
    if( xmlHttp.readyState==4 )
    if( xmlHttp.status==200 )
    xmlDoc=xmlHttp.responseXML;
    xmlDoc.getElementsByTagName("countries")
    <select name='countrsel' id="countrsel" onchange="call()">
    <option value="<%=%>"><%=%></option>
    </select>
    I am struck up here please help
    Edited by: RaviKIran on Nov 2, 2009 9:51 AM

  • JAXB and formating a date

    Hi,
    i have a problem:
    The java-classes generated by JAXB from the following code-snipplet
        <xs:attribute name="edate" use="required">
          <xs:simpleType>
            <xs:restriction base="xs:date"/>
          </xs:simpleType>
        </xs:attribute>produce during marshalling a string like "2000-01-22+01:00".
    How can I suppress the +01:00 (which I assume to be the offset
    from my local timezone to GMT)? Adding a pattern restriction doesn't work.
    Is it possible to modify the DateFormat used by JAXBs internal classes to
    achieve my goal?
    Thanks

    You can define your own conversion for the date inside your XML-Java binding Schema (XJS):
    <xml-java-binding-schema>
    <element name="date"
             type="value"
             convert="ConvertDate"/>
    <conversion name="ConvertDate"
                type="java.util.Date"
                parse="ConvertDate.parse"
                print="ConvertDate.format"/>
    </xml-java-binding-schema>
    ConvertDate contains two methods that help the marshalling and
    unmarshalling process convert to and from java.util.Date.
    import java.util.*;
    import java.text.*;
    public class ConvertDate {
       static final SimpleDateFormat _format =
          new SimpleDateFormat("yyyy.MM.dd");
       public static Date parse(String date)
          throws ParseException {
          synchronized(_format) {
             return _format.parse(date);
       public static String format(Date date) {
          synchronized(_format) {
             return _format.format(date);
    }

Maybe you are looking for

  • ITunes does not show Shared Music and cannot listen to Radio

    Hi, I would really appreciate some help on this issue - thanks! In itunes, the 'Shared Music' folder on the left side panel simply does not exist no matter how many times I check/uncheck the 'Look for Shared Music' in configurations. In addition, I c

  • Safari-Java-Webinar

    When trying to join a webinar I get an error message that Safari can not find Java. I deleted Java and reloaded it. Chrome does not have a problem accessing Java. I am on a PC with windows Vista

  • Windows 10 -- Windows 8

    Hey there, Not sure if this is the right place for this question, i have never really used microsoft forums before I just have a quick question about reverting back from windows 10 to windows 8. Now, i have an install disk because i had it for my PC

  • HT201263 After getting the recovery mode screen, I tried to restore my phone. But it was not working, it displays an error. Wat to do now?

    My iPhone was a contract phone then. I used it in India by using gevey sim. After 6 months, I unlocked the phone by factory unlock. Then I upgraded my phone from 4.2.1 to 6.0.1, after that sometimes the carrier signal will not appear and a message "r

  • Cloning a drive and mirror backup techniques

    Hi all, I have configured my new Mac Pro and loaded new apps and am at a point now where I want to put together a 'backup plan' for backing up work files and a clone drive of my OS/apps drive. I currently have my OS/apps drive (the orig 320GB) in bay