Simple Struts code to send data

this code not working......
submit.jsp
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html>
<head><title>Submit example</title></head>
<body>
<h3>Example Submit Page</h3>
<html:errors/>
<html:form action="submit.do">
Name:<html:text property="lastName"/> value:<html:text property="address"/><br>
Name:<html:text property="lastName"/> value:<html:text property="address"/><br>
Name:<html:text property="lastName"/> value:<html:text property="address"/><br>
Name:<html:text property="lastName"/> value:<html:text property="address"/><br>
<html:submit/>
</html:form>
<jsp:useBean id="bean" class="hansen.playground.SubmitAction"/>
<bean:write name="bean" property="lastName[2]"/>
</body>
</html>action form
package hansen.playground;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;
public final class SubmitForm extends ActionForm {
  /* Last Name */
  private String lastName[];// = "Hansen"; // default value
  public String getLastName(int index)
    return (this.lastName[index]);
  public void setLastName(int index,String value)
    this.lastName[index] = value;
  /* Address */
  private String address[];
  public String getAddress(int index)
    return (this.address[index]);
  public void setAddress(int index,String value)
    address[index]= value;
} action class
package hansen.playground;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public final class SubmitAction extends Action {
  public ActionForward perform(ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {
    SubmitForm f = (SubmitForm) form; // get the form bean
    // and take the last name value
    //String EmpNos[]=request.getParameterValues("lastName");
     //String lastName = f.getLastName();
     // Translate the name to upper case
    //and save it in the request object
    //request.setAttribute("lastName", lastName.toUpperCase());
   // Forward control to the specified success target
    return (mapping.findForward("success"));
}Struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
  <!-- ========== Form Bean Definitions ================= -->
  <form-beans>
    <form-bean      name="submitForm"
                    type="hansen.playground.SubmitForm"/>
  </form-beans>
  <!-- ========== Action Mapping Definitions ============ -->
  <action-mappings>
    <action   path="/submit"
              type="hansen.playground.SubmitAction"
              name="submitForm"
              input="/submit.jsp"
              scope="request">
    <forward name="success" path="/submit.jsp"/>         
    <forward name="failure" path="/submit.jsp"/>         
    </action>
  </action-mappings>
</struts-config>purpose was to send many data . can u make it runing ?
thanks

package hansen.playground;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;
public final class SubmitForm extends ActionForm {
/* Last Name */
private String lastName[];// = "Hansen"; // default
lt value
public String getLastName(int index)
return (this.lastName[index]);
public void setLastName(int index,String value)
this.lastName[index] = value;
/* Address */
private String address[];
public String getAddress(int index)
return (this.address[index]);
public void setAddress(int index,String value)
address[index]= value;
} What I am referring to means... you should have methods like this...
// Get the complete last name array
public String[] getLastName() { return this.lastName; }
// Set the complete last name array
public void setLastName(String[] lastName) { this.lastName = lastName; }Did you try this?
***Annie***

Similar Messages

  • Simple code to send ALV display as XLS attachment  to SAP inbox

    Hi All,
    Simple code to send ALV display as XLS attachment  to SAP inbox.
    Also i need to send only 200 records per attachement. So in this case i need send multiple attachment per mail
    Thanks,
    Lokesh

    The following code is used to send the internal table which u pass fo  the ALV display to be send as excel sheet attachment
    Internal table is it_attach[]
    ld_email               = po_email.
      ld_mtitle              = 'Email From Z377_EMAIL_XLS'.
      ld_format              = 'XLS'.
      ld_attdescription      = 'filename'.
      ld_attfilename         = 'Allot'.
      ld_sender_address      = ' '.
      ld_sender_address_type = ' '.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
      ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE li_content LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
      document_data              = w_doc_data
      put_in_outbox              = 'X'
      sender_address             = ld_sender_address
      sender_address_type        = ld_sender_address_type
      commit_work                = 'X'
    *IMPORTING
    *sent_to_all                = w_sent_all
      TABLES
      packing_list               = t_packing_list
      contents_bin               = t_attachment
      contents_txt               = li_content
      receivers                  = t_receivers
      EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      document_type_not_exist    = 3
      operation_no_authorization = 4
      parameter_error            = 5
      x_error                    = 6
      enqueue_error              = 7
      OTHERS                     = 8.

  • How to send data to bam data object through java code

    how to send data to bam data object through java code

    I've made a suggestion in other thread: https://forums.oracle.com/thread/2560276
    You can invoke BAM Webservices (Using Oracle BAM Web Services) or use JMS integration using Enterprise Message Sources (http://docs.oracle.com/cd/E17904_01/integration.1111/e10224/bam_ent_msg_sources.htm)
    Regards
    Luis Fernando Heckler

  • Using LoadVars in SSAS to send data to a php file

    I am using FMS 4.5 and have a simple application which I want to use to send two strings to a php file. But I get a compilation error whenever I try to assign any value to these objects:
    Here is main.asc:
    <code>
    var variables = new LoadVars();
    variables.username = "uname";
    variables.send(http://url.abc.com/test.php,POST)
    </code>
    I can't compile with the second line. FMS just says: Sending error message: Compilation error
    How do I send variables to a HTTP URL?

    However that should be fine..
    This is sample way to send data using LoadVars
    var my_lv = new LoadVars();
    my_lv.name= "myname";
    my_lv.send("http://server/test.php", "_blank", "POST");
    Try keeping url and and POST method within "quotes". Also, method [POST/GET] is third parameter, second is target where results must be loaded (if any)..

  • [iPhone] How would one send data to an http server?

    Hello,
    I would like to be able to send data (maybe XML?) to be processed by a server-side script.
    NSURLRequest seems to be mainly for downloading data, not uploading... A simple "ajax" request would do, so I would just serialize the data and send it in a POST variable. How do I implement such a request using the SDK?

    This what iam doing to post XML and to receive an XML response from our servers. Note that the Content-Type is set to text/xml. If your post data is different, set the type accordingly.
    Also i am using *NSURLConnection -> sendSynchronousRequest* class method to block for the response. You can also do asynchronous read of the response by creating a NSURLConnection object and setting a delegate which will listen for the incomming network events. Check the documentation for NSURLConnection .
    Hope this helps,
    -TRS
    // This method takes an XML post data and returns the response XML from server
    // Note that if you want to post binary data then just send postData instead of
    // postString as input parameter
    - (NSString *) postData: (NSString *) postString toURL:(NSString *) url {
    NSData *postData = [postString dataUsingEncoding: NSUTF8StringEncoding];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]
    cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10];
    NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];
    [request setHTTPMethod:@"POST"];
    [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
    [request setValue:@"text/xml" forHTTPHeaderField:@"Content-Type"];
    [request setHTTPBody:postData];
    NSURLResponse *response = nil;
    NSError *error = NULL;
    NSData *respData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
    NSString *responseString = nil;
    if (!error && respData) {
    if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
    int code = [((NSHTTPURLResponse *)response) statusCode];
    if (code == 200) {
    responseString = [[[NSString alloc] initWithData:respData encoding:NSUTF8StringEncoding] autorelease];
    } else {
    NSLog(@"
    Error");
    } else {
    NSLog(@"
    Error");
    [request release];
    return responseString;

  • How can I send data from a Comp to a Service?

    Hello!
    I have written a simple service, it works fine, i can receive data from it, but i need also to send data to the service.
    I have tried this:
    part of the code of my service:
    public void addUser(String UserName) {
                   UserList[number_user] = UserName;
                   number_user++; 
    part of the code of my comp:
    IszerdService myService = (IszerdService) PortalRuntime.getRuntimeResources().getService(serviceName);
    myService.addUser("Superman");
    could you show me what is the most simple way to send data to a service, and store in the service?
    thank you all!
    Istvan

    Hi Subathra,
    > Where do u face problem? Did u get any error while
    > le passing the data to the service? What's that?
    Actually I cant deal with putting data into the String Array of my service.
    Now I have solved the problem by using HashTable instead of String[] and the .put(key, object) method works fine, the data is delivered to the service succesfully.
    Regards,
    Istvan

  • Simple struts example but it doesn't work

    Hello everybody,
    I'm new in struts technology and I wanted try a simple struts example, but it didn't work. Here are listings of code:
    *** struts-config .xml (is located in WEB-INF/) :
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
    <struts-config>
    <form-beans>
    <form-bean name="registerForm" type="app.RegisterForm"/>
    </form-beans>
    <action-mappings>
    <action path="/register"
    type="app.RegisterAction"
    name="registerForm">
    <forward name="success" path="/success.html"/>
    <forward name="failure" path="/failure.html"/>
    </action>
    </action-mappings>
    </struts-config>
    *** RegisterAction.java (located in WEB-INF/classes/app):
    package app;
    import org.apache.struts.action.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class RegisterAction extends Action {
         public ActionForward perform(ActionMapping mapping, ActionForm form,
                   HttpServletRequest req, HttpServletResponse res) {
              // b Cast the form to the RegisterForm
              RegisterForm rf = (RegisterForm) form;
              String username = rf.getUsername();
              String password1 = rf.getPassword1();
              String password2 = rf.getPassword2();
              // c Apply business logic
              if (password1.equals(password2)) {
                   return mapping.findForward("success");
              // E Return ActionForward for failure
              return mapping.findForward("failure");
    *** RegisterForm.java (located in WEB-INF/classes/app):
    package app;
    import org.apache.struts.action.*;
    public class RegisterForm extends ActionForm {
    protected String username;
    protected String password1;
    protected String password2;
    public String getUsername() {return this.username;};
    public String getPassword1() {return this.password1;};
    public String getPassword2() {return this.password2;};
    public void setUsername(String username) {this.username = username;};
    public void setPassword1(String password) {this.password1 = password;};
    public void setPassword2(String password) {this.password2 = password;};
    *** faulire.html ( located webapps/NAME_APPLICATION/ )
    <HTML>
    <HEAD>
    <TITLE>FAILURE</TITLE>
    </HEAD>
    <BODY>
    Registration failed!
    <P>try again?</P>
    </BODY>
    </HTML>
    *** success.html ( located webapps/NAME_APPLICATION/ )
    <HTML>
    <HEAD>
    <TITLE>SUCCESS</TITLE>
    </HEAD>
    <BODY>
    Registration succeeded!
    <P>try another?</P>
    </BODY>
    </HTML>
    *** register.jsp ( located webapps/NAME_APPLICATION/ )
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:form action="register.do">
    UserName:<html:text property="username"/><br>
    enter password:<html:password property="password1"/><br>
    re-enter password:<html:password property="password2"/><br>
    <html:submit value="Register"/>
    </html:form>
    *** web.xml (located in WEB-INF/)
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
    <!-- Standard Action Servlet Configuration (with debugging) -->
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>
         org.apache.struts.action.ActionServlet
         </servlet-class>
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResources</param-value>
    </init-param>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>debug</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>detail</param-name>
    <param-value>2</param-value>
    </init-param>
    <init-param>
    <param-name>validate</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <!-- Standard Action Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!-- Struts Tag Library Descriptors -->
    <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
    </taglib>
    </web-app>
    After start of NAME_APPLICATION it show register form (register.jsp) but when I fill out all information and submit those information it show empty window in internet browser and in url box is something like this:
    http://localhost:8084/StrutsTest/register.do;jsessionid=2304C0A9820E7FCC23106C16564D51A8
    where is a problem? Thank you

    Employing a descendent of the Action class that does not implement the perform() method while using the Struts 1.0 libraries. Struts 1.1 Action child classes started using execute() rather than perform(), but is backwards compatible and supports the perform() method. However, if you write an Action-descended class for Struts 1.1 with an execute() method and try to run it in Struts 1.0, you will get this "Document contained no data" error message in Netscape or a completely empty (no HTML whatsoever) page rendered in Microsoft Internet Explorer.
    Also check this URL http://www.geocities.com/Colosseum/Field/7217/SW/struts/errors.html

  • Delaying send data until event occurs

    Hii all,
    I'm new to java socket programing.
    i'm trying to develop simple system using TCP socket for client server communication over a network. I use AWT for user interfaces.
    The client program is supposed to get two inputs from user via 2 Text fields and send those to server.
    In my client program i have a method to listen server socket send data to server and inner class for user interface thing and i have called those 2 in main method consecutively.
    I want to delay calling listenSocket() method until the user click submit button. i think i have to use some synchronized methods but i dont have much idea of how to do it.
    I have attached the code here.
    Can anybody help me plzzzz? any suggestions would be appreciated.
    public class Client {
    /*for TCP socket connection*/
    Socket clientSocket=null;               
    PrintWriter out = null;          
    BufferedReader in = null;
    private String accountNo =null;
    private String accountType =null;
    public static void main(String[] srgs) {
    Client client =new Client();
    CustomerRequestUI requestUI =client.new CustomerRequestUI();
    client.listenSockect();
    public void listenSockect() {
    try {
    clientSocket = new Socket("localhost", 1234);
    out =new PrintWriter(clientSocket.getOutputStream(),true);
    out.println(accountNo);
    out.println(accountType);
    } catch (UnknownHostException e) {
         // TODO Auto-generated catch block
         System.out.println("Unknown host: localhost");
         e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
         System.out.println("No I/O");
         e.printStackTrace();
    class CustomerRequestUI extends Frame implements ActionListener{
              //declare components
              Label accNumLabel     =null;
              Label accTypeLabel     =null;
              TextField accNumText =null;
              TextField accTypeText=null;
              Button submitButton     =null;
              Button closeButton =null;
         public CustomerRequestUI(){
              this.setTitle("Customer Request");
              this.setLayout(new GridLayout(3,2));
              this.setBackground(Color.lightGray);
              accNumLabel =new Label("Account Number");
              accNumText =new TextField(10);
              accTypeLabel =new Label("Account Type");
              accTypeText =new TextField(25);
              submitButton =new Button("Submit");
              closeButton =new Button("Close");
              //add components to frame
              this.add(accNumLabel);
              this.add(accNumText);
              this.add(accTypeLabel);
              this.add(accTypeText);
              this.add(submitButton);
              this.add(closeButton);
              //add ActionListener to components
              accNumText.addActionListener(this);
              accTypeText.addActionListener(this);
              submitButton.addActionListener(this);
              closeButton.addActionListener(this);
              this.pack();
              this.show();      
         public void actionPerformed(ActionEvent event) {
         Object source =event.getSource();
         if(source ==submitButton){
              accountNo =accNumText.getText();
              accountType =accTypeText.getText();
         if(source ==closeButton){
         this.setVisible(false);                    this.dispose();
         System.exit(0);                    
    }

    If you want to listenSocket after a user clicks submit, why don't to call listenSocket when the use clicks submit.

  • Send data using exel file to function generator

    Hi all,
    I have one function generator which I controll with LabVIEW, I attached here the simple code.
    I would like that code read some data from exel file .
    May you please help me?
    Thanks
    Attachments:
    DG4000General.vi ‏43 KB

    I used different example like the one that I attached but I can not connect with m device.
    Now I can read my datas from Exel but how can I send to generator?
    I really confused.
    thanks in advance
    Attachments:
    Untitled 1.vi ‏34 KB

  • Help, simple c++ code :S

    Hi, so i've been trying to make a simple program that would print in the screen the char that i wrote in the first place...
    i don't know why, but the following code isn't "printing".
    #include "stdafx.h"
    #include "stdio.h"
    int main()
    char l;
    printf("insert char: ");
    scanf_s("%c",&l);
    printf("char: %c", l);
    return 0;
    Could someone please tell me what is wrong with the code, anything helps. Thanks.
    Daniel Rangel

    This is the Small Basic programming language forum - moving to C++.
    However I think the reason is that the program shows your char input the ends - add a wait for key to see the output.
    #include "stdafx.h"
    #include "stdio.h"
    int main()
    char l;
    printf("insert char: ");
    scanf_s("%c", &l);
    printf("char: %c", l);
    scanf_s("%s", "press any key to exit...");
    return 0;
    As documented in
    http://msdn.microsoft.com/en-us/library/w40768et.aspx, your call to scanf_s is missing a parameter.  I don't know if this will cause run-time problems or not.
    Why are you including stdafx.h?
    To insure that your output is sent to the screen, you should add a \n to your format string.  Otherwise the output could be buffered until the system has some other reason to send data.
    To force the window to remain open until you have finished viewing the output (as currently coded it will close immediately), you could insert
         system("pause");
    immediately before the return statement.  Remember to include stdlib.h if you do this.
    When coding in C, you should use int main(void) instead of int main() but that is unlikely to affect a program such as this.

  • Tree Sending Data to JavaScript - Help!

    I am trying to call a function in JavaScript and apss a parameter to it. The code I have below is not working. The label I have in HTML always says undefined after I call the ExternalInterface function in my mxml function. Can someone please take a look and tell me what I am doing wrong?
    mxml code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
       width="404" height="356" preinitialize="init()">
      <mx:Script>
        <![CDATA[
          [Bindable]
          public var treeData:Array = new Array();
          public function init():void{
            var tmpObjectGrains:Object = new Object();
        var tmpObjectDairy:Object = new Object();
        var tmpObjectFruits:Object = new Object();
        var tmpObjectMeats:Object = new Object();
        var tmpObjectNuts:Object = new Object();
        tmpObjectGrains['label']="BOC";
        tmpObjectGrains['children']=[{label:'Line 1'},
                                         {label:'Line 2'},
                                         {label:'Line 3'},
                                         {label:'Line 4'}];
        treeData.push(tmpObjectGrains);
        tmpObjectDairy['label']="TOC";
            tmpObjectDairy['children']=[{label:'Line 10'},
                                        {label:'Line 20'},
                                        {label:'Line 30'}];
        treeData.push(tmpObjectDairy);
        tmpObjectFruits['label']="SLOC";
    tmpObjectFruits['children']=[{label:'Line X'},
                                         {label:'Line Y'},
                                         {label:'Line Z'}];
            treeData.push(tmpObjectFruits);   
         public function jsPassData(event:Event):void
         if (ExternalInterface.available)
             ExternalInterface.call("PassData", treeView1.selectedItem);
             lblMessage.text = "Data sent!";
           else
             lblMessage.text = "Error sending data!"
       ]]>
    </mx:Script>
      <mx:Panel id="pnlMain" x="0" y="0" width="404" height="356"
         layout="absolute" title="JavaScript Test">
         <mx:Tree id="treeView1" x="0" y="0" dataProvider="{treeData}" labelField="label" change="jsPassData(event);" width="268" height="219"></mx:Tree>
        <mx:Label x="276" y="22" id="lblMessage"/>
      </mx:Panel>
    </mx:Application>
    JavaScript function:
    <script language="JavaScript" type="text/javascript">
    function PassData(data)
      if(person == null)
        alert("Select a line");
      else
        document.getElementById('TreeView').innerHTML = data.label;
    </script>

    I have tried sending an object or just simple text and still cannot get the data through....
    It seems as though I need to know how to call which item is selected in the tree and how to receive it in JavaScript.

  • Send data from applet to web server

    Hi,
    I want to send data(event notification) to resource through web server using url.
    Like,As long as perticular action or event is occuring I am sending that message to url.
    I reffered Sevlet theory uses HTTPMessage,but I am confused how should start and what would be feasible?
    Even when I run my code I am not finding browser.How should I place an applet in web server page?
    Regards,
    Palak
    Message was edited by:
    palak_shah

    Hi
    I agree usage of HttpClient is a better and a simple method.
    But If your Application Requirements are Simple you may go by using URL & URLconnection Objects in java.net package.
    Just to Add In You Can Checkout the links given below to have a better understanding of how the communication works...
    The Example APPLET code:
    http://mindy.cs.bham.ac.uk/AppletServletExample/EgApplet.java.txt
    The Example SERVLET code:
    http://mindy.cs.bham.ac.uk/AppletServletExample/EgServlet.java.txt
    and the Example AppletDemo Class
    http://mindy.cs.bham.ac.uk/AppletServletExample/EgApplet.class
    Hope this helps :)
    REGARDS,
    RaHuL

  • Send data from producer to consumer

    Hi,
    I am trying on a sampe project with weblogic as both producer and consumer. I could send the data from consumer to producer to using Interceptors. Now, my requirement is to send data from producer back to consumer. I can do this using SimpleStateHolder, but I want a generic way like passing information in cookies/HTTP Request Headers from producer...etc and to retrieve them at consumer. This is because in my actual implementation the producer will be websphere.
    So, please can anyone tell me how to send data from producer to consumer ???
    Thanks,
    Anu

    Hello Anu,
    I believe WLP 10.2 requires some patches to get the consumer
    interceptor to properly access cookies coming from the producer, so
    that is probably why you aren't seeing the cookies. After reading your
    use-case, I don't think you will need to get these patches to get your
    use-case to work, but if you are still interested in the patches, I can
    find out the details for you.
    The reason the redirect code you posted isn't working is because the
    response has already been committed during the getMarkup operations and
    it is too late to redirect the page to a different URL, so the redirect
    is being ignored.
    The good news is that the functionality you want should all be fairly simple to implement.
    When the user opens the remote portlet, makes a selection and then
    submits it, the first thing that will happen is a WSRP
    BlockingInteraction call to the producer, to let the remote portlet
    know that a user has interacted with it. This happens before the
    GetMarkup operation, during a time when it is still legal to redirect
    to a different URL. In fact, the portlet on the producer is allowed to
    send a response indicating that the page should be redirected to a
    different URL.
    So in your remote portlet, you can have it look at the form values that
    were submitted during the BlockingInteraction call, and if the user
    selected the particular value that should be redirected to another
    portlet, the remote portlet can request a redirect. The only problem
    here is that your remote portlet doesn't know the URL to the portlet it
    wants to redirect to on the consumer side, but you can handle that in
    an interceptor on the consumer.
    So, rather than implement the IGerMarkupInterceptor, use the IBlockingInteractionInterceptor. For example:
    public sampleInterceptor implements IBlockingInteractionInterceptor
    // Other methods need to be implemented to do nothing...
    public Status.PostInvoke postInvoke(<code>IBlockingInteractionRequestContext requestContext,
    IBlockingInteractionResponseContext responseContext)</code>
    String redirectUrl = responseContext.getRedirectURL();
    if(redirectUrl != null)
    // The producer portlet wants to redirect- substitute the right consumer URL
    PageURL pageUrl =
    PageURL.createPageURL(requestContext.getHttpServletRequest(),
    requestContext.getHttpServletResponse),
    "voipTrunk_portal_page_11_page_12_page_13");
    responseContext.setRedirectURL(pageUrl.toString());
    This should be all that you need to do on the consumer side. It will
    automatically redirect for you to the URL you set in the interceptor,
    since the producer portlet requested a redirect.
    On the producer side, you will need to have the portlet send the
    redirect request during the BlockingInteraction operation. How you do
    this depends on what portlet type you are using and what producer you
    are using. For example, in WLP using a JSP portlet, you would need to
    use a backing file on the portlet, and have that class implement the
    JspBacking class:
    http://edocs.beasys.com/wlp/docs102/javadoc/com/bea/netuix/servlets/controls/content/backing/JspBacking.html
    Then, in the handlePostbackData method you would look for the special value and redirect if it exists, such as:
    public boolean handlePostbackData(HttpServletRequest request, HttpServletResponse response)
    String paramValue = request.getParameter("paramName");
    if((paramValue != null) && (paramValue.equals("specialValue"))
    // Need to send a redirect request
    PortletBackingContext pbc = PortletBackingContext.getPortletBackingContext(request);
    pbc.sendRedirect("http://anyUrlWillWork");
    return(true);
    return(false);
    Since the consumer interceptor is changing the redirect URL, any
    redirect URL the producer sends will work- it just needs to look like a
    valid, absolute URL to pass some simple checks on the producer.
    Backing files are documented here: http://e-docs.bea.com/wlp/docs102/portlets/building.html#wp1077130
    As I mentioned before, different portlet types and producers would do
    this differently. For example, I don't think WebSphere has backing
    files, and in JSR168 portlets a backing file is not needed- you would
    do the equivalent code in the JSR168 portlet's processAction() method
    (using javax.portlet.ActionResponse.sendRedirect(String URL) to send
    the redirect request). JSR168 portlets should work in both WLP and
    WebSphere, but I don't know the details of the portlet type you want to
    use on the WebSphere producer; if it isn't a JSR168 portlet, WebSphere
    must have some way equivalent to the backing file's handlePostbackData
    method to participate in a WSRP BlockingInteraction operation and
    request a redirect.
    No cookies or headers are required though, so I don't think you would
    need the patches to WLP 10.2 for the interceptor dealing with cookies.
    Hope this helps,
    Kevin

  • Sending data to EXCEL from Oracle Forms 6.0 URGENT!!!!!

    Dear all,
    I have a problem to which I hope to get a solution from anyone
    out there...
    The problem is as follows:
    I have a form that contains some data. Now this data I need to
    transfer to an excell sheet. I tried to do so through report
    builder (6.0) but every time I try to convert my report I get a
    general protection fault. So instead I'm sending the data to a
    text file through text_io built in then reopening the text file
    from excel. Isn't there a better way to do it? ie sending the
    data stright from forms to excel?
    Thanks in advance
    null

    TRY THIS OUT....OLE2.... IT WORKS GREAT...DIRECTLY TO EXCEL...
    Oracle Corporate Support
    Problem Repository
    1. Prob# 1030046.6 NEW: OLE AUTOMATION NO LONGER WORKS AFTER
    UPGRADE TO OF
    2. Soln# 2077481.6 NEW: MICROSOFT CHANGED OLE INTERFACE FOR
    OFFICE97
    1. Prob# 1030046.6 NEW: OLE AUTOMATION NO LONGER WORKS AFTER
    UPGRADE TO OF
    Problem ID : 1030046.6
    Affected Platforms : MS Windows 95
    MS Windows NT
    Affected Products : SQL*Forms
    Oracle Reports
    Oracle Graphics
    Oracle Developer/2000
    Affected Components : SF40 V04.05.XX
    SQLREP V02.05.XX
    ORAGRAPH V02.05.XX
    DEV2K Generic
    Affected Oracle Vsn : Generic
    Summary:
    NEW: OLE AUTOMATION NO LONGER WORKS AFTER UPGRADE TO OFFICE97
    +=+
    Problem Description:
    ====================
    You have upgraded to Microsoft Office97 and OLE calls in your
    Developer/2000
    applications no longer work.
    Problem Explanation:
    ====================
    Examples:
    You are using Forms to send data to a Microsoft Word document
    and print
    letters, using ole automation. This worked fine with Word 6.0,
    but when
    they
    upgraded to Word 8.0 (Office97), the letters do not get printed.
    When you try to get an object handle to the Excel97 Workbooks
    collection
    using
    the OLE2 Package, you get the following error:
    FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception
    ORA-305500
    The Same code works fine against Excel 7.0.
    [ Search Words: Office 97 msoffice ms office object linking and
    embedding
    application get_obj_property workbook invoke_obj
    appshow
    upgrade upgrading bug483090 olex.rdf demo ]
    +==+
    Diagnostics and References:
    2. Soln# 2077481.6 NEW: MICROSOFT CHANGED OLE INTERFACE FOR
    OFFICE97
    Solution ID : 2077481.6
    For Problem : 1030046.6
    Affected Platforms : MS Windows 95
    MS Windows NT
    Affected Products : SQL*Forms
    Oracle Reports
    Oracle Graphics
    Oracle Developer/2000
    Affected Components : SF40 V04.05.XX
    SQLREP V02.05.XX
    ORAGRAPH V02.05.XX
    DEV2K Generic
    Affected Oracle Vsn : Generic
    Summary:
    NEW: MICROSOFT CHANGED OLE INTERFACE FOR OFFICE97
    +=+
    Solution Description:
    =====================
    WORD:
    Microsoft made some changes in the upgraded version of Word
    which cause it
    to
    come up as a hidden application. Customer had to add "AppShow"
    to his code,
    and ole automation works fine now.
    EXCEL:
    The issue here is that Microsoft changed the object "Workbooks",
    which is
    now
    a property of object "Excel.Application". So, replace the call:
    workbooks := ole2.invoke_obj(application, 'workbooks');
    with
    workbooks := ole2.get_obj_property(application, 'workbooks');
    For example:
    PACKAGE BODY olewrap IS
    -- Declare the OLE objects
    application OLE2.OBJ_TYPE;
    workbooks OLE2.OBJ_TYPE;
    workbook OLE2.OBJ_TYPE;
    worksheets OLE2.OBJ_TYPE;
    worksheet OLE2.OBJ_TYPE;
    cell OLE2.OBJ_TYPE;
    args OLE2.LIST_TYPE;
    procedure init is
    begin
    -- Start Excel and make it visible
    application := OLE2.CREATE_OBJ('Excel.Application');
    ole2.set_property(application,'Visible', 'True');
    workbooks := OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 'c:\test\ms\excel\test.xls');
    workbook := OLE2.GET_OBJ_PROPERTY(workbooks, 'Open', args);
    OLE2.DESTROY_ARGLIST(args);
    worksheets := OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
    worksheet := OLE2.GET_OBJ_PROPERTY(worksheets,'Add');
    -- Return object handle to cell A1 on the new Worksheet
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 1);
    OLE2.ADD_ARG(args, 1);
    cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
    OLE2.DESTROY_ARGLIST(args);
    -- Set the contents of the cell to 'Hello Excel!'
    OLE2.SET_PROPERTY(cell, 'Value', 'Hello Excel!');
    END;
    procedure addstuff is
    BEGIN
    -- Return object handle to cell A1 on the new Worksheet
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 2);
    OLE2.ADD_ARG(args, 2);
    cell:=OLE2.INVOKE_OBJ(worksheet, 'Cells', args);
    OLE2.DESTROY_ARGLIST(args);
    -- Set the contents of the cell to 'This is the added stuff'
    OLE2.SET_PROPERTY(cell, 'Value', 'This is the added stuff');
    END;
    procedure stop is
    begin
    -- Release the OLE objects
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 'C:\OLETEST2.XLS');
    OLE2.INVOKE(worksheet, 'SaveAs', args);
    OLE2.DESTROY_ARGLIST(args);
    OLE2.RELEASE_OBJ(cell);
    OLE2.RELEASE_OBJ(worksheet);
    OLE2.RELEASE_OBJ(worksheets);
    OLE2.RELEASE_OBJ(workbook);
    OLE2.RELEASE_OBJ(workbooks);
    OLE2.RELEASE_OBJ(application);
    END;
    Solution Explanation:
    =====================
    Microsoft changed some of the OLE calling interfaces for the
    Office97
    products. Thus, some of your existing OLE calls may need to be
    changed to
    comply with the Office97 interface.
    Consult with Microsoft and your Office97 documentation or more
    information
    on
    what the OLE interface is for the Office97 suite of products.
    Additional Information:
    =======================
    Related Bugs:
    483090 (Closed, Vendor OS Problem)
    FORM GIVES FRM-40735: UNHANDLED EXCEPTION ORA-305500 AGAINST
    EXCEL97.OFMPE0497
    +==+
    References:
    ref: {8192.4} BUG-483090
    Oracle Corporate Support
    Problem Repository
    1. Prob# 1030046.6 NEW: OLE AUTOMATION NO LONGER WORKS AFTER
    UPGRADE TO OF
    2. Soln# 2077481.6 NEW: MICROSOFT CHANGED OLE INTERFACE FOR
    OFFICE97
    1. Prob# 1030046.6 NEW: OLE AUTOMATION NO LONGER WORKS AFTER
    UPGRADE TO OF
    Problem ID : 1030046.6
    Affected Platforms : MS Windows 95
    MS Windows NT
    Affected Products : SQL*Forms
    Oracle Reports
    Oracle Graphics
    Oracle Developer/2000
    Affected Components : SF40 V04.05.XX
    SQLREP V02.05.XX
    ORAGRAPH V02.05.XX
    DEV2K Generic
    Affected Oracle Vsn : Generic
    Summary:
    NEW: OLE AUTOMATION NO LONGER WORKS AFTER UPGRADE TO OFFICE97
    +=+
    Problem Description:
    ====================
    You have upgraded to Microsoft Office97 and OLE calls in your
    Developer/2000
    applications no longer work.
    Problem Explanation:
    ====================
    Examples:
    You are using Forms to send data to a Microsoft Word document
    and print
    letters, using ole automation. This worked fine with Word 6.0,
    but when
    they
    upgraded to Word 8.0 (Office97), the letters do not get printed.
    When you try to get an object handle to the Excel97 Workbooks
    collection
    using
    the OLE2 Package, you get the following error:
    FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception
    ORA-305500
    The Same code works fine against Excel 7.0.
    [ Search Words: Office 97 msoffice ms office object linking and
    embedding
    application get_obj_property workbook invoke_obj
    appshow
    upgrade upgrading bug483090 olex.rdf demo ]
    +==+
    Diagnostics and References:
    2. Soln# 2077481.6 NEW: MICROSOFT CHANGED OLE INTERFACE FOR
    OFFICE97
    Solution ID : 2077481.6
    For Problem : 1030046.6
    Affected Platforms : MS Windows 95
    MS Windows NT
    Affected Products : SQL*Forms
    Oracle Reports
    Oracle Graphics
    Oracle Developer/2000
    Affected Components : SF40 V04.05.XX
    SQLREP V02.05.XX
    ORAGRAPH V02.05.XX
    DEV2K Generic
    Affected Oracle Vsn : Generic
    Summary:
    NEW: MICROSOFT CHANGED OLE INTERFACE FOR OFFICE97
    +=+
    Solution Description:
    =====================
    WORD:
    Microsoft made some changes in the upgraded version of Word
    which cause it
    to
    come up as a hidden application. Customer had to add "AppShow"
    to his code,
    and ole automation works fine now.
    EXCEL:
    The issue here is that Microsoft changed the object "Workbooks",
    which is
    now
    a property of object "Excel.Application". So, replace the call:
    workbooks := ole2.invoke_obj(application, 'workbooks');
    with
    workbooks := ole2.get_obj_property(application, 'workbooks');
    For example:
    PACKAGE BODY olewrap IS
    -- Declare the OLE objects
    application OLE2.OBJ_TYPE;
    workbooks OLE2.OBJ_TYPE;
    workbook OLE2.OBJ_TYPE;
    worksheets OLE2.OBJ_TYPE;
    worksheet OLE2.OBJ_TYPE;
    cell OLE2.OBJ_TYPE;
    args OLE2.LIST_TYPE;
    procedure init is
    begin
    -- Start Excel and make it visible
    application := OLE2.CREATE_OBJ('Excel.Application');
    ole2.set_property(application,'Visible', 'True');
    workbooks := OLE2.GET_OBJ_PROPERTY(application, 'Workbooks');
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 'c:\test\ms\excel\test.xls');
    workbook := OLE2.GET_OBJ_PROPERTY(workbooks, 'Open', args);
    OLE2.DESTROY_ARGLIST(args);
    worksheets := OLE2.GET_OBJ_PROPERTY(workbook, 'Worksheets');
    worksheet := OLE2.GET_OBJ_PROPERTY(worksheets,'Add');
    -- Return object handle to cell A1 on the new Worksheet
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 1);
    OLE2.ADD_ARG(args, 1);
    cell:=OLE2.GET_OBJ_PROPERTY(worksheet, 'Cells', args);
    OLE2.DESTROY_ARGLIST(args);
    -- Set the contents of the cell to 'Hello Excel!'
    OLE2.SET_PROPERTY(cell, 'Value', 'Hello Excel!');
    END;
    procedure addstuff is
    BEGIN
    -- Return object handle to cell A1 on the new Worksheet
    args := OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 2);
    OLE2.ADD_ARG(args, 2);
    cell:=OLE2.INVOKE_OBJ(worksheet, 'Cells', args);
    OLE2.DESTROY_ARGLIST(args);
    -- Set the contents of the cell to 'This is the added stuff'
    OLE2.SET_PROPERTY(cell, 'Value', 'This is the added stuff');
    END;
    procedure stop is
    begin
    -- Release the OLE objects
    args:=OLE2.CREATE_ARGLIST;
    OLE2.ADD_ARG(args, 'C:\OLETEST2.XLS');
    OLE2.INVOKE(worksheet, 'SaveAs', args);
    OLE2.DESTROY_ARGLIST(args);
    OLE2.RELEASE_OBJ(cell);
    OLE2.RELEASE_OBJ(worksheet);
    OLE2.RELEASE_OBJ(worksheets);
    OLE2.RELEASE_OBJ(workbook);
    OLE2.RELEASE_OBJ(workbooks);
    OLE2.RELEASE_OBJ(application);
    END;
    Solution Explanation:
    =====================
    Microsoft changed some of the OLE calling interfaces for the
    Office97
    products. Thus, some of your existing OLE calls may need to be
    changed to
    comply with the Office97 interface.
    Consult with Microsoft and your Office97 documentation or more
    information
    on
    what the OLE interface is for the Office97 suite of products.
    Additional Information:
    =======================
    Related Bugs:
    483090 (Closed, Vendor OS Problem)
    FORM GIVES FRM-40735: UNHANDLED EXCEPTION ORA-305500 AGAINST
    EXCEL97.OFMPE0497
    +==+
    References:
    ref: {8192.4} BUG-483090
    null

  • Using RFC Function Module to send data to NON SAP Application

    Hi friends,
    Please guide me how can I send data from SAP -> Dotnet Applcation using Dotnet Connector through RFC function module from SAP side. In my scenerio, I Run Z transaction  to executte RFC function module which create some data to pass to dotnet connector.
    Regards,
    Rajesh Kumar

    Hi,
    You can make use of Dotnet connector to read the content of SAP RFC .. (eaiest of all)
    The RFC can be executed using connector , and can read the data simultaneously.. u need to code in dotnet for this..
    else create a webservice and read it from dot net ..
    Regards
    Renu Gusain
    Edited by: Renu Gusain on Jan 25, 2010 12:55 PM

Maybe you are looking for

  • How can I retrieve a photo from Time Machine?

    My husband needs pictures he had stored under his profile.  I deleted everything due to space limits on the Macbook Air, but everything was backed up through Time Machine 1st.  Now he needs those pictures and I cannot figure out how to find them and

  • Compressing photos in aperture

    I presume that it must be possible to compress the total size off a photo, so that i will be able sending them easily by Email. I would like to send by email at least 20 photos in one email, and the size of each photo is now about 3 Mb . How must I p

  • Can't open "sound" in system preferences

    Hello, I've had a problem with the earphone jack today.(A red light was appearing when i took off the earphones) Anyway i seem to fix it but i can't open Sound from System Preferences. It's like stucked. Everything else is working but i can't change

  • Choppy Ken Burns screensaver.........Never had this issue before

    Maybe I've just been lucky to this point as I've had no issues whatsoever with the upgrade to v2.0. But I came home from Valentine's Day dinner with my family, went to the aTV and noticed something that I'd never seen before......a slightly choppy an

  • HTTPS inbound blocked?

    Hello, I have FIOS bundle with 35/35 internet plan. I access my home computer using RDP gateway which runs on port 443 and there is no way to customize the port it can run on. Until a week ago, it was working fine but I can't access it anymore. The r