Using string data as html
I have a javabean that uses a collection to set my nav bars depending on what section of the site you are in. I have a column in my collection that has html code as to what to show after the link (an arro, line, etc). When I display this on the page, I am getting the actual html code displayed. How can I get the html code to render as html? Below is how I have my collection set up and how I am displaying it.
col.add(new NavBean("home", "Refill Prescriptions", "http://www.server.com/refill_now.php", "<br><img src=/DynWebProject/layout/sitegray.gif width=116 height=1><br>"));Here is how I am trying to display it, I am using the struts iterate tag to go through my collection to determine what nav links to show.
<jsp:include page="/navAction.do"></jsp:include>
<logic:iterate id="NavLink" name="NavLinks" scope="request" type="dynwebproject.util.beans.NavBean" >
<logic:match name="NavLink" property="navSection" value="<%=navsec%>">
<a href='<c:out value="${NavLink.navURL}" />' class="navbartoplevel">
<c:out value="${NavLink.navName}" />
</a>
<c:out value="${NavLink.navHtml}" />
</logic:match>
</logic:iterate>Thanks!!
Try this
Add escapeXml="false" to your c:out tag like this:
<c:out value="${NavLink.navHtml}" escapeXml="false" />
sp12
Similar Messages
-
Minus date in string data type
Hi all,
i having one table in database that used to store the borrow_date and return_date, the date is in this format 06/12/2008, when i retrieve the date from the database, and i pass it into String data type, for example as follows:
private String borrow_date = 05/12/2008;
private String return_date = 10/12/2008;
if for example student A return the book on 15/12/2008, which is after the return_date in database, then i want to minus is 15/12/2008 with 10/12/2008, so that i can get the int value of 5 days. Because i want to use this integer 5 for late penalty. One day charge for 20 cent.
e.g: String borrow_date - String return_date = int total_days;
Now my problem is this, i dont know how to use string data type minus with string data type to get the integer type.
I had tried for many methods already, still cannot get it, i can get the total days in int data type if the date is in Date or Calendar data type. The problem now is the date is in String data type. Any idea from you? :)
Regards,
poh_ccpoh_cc wrote:
because in my case, i have to use string data type :)Thinking about this again, it really is stupid. You say you are even storing the dates in the database as Strings and not Dates. It can only lead to a world of hurt. -
I tried to use the config VIs to record some front-panel settings for later restoration, one of which could be a single space character (part of a string parsing system).
I soon discovered that whenever I tried to save that single-space value to an INI file, only a null string was saved.
After doing some digging I discovered that buried in the Write Key vi is a worker vi called Config Data Modify that uses Trim String on the string data before it is written to the file and that's what was eating my string character. I don't know whether this is a bug or a feature but there are at least three ways to fix it.
1) Assuming you want to leave the library VIs alone, you can pre-process any stings sent to "write key" to replace all spaces with "\20" and then post-process all strings read using "read key" to replace all instances of \20 with spaces.
and if you don't mind modifying the library VIs, either to save/use under a different name or to stick back into the library in a modified state (caution - can cause problems when you move code to another machine with an un-modified library) then...
2) You can yank the trim-string out of the Config Data Modify vi and hope that it does not have any undesirable side effects with regards to the other routines that use Config Data Modify (so far I have not found any in my limited testing)
or
3) You can modify the string pre-processing vi, Remove Unprintable Chars, to add the space character to the list of characters that get swapped out automatically.
Note that both option #1 (as suggested above) and option #3 will produce an INI file data entry that looks like key="\20Hello\20World\20" while option #2 produces an entry that looks like key=" Hello World "
The attached PDF contains screenshots of all this.
Attachments:
Binder1.pdf 2507 KBHi Warren,
there's a 4th option:
Simply set the "write raw string" input of the write key function to TRUE
This option only appears when a string is wired to that function!
Just re-checked:
I think it's a limitation of the config file format. It's text based and (leading) spaces in the value are "overseen" as whitespaces. So your next option would be to use quotes around your string with spaces...
Message Edited by GerdW on 05-02-2009 08:32 PM
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome -
Use Java to collect data from HTML
Hi Guys
I am doing a online stock trading project, the main part is to collect raw data from http://finance.yahoo.com User can retrieve the stock detail by inputting the right stock symbol, such as "AOL". I dont have too much problem in this part because yahoo provde a spreedsheet format to display the result. If you type the URL below, it can bring you a set of stock data separating by comma. So, I can use StringTokenizer(date, ",") to collect each data from yahoo into my system.
========================================================================
http://finance.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=AOL&
"AOL",15.57,"8/12/2003","4:01pm",+0.04,15.47,15.63,15.40,12097200
========================================================================
However beside this function, I also need to search Stock Symbol, because user may only know the company name. Although Yahoo finance also provide this function, with no spreedsheet format provided. So, if I type the URL below, it will only give me a set of result BUT in HTML format.
========================================================================
http://finance.yahoo.com/l?s=AOL&t=S&m=
========================================================================
So, can anyone tell me what is the best way to collect data from a HTML page? Or anyone know any good stock quoting sites which also provide spreedsheet format?
Thank you very much
KelI am doing a online stock trading project, the
the main part is to collect raw data from
http://finance.yahoo.com
Sounds fun.
So, can anyone tell me what is the best way to
to collect data from a HTML page? Or anyone know any
good stock quoting sites which also provide
spreedsheet format?I really don't know any other stock quote sites. But if you want to implement a search function for stock names, I would do it like this
1) Code the HTTP SUBMIT/POST to lookup the possible stock names
2) Use XSL to filter out the HTML path to the table with results, the layout is consistent, so there are no strange exceptions. You can check the DOM structure by using Mozilla's DOM inspector. Just write down the path to the TABLE element and select it, and transform it to CSV for example.
3) Reparse the CSV to fill some boxes
To possibly save some server load use a small fixed size in memory cache to store N requests based on some strategy.
The other part is actual a separate part of what you want to code and should be a separate class in which you can feed the stock name.
If the user types in a bad stock name, you can retrieve a list of possible names using the input as the company name.
Greets.
Maybe there is a SOAP service out there somewhere. -
How to use Jquery Data Grid in HTML
can anyone please tell me how to use JQuery Data grid in my HTML page with example.
I have one HTML page i want the standard JQuery Data Grid with search and pagination functionality.Guys I have got the solution
thanks a lot
please refer this link for JQGrid
http://www.codeproject.com/Articles/609442/Using-JqGrid-in-ASP-NET -
Code to translate xml data into html using jaxp ?
Hi all !!
Could you please send me code to translate xml data into html using jaxp
i am sending my xml file and xsl file
its urgent
my xml file is :
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="scenario.xsl"?>
<scenarioReport>
<node name="node1">
<netObjId>124 </netObjId>
<result>undefined</result>
<report>The cell is 124.</report>
<action>qsdsqdqsd </action>
</node>
<node name="node 3">
<netObjId>124 </netObjId>
<result>undefined</result>
<report>Result is unresolved because ...</report>
<action>No action</action>
</node>
<node name="node 2">
<netObjId>124 </netObjId>
<result>undefined</result>
<report>qsdqsdqs </report>
<action>qsdsqd</action>
</node>
<node name="node 5">
<netObjId>124 </netObjId>
<result></result>
<report> </report>
<action> </action>
</node>
<node name="node 4">
<netObjId>124 </netObjId>
<result></result>
<report> </report>
<action></action>
</node>
</scenarioReport>
my xsl file is::
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<body>
<h2> Scenario Report</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th align="left">Nodename</th>
<th align="left">netObjId</th>
<th align="left">Result</th>
<th align="left">Report</th>
<th align="left">Action</th>
</tr>
<xsl:for-each select="scenarioReport/node">
<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="netObjId"/></td>
<td bgcolor="#ffffff "><xsl:value-of select="result"/></td>
<td><xsl:value-of select="report"/></td>
<td><xsl:value-of select="action"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>Must be something wrong with your XSL.
However apparently it was so urgent that you didn't have the time to look at what you posted. They just "fixed" the forum software and apparently it doesn't escape HTML that you type in any more. Or stuff that looks like HTML, either. So your post was unreadable.
If your deadline hasn't passed, try reposting that code surrounded by [pre] and [/pre]. -
Use report to display html data
Hi
I have multiple rows of text in a clob field that contains html tags. I want to display this data in html format in my htmldb application. Can I use an htmldb report to do this or am I better off using an item?
Thanksbump...
has anyone a solution to this?
I have a form that allows users to add raw HTML code. Now I want to display the formatted version in a report but the tags show in the report instead...any suggestions?
regards
Paul P -
Using RSA to encrypt query string data
If I want to use RSA to encrypt query string data, what is the industry standards for such a thing? I understand how the RSA works. Based upon that alone, I would just need to get the public key. However, I understand that it is safer to use a PKI to obtain that public key?
Can someone tell me what is "best practice" for such a thing?If the third-party-site supports https:, you do NOT have to encrypt anything yourself. That's what https is for - the communication between the user-agent and the server is encrypted as part of the protocol, and all the complicated parts of insuring a secure channel are handled for you.
If the secure site does not support htpps, then you can't use it. Which begs the question of why you are trying to do secure communication via HTTP POST with an insecure site.
To clarify, so we're sure we're talking about the same scenario - there's your server (A), which generates pages for a user-agent (B), which pages point to a third-party site (C). Are you trying to protect your data from eavesdroppers? Or are you trying to hide it from B?
In the first case, you have two options.
1) If both A and C supports https, then all you need to do is build pages with https: URLs pointing at C, and you're done. B hits A using https: URLs, it gets pages back that point to C using https URLs, lots of crypto-magic happens under the covers without you haveing to worry about it, and your data is protected.
2) If A and/or C do NOT support https, then you have to figure out how to encrypt communications between A and C. This is a private channel - we won't be able to help you much, because we don't know what C is expecting. Whatever C's protocol is, and whatever its key is, is what you'll need to implement in A, in order to talk to C.
(If you're actually trying to hide data from B, while sticking it into a page that B has to render - ew. Just...ew. It's wrong on enough levels that I don't think I can adequately describe them all.)
You asked about best-practices - 1) is it. 2) is not. Don't do that. No offense, but specially given your level of understanding of How Crypto Works, whatever you come up with is really really REALLY likely to be horribly flawed in a way that you won't see.
Crypto is both easier and harder than you think it is. Your best bet is to use the standards that the community has hammered out - your data is much, much safer that way.
Grant -
How to load data into html:select using Struts ?
How to load data into <html:select> using Struts ?
I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
please use:
<html:select >
<html:options />
</html:select >
Please help me. please detail it. thanks a lot.
Message was edited by:
tranminhmanIn order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
Hope this helps...
Chaitanya V -
Connect to SAP R/3 using SAP GUI for HTML through saprouter
Hello,
I have my system running on my intranet, but I need to connect some support enginners through an Internet connection. Nowadays some users can connect to QAS and PRO systems using SAP GUI for windows and java with the saprouter string, but the support enginners are using SAP GUI for HTML, do I need a special string or configuration so html users can connect to my system from the Internet?
Thanks in advance.thanks, I can get the data from SAP R/3 to crystal report.
but still dont know how to do the second question mentioned in previous message:
once the table I want to get the data from is a cluster, and have found the mapping data dictionary of this data cluster, which displayed in crystal report connection as well, however, the data is not what I wanted. -
How to fix the size of table data in html
I want to fix the size of table data in html. ie if i want to insert only 50 char in a <td> field then it contain only 50 character, after that it switched to another line and contain the remaining character. Means <td> field wil not get automatically adjust there size according to data.
you cant specify how many characters a td cell can have but u can specify the pixel width of a td cell
<td width=50>
as long as you have wrap text on, then text will not force the box size over the 50 pixels
this wont limit it to only 50 chars though, you will probably have to use some javascript to cut the string down to size (unless youre using something like php or asp then that will do the trick too) -
Using the Data Engine Java API
I try to use the Data Engine Java API to generate an XML document from database data.
So as mentioned in the documentation Business Intelligence Publisher User's Guide Release 10.1.3.2 (page 4-26 to 4-27)
a) I created a java class (using Jdev Version 11.1.1.0.0)
package oracle.apps.XMLPublisher.client;
import com.sun.java.util.collections.Hashtable;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import oracle.apps.xdo.XDOException;
import oracle.apps.xdo.dataengine.DataProcessor;
public class XMLFileGenerator {
public XMLFileGenerator() {
public static void dataEngine() throws ClassNotFoundException, Exception {
XMLFileGenerator xMLFileGenerator = new XMLFileGenerator();
try {
//Initialization instantiate the DataProcessor class//
DataProcessor dataProcessor;
dataProcessor = new DataProcessor();
//Set Data Template to be executed
dataProcessor.setDataTemplate("PERFRBS.xml");
Hashtable parameters;
parameters = new Hashtable();
parameters.put("P_LEGAL_ENTITY_ID", "3259");
parameters.put("P_TRU_ID", "3262");
parameters.put("P_YEAR", "2009");
dataProcessor.setParameters(parameters);
// Now set the jdbc connection to the database that you
// wish to execute the template against.
// This sample assumes you have already created
// the connection object 'jdbcConnection'
Class.forName("oracle.jdbc.OracleDriver");
String url =
"jdbc:oracle:thin:@ap6005sdb.us.oracle.com:1526:hremeadv";
Connection jdbcConnection;
jdbcConnection= DriverManager.getConnection(url, "apps", "*****");
dataProcessor.setConnection(jdbcConnection);
System.out.println("Here1");
// Specify the output directory and file for the data file
dataProcessor.setOutput("BilanSocial.xml");
System.out.println("Here2");
dataProcessor.processData();
System.out.println("Here3");
} catch (SQLException e) {
System.out.println("SQLException " + e.getMessage());
} catch (XDOException e) {
System.out.println("XDOException" + e.getMessage());
public static void main(String[] argv) throws ClassNotFoundException,
Exception {
XMLFileGenerator xmlPublisher = new XMLFileGenerator();
XMLFileGenerator.dataEngine();
b) to generate my xml file based on the following data template
<?xml version="1.0" encoding="ISO-8859-1" ?>
<dataTemplate name="PERFRBS" defaultPackage="" version="1.0">
<parameters>
<parameter name="P_LEGAL_ENTITY_ID" dataType = "number"></parameter>
<parameter name="P_TRU_ID" dataType = "number"></parameter>
<parameter name="P_YEAR" dataType = "number"></parameter>
</parameters>
<lexicals>
</lexicals>
<dataQuery>
<sqlStatement name="Q_INDICATORS">
<![CDATA[ SELECT pai.action_information3 YEAR,
pai.action_information17 INDICATOR_VALUE
FROM pay_action_information pai
WHERE pai.action_information_category = 'HR_FR_BS'
AND pai.action_context_type = 'PA'
AND pai.action_information1 = :P_LEGAL_ENTITY_ID
AND pai.action_information2 = :P_TRU_ID
AND pai.action_information3 = :P_YEAR
]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_YEARS" dataType="varchar2" source="Q_INDICATORS">
<element name="YEAR" dataType="varchar2" value="YEAR"/>
<element name="INDICATOR_VALUE" dataType="number" value="INDICATOR_VALUE"/>
</group>
</dataStructure>
</dataTemplate>
---> But when I run it , it fails when calling the data processor with the following error
D:\Jdeveloper11g\jdk\bin\javaw.exe -client -classpath "D:\Jdeveloper11g\jdevhome\XMLPublisher\src\Client\classes;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\versioninfo.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\xdocore.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\collections.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\xmlparserv2-904.jar;D:\BI publisher\XMLP562_WIN\XMLP562_WIN\manual\lib\i18nAPI_v3.jar;D:\Jdeveloper11g\jdbc\lib\ojdbc14dms.jar;D:\Jdeveloper11g\jlib\orai18n.jar;D:\Jdeveloper11g\diagnostics\lib\ojdl.jar;D:\Jdeveloper11g\jlib\dms.jar" -Dhttp.proxyHost=emeacache.uk.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts= -Dhttps.proxyHost=emeacache.uk.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts= oracle.apps.XMLPublisher.client.XMLFileGenerator
Here1
Here2
Exception in thread "main" java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleStatement from class oracle.apps.xdo.dataengine.DBConnection
at oracle.apps.xdo.dataengine.DBConnection.setRowPrefetchSize(DBConnection.java:42)
at oracle.apps.xdo.dataengine.XMLPGEN.setRowPrefetchSize(XMLPGEN.java:1224)
at oracle.apps.xdo.dataengine.XMLPGEN.writeData(XMLPGEN.java:420)
at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:281)
at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:251)
at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:192)
at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:222)
at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:334)
at oracle.apps.XMLPublisher.client.XMLFileGenerator.dataEngine(XMLFileGenerator.java:50)
at oracle.apps.XMLPublisher.client.XMLFileGenerator.main(XMLFileGenerator.java:62)
Process exited with exit code 1.
Thanks by advance for your helpMake sure you have the Oracle JDBC library setup in project parties and it's setup to export. The api's are fine. Have you looked at the BIPublisherIDE I wrote. All this code is already written for you. There is a manual on the site as well
http://bipublisher.blogspot.com/2008/03/bi-publisher-bipublisheride.html
Ike Wiggins
http://bipublisher.blogspot.com -
How to get & use xml data with jstl libraries? (URGENT PLZ)
I am using jstl to get and use xml data
I needs to perform operations on the parsed xml document with other libraries of jstl. How can i do that.
I used Dom variable to parse my document as:
<x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
where my project.xml is:
<?xml version="1.0" encoding="iso-8859-1"?>
<project> <projectName>myProject</projectName> </project>
I can dislay this value in html by
<x:out select="$test/project/projectName"/>
But I need a string value sotred in variable such as <c:set var="pname" value="???">
HOW CAN I SET THIS VALUE IN CORE VARIABLE THAT IS, USING <c:set...> SO THAT IT CAN BE USED ANYWHERE IN JSP PAGE TO CONCATE RETURNED STRING IN OTHER STRING VARIABLES DEFINED BY CORE LIB?
Jessy
Message was edited by:
jessy
Message was edited by:
jessyI believe that <c:set> should do that but i am facing problem in it. Look into this jsp scriptlet:
1-<x:parse varDom="test"> <c:import url="project.xml"/> </x:parse>
2-<x:set var="ds" select="$test/project/projectName"/>
3-<x:out select="$ds"/> <br>
4-<c:set var="tt" value="${ds}" />
5-<c:out value="${tt}" />
In line 3 variable ds returns: myProject
In line 5 variable tt returns: [[projectName: null]]
perhaps on line 4 ds is storing some array to tt and i am not calling correct array element. I tried many options but still could not find solution. Plz Plz do something urgent for me. Thanks
Jessy
Message was edited by:
jessy -
Creating Mime-messages from String data
How do I save string data of email received from Outlook Express by calling BufferedReader's readLine() method over a socket a connection so that it can be converted into MimeMessage.
Sorry but i didn't read your code snipppet so well.
So you have a Vector v wicht contains the client part of the dialog.
This is a typical conversation: ( you don't use EHLO or HELO handshake!? it's considered rude not to introduce yourself :) )
EHLO CLIENTNAME
250
MAIL FROM:<[email protected]>
250 MAIL FROM:<[email protected]> OK
RCPT TO:<[email protected]>
250 RCPT TO:<[email protected]> OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
Message-ID: <24569170.1093420595394.JavaMail.cau@PTWPC019>
From: [email protected]
To: [email protected]
Subject: something
Mime-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_0_17459938.1093420595224"
------=_Part_0_17459938.1093420595224
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
TEXT CONTENTS
------=_Part_0_17459938.1093420595224
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit
<b>HTML CONTENTS<b>
------=_Part_0_17459938.1093420595224--
250 <412ADBC5000000B5> Mail accepted
QUIT
221 ontrob1.bmsg.nl QUIT
The results in the vector from DATA to the ending dot . should be the part of your constructor string;
Use this constructor
MimeMessage mm = new MimeMessage(null, ByteArrayInputStream( yourstring.getBytes() ) ) ;at this moment you can deconstruct the mime further.
maybe this code will help:
you should call the dumpPart method like this dumpPart( mm );
Store store;
Folder folder;
static boolean verbose = false;
static boolean debug = false;
static boolean showStructure = true;
private static void dumpPart(Part part) throws Exception {
if (part instanceof Message)
dumpEnvelope((Message) part);
/** //Dump input stream ..
InputStream is = part.getInputStream();
// If "is" is not already buffered, wrap a BufferedInputStream
// around it.
if (!(is instanceof BufferedInputStream))
is = new BufferedInputStream(is);
int c;
while ((c = is.read()) != -1)
System.err.write(c);
pr("CONTENT-TYPE: " + part.getContentType());
* Using isMimeType to determine the content type avoids
* fetching the actual content data until we need it.
if (part.isMimeType("text/plain")) {
pr("This is plain text");
pr("---------------------------");
if (!showStructure)
System.out.println((String) part.getContent());
} else if (part.isMimeType("multipart/*")) {
pr("This is a Multipart");
pr("---------------------------");
Multipart mp = (Multipart) part.getContent();
level++;
int count = mp.getCount();
for (int i = 0; i < count; i++)
dumpPart(mp.getBodyPart(i));
level--;
} else if (part.isMimeType("message/rfc822")) {
pr("This is a Nested Message");
pr("---------------------------");
level++;
dumpPart((Part) part.getContent());
level--;
} else if (!showStructure) {
* If we actually want to see the data, and it?s not a
* MIME type we know, fetch it and check its Java type.
Object o = part.getContent();
if (o instanceof String) {
pr("This is a string");
pr("---------------------------");
System.out.println((String) o);
} else if (o instanceof InputStream) {
System.err.println("HELLO CAU 1111");
pr("This is just an input stream");
pr("---------------------------");
InputStream is2 = (InputStream) o;
int c2;
while ((c2= is2.read()) != -1)
System.out.write(c2);
System.err.println("\nHELLO CAU");
} else {
pr("This is an unknown type");
pr("---------------------------");
pr(o.toString());
} else {
pr("This is an unknown type");
pr("---------------------------");
private static void dumpEnvelope(Message msg) throws Exception {
pr("This is the message envelope");
pr("---------------------------");
Address[] a;
// FROM
if ((a = msg.getFrom()) != null) {
for (int j = 0; j < a.length; j++)
pr("FROM: " + a[j].toString());
//TO
if ((a = msg.getRecipients(Message.RecipientType.TO)) != null) {
for (int j = 0; j < a.length; j++)
pr("TO: " + a[j].toString());
// SUBJECT
pr("SUBJECT: " + msg.getSubject());
// DATE
Date d = msg.getSentDate();
pr("SendDate: " + (d != null ? d.toString() : "UNKNOWN"));
//FLAGS
Flags flags = msg.getFlags();
StringBuffer sb = new StringBuffer();
Flags.Flag[] sf = flags.getSystemFlags(); // get the system flags
boolean first = true;
for (int i = 0; i < sf.length; i++) {
String s;
Flags.Flag f = sf;
if (f == Flags.Flag.ANSWERED)
s = "\\Answered";
else if (f == Flags.Flag.DELETED)
s = "\\Deleted";
else if (f == Flags.Flag.DRAFT)
s = "\\Draft";
else if (f == Flags.Flag.FLAGGED)
s = "\\Flagged";
else if (f == Flags.Flag.RECENT)
s = "\\Recent";
else if (f == Flags.Flag.SEEN)
s = "\\Seen";
else
continue; // skip it
if (first)
first = false;
else
sb.append(' ');
sb.append(s);
String[] uf = flags.getUserFlags(); // get user-flag strings
for (int i = 0; i < uf.length; i++) {
if (first)
first = false;
else
sb.append(' ');
sb.append(uf[i]);
pr("FLAGS: " + sb.toString());
// X-MAILER
String[] hdrs = msg.getHeader("X-Mailer");
if (hdrs != null)
pr("X-Mailer: " + hdrs[0]);
else
pr("X-Mailer NOT available");
static String indentStr = " ";
static int level = 0;
* Print a, possibly indented, string.
public static void pr(String s) {
if (showStructure)
System.out.print(indentStr.substring(0, level * 2));
System.out.println(s);
Tricae -
Need to convert string data to numbers.
I have string data that I need to convert to numbers so that I can graph it or perform calculations on it. The data (file attached) is in three columns (tab separated) and is in the format time/double/time (saved as a string with Write haracters to File.) When I try Read From Spreadsheet I get 0.0000 for column 1 and 2.0000 for column 3.
Attachments:
testOK.txt 1 KBHi,
I've done this through scan from file, using %s%f%s%s so I get the relative time, numeric, time, PM
See the attached .vi.
Hope it helps
S.
// it takes almost no time to rate an answer
Attachments:
disect_data.vi 46 KB
Maybe you are looking for
-
Adding an item to a List when clicking a WebPart Properties 'OK' button
Hi all, I wonder if someone can help me. Im new to SharePoint Programming but learning slowly. I have a superb Web Part downloaded from Codeplex which essentially is a Countdown Timer in jQuery. (spCountdown) The code itself works perfectly however
-
my iphone 5 has restored to an old backup after updating to ios 7 is there any way of getting my stuff back as this has now become the most recent back up? also since the update it keeps resetting itself? i had a lot of stuff on there that i really w
-
Apply Oracle Functions to Individual numeric characters in a string
I'm trying to apply MOD function and some arithmetic to each and every numeric character with-in a string. Maximum length of the string is 30 characters, and its variable length. When I try the traditional for loop, my execution time increases drasti
-
i like all the Feature's of the New API. i would like 2 Suggest Use the 3d and other's on '''FireFox API Demo Slide Show''' i would like 2 Use it for Music files and maybe Video's, i would use it directly on my Computer. i Dont know how 2 that, i lik
-
General question re: FI-CO
I'm completly new to SAP and am interested in the Treasury - Cash side in terms of consultancy and implementation. I have experience in implementing treasury systems and solutions and am looking to branch out into the ERP side hence my query to FI-CO