How to embid java code in JavaScript

Hi!!
I am writing JSP program.
Do u know how to embid java code in javascirpt
ex:
<SCRIPT>
alert("hello");
<%
System.out.println("Hello...Satish. ");
%>
</SCRIPT>
This alert message is not comming when i add the java code.

Do u know how to embid java code in javascirptYou can't.
Java/JSP code runs, and produces a web page. At this point any html/javascript is treated just as "text" to output.
That web page is then sent to the browser which runs javascript.
All java code has been run/removed - maybe generating HTML in its place.
The only way to call java code again is to submit an HTTP request - normally by clicking a link/submitting a form.

Similar Messages

  • Regarding use of java code inside javascript

    Hi ,
    I have doubt regarding how to use java code inside javascript,
    i am giving my application code here
    <%@page import="java.util.*"%>
    <%@ page import="com.suuny.sard.pmt.pat.*"%>
    <SCRIPT LANGUAGE="JavaScript">
    function fun(){
         var ac=document.login.Projectname.options[document.login.Projectname.selectedIndex].value;
         var c = document.login.task1.value;
         alert(ac);
         alert(c);
         return true;
    </SCRIPT>
    <form name="login" action="/pmt/jsp/Leavemanagement/Leave_Ems_HomePage.jsp" method="get" encType="x-www-form-encoded" >
    <table width="100%" Align="Center" cellspacing="0" cellpadding="0" border="0">
    <tr class="tablerow"><td colspan="6" align="center"><font class="pagehead" align="center">Create Tasks</font></td></tr>
         <tr class="tableheader">
              <th>Project
              <th>Task-Id
              <th>TaskName
              <th>Assigned To
              <th>description
              <th>Milestone
         </tr>
         <%
              for(int i=1;i<2;i++){%>
                   <tr class="tablerow"><td align="center">
                   <select class="SELECT" NAME="Projectname" VALUE=" " onchange="return fun();" >
                   <!--<option value=""> </option>-->
                   <%
                        ArrayList ar =null;
                        ArrayList projectids=null;
                        Hashtable ht = new Hashtable();
                        ProjectNames pnames=new ProjectNames();
                   ht = pnames.getProjectNames();
                        ar=(ArrayList)ht.get("projects");
                        projectids=(ArrayList)ht.get("projectIds");
                        for(int j=0;j<ar.size();j++){
                        out.println("<option value=\""+projectids.get(j)+"\">"+ar.get(j)+"</option>");
                   %>
    </select>
         <%
                   out.println("<td align=\"center\"><input type=\"text\" name=\"task"+i+"\"value=\"\" size=\"25\"></td>");
                   out.println("<td align=\"center\"><input type=\"text\" name=\"taskname"+i+"\"value=\"\" size=\"25\"></td>");
              %>
              <td align="center">
                             <select class="SELECT" NAME="Projectname1" VALUE=" ">
                             <!--<option value=""> </option>-->
                             <%
                                  ArrayList ar1 =null;
                             ar1 = pnames.getProjectResource("VXML02");
                                  for(int j=0;j<ar1.size();j++){
                                  out.println("<option value=\""+ar1.get(j)+"\">"+ar1.get(j)+"</option>");
                             %>
    </select>
              <%
                   out.println("<td align=\"center\"><input type=\"text\" name=\"description"+i+"\"value=\"\" size=\"25\"></td>");
                   out.println("<td align=\"center\"><input type=\"text\" name=\"milestone"+i+"\"value=\"\" size=\"25\"></td><tr>");
              out.println("<tr class=\"tablerow\"><td colspan=\"6\" align=\"center\"><input class=\"txtbuttonsmall\" type=\"submit\" value=\"save\"></td>");
         %>
    </Table>
    </form>
    My question is :
    I selected one project from first combo box ,i need project members corresponding to the project.
    In my code "pnames.getProjectResource("VXML02");" in this function iam passing one static projrct value,but i need dynamically selected project from first combo box(<select class="SELECT" NAME="Projectname" VALUE=" " onchange="return fun();" >),so please help me guys.

    Hi Marco,
    I "executed" some java code within XSLs file. I have quoted the word executed because I didn't really run java code, but I used a simply trick that I describe you below.
    Into your XSLs put an iframe which is hided (it has an height of 0 pixel). As src of the iframe put the address of a portal component which execute your code (in my case calculate some PCD URL of some pages into a defined role). As result of component execution, I use the response.write method in order to execute some jscript code, which is able to interact with the HTML generated by XSLs files, for example in my case response.write put the PCD URL into a drop down list placed into the "edit" form.
    This works fine. I don't know if is suitable also for your case, anyway could be a hint, but pay attention to Roland's recommendations.
    Ciao
    Roberto

  • How to call java function in javascript

    Hello Everyone,
    Can anyone tell me solution that:
    How to call java function in javascript?
    Thanks,
    VIDs

    You can't since Java is running on the server and javascript is running in the browser long after the Java side of things has finished executing. Assuming you're not talking about an applet here.
    But you can make calls back to the server through Ajax. All you need is something like a servlet on the receiving end which you can invoke through Ajax; from that point you can execute any Java code you want.

  • How to use Java code inside WebDynpro-ABAP

    Hi,
        How to use Java code inside WebDynpro-ABAP.
    Could any one provide sample code.
    Cheers,
    Sam

    Hi Sam,
    We can't Bring Java Inside the ABAP. Both are running in different Environments.
    and also ABAP Codes are runs on BASIS.
    -Basis is a middleware between ABAP codes and Ur OS.
    -Contains set of programs to load,RUN,intepret the ABAP program..
    So Both are Different.
    Regards,
    Ramganesan K.

  • How to write java code to read the pixel color in some place of screen?

    Hello all:
    How to write java code to read the pixel color in some place of screen?
    The java application iteself doesn't have any GUI.
    thank you
    -Danel

    See java.awt.Robot

  • Can i write java code in JavaScript function

    I want to call JavaBeans within JavaScript function. Can I do it?
    I have a button in JSP . When the button be clicked,the data be inputted will be checked by JavaScript function. If check is ok, then call a Bean's function to write the data to database.
    Please Help!

    well indeed u can write java code in javascript functions. But probably it will not work the way u want it to.
    when u say that u click a button, it means that some client side action is performed. Now if u wud require a java bean to be called then it means that the server needs to be contacted for the same, and if that has to be done, necessarily the form needs to be submitted.
    U can populate values from a java bean and then the same can be made available to a javascript variable / function when the page is loaded rather than, when the button is clicked.
    What u can do is on click of button u can process [display / calulate..etc ] the information which has already been got by the java bean.
    Kris

  • How to pass java arraylist into javascript arrays

    Hi, i have declare an arraylist
    ArrayList list1 = new ArrayList();Inside the arraylist, there are elements. Now, i wan to pass the elements in the java arraylist into javascript arrays but i encounter javascript errors.
    This is how i code.
    var arr1 = new Array();
    <%
    for ( int x =0; x<list1.size(); x++)
    %>
         arr1[<%=x%>] = <%=(String)list1.get(x)%>;
    <%
    %>how do i solve this problem?
    Thanks for the guidance in advance

    JTech wrote:
    Hi,
    Use Quotes around string value ( arr1[indexposition] = "stringvalue";), when assign to javascript array as below.
    arr1[<%=x%>] = "<%=(String)list1.get(x)%>"; Regards,
    Ram.Hi Ram,
    How about using arr1 = <%=list.toArray()%> ??? Is this possible? I tried it but was not working on my IDE. Do you have any solutions for this??
    Regards,
    Thiagu

  • ANSWER: HOW TO DETECT Java Plugin from JavaScript

    I created a new topic because the questions about
    how to detect Java Plugin in browsers are scattered
    thoughout this forum.
    Basically you need to employ two approaches for IE and NS.
    In IE you need to try to instantiate a small applet
    (not your production applet) in order to see if browser
    can do it. if the browser can do it, you can make a
    call applet from JavaScript in order to find version of
    JRE (as well as a host of other things).
    In NS you can write a simple JavaScript which will
    interrogate the browser for all plugins installed. Then
    ypu can make a desicion whether to pass execution to
    the next(or generated) page which hosts your applet,
    or ask the user to download/install a plugin.
    I ecourage everybody to host a plugin on your site
    rather leave default link to it which is generated by
    html converter.
    In order to run sample,
    Prerequisites:
    Java Plugin 1.3.
    If you have a different version of plugin,
    substitute hardcoded plugin version in JavaScript for
    value that you have.
    1. compile java file
    2. put class file in the same directory with html file
    3. load html file into the browser.
    4. press "Check Java Plugin.." button
    5. see it work
    6. examine code
    7. uninstall plugin
    8. repeat steps 1 - 4
    9. see it work
    10. install plugin.
    Sample code follows:
    **********************HTML FILE BEGIN***********
    <HTML>
    <HEAD>
    <!-- Generated by Kawa IDE -->
    <TITLE>Detect Java Runtime</TITLE>
    </HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    var browsername;
    function doNetscape()
    for (i=0; i < navigator.plugins.length; i++)
    for (j = 0; j < navigator.plugins.length; j++)
    if(navigator.plugins[i][j].type == "application/x-java-applet;version=1.3")
    alert("You are running Netscape with Java Plugin 1.3.0 - OK");
    return;
    alert("You are running Netscape\nPlease, install Java Runtime Environment 1.3.0");
    function doMicrosoft()
    var applet = document.myApplet;
    if(applet == null)
    alert("You are running Microsoft Browser.\nPlease, install Java Runtime Environment 1.3.0");
    return;
    var version = applet.getJavaVersion();
    if(version == "1.3.0")
    alert("You are running IE, Java Plugin 1.3.0 installed - OK");
    else
    alert("You are running IE, other plugin installed - mybe OK if later that 1.3.0\nYour version: " + version);
    function getJava()
    var applet = document.myApplet;
    if(applet == null)
    alert("Please, install Java Runtime Environment");
    return;
         alert("JRE Version: " + document.myApplet.getJavaVersion());
    function checkJavaPlugin()
         browsername = navigator.appName;
         if(browsername.indexOf("Netscape")!= -1)
              browsername="NS";
              doNetscape();
         else
              if(browsername.indexOf("Microsoft")!=-1)
                   browsername="MSIE";
                   doMicrosoft();
              else
                   browsername="N/A";
                   alert("Unknown browser: " + browsername);
    </SCRIPT>
    <body>
    <Strong>Check Java Plugin</strong>
    <OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
         WIDTH = 1
         HEIGHT = 1 >
         <PARAM NAME = CODE VALUE = "DetectPluginApplet.class" >
         <PARAM NAME="scriptable" VALUE="true" >
         <embed type="application/x-java-applet;version=1.3"
              code = DetectPluginApplet width = 2 height = 2 MAYSCRIPT = "true" >
         </embed>
         </EMBED>
    </object>
    <FORM>
         <INPUT TYPE="button" value="Get Plugin Version in IE" onClick="getJava()">
         <INPUT TYPE="button" value="Check Java Plugin in NS and IE" onClick="javascript:checkJavaPlugin()">
    </FORM>
    </BODY>
    </HTML>
    **********************HTML FILE END***********
    ***************APPLET FILE BEGIN***********
    import java.awt.*;
    public class DetectPluginApplet extends java.applet.Applet
         public void init()
              add(new Label("DetectPluginApplet"));
    public String getJavaVersion()
    return System.getProperty("java.version");
    **************APPLLET FILE END************

    Try following java script, it works on new browsers (NS 4+, IE5+). For IE you have to enable 'ActiveX objects creation' in security options.
    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
    && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5 = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie6 = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.0") !=-1));
    var is_ie5up = (is_ie && (is_major == 4)
    && ( (agt.indexOf("msie 5.0")!=-1)
    || (agt.indexOf("msie 5.5")!=-1)
    || (agt.indexOf("msie 6.0")!=-1) ) );
    var pluginDetected = false;
    var activeXDisabled = false;
    // we can check for plugin existence only when browser is 'is_ie5up' or 'is_nav4up'
    if(is_nav4up) {
    // Refresh 'navigator.plugins' to get newly installed plugins.
    // Use 'navigator.plugins.refresh(false)' to refresh plugins
    // without refreshing open documents (browser windows)
    if(navigator.plugins) {
    navigator.plugins.refresh(false);
    // check for Java plugin in installed plugins
    if(navigator.mimeTypes) {
    for (i=0; i < navigator.mimeTypes.length; i++) {
    if( (navigator.mimeTypes[ i].type != null)
    && (navigator.mimeTypes[ i].type.indexOf(
    "application/x-java-applet;jpi-version=1.3") != -1) ) {
    pluginDetected = true;
    break;
    } else if (is_ie5up) {
    var javaVersion;
    var shell;
    try {
    // Create WSH(WindowsScriptHost) shell, available on Windows only
    shell = new ActiveXObject("WScript.Shell");
    if (shell != null) {
    // Read JRE version from Window Registry
    try {
    javaVersion = shell.regRead("HKEY_LOCAL_MACHINE\\Software\\JavaSoft\\Java Runtime Environment\\CurrentVersion");
    } catch(e) {
    // handle exceptions raised by 'shell.regRead(...)' here
    // so that the outer try-catch block would receive only
    // exceptions raised by 'shell = new ActiveXObject(...)'
    } catch(e) {
    // Creating ActiveX controls thru script is disabled
    // in InternetExplorer security options
    // To enable it:
    // a. Go to the 'Tools --> Internet Options' menu
    // b. Select the 'Security' tab
    // c. Select zone (Internet/Intranet)
    // d. Click the 'Custom Level..' button which will display the
    // 'Security Settings' window.
    // e. Enable the option 'Initialize and script ActiveX controls
    // not marked as safe'
    activeXDisabled = true;
    // Check whether we got required (1.3+) Java Plugin
    if ( (javaVersion != null) && (javaVersion.indexOf("1.3") != -1) ) {
    pluginDetected = true;
    if (pluginDetected) {
    // show applet page
    } else if (confirm("Java Plugin 1.3+ not found, Do you want to download it?")) {
    // show install page
    } else {
    // show error page
    }

  • How to call java classes from javascript?

    i have a button which calls javascript i need to access a class to update the values in the database.. how do you call the java code from within the javascript?
    the class is stored under tomcats classes directory and is accessed:
    com.Database.Employee
    the method is called : UpdateEmployeeDetails
    the button
    <input type="button" value="Save" onclick="submitForm('save')" />the javascript
    <script language="javascript">
            function submitForm(process){    
                document.myForm.action="update.jsp";
                document.myForm.submit();
    </script>

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How to use Java code signing certificate in oracle 11i

    Hello,
    I am try to configure java code signing certificate in 11.5.10.2 application. we got java sign certificate from verisgin. SA's imported the certificate and created alias XXX_XXX with password and passphrase.
    I am able to see the my certificate. keytool -list -v -keystore xxx_xxxx.jks -storepass Password.
    how do I use it. I am using Enhance Jar Signing for EBS DOC ID 1591073.1.
    could you please give me some advice on it?
    Thanks
    Prince

    Hussien,
    I find out apps keystore keypassword and storepassword, I imported the java code sign certificate. I generated Jar files through adadmin, but I am getting  warning error
    adogif() unable to generate Jar Filers under JAVA_TOP.
    executing /usr/jdk/jdk1.6.0_45/bin/java sun.security.tools.JarSigner keysotre **** -sigfile CUST Signer /apps/......
    Error JarSigner subcommand Exited With status 1.
    No standard output from jarsigner JarSigner error output: Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/tools/JarSigner Caused by: java.lang.ClassNotFoundException: sun.security.tools.JarSigner         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)         at java.security.AccessController.doPrivileged(Native Method)         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)         at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Could not find the main class: sun.security.tools.JarSigner.  Program will exit. WARNING: The following path(s), defined in /apps2/property/product/tst/appl/cz/11.5.0/java/make/czjar.dep as elements of the output:   oracle/apps/cz/runtime/tag WARNING: Copying cztag.lst from the old fndlist.jar ...   About to Analyze flmkbn.jar : Fri Nov 22 2013 10:45:51
    Please let me know if you have any idea. Thanks Prince

  • How to use java code in my forms.................

    Hi All,
    I want to use the below java code in my form 6i ..but don't know how????????
    related function is also given below..........
    Any idea .......Please
    Thanks
    Harry.....
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.sql.*;
    public class MyProgram {
    private static Connection con = null;
    private static Statement st;
    public static ResultSet rs;
    public static String s;
    /* public void setlable(int n)
    rs = st.executeQuery("SELECT number_to_words("+n+") FROM dual");
    while (rs.next())
    output.setText(rs.getString(1));
    public static void main(String[] args) {
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@172.19.193.38:1525:ITSTIN", "scott", "tiger");
    st = con.createStatement();
    }catch(Exception exp){
    System.out.println("Error"+exp.toString());
    JFrame f = new JFrame("Conver Digit to Words..");
    JLabel input = new JLabel("Enter Numeric digits :");
    final JLabel output = new JLabel("Please enter value into TestBox.....",JLabel.CENTER);
    final JTextField TF1 = new JTextField(90);
    final JButton B1 = new JButton("Close");
    f.setSize(750, 250);
    f.setLocation(300,200);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container contentPane = f.getContentPane();
    contentPane.setLayout(null);
    contentPane.setBackground(Color.CYAN);
    TF1.setLocation(300,25);
    TF1.setSize(150,30);
    input.setLocation(175,25);
    input.setSize(150,30);
    input.requestFocus();
    output.setLocation(15,100);
    output.setSize(650,30);
    output.setForeground(Color.RED);
    B1.setSize(100,32);
    B1.setLocation(620,175);
    contentPane.add(TF1);
    contentPane.add(input);
    contentPane.add(output);
    contentPane.add(B1);
    f.setVisible(true);
    B1.addMouseListener(new MouseAdapter(){
    public void mouseClicked(MouseEvent me)
    System.exit(0);
    TF1.addKeyListener(new KeyAdapter(){
    public void keyReleased(KeyEvent event){
    if (TF1.getText().equals("") )
    output.setText("Please enter value into TestBox.....");
    else
    try
    if (TF1.getText().length()<12)
    s = "SELECT initcap(number_to_words("+Long.parseLong(TF1.getText())+")) FROM dual";
    rs = st.executeQuery(s); //Function number_to_words exists in scott@itstin created by AMUY-IN
    while (rs.next())
    output.setText(rs.getString(1));
    }catch(Exception e)
    System.out.println("Error-2"+e.toString());
    ================================function===============
    CREATE OR REPLACE FUNCTION amuy_con_to_eng(nm2 NUMBER) RETURN VARCHAR2 IS
    nm1 NUMBER(10,0) := nm2;
    NM VARCHAR2(100):='';
    div NUMBER;
    BEGIN
    WHILE nm1>0 LOOP
    IF nm1>=20 THEN
    div :=Floor(nm1/10);
    NM := NM||' '||base_convert(div*10);
    nm1:=Mod(nm1,10);
    END IF;
    IF nm1>=1 AND nm1<20 THEN
    NM := NM||' '||base_convert(nm1);
    nm1:=nm1/10;
    END IF;
    nm1 :=Floor(nm1/10);
    END LOOP;
    RETURN NM;
    END;
    CREATE OR REPLACE FUNCTION number_to_words(inm NUMBER) RETURN VARCHAR2 IS
    /* Function that converts number's to word's*/
    /* Created buy amuy-in */
    l_inm NUMBER(35,0);
    NM VARCHAR2(1000):='';
    div NUMBER;
    BEGIN
    l_inm := inm;
    IF inm<=0 THEN
    RETURN 'ZERO';
    ELSE
    WHILE l_inm>0 LOOP
    case when Length(l_inm) >= 1 AND Length(l_inm)<=2
    then RETURN NM||' '||sf_num_to_words(l_inm);
    when Length(l_inm) = 3
    then div :=Floor(l_inm/RPad(1,3,0));
    l_inm := Mod(l_inm,RPad(1,3,0));
    NM :=NM||' '||sf_num_to_words(div)||' '||'HUNDRED';
    when Length(l_inm) >= 4 AND Length(l_inm) <= 5
    then div :=Floor(l_inm/RPad(1,4,0));
    l_inm := Mod(l_inm,RPad(1,4,0));
    NM :=NM||' '||sf_num_to_words(div)||' '||'THOUSAND';
    when Length(l_inm) >= 6 AND Length(l_inm) <= 7
    then div :=Floor(l_inm/RPad(1,6,0));
    l_inm := Mod(l_inm,RPad(1,6,0));
    NM :=NM||' '||sf_num_to_words(div)||' '||'LAKH';
    when Length(l_inm) >= 8 AND Length(l_inm) <= 9
    then div :=Floor(l_inm/RPad(1,8,0));
    l_inm := Mod(l_inm,RPad(1,8,0));
    NM :=NM||' '||sf_num_to_words(div)||' '||'CRORE';
    when Length(l_inm) >= 10 AND Length(l_inm) <= 11
    then div :=Floor(l_inm/RPad(1,10,0));
    l_inm := Mod(l_inm,RPad(1,10,0));
    NM :=NM||' '||sf_num_to_words(div)||' '||'ARAB';
    ELSE RETURN 'ERROR {Length of input value should be <12}';
    END CASE;
    END LOOP;
    RETURN NM ;
    END IF;
    END;
    /

    You cannot use java directly inside forms. You can either create a java-bean to enhance the GUI (as you have some UI-components in your java-code, i guess this would be the direction) or use the java-importer and call server-side-java. Both require that you are running forms in a web-version and not as client-server.
    What exactly is your requirement?

  • How to call java program from javascript

    Hi,
    I have an java program which will transform one xml to another xml using XSLT.
    I want to call this java program from Javascript? Is this possible? Please suggest me.
    Thanks,
    Gopal

    is it not possible?
    do i have to refresh the page and read in the values like...
    <%
    String ename = request.getParameter( "EmployeeName");
         session.setAttribute( "ename", ename);
    %>and then call the class from here?
    looking around ive come across ajax but i dont know how to use it and what you need to install and if its compatable with tomcat and jsp?
    is ajax better or not really worth it?
    i have anything up to 100 fields that need saving at one save click

  • How does a java code tell a backspace is entered by a GUI user?

    How to design a java code, so that the code catches a
    backspace a GUI user enters?

    search for keyEvent and VK_BACKSPACE

  • How to call java code in xsl?

    I'm trying to call java code in xsl. I've not been able to do so so far....any help is greatly appreciated.
    Here's my xsl:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
              xmlns:xalan="http://xml.apache.org/xalan"
              xmlns:java="http://xml.apache.org/xalan/java"
              extension-element-prefixes="java">
    <xsl:output method="xml" indent="yes"/>
    <xsl:strip-space elements="*"/>
    <xsl:template match="data_order">
    <order xsl:use-attribute-sets="order-info"></order>
    <fromdate><xsl:value-of select="ds/temporal/ds_start_date"/></fromdate>
    <stringdate><xsl:variable name="stringDate" select="java:ConvertDate2.changeDate(ds_start_date)"/>
    </stringdate>
    <thrudate><xsl:value-of select="ds/temporal/ds_stop_date"/></thrudate>
    <chans><xsl:apply-templates select="ds/subset_spec/channels"/></chans>
    </xsl:template>
    <xsl:attribute-set name="order-info">
    <xsl:attribute name="id"><xsl:value-of select="@job_id"/></xsl:attribute>
    <xsl:attribute name="job"><xsl:value-of select="@origin"/></xsl:attribute>
    </xsl:attribute-set>
    <xsl:template match="channels">
    <xsl:copy use-attribute-sets="sequence">
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>
    <xsl:attribute-set name="sequence">
    <xsl:attribute name="index"><xsl:value-of select="position()"/></xsl:attribute>
    </xsl:attribute-set>
    </xsl:stylesheet>
    And here's my java code
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class ConvertDate2
    public static String changeDate(String inputdate)
    String date_array[];
    String combined_date;
    date_array = inputdate.split("[-]");
    combined_date = date_array[0]+ date_array[1]+ date_array[2];
    return combined_date;
    }//end changeDate
    }// end class

    Try Changing your namespace for java to ConvertDate2(This class should be in classpath) and replace
    <stringdate><xsl:variable name="stringDate" select="java:ConvertDate2.changeDate(ds_start_date)"/>
    </stringdate>
    with
    <stringdate><xsl:variable name="stringDate" select="java:changeDate(ds_start_date)"/>
    </stringdate>
    Make sure your query matches with ds_start_date correctly.

  • Guide on how to modify Java code for Syclo

    Hi All,
    I have ZS4SAPSM-3.0.0.0 jar file in Installed Agentry server's Java folder.
    I want to modify some code in Java. I imported that file in Eclipse and modified it and tried to run it. It was calling some JCO client etc.
    Can someone guide me to know the procedure to modify Java code?
    Regards
    -prit
    Tags edited by: Michael Appleby

    How-to Build an Agentry based mobile app from scratch connecting to an SAP back-end Part1
    Pls Read this document. It was very helpful to me to built the app from scratch.
    I think you will understand the idea of Java and it will help to solve you problem.
    If you have more questions pls attach the examples here.

Maybe you are looking for

  • Unable to open OEM on RHEL5

    Hi, I've successfully installed and create database on RHEL Version 5. I'm using Oracle 11g db server. all services, listener and database is up the only problem is when I access OEM using Firefox https://192.168.1.1:1158/em it gives me security cert

  • Yosemite slow on Macbook Air

    Help! Seriously.... I updated to Yosemite the other day and since then my Macbook is extremely slow... It is really annoying, especially because I have no clue what the reason could be. I would really appreciate if anyone has an idea how to fix this.

  • Re: How to merge two video files in a single file.

    If you want to get just sequence of two files, so you can use http://java.sun.com/products/java-media/jmf/2.1.1/solutions/Concat.html I suppose. Or some for merging on http://java.sun.com/products/java-media/jmf/2.1.1/solutions/

  • Several single value selection in InfoPackage Data selection using Routine

    Hi, I am trying to extract data from a table(containing Ticket data) in R/3 using Generic extractor with table. As the table is not supporting the delta functionality i have to do daily full load for more than 5 lak records. I dont want all the ticke

  • Mail is freaking out - Triple spacing in headers

    Mail is freaking out, & triple spacing header info - HELP My Mac at work is exhibiting strange behavior. It is giving every e-mail huge space gaps in the header before the email.