Coding to send mail but body with java script

Hi,
here my requirement is send mail in action but body with java script just tell me how i include java script in coding of mail sending.
regards,
ss

self

Similar Messages

  • TS1307 I am holidaying in Auckland using my daughters orcon internet account for sending mail but it will not send. I am sure I am putting in the correct information but it still says orcon offline. I have spent half an hour with Orcon putting in correct

    I am holidaying in Auckland using my daughter's Orcon internet account for sending mail but it will not send. I am sure I am putting in the correct information but it still says mail.orcon.net.nz(Offline). I have spent half an hour with Orcon putting in correct info. They do not know how to help me further and neither does telstra clear, my own internet provider.
    Any advice appreciated.

    On the Mail menubar > Mailbox, make sure Take all accounts online is selected.

  • I can send mail but can't receive mail on thunderbird

    I am using Thunderbird since 2 years ago and im getting a new problem. I can send mail but cant receive any mail . When pressed GET mail i receive 'connecting to mail.gandi.net' only. that's all.
    Can you please help.
    below is my troubleshoot information:
    Application Basics
    Name: Thunderbird
    Version: 31.3.0
    User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0
    Profile Folder: Show Folder
    (Local drive)
    Application Build ID: 20141127140543
    Enabled Plugins: about:plugins
    Build Configuration: about:buildconfig
    Memory Use: about:memory
    Mail and News Accounts
    account1:
    INCOMING: account1, , (none) Local Folders, plain, passwordCleartext
    account2:
    INCOMING: account2, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    account3:
    INCOMING: account3, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    account4:
    INCOMING: account4, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    account5:
    INCOMING: account5, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    account6:
    INCOMING: account6, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    account11:
    INCOMING: account11, , (rss) Feeds, plain, passwordCleartext
    account13:
    INCOMING: account13, , (rss) Feeds-2, plain, passwordCleartext
    account14:
    INCOMING: account14, , (pop3) mail.gandi.net:995, SSL, passwordCleartext
    OUTGOING: mail.gandi.net:465, SSL, passwordCleartext, true
    Crash Reports
    http://crash-stats.mozilla.com/report/index/bp-0490c01b-d20a-4d94-89fa-de36f2141208 (12/8/2014)
    http://crash-stats.mozilla.com/report/index/bp-01ec1457-2d47-4bde-838d-e381a2141205 (12/5/2014)
    http://crash-stats.mozilla.com/report/index/bp-b0b8fa7c-5dc9-4dc5-8d8d-4aae12141205 (12/5/2014)
    http://crash-stats.mozilla.com/report/index/bp-660baa33-28ce-47c6-8fb4-1b5682141205 (12/5/2014)
    http://crash-stats.mozilla.com/report/index/bp-4a7623a9-b2b5-42c4-9f49-73aa52141204 (12/4/2014)
    Extensions
    Lightning, 3.3.1, true, {e2fda1a4-762b-4020-b5ad-a41df1933103}
    Quick Translator, 1.0, true, {5C655500-E712-41e7-9349-CE462F844B19}
    Simple Locale Switcher, 0.8.4, true, simplels@nohamelin
    Important Modified Preferences
    Name: Value
    accessibility.typeaheadfind.flashBar: 0
    browser.cache.disk.capacity: 409600
    browser.cache.disk.smart_size.first_run: false
    browser.cache.disk.smart_size.use_old_max: false
    browser.cache.disk.smart_size_cached_value: 358400
    extensions.lastAppVersion: 31.3.0
    font.internaluseonly.changed: false
    font.name.monospace.el: Consolas
    font.name.monospace.tr: Consolas
    font.name.monospace.x-baltic: Consolas
    font.name.monospace.x-central-euro: Consolas
    font.name.monospace.x-cyrillic: Consolas
    font.name.monospace.x-unicode: Consolas
    font.name.monospace.x-western: Consolas
    font.name.sans-serif.el: Calibri
    font.name.sans-serif.tr: Calibri
    font.name.sans-serif.x-baltic: Calibri
    font.name.sans-serif.x-central-euro: Calibri
    font.name.sans-serif.x-cyrillic: Calibri
    font.name.sans-serif.x-unicode: Calibri
    font.name.sans-serif.x-western: Calibri
    font.name.serif.el: Cambria
    font.name.serif.tr: Cambria
    font.name.serif.x-baltic: Cambria
    font.name.serif.x-central-euro: Cambria
    font.name.serif.x-cyrillic: Cambria
    font.name.serif.x-unicode: Cambria
    font.name.serif.x-western: Cambria
    font.size.fixed.el: 14
    font.size.fixed.tr: 14
    font.size.fixed.x-baltic: 14
    font.size.fixed.x-central-euro: 14
    font.size.fixed.x-cyrillic: 14
    font.size.fixed.x-unicode: 14
    font.size.fixed.x-western: 14
    font.size.variable.el: 17
    font.size.variable.tr: 17
    font.size.variable.x-baltic: 17
    font.size.variable.x-central-euro: 17
    font.size.variable.x-cyrillic: 17
    font.size.variable.x-unicode: 17
    font.size.variable.x-western: 17
    gfx.blacklist.suggested-driver-version: 6.1400.1000.5218
    gfx.direct3d.last_used_feature_level_idx: 0
    mail.openMessageBehavior.version: 1
    mail.winsearch.firstRunDone: true
    mailnews.database.global.datastore.id: f06768f2-32d9-440c-bc02-f0414c2d7f3
    mailnews.database.global.views.conversation.columns: {"threadCol":{"visible":true,"ordinal":"1"},"flaggedCol":{"visible":true,"ordinal":"3"},"attachmentCol":{"visible":false…
    network.cookie.prefsMigrated: true
    places.database.lastMaintenance: 1418013595
    places.history.expiration.transient_current_max_pages: 104858
    plugin.importedState: true
    plugin.state.java: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_bgcolor: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_bgimages: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_colorspace:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_command:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_downloadfonts: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_duplex: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_edge_bottom: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_edge_left: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_edge_right: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_edge_top: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_evenpages: true
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_footercenter:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_footerleft: &PT
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_footerright: &D
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_headercenter:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_headerleft: &T
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_headerright: &U
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_in_color: true
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_margin_bottom: 0.5
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_margin_left: 0.5
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_margin_right: 0.5
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_margin_top: 0.5
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_oddpages: true
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_orientation: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_page_delay: 50
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_data: 9
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_height: 11.00
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_name:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_size_type: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_size_unit: 1
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_paper_width: 8.50
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_plex_name:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_resolution: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_resolution_name:
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_reversed: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_scaling: 1.00
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_shrink_to_fit: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_to_file: false
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_unwriteable_margin_bottom: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_unwriteable_margin_left: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_unwriteable_margin_right: 0
    print.printer_RICOH_Aficio_MP_C2030_RPCS.print_unwriteable_margin_top: 0
    security.default_personal_cert: Select Automatically
    security.disable_button.openCertManager: false
    security.disable_button.openDeviceManager: false
    Graphics
    Adapter Description: Intel(R) HD Graphics Family
    Vendor ID: 0x8086
    Device ID: 0x0116
    Adapter RAM: Unknown
    Adapter Drivers: igdumd64 igd10umd64 igd10umd64 igdumdx32 igd10umd32 igd10umd32
    Driver Version: 8.15.10.2291
    Driver Date: 1-27-2011
    Adapter Description (GPU #2): NVIDIA GeForce GT 525M
    Vendor ID (GPU #2): 0x10de
    Device ID (GPU #2): 0x0df5
    Adapter RAM (GPU #2): 1024
    Adapter Drivers (GPU #2): nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2um
    Driver Version (GPU #2): 8.17.12.6721
    Driver Date (GPU #2): 2-18-2011
    Direct2D Enabled: true
    DirectWrite Enabled: true (6.1.7601.17514)
    ClearType Parameters: ClearType parameters not found
    WebGL Renderer: false
    GPU Accelerated Windows: 1/1 Direct3D 10
    AzureCanvasBackend: direct2d
    AzureSkiaAccelerated: 0
    AzureFallbackCanvasBackend: cairo
    AzureContentBackend: direct2d
    JavaScript
    Incremental GC: 1
    Accessibility
    Activated: 0
    Prevent Accessibility: 0
    Library Versions
    Expected minimum version
    Version in use
    NSPR
    4.10.6
    4.10.6
    NSS
    3.16.2.3 Basic ECC
    3.16.2.3 Basic ECC
    NSS Util
    3.16.2.3
    3.16.2.3
    NSS SSL
    3.16.2.3 Basic ECC
    3.16.2.3 Basic ECC
    NSS S/MIME
    3.16.2.3 Basic ECC
    3.16.2.3 Basic ECC

    Here is what I did to resolve the problem:
    In Mail/preferences/accounts/account information/ and at the bottom of the box there is a toggle arrow up and down to edit the outgoing mail server, check the box "use only this server" and  hit this toggle button and select "edit SMTP Server List" at the very bottom of the email names.
    Select Advanced tab.  Correct and/or add usernames and passwords as needed for each email account.  Be sure to select OK each time to get the passwords to hold!  Some changes don't seem to hold unless you click OK before you move on.
    To test:       Window/activity (a little windows will pop up showing activity bars)   and then "get mail" button.  This should show any problems
    Another test:  window/connection doctor
    This shouldl fix both pop and imap.  so far it worked on yahoo, mobile me, gmail, hotmail, and others.  Of course, you will need to know the incoming and outgoing mail server info, user name, and passwords.
    Too bad we have to go though hoops to use an email program that used to work well.  Worse yet, many may not know for days that their email isn't working.
    This is easy method of setting up your email accounts but may not allow enough detail to make the mail accounts function properly in Mail 5.0:
    system preferences/internet and wireless/mail, contacts, calendars/ add account
    shyannlindy listening to the outdoor concert from
    Cheyenne Frontier Days, the Worlds' Largest Outdoor Rodeo

  • Script task to convert output from a sql query into send mail task body formatting

    SSIS 2008R2 Version
    Code from script task
       Microsoft SQL Server Integration Services Script Task
       Write scripts using Microsoft Visual C# 2008.
       The ScriptMain is the entry point class of the script.
    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Runtime;
    using System.Windows.Forms;
    namespace ST_29dd6843bd6c4aee9b1656c1bbf55ba8.csproj
        [System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]
        public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
            #region VSTA generated code
            enum ScriptResults
                Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
                Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
            #endregion
            public void Main()
                Variables varCollection = null;
                string header = string.Empty;
                string message = string.Empty;
                Dts.VariableDispenser.LockForWrite("User::gsEmailMessage");
                Dts.VariableDispenser.LockForWrite("User::gsWebserviceName");
                Dts.VariableDispenser.LockForWrite("User::gsNoOfCallsInADay");
                Dts.VariableDispenser.LockForWrite("User::gsCalledBySystem");
                Dts.VariableDispenser.GetVariables(ref varCollection);
                //Set the header message for the query result
                if (varCollection["User::gsEmailMessage"].Value == string.Empty)
                    header = "Hi, Count is greater then 50 :\n\n";
                    //header = "Execute SQL task output sent using Send Email Task in SSIS:\n\n\n";
                    header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
                    header += string.Format("{0}\t\t\t\t{1}\t\t{2}\n", "WebService Name", "No Of Calls In A Day", "Called By System");
                    header += "----------------------------------------------------------------------------------------------------------------------" + "\n";
                    varCollection["User::gsEmailMessage"].Value = header;
                //Format the query result with tab delimiters
                     message = String.Format("<HTML><BODY><P>{0}</P><P>{1}</P><P>{2}</P></BODY></HTML>",
                                            varCollection["User::gsWebserviceName"].Value,
                                            varCollection["User::gsNoOfCallsInADay"].Value,
                                            varCollection["User::gsCalledBySystem"].Value);
                varCollection["User::gsEmailMessage"].Value = varCollection["User::gsEmailMessage"].Value + message + "\n";
                Dts.TaskResult = (int)ScriptResults.Success;
    Above code will return data in below format and then i send this output in aemail using send mail task.
    Hi, count is greater then 50 :
    WebService Name                                                         
    No Of Calls In A Day                        Called By System
    WebServiceone                                                     1                             
    Internetbutiken
    WebServiceGetdetailstwo                                                  1                             
    Internetbutiken
    Servicenamethree                                                            2                             
    MOB
    As you can see above code is not in align as if we service name is shorter then 2nd column get disallign and its not look good.I need output should be like below.
    Hi, count is greater then 50 :
    WebService Name                                                         
    No Of Calls In A Day                        Called By System
    WebServiceone                                                              1                             
    Internetbutiken
    WebServiceGetdetailstwo                                              1                             
    Internetbutiken
    Servicenamethree                                                          2                             
    MOB
    Please suggest something...
    Thanks 
    SR_MCTS

    See code explained here
    http://microsoft-ssis.blogspot.in/2013/08/sending-mail-within-ssis-part-2-script.html
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    This will not help.As I am not creating smtp connectin ,send from ,send to in script task.I am just creating email body from sql output.

  • Cannot send mail but get receive mail

    Cannot send mail but can receivr mail

    I had this problem, too, when I took my laptop to work and tried to send mail using their wireless settings.  (I have never had this problem with wireless internet at home.)  After a lot of research it appeared to be a port issue.  Apple and Yahoo directed me to contact AT&T, my email server provider, to inquire if there was another port setting or off-line port that could be used.  This turned out to be too complicated because I had to get my boss's wireless codes, etc.  I got around the whole thing by logging into my email through Yahoo rather than Apple's Mail program.  This allowed me to send emails at work with no problems.  Hope this helps.

  • I can send mail but cannot receive it on my iMac since upgrading to Yosemite

    I can send Mail but I cannot receive it on my iMac Mail account, have checked all account information and it is correct.

    Hey phillipfrompaupack,
    I see that you are having issues with your mail in Yosemite. Here is an article for you that will help you troubleshoot these issues:
    OS X Mail: Troubleshooting sending and receiving email messages - Apple Support
    http://support.apple.com/en-us/ts3276
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • Mail app won't send mail, but it will receive mail

    The mail app on my macbook pro and iphone will not send mail, but they can recieve mail.  I deleted both accounts and reloaded them and they still won't work.  After that I ran repair permissions and it found nothing wrong.  Has anyone experienced this problem and how can I fix this?

    I had same problem with my MBA and Mac Desktop (don't have iPhone)...could receive but not send emails after Lion upgrade.  I only experienced it at home versus at work (inconsistently on both on my macbook air and my desktop mac).
    For me the solution was when you compose an email there are two dropdown listboxes next to From:  ...in the second one select smtp.me.com:yourusername   Until Apple makes a change you might need to do that each time you send or reply to a message.
    I think it has something to do with if you don't do that then port 25 might get used which can be blocked by a lot of ISPs.
    Apple support helped me solve this problem and said it was a known issue they are working on.
    Hope this helps with your issue!

  • I work in psd, i want to send mail to pdf,  with out pixel, how do i do ?

    i work in psd, i want to send mail to pdf,  with out pixel, how do i do ?

    Well it is difficult to understand your question so little information, and with an apparent language problem, but you can can Save As to the pdf format.  If you have any text layers, do _not_ flatten before exporting.  Use a High Quality Print preset in the PDF dialog box, unless file size is critical.
    If I have misunderstood your question, please give a lot more information, including what version of Photoshop.  You can use your own language if that is easier, and we'll use the forum Translate feature, but the more information you put in your post, the better chance of it being understood.

  • TS3276 I cannot send mail but i do receive it

    I cannot send mail but do recieve it, what do I write in Imap path prefix?

    Oh, its not as "strange" as you might think.
    The problem is SPAM.  Internet Service Provider (ISPs) are struggling to prevent outsiders - or their own customers - from sending huge amounts of SPAM.
    To do this, they have to make regular changes to how e-mail is handled.  My guess, based on what you have told me so far, is that your ISP has made a change to how e-mails are sent.
    This means you have to find out what that change was and adjust your Mail account settings.  Hopefully your ISP has a "Support" web page where there is a step-by-step How To document that will lead you through this.

  • HT201320 I can send mail but I can't receive mail. All my account setup info is correct. Any ideas?

    I can send mail but I can't receive mail. All my account setup info is correct. Any ideas?

    I can send mail but I can't receive mail. All my account setup info is correct. Any ideas?

  • I can send mail but cannot receive it.  What is the problem???

    I just purchased an iPad.  I can send mail but not receive it.  What is the problem????

    beverly220 wrote:
    Yes I get error messages.  I can send & receive messages from our home computer & from a iPod Touch.
    Are we supposed to guess what the error messages are that you get? We can't help unless you provide some information. We can not see your iPad so can not see the error messages.

  • HT2500 hi - can't send mails but can receive them and use internet - pls help

    Hi - please help, I can't seem to send mails but I can receive them and surf the net?

    You need to open Mail>Preferences>Accounts>"Account Information" tab>and there input the required information for your Outgoing Mail Server (SMTP).  Your Internet Service Provider will have the required information to give you to input here.  Make sure that you also click at the end of the line "Outgoing Mail Server" on the arrows to get the dropdown list, and there click on "Edit SMTP Server List" and fill in the data in that resulting window also.

  • Problem with Java Script after upgrade from BW 3.5 to BI7

    Dear Colleagues,
    We're facing the issue with Java Script after upgrade of BW 3.5 to BI7.
    Just after update we checked the basic functionality and it occured that some of web templates that use Java Script don't work. They generate seelction screen, but after selection the screen becomes blank without any error messages.
    We're currently stucked since web templates weren't converted to BI7 version so they should work exactly as before the upgrade.
    We compared the Java code with other environment that was not upgraded - it's perfectly the same.
    The only explanation that comes to my mind is that some Java Script settings on the server level were changed during the upgrade but I have no idea where I can check that.
    Thanks in advance for any suggestions,
    Andrzej Bobula

    Hi Deepu,
    Thanks, it was great to read your reply and then few minutes later talk to you live on SDN Day!
    Unfortunately, http cache clean-up did not help. But there is another funny thing I found - for exactly the same 3.5 webtemplate html code returned from WebAS 3.5 was different then from 7.0.
    Unfortunately, this editor does not allow to paste complete code, even in CODE brackets, but here are main differences:
    <b>3.5</b>
       if (navigator.appName == "Microsoft Internet Explorer")
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=1&REQUEST_NO=1&CMD=GET_TEMPLATE"
    name="Content">
    and
    <b>7.0</b>
       if (navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)
    <frame src="/sap/bw/BEx?SAP-LANGUAGE=E&PAGENO=8&REQUEST_NO=0&CMD=GET_TEMPLATE"
    name="Content" 0nLoad="javascript:loadTitle()">
    (I intentionaly put 0 i/o o in 0nLoad, otherwise Forum's editor does not accept the text.
    How about SAP's claim that technical upgrade from 3.x to 7.0 changes nothing?
    Regards,
    Vitaliy

  • Web site with Java Scripts ( on iphone4)

    try to open a web site with Java scripts , but it just show empty on the scripts section , anyone can help ? (on iphone 4 with iOS 4.1)

    Hi, welcome to Apple Discussions.
    Web pages that make use of Javascript should work just fine. Those that have embedded Java applications won't. Java & Javascript are two different animals despite the similarity in the names. Like Flash, Java is not supported on iOS.
    tt2

  • Problems with Java Scripting API

    Hello Everyone!
    Guys, I need help with Java scripting API. A problem is that I cannot understand how can I operate Java Object's fields and methods from the script language. I have chosen embedded javascript to work with. And I can get the fields and methods of in-box java classes (such as ArrayList for example), but I cannot work with methods and fields from my own classes!
    Here is an example:
    public class ScriptingExample {  
        class MyClass {  
            int myfield = 5;  
            int getInt() {return 7;}  
        public void runExample() {  
            ScriptEngineManager mgr = new ScriptEngineManager();  
            List<ScriptEngineFactory> factories = mgr.getEngineFactories();  
            ScriptEngineManager factory = new ScriptEngineManager();  
            ScriptEngine engine = factory.getEngineByName("JavaScript");  
            MyClass mc = new MyClass();  
            try{  
                engine.put("mc", mc);  
                engine.eval("print(mc.myfield); print(mc.getInt())"); // or engine.eval("print(mc.myfield)");
            } catch (Exception e) {e.printStackTrace();}  
    }  If I run the code with the commented part it prints "undefined" instead of "5".
    If I run the code as it is it prints error instead of "7":
    undefinedjavax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Cannot find function getInt. (<Unknown source>#1) in <Unknown source> at line number 1
    at com.sun.script.javascript.RhinoScriptEngine.eval(Unknown Source)
    at com.sun.script.javascript.RhinoScriptEngine.eval(Unknown Source)
    at javax.script.AbstractScriptEngine.eval(Unknown Source)
    at solutiondatabase.ScriptingExample.runExample(ScriptingExample.java:26)
    at solutiondatabase.Main.main(Main.java:49)
    How can I fix it?

    Guys,
    please let me raise this topic because several new questions emerged.
    (1) How can I get all the variables created inside my engine?
    There are two kinds of variables: first kind is Java obejcts put inside the engine and second kind is the variables created in my script, such as 'var a = 4;'. How can I list all the variables of that two kinds?
    (2) Is there is a way to make 'import static' to the engine? I dont want to write MyClass.MyEnum.MyEnumItem every time. Also, I cannot put the whole enum into the engine with engine.put("MyEnum", MyEnum); I can put only enum items separately: engine.put("MyEnum", MyEnum.EnumItemA);. Thats why I ask about static import.
    (3) How can I cast engine variables back to java variables inside my java code?
    Here is my example:
    package mypackage;
    import java.util.ArrayList;
    import java.util.List;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineFactory;
    import javax.script.ScriptEngineManager;
    public class Main
         public static void main(String[] args) throws Exception 
              ScriptEngineManager mgr = new ScriptEngineManager();
              List<ScriptEngineFactory> factories = mgr.getEngineFactories();
              ScriptEngineManager factory = new ScriptEngineManager();
              ScriptEngine engine = factory.getEngineByName("JavaScript");
              ArrayList<Double> myList = new ArrayList<Double>();
              myList.add(5.0);                    
              engine.put("MyList", myList);     
              engine.eval("MyVar = MyList.get(0);");
              System.out.println((Double)engine.get("MyVar"));
    }The result is:
    Exception in thread "main" java.lang.ClassCastException: sun.org.mozilla.javascript.internal.NativeJavaObject cannot be cast to java.lang.Double
    +     at mypackage.Main.main(Main.java:28)+
    Is it possible to retrieve my Double java object from the engine?
    Edited by: Dmitry_MSK on Aug 6, 2010 1:56 AM

Maybe you are looking for

  • How to strore mouse coordinates in array

    Hi, I am using LaptopTouchpad to get cursor coordinates. I need to track all the coordinates while the cursor moving. But i am getting only present coordinates. i thought that to track coordinates, i need to store in an array. while doing that i am g

  • Format a mac through pc?

    can i format my mackbook HD through a laptop with vista? i want to reformat the internal HD on my macbook how do i do this also how do i connect them up? disk utility doesnt work its the windows partition on my macbook that wont deleat can i connect

  • Multiple terminal windows on multiple views in Subtle WM?

    Apologies if this has already been answered somewhere, but I couldn't find it. I'm using the Subtle WM, and I really love it's use of gravities and tags to position windows. The only problem I've run into is when I have multiple copies of the same pr

  • How can we create a common function for 2 or more java card applets?

    I have 2 java card applets. They use one common function. But i don't know how to set up it. Anybody knows it, please help me. Please show me step by step to do it. Thank you.

  • Order of file script

    Hi experts, my req is i have one file this file contains lot table structure(100 tables dependence) after that how to validate the order of table structure iam prepared the script for single file with single table but my req is multiple tables struct