Running Java Code - Easy
This is easy but I'm dumb
I have compile classes in c:\Test, two classes are in this folder, packaged correctly, TreeDemo and XMLParser. TreeDemo is the parent/control class.
how do run them?
I've tried things like
java c:\ Test.TreeDemo
To create packeges you need use the packege command.
package Teste;using this command when you compile the .java like this:
"javac Test.TreeDemo.java"
and after
"javac Test.XMLParser.java"
and to run just type
"java Test.TreeDemo" or "java.Test.XMLParser", depends wich one is the main program.
ps: the package command "must" be the first command in a .java source code.
Similar Messages
-
Run java code on report completion
I understand that Business Objects allows for custom notifications when a scheduled report is completed successfully. Is there a way in Java to be notified when a report is successfully completed? I want to run some code upon report completion. Thanks.
When you create a schedule event, you can decide if the event will be triggered when the report succeeds, fails, or both.
You can then set it up so that each time the event is triggered, a java app that has been published to enterprise is run. The difficulty here is that you will probably want to know exactly "which" report has completed succcesfully (Unless you set up a seperate event for each report) - and I don't know of any way to do that reliably.
But if you just want some java code to run each time a report is completed, then you can use this method.
So the steps would be:
1. Create Schedule Event
2. When you schedule the report - assign the event to it (You won't be able to do this in the CMC - you need to use either custom code or Infoview)
3. Publish your java code to Enterprise
4. Schedule your java code to run, and set the events to wait for to the event you assigned in Step 2
a programmer learning programming from perl is like a chemisty student learning the definition of "exothermic" with dynamite -
Running Java code on AIX locks up!
I am a newbie to AIX and UNIX. I am running a Java program that updates some records in a database, but the program "locks up". Even a simple HelloWorld Java program on AIX 4.3.3 that all it does is do a System.out.println("Hello World"); does the same thing. What I mean by "lock up" is that I execute the Java command on the $ command prompt and the cursor goes to the next line and doesn't do anything else! This doesn't happen all the time-other times, my programs run fine. The JRE is 1.3.1. Anybody out there with experience running Java on AIX know what is going on with this? Thanks.
Lot's of experience with the Java runtime on AIX. Can you type at the shell prompt ($):
java -version
What comes back? If nothing, tell root (sysadmin) to reinstall and get the license for the java runtime. Otherwise, do this:
$ cat <<EOF >T.java
public class T { public static void main(String[] argv) {
System.out.println("Hello World!");
EOF
$ javac T.java && java TThen post back what happens. -
How to run Java codes from ABAP
Hi Gurus,
I have .JAVA & .CLASS files which connect to the website through HTTPS connection and generates the TEXT file at C:\ by obtaining some data from WEB Site. This java files needs SSL certificate Which has been imported in SAP. How can i run the Java files from SAP R/3, Please help me.
Thanks
Ganeshhiii
refer to following link..
Java from ABAP?
Re: Calling Java API from ABAP using JCo
i hope it will solve your problem
regards
twinkal -
Diff. between running java code in a single processor vs multiprocessor
Hi,
This is a general question and I tried to find answer for it, but couldn't find so came here as usual.
When designing a new Java project do we need to consider whether the application will be running in a single processor/multi processor. Does our design affect assigning thread to different processors? if so what the steps that we need to take, so that my application makes full use of multiprocessor. What is the difference in desinging application for single processor and multi processsor? Recently we had a problem in which our application makes use of only 2 processor out of 16 and I have no answer for it.
Thanks.I have some good amount of experience working with
multi threaded java program and i know about the
overhead involved and overkill in multi threaded
programs.
let's assume that for the moment (many beliefs held about MT and MP computing are wrong, including possibly some or all of my own).
Will design vary depending whether we deploy it in a
multi-processor / singe processor CPU ?
If it was correctly implemented before, no.
But keep in mind that instead of receiving subsequent timslices threads can in an MP environment run truely in parallel.
If threads depend on the timing of other threads (ugly but we all know it happens) things can go wrong.
Of course as with all MT issues they tend to go wrong only after the product has passed all tests and has shipped to customers.
If it's the job of the operating system to assign
threads to different processor, then it doesn't
matter whether I design keeping in mind single
processor or multi processor CPU? OS willRead above. It SHOULD NOT matter, if your design is good.
intelligently give different threads to different
processor to make use of multiple processors right?Either the OS or the hardware. In an MP system there may well be dedicated hardware to do CPU allocation rather than it being handled by the operating system. -
Hi,
I have a large comprehensive program written in Java and I would like to incorporate the answer in Excel... is there any way I can call the Java program from Excel, execute it and record the answer on an excel spreadsheet?
Thanks,
mbrolass.You could write a macro in Excel to call your Java program. This was addressed in a former thread: http://forum.java.sun.com/thread.jspa?threadID=689170&start=0&tstart=0
Excel VBA Accessing Java
http://j-integra.intrinsyc.com/support/com/doc/#javafromcom/excelvba2java.html
In order to run this, you'll need to download and install J-Integra for COM.
http://j-integra.intrinsyc.com/downloads/ -
Hi
I have requirement of converting word document to PDF/A. Iam using the APIs provided by Livecycle ES. I tried to implement the requirement by creating a java program with the jar files provided. But iam getting the following error. Can anyone plz help me?
ALC-PDG-1000-000: com.adobe.livecycle.generatepdf.client.ConversionException: ALC-PDG-001-000-Conversion failed because of an exception.
Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:90)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java :119)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:172)
at Converttopdfa.main(Converttopdfa.java:44)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:84)
... 5 more
Error OCCURRED: ALC-PDG-001-000-Conversion failed because of an exception.
Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:194)
at Converttopdfa.main(Converttopdfa.java:44)XML reading program<br /><br />package com.parser;<br />import static org.w3c.dom.Node.ATTRIBUTE_NODE;<br />import static org.w3c.dom.Node.CDATA_SECTION_NODE;<br />import static org.w3c.dom.Node.COMMENT_NODE;<br />import static org.w3c.dom.Node.DOCUMENT_TYPE_NODE;<br />import static org.w3c.dom.Node.ELEMENT_NODE;<br />import static org.w3c.dom.Node.ENTITY_NODE;<br />import static org.w3c.dom.Node.ENTITY_REFERENCE_NODE;<br />import static org.w3c.dom.Node.NOTATION_NODE;<br />import static org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE;<br />import static org.w3c.dom.Node.TEXT_NODE;<br /><br />import java.io.IOException;<br />import java.io.StringReader;<br />import java.util.ArrayList;<br />import java.util.HashMap;<br /><br />import javax.xml.parsers.DocumentBuilder;<br />import javax.xml.parsers.DocumentBuilderFactory;<br />import javax.xml.parsers.ParserConfigurationException;<br /><br />import org.w3c.dom.Document;<br />import org.w3c.dom.DocumentType;<br />import org.w3c.dom.Node;<br />import org.w3c.dom.NodeList;<br />import org.w3c.dom.Text;<br />import org.xml.sax.InputSource;<br />import org.xml.sax.SAXException;<br /><br />public class MainClass {<br /> <br /> HashMap map = new HashMap();<br /> ArrayList a = new ArrayList(10);<br /> public static void main(String args[]) {<br /> DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();<br /> builderFactory.setNamespaceAware(true); // Set namespace aware<br /> builderFactory.setValidating(true); // and validating parser feaures<br /> builderFactory.setIgnoringElementContentWhitespace(true); <br /> <br /> DocumentBuilder builder = null;<br /> try {<br /> builder = builderFactory.newDocumentBuilder(); // Create the parser<br /> } catch(ParserConfigurationException e) {<br /> e.printStackTrace();<br /> }<br /> Document xmlDoc = null;<br /><br /> try {<br /> xmlDoc = builder.parse(new InputSource(new StringReader(xmlString1)));<br /><br /> } catch(SAXException e) {<br /> e.printStackTrace();<br /><br /> } catch(IOException e) {<br /> e.printStackTrace();<br /> }<br /> DocumentType doctype = xmlDoc.getDoctype(); <br /> if(doctype == null) { <br /> System.out.println("DOCTYPE is null");<br /> } else { <br /> System.out.println("DOCTYPE node:\n" + doctype.getInternalSubset());<br /> }<br /><br /> System.out.println("\nDocument body contents are:");MainClass m = new MainClass();<br /> m.listNodes(xmlDoc.getDocumentElement(),""); // Root element & children<br /> <br /> m.abc();<br /> }<br /> public void abc(){<br /> System.out.println("++++"+a.size());<br /> <br /> for(int i=0; i<a.size();i+=2){<br /> map.put(a.get(i), a.get(i+1));<br /> <br /> <br /> //map.put(i, i+1);<br /> <br /> //map.put(a.get(i), a.get(i+1));<br /> } <br /> <br /> System.out.println("Map"+map.toString());<br /> <br /> <br /> }<br /> <br /> private void listNodes(Node node, String indent) {<br /> try{<br /> <br /> String nodeName = node.getNodeName();<br /> //System.out.println(indent+" Node: " + nodeName);<br /> // if(nodeName == "id")<br /> short type = node.getNodeType();<br /> <br /> //System.out.println(indent+" Node Type: " + nodeType(type));<br /> if(type == TEXT_NODE){<br /> <br /> <br />// System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> if((node).getParentNode().getNodeName()== "id"){<br /> //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> System.out.println(indent+" key is: "+((Text)node).getWholeText());<br /> a.add(((Text)node).getWholeText());<br /> }<br /> if((node).getParentNode().getNodeName()== "val"){<br /> //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> System.out.println(indent+" value is: "+((Text)node).getWholeText());<br /> a.add(((Text)node).getWholeText());<br /> }<br /> <br /> <br /> }<br /> <br /> NodeList list = node.getChildNodes(); <br /> if(list.getLength() > 0) { <br /> // System.out.println(indent+" Child Nodes of "+nodeName+" are:");<br /> for(int i = 0 ; i<list.getLength() ; i++) {<br /> listNodes(list.item(i),indent+" "); <br /> }<br /> <br /> <br /> } <br /> } catch(Exception e){<br /> e.printStackTrace();<br /> }<br /> }<br /><br /> static String nodeType(short type) {<br /> switch(type) {<br /> case ELEMENT_NODE: return "Element";<br /> case DOCUMENT_TYPE_NODE: return "Document type";<br /> case ENTITY_NODE: return "Entity";<br /> case ENTITY_REFERENCE_NODE: return "Entity reference";<br /> case NOTATION_NODE: return "Notation";<br /> case TEXT_NODE: return "Text";<br /> case COMMENT_NODE: return "Comment";<br /> case CDATA_SECTION_NODE: return "CDATA Section";<br /> case ATTRIBUTE_NODE: return "Attribute";<br /> case PROCESSING_INSTRUCTION_NODE: return "Attribute";<br /> }<br /> return "Unidentified";<br /> }<br /><br /> static String xmlString ="<?xml version=\"1.0\"?>" +<br /> " <!DOCTYPE address" +<br /> " [" +<br /> " <!ELEMENT address (buildingnumber, street, city, state, zip)>" +<br /> <br /> " <!ELEMENT buildingnumber (#PCDATA)>" +<br /> " <!ELEMENT street (#PCDATA)>" +<br /> " <!ELEMENT city (#PCDATA)>" +<br /> " <!ELEMENT state (#PCDATA)>" +<br /> " <!ELEMENT zip (#PCDATA)>" +<br /> " ]>" +<br /> "" +<br /> " <address>" +<br /> " <buildingnumber> 29 </buildingnumber>" +<br /> " <street> South Street</street>" +<br /> " <city>Vancouver</city>" +<br /> "" +<br /> " <state>BC</state>" +<br /> " <zip>V6V 4U7</zip>" +<br /> " </address>";<br /> <br /> static String xmlString1 ="<?xml version=\"1.0\"?>" +<br /> " <!DOCTYPE retrCtx" +<br /> " [" +<br /> <br /> <br /> " <!ELEMENT retrCtx (id, val)>" +<br /> <br /> " <!ELEMENT id (#PCDATA)>" +<br /> " <!ELEMENT val (#PCDATA)>" +<br /> " ]>" +<br /> "" +<br /> "<retrCtx ver = '1'>" +<br /> " <item_map type='std'>" +<br /> " <item>" +<br /> " <id>rtrId</id>" +<br /> " <val>00993236327</val>" +<br /> " </item>" +<br /> " <item>" +<br /> " <id>rtrId2</id>" +<br /> " <val>009932363278</val>" +<br /> " </item>" +<br /> " </item_map> " +<br /> " <item_map type='std'>" +<br /> " <item>" +<br /> " <id>rtrId3</id>" +<br /> " <val>00993236329</val>" +<br /> " </item>" +<br /> " <item>" +<br /> " <id>rtrId4</id>" +<br /> " <val>009932363210</val>" +<br /> " </item>" +<br /> " </item_map> " +<br /> " </retrCtx>";<br />}
-
Running the .class file from java code
I'm doing a kind of providing service like compiling and running Java code on server side and giving output to the end user.
Please suggest me an approach with code to run .class file from the Java code.
import java.io.*;
public class demo {
public static void main(String args[]) throws IOException, InterruptedException {
int result;
try {
System.out.println("command output:");
Process proc = Runtime.getRuntime().exec("java -cp . demoh");
InputStream in = proc.getInputStream();
result = proc.waitFor();
BufferedInputStream buffer = new BufferedInputStream(proc.getInputStream());
BufferedReader commandOutput = new BufferedReader(new InputStreamReader(buffer));
String line = null;
System.out.print(commandOutput);
try {
while ((line = commandOutput.readLine()) != null) {
System.out.print(line);
System.out.println("command output: " + line);
}//end while
commandOutput.close();
} catch (IOException e) {
//log and/or handle it
}//end catc
} catch (IOException e) {
System.err.println("IOException raised: " + e.getMessage());
}What happened when you tried what you have there?
-
Hi All
I dont know which one of the following is more effective in JSP
writing java code like <% out.println("Hellooo "); %>
OR
writing like <%="hello" %>
I shall be very much thankful to all those who spare their valuable time to clarify my doubt. I hope my question is not a stupid one.
Thanks
Elishawhen both gives the same out put, why there are two for the same out put?Because it is easier to do this:
Hello <%= userName %>
than this:
Hello <% out.println("userName"); %>
Also there is a BIG difference in readability and maintainability of the JSP page. JSP pages are all about having html, and a few "fill in the blank" spots. The less <% scriptlet code %> you put on your JSP page, the better. If you want to run java code, do it in a servlet/bean.
With the advent of JSTL, scriptlet code in JSPs should be a thing of the past. -
Trying to Access Website using SSL running JAVA from inside ORACLE DB
Hi,
I am trying to access website using SSL and running JAVA code from inside Oracle 10g DB server using SSL and Java. I have loaded my java code into Oracle data base. My problem is when I am running same code from outside the DB it is running perfectly fine but when the same code is loaded into DB and trying to run from DB under these environment I am using for running my code:-
JDK 1.4.2_06
JSSE 1.4
Database :- Oracke 10G
I am getting following Exception:-
CALL testssl_http_mar20_New();
java.io.IOException: Unable to tunnel through 123.456.789.123:80. Proxy returns "HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
at
com.sun.net.ssl.internal.www.protocol.https.HttpsClient.doConnect(DashoA12275)
at
com.sun.net.ssl.internal.www.protocol.https.NetworkClient.openServer(DashoA12275
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.l(DashoA12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpClient.<init>(DashoA1
2275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.<init>(DashoA
12275)
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
at com.sun.net.ssl.internal.www.protocol.https.HttpsClient.a(DashoA12275
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.connect(DashoA122
75)
at
com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnection.getInputStream(Da
shoA12275)
at java.net.URL.openStream(URL.java:924)
at SecureURLhttp_Mar20_New.SecureURLhttp_Mar20_New(
source code is below :-
import java.io.*;
import java.net.*;
import java.security.*;
import java.util.*;
public class SecureURLhttp
public static void main(String[] args) throws Exception
SecureURLhttp r = new SecureURLhttp();
r.SecureURLhttp();
public static void SecureURLhttp() throws IOException
System.setProperty("java.protocol.handler.pkgs","oracle.aurora.rdbms.url|com.sun.net.ssl.internal.www.protocol");
System.setProperty("https.proxySet","true");
Authenticator.setDefault(new MyAuthenticator());
System.setProperty("https.proxyHost","123.456.789.123");
System.setProperty("https.proxyPort","80");
// URL verisign = new URL("https://login.oracle.com/");
URL verisign = new URL("https://www.verisign.com");
BufferedReader in = new BufferedReader(new InputStreamReader(verisign.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
in.close();
/* Code Newly Add for checking the system property */
java.util.Properties props = System.getProperties();
java.util.Enumeration propNames = props.propertyNames();
while (propNames.hasMoreElements ())
Object o= propNames.nextElement();
String name = (String ) o;
String val = props.getProperty(name) ;
System.out.println ( name + " = " + val );
private static class MyAuthenticator extends Authenticator {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("<USERNAME>",new String("<USER_PASSWORD>").toCharArray());
}Please help me out:
Thanks a lot in advance.0- the fact the ISA server logs an 'anonymous' seems logical, since it answers by HTTP 407. I will say it's even a "good log" :) but I had preferred a good old "security exception" but it's not the case..
1- The code for checking the properties (your debugging) should be placed BEFORE trying to connect to the url if you want to see what's happening
2- The 'normal' way to set the proxy is to set the following properties
System.setProperty("http.proxySet","true"); // and NOT https.proxyset as ejp said
System.setProperty("http.proxyHost","123.456.789.123");
System.setProperty("http.proxyPort","80");
3- what's the behavior if you change 123.456.789.123 by the real name (hostname) of the server ?
4- You can try setting up the proxy in the java control panel instead of in your code (easy to do under Windows, you look for the networking settings, and you find the proxy settings for http/https there. Otherwise look for all files called net.properties and edit them).
5- to help debbuging, we can rely on several methods of Authenticator :
protected PasswordAuthentication getPasswordAuthentication() {
System.err.println(".\tgetRequestingHost: " + getRequestingHost());
System.err.println("..\tgetRequestingSite: " + getRequestingSite());
System.err.println("...\tgetRequestingPort: " + getRequestingPort());
System.err.println("....\tgetRequestingProtocol: " + getRequestingProtocol());
System.err.println(".....\tgetRequestingPrompt: " + getRequestingPrompt());
System.err.println("......\tgetRequestingScheme: " + getRequestingScheme());
return new PasswordAuthentication("<USERNAME>",new String("<USER_PASSWORD>").toCharArray());
Try all this and let us see the output messages.
Please remember to give some 'duke stars' if it helped resolving the problem ;)
NephYliM -
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 -
Use of Java Code within the generated XML Forms Stylesheets
Hello,
is the use of Java-Code possible with the XSL-Files generated by XML-Forms, as possible in standard XSLs? I know that this would mean a modification.
kind regards,
MarcoHi 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 -
Running java from command prompt?
What do I need to be able to run java code from the command prompt? I have J Builder and when I have questions, mainly people give want me to run from command line. When I do so it says it does not know what javac is.
javac, java etc.. commands are in the j2sdk\bin directory.
So you have to give PATH to that bin directory in order to use it in command line. Go to the JBuilder installation folder and look for the j2sdk. (JBuilder comes with the j2sdk but the name may vary)
If you find it, then give the PATH to it's bin directory.
Or you can download the j2sdk from sun seperately, and give the PATH to its bin directory. -
Migration of JAVA code(JDK 1.2) from Windows NT to Solaris 8.0
What are the issues while porting the code in JAVA code JDK 1.1.7 and JDK 1.2 from Windows NT to Solaris 8.0
What are the considerations while porting the scripts of installshield from windows NT to solaris 8.0There is no special issues about running Java code created on NT on Solaris.
I have met only one issue in JDK 1.2, when the original code was compiled using IBM Java Compiler and it was fixed by recompile with original Java Compiler from JDK. -
Hi All,
I wanted to approve a resource's request from javacode, for that I am using "setRequestResponse"
but when I am running java code i m getting following error.
"Thor.API.Exceptions.tcInvalidResponseException" though i m passing "Approve" as response argument
on RO's approval task there is "Approve,Reject,UNKNOWN" status
I have gone through some discussion but still It is nit working
Thanks in advanceSo as I told you that setRequestResponse API is just used to Set Response for any Open Task and not actual approval . This is done using the the updateTask API. Here is the code which will do the needful for you.
I am assuming that the user for whom the approval has to completed using Java code, has the User.Key = 81. In addition to it there may be multiple approval tasks assigned to any user, in case you want to filter out that which particular task has to be approved through Java code then you might want to modify the map search in below code to include additional filter criterion.
HashMap search = new HashMap();
search.put("Process Instance.Task Information.Assigned To User Key", "81");
tcResultSet pend = requestOperationsIntf.getApprovalTasksAssigned(search);
// The above ResultSet stores all the request information pending for approval. Right now there is just one row
pend.goToRow(0);
long taskInsKey = pend.getLongValue("Process Instance.Task Details.Key");
// Extract the taskInstance key form the above resultSet to pass to the next API
Map mhProcessMap = new HashMap();
mhProcessMap.put("Process Instance.Task Details.Data", "Approve");
// Where 'Approve', 'Reject' etc will be your approval task responses
proOperIntf.updateTask(taskInsKey, mhProcessMap);
Now after running the above code you approval task will get approved as required.
Thanks
Sunny
Maybe you are looking for
-
I have searched the Toshiba website with no success. I have seen claims that instructions are availble but can not find them. What I want is for my movies and pictures to be readable on both types of machines.
-
How can I include beans with different JREs as activeX components
Hallo, I have to integrate two java applications via activeX in one VB Application. The first application requieres JRE 1.3.1_09, the second needs JRE 1.4.2, which means that they need different activex bridges. Both should be intergated in the same
-
When in Firefox 23.0's history/library window when I am browsing it will auto-scroll to the top of "Today" page making it frustrating and difficult to browse. I do not seem to recall this being the case before. I disabled "auto-scroll" in options and
-
Shared objects across JVMs?
I'm sure this topic must come up fairly frequently, but try as I might, I couldn't find a satisfying answer for what I'm looking for. I have an object that loads a very large in-memory datastructure from disk early in its lifetime, after which time t
-
Special effects problem in FCP5
I just upgraded to Final cut pro 5 from 4 and for some reason no filters, color correction, invert, blur nor mask work and I have no idea why. When I apply them it neither shows up in realtime or render. Transactions still work thought.