Java Thread - difficulty while passing value from parent to child thread

Hi All,
I am calling a java program from a unix script .
My oblectives are
1)to pass value from scripts to main java class
2)main class should create a child thread and pass data to child and should return control back to script
3)child thread should run independtly of parent
The calling unix script is part of process and hence should return control back to its calling script immediately.
Findings
1)Without passing data thru setter getter /constructor method to child thread my objectives are met
2)When I pass the data from parent thread to child thread calling unix scripts wait till child thread finishesh its working
call.scr
java Main <list of Arguments>
Main.java
public class Main
             public static void main(String args[]) throws Exception
             String data2="Z";
             String data1=null;
             for(int i=0;i<args.length;i++)
                  data2=data2+","+args;
data1=data2;
Child cu=new Child();
cu.setData(data1);
data2=null;
data1=null;
cu.start();
Child.javaclass Child extends Thread
public String data;
void setData(String data)
this.data=data;
public void run()
----------> processing on data
I think due to passing of data from parent thread to child thread (Inter thread data communication/Inter process communication)
  the threads are not working as desired.
Plz anybody can suggest something.....
Thanx.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

aschin,
You seem to be confusing Java Threads with Operating System Processes.
If you want you're java program to run in the unix background then you'll need to run it in the unix background. Java (being o/s agnostistic) doesn't provide process manipulation functionality (which would include the ability to throw itself into the background, as a C program can) in the standard API, and it's hard to imagine any third party producing anything as low level as a process controler... so yeah, just start the java program in the background... and you'll need to workout some interprocess communication protocol... named pipes have worked well for me in the past, as they doesn't suffer from the quit same performance issues as real disk files.
Good luck. Keith.

Similar Messages

  • Passing value from Parent form to popup?

    Hello out there,
    I am a complete newb so please execuse if this has been answered somewhere else.
    I want to pass a text field that a user enters on a parent form to a enterable field I have pre-defined on a pop
    up. I have seen some examples out there but non exactly what I need.
    So a user finds some value in a text field on the parent form. ITs not found so they click on the "pop up" request screen/button which only has one enterable text field in that pop up. I wanted that enterable text field defaulted with the value from the parent form.
    Are there examples somewhere out there to do this? Thanks in advance

    Either pass it as request parameter or use JS to get it from DOM tree of the parent window.

  • Error while passing values from Interactive form to Webdynpro Application

    Hi,
    Iam working on AdobeInteractive Forms using GP.There is an interactive form with a submit button on my desktop. Now when i click on submit the values in the Interactive Form should be passed to an Webdynpro application.But when i click on submit button i was getting error.Can any one solve my issue.
    The Error is:
    SAP Guided Procedures - Error Page
    What happened?
    An internal error occurred while processing your request
    What can you do?
    Try again later. If the problem persists, contact your system administrator.
    Additional Error Information
    Error while processing document via ADS
    com.sap.caf.eu.gp.base.exception.EngineException: Error while processing document via ADS
    at com.sap.caf.eu.gp.model.iforms.adapter.pdf.AdobePDFAdapter.processPDF(AdobePDFAdapter.java:842)
    at com.sap.caf.eu.gp.model.iforms.adapter.pdf.AdobePDFAdapter.getSessionContext(AdobePDFAdapter.java:1116)
    at com.sap.caf.eu.gp.model.iforms.postproc.FormPostprocessor.processData(FormPostprocessor.java:396)
    at com.sap.caf.eu.gp.model.iforms.FormPostProcessor.doPost(FormPostProcessor.java:182)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Processing exception during a "GetData" operation. Request start time: Thu May 01 12:33:23 CDT 2008 com.adobe.ProcessingException: Error creating PDF Document - PDF Exception: Stream does not represent a PDF document. [Ljava.lang.StackTraceElement;@309d01f5 Exception Stack Trace: com.adobe.ProcessingException: Error creating PDF Document - PDF Exception: Stream does not represent a PDF document. [Ljava.lang.StackTraceElement;@309d01f5
    at com.adobe.ads.remote.PDFState.getDocumentFromFile(Unknown Source)
    at com.adobe.ads.remote.PDFState.getDocument(Unknown Source)
    at com.adobe.ads.remote.EJB_PDFAgent.exportFormData(Unknown Source)
    at com.adobe.ads.operation.GetData.execute(Unknown Source)
    at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
    at com.adobe.ads.request.Request.processOperations(Unknown Source)
    at com.adobe.ads.request.Request.process(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
    at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
    at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
    at SoapServlet.doPost(SoapServlet.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException: Stream does not represent a PDF document.
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.init(Unknown Source)
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.<init>(Unknown Source)
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.newDocument(Unknown Source)
    at com.adobe.internal.pdftoolkit.pdf.document.PDFDocument.<init>(Unknown Source)
    at com.adobe.internal.pdftoolkit.pdf.document.PDFDocument.newInstance(Unknown Source)
    ... 35 more
    at com.sap.tc.webdynpro.pdfobject.core.PDFObject.doSoapCall(PDFObject.java:413)
    at com.sap.tc.webdynpro.pdfobject.core.PDFObject.getData(PDFObject.java:311)
    at com.sap.caf.eu.gp.model.iforms.adapter.pdf.AdobePDFAdapter.processPDF(AdobePDFAdapter.java:816)
    ... 19 more
    Caused by: com.sap.tc.webdynpro.pdfobject.core.PDFObjectRuntimeException: Processing exception during a "GetData" operation. Request start time: Thu May 01 12:33:23 CDT 2008 com.adobe.ProcessingException: Error creating PDF Document - PDF Exception: Stream does not represent a PDF document. [Ljava.lang.StackTraceElement;@309d01f5 Exception Stack Trace: com.adobe.ProcessingException: Error creating PDF Document - PDF Exception: Stream does not represent a PDF document. [Ljava.lang.StackTraceElement;@309d01f5
    at com.adobe.ads.remote.PDFState.getDocumentFromFile(Unknown Source)
    at com.adobe.ads.remote.PDFState.getDocument(Unknown Source)
    at com.adobe.ads.remote.EJB_PDFAgent.exportFormData(Unknown Source)
    at com.adobe.ads.operation.GetData.execute(Unknown Source)
    at com.adobe.ads.operation.ADSOperation.doWork(Unknown Source)
    at com.adobe.ads.request.Request.processOperations(Unknown Source)
    at com.adobe.ads.request.Request.process(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.processRequest(Unknown Source)
    at com.adobe.AdobeDocumentServicesEJB.rpData(Unknown Source)
    at com.adobe.AdobeDocumentServicesLocalLocalObjectImpl0_0.rpData(AdobeDocumentServicesLocalLocalObjectImpl0_0.java:120)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:157)
    at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:79)
    at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
    at SoapServlet.doPost(SoapServlet.java:51)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: com.adobe.internal.pdftoolkit.core.exceptions.PDFCosParseException: Stream does not represent a PDF document.
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.init(Unknown Source)
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.<init>(Unknown Source)
    at com.adobe.internal.pdftoolkit.core.cos.CosDocument.newDocument(Unknown Source)
    at com.adobe.internal.pdftoolkit.pdf.document.PDFDocument.<init>(Unknown Source)
    at com.adobe.internal.pdftoolkit.pdf.document.PDFDocument.newInstance(Unknown Source)
    ... 35 more
    at com.sap.tc.webdynpro.pdfobject.core.PDFObject.doSoapCall(PDFObject.java:400)
    ... 21 more

    Hi Praveen,
    The concept what we have observed is When you click on Submit the values were sent to GP. There GP framework takes care of all these. After that when you try to login to Portal and click on GP Inbox and try to open the application, what ever the data that is sent previously will be retrieved.
    Due to some reasons like Delegation and other conecpts where GP will not fit we have scrapped GP and got back to workflow. There we have used the concept of Portal Webservice inorder to send the data to R/3 by clicking on Submit button.
    We have successfully implemented the Adobe Forms Offline Scenario using Portal Webservice.

  • Child package cannot read param value from parent ssis package

    Hi all,
    I think I must be crazy !! i have a big problem in my ssis project .
    i have more than 40 package one parent and 39 childs 
    i use configuration method to get variable values from parent to child packages and it work well .. but when i copy my ssis project
    to the production server i face the following problem .. childs package didn't read the variables values from the parent package 
    i revised the configuration many times i can't find any missing !!
    any help please ...
    Thanks,

    Do not copy the packages from the projet to the production server, but you must generate the manifest installation including your configuration, and deploy them.
    Note : not forget to include the configuration.
    To learn more about how to install the package :
    Lesson 1:
    http://msdn.microsoft.com/en-us/library/ms365332(v=sql.105).aspx
    Lesson 2 :
    http://msdn.microsoft.com/en-us/library/ms365329(v=sql.105).aspx
    Lesson 3 :
    http://msdn.microsoft.com/en-us/library/ms365321(v=sql.105).aspx

  • Pass value from Java to Perl

    Anyone knows how to pass value from Java to Perl program?

    Did you write the perl program? Can you change it? Or are you trying to interface to something that already exists? This will limit your options, of course.
    Anyway the first option is simple. The java program does this:
    System.out.println("This is a line of input.");The perl program does this:
    while(<>)and in that block, $_ is assigned to each line of input.
    Then you can invoke both like this:
    $ java MyJavaProgram | perl MyPerlProgram.pl

  • Passing values from javascript in pop up window to parent jsp

    Hi
    I am trying to pass values from a pop up window to the main window that popped this child window , with the idea to have the parent window refresh itself with value from pop up window.But the values are not going through.I do a request on the hidden variable but when the parent
    jsp refreshes , the variable is still null...
    The following is the code i have .
    Parent jsp:a.jsp
    <form name='summary'>
    <input type=hidden name=customerid value="">
    <input type="button" class="textButton" name="action" value="customerlist" onClick="javascript:openWin('b.jsp','800','350')">
    <script>
    function openWin(loc, w, h) {
    var newWin = window.openloc,"HTML",'dependent=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=' + w + ',height=' + h);
    newWin.window.focus();
    </SCRIPT>
    <%
    String optionVal = request.getParameter("customerid");%>
    var user = "<%= optionVal%>";
    </form>
    child jsp- b.jsp (pop up window)
    <script>
    function closer(){
    var val = document.formname.id.selected.value;
    window.opener.document.summary.customerid.value = val;
    window.opener.location.reload();
    </script>
    <form name = formname>
    <input type="text" name="id" value = ''>
    <input type="button" class="textButton" value="select"
    onClick="closer();window.close();">
    </form>
    Any ideas on what i am missing
    Thanks
    Arn

    use window.opener.document.forms[0].filedname.value = 'value u need to set'

  • How to pass value from jsp to java bean

    I have huge problem . How to pass value from jsp value to java bean.Please replay me soon

    Use the <jsp:setProperty> tag. There are several ways to use it. The one you probably want is:
    <jsp:setProperty name="bean_name"  property="property_name"  value="the_value_you_want_to_set"/>

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Passing value from JSP to JApplet

    Hello,
    I am stuck up with a problem, can anyone please tell me how do i pass a value from a JSP page
    to a JApplet,
    and the parameter passed through JSP should be displaed in the JTextArea.
    It would be kindful if any of you could help.
    Thanks
    Sanam

    hello,
    thanks for reply.
    I know how to pass parameters from html,
    I want to pass values from jsp page,
    and i dono how to do it, may be we cann pass values through url connection but i dono how.
    if anone knows plz help me in solving this.
    i hvae posted my applet code.
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.JToolBar;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JTextArea;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    import java.sql.*;
    <applet code = "DocApplet" width = 500 height =5000>
    </applet>
    public class DocApplet extends JApplet
         private JPanel jp;
         private Container cp;
         private JTextArea jt;
         private JToolBar tb;     
         private JScrollPane sp;
         private String annotation;
         private String url;
         private Connection con;
         private Statement stmt;
         public void init()
              jp = new JPanel();
              cp = getContentPane();
              jt = new JTextArea();
              tb = new JToolBar();
              sp = new JScrollPane(jt);
              repaint();
         public void start()
              jp.setLayout(new BorderLayout());
              jp.add(tb, BorderLayout.NORTH);
              jp.add(sp, BorderLayout.CENTER);
              jt.setBackground(Color.BLACK);
              jt.setForeground(Color.WHITE);
              setContentPane(jp);
              addButtons(tb);
              repaint();
         public void run()
              repaint();
         public void paint()
         private void addButtons(JToolBar tb)
              JButton button = null;
              button = new JButton("Save");
              button.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
              tb.add(button);
    }

  • How to Pass values from XML to JSP??? Urgent Please Help me

    Hi guys,
    I am new to XML, I want to pass values from XML to JSP. I have a xml file with attributes, I should send this values to a JSP file. How is it??? Please Help guys.... its very urgent. Please send me how to do it with an example or atleast any urls related that....
    Looking for ur favourable reply.
    Thanks in advance,
    Sridhar

    in a servlet :
    parse your xml file (see how at the end of the post) and
    put the values you want in the request attributes
    request.setAttribute("value1", value1);
    ...redirect to the jsp
    in the JSP:
    get the wanted attributes:
    String value1=(String)request.getAttribute("value1");To learn how to parse a xml file, pay a look at this page, it explains how to read the XML document to build an object representation, and then how to navigate through this object to get the data
    http://labe.felk.cvut.cz/~xfaigl/mep/xml/java-xml.htm

  • Passing value from one jsp to another?

    how to pass value from one jsp to another? i have a value assigned in the link, i want to pass that value to another jsp page?
    please help with code?

    Instead of the value being passed, i am getting a null value.
    Here is my calendar code:
    <%@page import="java.util.*,java.text.*" %>
    <html>
    <head>
    <title>Print a month page.</title>
    </head>
    <body bgcolor="white">
    <%
                  boolean yyok = false;
                  int yy = 0, mm = 0;
                  String yyString = request.getParameter("year");
                  if (yyString != null && yyString.length() > 0)
                      try
                          yy = Integer.parseInt(yyString);
                                  yyok = true;
                       catch (NumberFormatException e)
                          out.println("Year " + yyString + " invalid" );
                  Calendar c = Calendar.getInstance( );
                  if (!yyok)yy = c.get(Calendar.YEAR);  
                         mm = c.get(Calendar.MONTH);
    %>
                  <table align="center">
                      <tr>
                  <td>
                       <form method=post action="calendar.jsp">
                          Enter Year : <select name="year">
    <%         
                 for(int i= yy;i<=2010;i++)
    %>
                  <OPTION VALUE= <%=i%> > <%=i%> </option>
    <%       
    %>
              </select>
                      <input type=submit value="Display">
                      </form>
                      </td>
                    </tr>
    <tr>
                     <table>
    <%!
    String[] months = {"January","February","March",
                    "April","May","June",
                    "July","August","September",
                    "October","November", "December"
    int dom[] =     {
                        31, 28, 31, 30,
                        31, 30, 31, 31,
                        30, 31, 30, 31
    %>
    <%
                int leadGap =0;
    %>
    <div id="t1" class="tip"><table border="4" cellpadding=3 cellspacing="3" width="250" align="center" bgcolor="lavender">
    <tr>
    <td halign="centre" colgroup span="7" style="color:#FF0000;">
    </colgroup>
    <tr>
    <td>
    <%
              GregorianCalendar calendar =null;
              for(int j=0;j<12;j++)
                        calendar = new GregorianCalendar(yy, j, 1);
                  int row = 1 ;
                  row = row + j;
        %>
              <table>
                <tr>
              <colgroup span="7" style="color:#FF0000;">
              </colgroup>
                </tr>
              <tr align="center">
              <th colspan=7>
                  <%= months[j] %>
                  <%= yy %>
              </th>
              </tr>
    <tr>
    <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
    </tr>
    <%
        leadGap = calendar.get(Calendar.DAY_OF_WEEK)-1;
        int daysInMonth = dom[j];
        if ( calendar.isLeapYear( calendar.get(Calendar.YEAR) ) && j == 1)
        ++daysInMonth;
        out.print("<tr>");
        out.print(" ");
          for (int h = 0; h < leadGap; h++)
           out.print("<td>");
          out.print("</td>");
        for (int h = 1; h <= daysInMonth; h++)
          out.print("<td>");
          out.print("<a href=desc.jsp>" + h + "</a>" );
          out.print("</td>");
        if ((leadGap + h) % 7 == 0)
            out.println("</tr>");
    out.println("</tr></table></div>");
    if( row%3 != 0)
    out.println("</td><td>");
    else
    out.println("</td></tr>\n<tr><td>");
    %>
    </html>I need to pass the value in 'h' to the desc.jsp page.
    my code for desc.jsp is :
    <html>
    <head>
    </head>
    <body bgcolor="lightblue">
    <form method=post action="Calenda.jsp">
    <br>
    <%= request.getParameter("h") %>
    <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
    <BR> <INPUT TYPE=SUBMIT VALUE="submit">
    </form>
    </body>
    </html>But i am not able to pass the value. The 'h' value contains all the date. i want to pass only a single date, the user clicks to the other page. please help

  • Getting error , while passing parameters from one page to another page

    Hello friends,
    i am getting error, while passing parameters from one page to another page, below code i wrote.
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    ArrayList arl=new ArrayList();
    EresFrameworkAMImpl am=(EresFrameworkAMImpl)pageContext.getApplicationModule(webBean);
    ERecordImpl ERecordObj=new ERecordImpl();
    HashMap hMap = new HashMap();
    hMap.put("1",ERecordObj.getTransactionName());
    hMap.put("2",ERecordObj.getTransactionKey());
    hMap.put("3",ERecordObj.getDeferredMode());
    hMap.put("4",ERecordObj.getUserKeyLabel());
    hMap.put("5",ERecordObj.getUserKeyValue());
    hMap.put("6",ERecordObj.getTransactionAuditId());
    hMap.put("7",ERecordObj.getRequester());
    hMap.put("8",ERecordObj.getSourceApplication());
    hMap.put("9",ERecordObj.getPostOpAPI());
    hMap.put("10",ERecordObj.getPayload());
    // hMap.put(EresConstants.ERES_PROCESS_ID,
    if(pageContext.getParameter("item1")!=null)
    pageContext.forwardImmediately(EresConstants.EINITIALS_FUNCTION,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    hMap,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES
    Error(71,2): method forwardImmediately(java.lang.String, byte, null, java.util.HashMap, boolean, java.lang.String) not found in interface oracle.apps.fnd.framework.webui.OAPageContext
    Thanks
    krishna.

    Hi,
    You have imported the wrong class for HashMap.
    Import
    com.sun.java.util.collections.HashMap; instead of java.util.HashMap
    Thanks,
    Gaurav

  • How to pass values from single Databank file across different scripts?

    Hi Guys,
    I have a question regarding using single databank file across different scripts.
    Lets say there 5 web service scripts and these are very generic scripts where the input/request xml schema of each script is parameterized without having any databank as script asset.
    These 5 web service scripts are like library functions and so we dont want to attach any databank as script asset.
    However I have a driver script to call all of these 5 library scripts and now I attach a databank (a .csv file) to the driver script as script asset. Say this .csv file has got 10 different columns with just single record/row.
    As and when the function call goes to those 5 scripts i.e one by one, then based on the function call the corresponding columns are used and the data for those columns must be read.
    Is there any solution to acheive this?
    Faster help is highly appreciated.

    Hi JB,
    what i was looking for, was an approach to use a databank file (.csv file) in a parent script and then by reading that .csv file, the data should be moved from the parent script to individual child scripts.
    The child scripts are very generic scripts and are like library functions which are not data dependent. they are fully parameterized and they dont have any sort of databank attached to them.
    Now the question is if the databank has got 10 columns where first 3 columns belong to one child script, second 3 columns belong to 2nd child script and so on.
    Then how do we pass the values from parent script to a child script and what is the best/recommended approach.

  • Passing values from a FORM to another FORM

    Hi,
    I have to pass values from FORM "A" to FORM "B". What is the best way to do this?\
    Can I use a GLOBAL variable?
    Thanks,
    Marc.

    I think he meant the global namespace.
    You set a :global_your_name_here to a value and that value is available in your entire application. See the help file section on the global namespace for more information.
    Forms parameters are parameters that you form picks up from the outside when it starts. The calling entity must supply them in the URL or they will be set to null. You set them up in the object navigator in the Parameters node.

  • Script fails when passing values from pl/sql to unix variable

    Script fails when passing values from pl/sql to unix variable
    Dear All,
    I am Automating STATSPACK reporting by modifying the sprepins.sql script.
    Using DBMS_JOB I take the snap of the database and at the end of the day the cron job creates the statspack report and emails it to me.
    I am storing the snapshot ids in the database and when running the report picking up the recent ids(begin snap and end snap).
    From the sprepins.sql script
    variable bid number;
    variable eid number;
    begin
    select begin_snap into :bid from db_snap;
    select end_snap into :eid from db_snap;
    end;
    This fails with the following error:
    DB Name DB Id Instance Inst Num Release Cluster Host
    RDMDEVL 3576140228 RDMDEVL 1 9.2.0.4.0 NO ibm-rdm
    :ela := ;
    ERROR at line 4:
    ORA-06550: line 4, column 17:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    &lt;a string literal with character set specification&gt;
    &lt;a number&gt; &lt;a single-quoted SQL string&gt; pipe
    The symbol "null" was substituted for ";" to continue.
    ORA-06550: line 6, column 16:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    ( - + case mod new not null &lt;an identifier&gt;
    &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg
    count current exists max min prior sql stddev su
    But when I change the select statements below the report runs successfully.
    variable bid number;
    variable eid number;
    begin
    select '46' into :bid from db_snap;
    select '47' into :eid from db_snap;
    end;
    Even changing the select statements to:
    select TO_CHAR(begin_snap) into :bid from db_snap;
    select TO_CHAR(end_snap) into :eid from db_snap;
    Does not help.
    Please Help.
    TIA,
    Nischal

    Hi,
    could it be the begin_ and end_ Colums of your query?
    Seems SQL*PLUS hs parsing problems?
    try to fetch another column from that table
    and see if the error raises again.
    Karl

Maybe you are looking for