Send large string between servlets in different domain

Hi,
I need to send a large string from servlet in an web application to a
servlet in another web application. Those two application are in
different domains. I can't send the string as request parameter,
bacause string is too large. I can't send as request attribute either,
because attribute will lost during redirect to another domain.
Any solutions? Thanks for any help.

do set/getAttribute at the ServletContext level which is unique for a particular webapplication. from 1st application u can access the 2nd one using , getServletConfig().getServletContext().getContext("/uripath") which gives you the ServletContext handle of the other application and you can do getAttribute of this.
Rgds
Padmanava

Similar Messages

  • Sending mails through PL/SQL  in different domains

    Hi all,
    I am having procedure like this.....
    create or replace procedure send_test_message
    IS
    mailhost VARCHAR2(64) := 'xxx.com';
    sender VARCHAR2(64) := '[email protected]';
    recipient VARCHAR2(64) := '[email protected]'; /* Error comes in this */
    --recipient   VARCHAR2(64) := '[email protected]';  /*  This is working  fine  */
    mail_conn utl_smtp.connection;
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, sender);
    utl_smtp.rcpt(mail_conn, recipient);
    -- If we had the message in a single string, we could collapse
    -- open_data(), write_data(), and close_data() into a single call to data().
    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'This is a test message.' || chr(13));
    utl_smtp.write_data(mail_conn, 'This is line 2.' || chr(13));
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    dbms_output.put_line('Successfully sends......');
    EXCEPTION
    WHEN OTHERS THEN
    -- Insert error-handling code here
    dbms_output.put_line(sqlerrm);
    END;
    When i called this procedure, i am getting following error....
    ORA-29279: SMTP permanent error: 550 5.7.1 [email protected].. Relaying denied. IP name lookup failed [219.120.53.234]
    [email protected] -- This mail id is mine and it exists.
    Any help is appreciated.
    Thanks in advance,
    Pal

    > May be silly for you, but i like to know,
    Anybody (different provider/domain) can send mails through his mobile to my
    mobile (different provider/domain). How it is possible ?
    I send an e-mail to you. My mail reader contacts my e-mail server. The e-mail server sees that I'm from the same domain. It accepts my e-mail - it ignores (for now) what the recipient's domain are.
    My domain's e-mail server looks at the recipient and sees your domain. It now attempts to contact your domain's e-mail server. If it fails, it sends me an e-mail telling me of that failure.
    If it succeeds, it tells your e-mail server that it has an e-mail for you from me. Your e-mail server sees that the recipient is on its domain. It therefore accepts the e-mail and delivers it to your post box. Your e-mail server is not concerned about the originator (me and my domain) as the delivery is for someone on its domain.
    Only when the recipient and sender are both "unknown" to the mail server, it will/should refuse to accept that e-mail and try to relay it between one and another domain.
    Bottom line - when sending an e-mail the SMTP server expects that you are either on the same domain as it (in which case it is there to service you), or that you are delivering an e-mail for someone on its domain (that someone being serviced by the server).

  • Unable to send email to different domain by JavaMail

    Hello,
    I'm developing a servlet application by using using JavaMail 1.2 with JDK 1.3/Resin 1.2.
    My application is hosted at an ASP. When I send email some addresses under my domain,
    there is no problem. Emails are sent successfully. But, if I send emails to addresses under different domains, I get MessagingException in Transport.send(message) method.
    My CGI scripts can successfully email messages to different domain.
    thanks in advance...

    There is a Java Mail forum where you could have asked this. However, if you had looked there you would have found this question asked several times a week. Your ASP doesn't allow its e-mail system to be used for relaying. Ask the ASP if you don't understand what that means.

  • Send portal screen parameters to one absolute url in a different domain

    Hi Experts,
    We have a requirement wherein we have to send some screen parameters of the portal application to one url which is in a different domain.
    We are currently using Iframe UI element and binding the source property of the UI element to a string attribute wherein we have set the url and the parameters.
    The portal application is a webdynpro java application. The only requirement is to send the screen parameters to one particular url and nothing else. We do not want to create any html files and moreover we also do not want to make Iframe ui element visible in our webdynpro application.
    Can you please suggest how can I acheive this?
    Thanks & Regards,
    Anurag

    you can add the portal parameters to the target application URL
    target app : http://some.com/application.jsp&param1=myvalue&param2=value
    read URL parameters in Dynpro:
    WDWebContextAdapter.getWebContextAdapter().getRequestParameter("param1");
    Lemme know your requirement passing to URL or getting portal params
    Regards,
    Nikhil

  • How to send a String to a Servlet using a HTTP POST

    Well, I have designed a servlet that receives a HTTP POST, I was testing it using an HTML form to send (using POST) information, now, I have coded a Java App to send it a string, I don't know how to make the servlet recognize that info so it can make its work, I am posting both codes (Servlet & API) so anyone can guide me and tell me how and where to modify them
    Servlet:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.getParameter("cadena");
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now, the JAVA API is:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    URL url1 = new URL
    ("http://localhost:8080/XMLSender/xmlwriter");//internal site
    URLConnection UrlConnObj1 = url1.openConnection();
    HttpURLConnection huc1 = (HttpURLConnection)UrlConnObj1;
    huc1.setRequestMethod("POST");
    huc1.setDoOutput(true);
    huc1.setDoInput(true);
    huc1.setUseCaches(false);
    huc1.setDefaultUseCaches(false);
    String cadena = ""
    + "<root>\n"
    + "<tlf>$TLF$</tlf>\n"
    + "<op>$OP$</op>\n"
    + "<sc>$SC$</sc>\n"
    + "<body>$BODY$</body>\n"
    + "</root>";
         PrintWriter out = new PrintWriter(huc1.getOutputStream());
    System.out.println("string="+cadena);
    out.write(cadena);
    out.close();
    I'm a JAVA newbie, so, maybe I'm getting a bad idea of what I need to do, anyway, every (detailed) help is welcome. What my servlet should do (and it doesn't when I send the message through the API) is to write a file with the info received.

    I'm not trying to send a string from a WEB Page, I'm tryring to send it using a JAVA program, I mean, using a HTTPSender, in fact, I already have made the code to do that:
    import java.io.*;
    import java.net.*;
    public class HTTPSender {
    public static void main(String[] args) throws Exception {
    try {
    String cadena = "Message to be written";
    // Send data
    URL url = new URL("http://localhost:8080/XMLSender/xmlwriter");
    URLConnection conn = url.openConnection();
    conn.setDoOutput(true);
    OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
    wr.write(cadena);
    wr.flush();
    // Get the response
    BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    // Process line...
    wr.close();
    rd.close();
    } catch (Exception e) {
    And modified my servlet so it can receive anything:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.sql.*;
    public class xmlwriter extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    ServletOutputStream salida = res.getOutputStream();
    res.setContentType("text/HTML");
    String cadena = req.toString();
    File f1 = new File ("c:/salida.xml");
    FileWriter out = new FileWriter(f1);
    f1.createNewFile();
    out.write(cadena);
    out.close();
    salida.println("OK");
    Now the problem is that, the servlet in fact DOES create the file, but....the file is empty, that means that no info is arriving to the servlet, why?, how should I send it then? I repeat FORGET about a Web Page Form, that is in the past and I don't need that.

  • Authentication needed after doing trust between two different domains.

    Hi There,
    I have a problem when i did the trust relationship between two different domains in two different forests ,,in the trust relationship steps all working two ways trust,with external trust,stub zone created on both domains and they are validated in both sides
    ,,my problem is with the objects it can't be retrieved from side and it can be from the other side . For instance :
    NY domain can get the users and computers of 2012DC1 
    but 2012DC1 can't get the users and computers of NY
    Date and time are the same,i am always getting this error 
    The session setup from computer '2012DC1' failed because the security database does not contain a trust account 'test.com.' referenced by the specified computer.  
    USER ACTION  
    If this is the first occurrence of this event for the specified computer and account, this may be a transient issue that doesn't require any action at this time.  If this is a Read-Only Domain Controller and 'test.com.' is a legitimate machine account
    for the computer '2012DC1' then '2012DC1' should be marked cacheable for this location if appropriate or otherwise ensure connectivity to a domain controller  capable of servicing the request (for example a writable domain controller).  Otherwise,
    the following steps may be taken to resolve this problem:  
    If 'test.com.' is a legitimate machine account for the computer '2012DC1', then '2012DC1' should be rejoined to the domain.  
    If 'test.com.' is a legitimate interdomain trust account, then the trust should be recreated.  
    Otherwise, assuming that 'test.com.' is not a legitimate account, the following action should be taken on '2012DC1':  
    If '2012DC1' is a Domain Controller, then the trust associated with 'test.com.' should be deleted.  
    If '2012DC1' is not a Domain Controller, it should be disjoined from the domain.
    Can you please help me in this error.
    Thank You in advance.

    Hello,
    "The session setup from computer '2012DC1' failed because the security database does not contain a trust account 'test.com.' referenced by the specified computer. "
    This belongs to the machine 2012Dc1 in test.com and not to the other domain from your trust. Seems for me that you mix the trust with the problems of the machine 2012DC1 in test.com.
    In this error message 2012DC1 has lost the trust to its OWN domain and therefore you have to find the reason. How exactly was this machine installed?
    Or was there a restore on that machine from not supported type of backup like image/clone/snapshot?
    Best regards
    Meinolf Weber
    MVP, MCP, MCTS
    Microsoft MVP - Directory Services
    My Blog: http://blogs.msmvps.com/MWeber
    Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    Twitter:  

  • Send email to different domain using different address

    hi
    I want to set my exchange recipients have 2 email address.
    1=[email protected] 2=[email protected]
    1.how can I set this setting? (I know I can use something called policy but I don't know how can use that for exchange 2013; please tell me how can do this)
    2.how can set my exchange server to send email to different domain with different account? (after question 1; my recipients has 2 email address (***@domain.com,
    ***@domain.co) I want my recipients when send email to "company.com" using domain.com address and for other domains using domain.co)
    thanks

    1.  Add an accepted domain.  Add the e-mail address to your e-mail address policy.  Update the e-mail address policy.
    2.  http://www.ivasoft.biz/choosefrom2007.shtml  This has been the traditional answer for Exchange 2010 and earlier.  You might contact him to see if it works for Exchange 2013. 
    I don't know of a native way to do this except to create separate mailboxes for each address.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Sending e-mails between different SAP-Systems with SMTP

    Hello,
    I want to send e-mails between two different internal SAP-Systems. I already configured SMTP in both systems but ist not possible to send an e-mail from system A to system B.  I've got following error message:
    Cannot process message; no node determined for <sapuser>:
    Thanks in advance & best regards,
    Christoph

    Hi Christoph,
    but it is possible that the email for user from System B is also available in the system itself(transaction so01) and not only in his outlook inbox?
    As the email is sent from System A. It will be available under SOST of system A.
    As user in System B is receiving the email, it will be appearing in users inbox.
    Check with Mail server administrator on where to enable SMTP relaying for IP address of SAP server.
    Hope this helps.
    Regards,
    Deepak Kori

  • Send an report to an account on different domain.

    How can I authenticate the MARS when it sends an email to an account on different domain.
    Our mail server requires authentication to send mail.
    Thanks.
    Andrea.

    Hi Andrea,
    It isn't MARS but your email server which needs to be configured. Post what flavor of email server software you are using and I bet somebody in the forum can assist.
    Hope this helps.
    Paul

  • ObjectStream communication between servlet and rich client

    Hi,
    I need to send multiple objects from a servlet to a rich client.
    Is it possible to send 2 objects of different types at the same time - ie, a hashtable and a custom object by writing them one after another into the response's ObjectOutputStream?
    Also, if I have two vectors containing different object types, say a Vector of Strings and a Vector of custom objects, how do I read the ObjectStream at the client end to get these two objects? Do I read two Vectors from the ObjectInputStream and then check the contained object using instanceOf?
    In the above scenarios, is it better to wrap the entire set of objects with a serialized wrapper class and send that single object from the server to the client?
    Please advice. Thanks in advance!

    You can send any number of objects in a stream one after other. If they are in different types/classes then you have to be carefull when casting to the specific types at the other end becouse if you try to cast to wrong type you get a runtime exception.
    Normally when you receive the objects you will know in advande (programming time) which vector comes first in the stream so you can treat them acordingly.
    Since both of them are vectors you can cast them to vector references at the read end and can tread the elements of the first vectors as strings and the elements of the other vectors as something else provided that the client always send the string vector first.
    Whether to make it a single object or ot is a design decision that you have to make. It it make sence to put those two vectors together(logically related) then its better to do so.

  • Passing a large string in URL

    Hi
    The scenario is as follows
    There are two servers A and B on different locations. From Server A i want to send a request to a url on server B. The request contains a string parameter of very large value (more than 255 characters). The problem is that I cant use a get because of the restriction.
    How can I do the above in a jsp page. The string is generated dynamically when the user clicks on a link and also contains special characters like (+%)
    I know i need to encode the url. But how do i post to a url on a different server
    It would be nice if i can get the complete code. Short of time and cant read much thrugh the docs :)
    Thanks
    Sairam

    That depends, what type of field are you inserting the string into? What you need to do is check the size of the field and the length of the string. If the length exceeds the field size, then you either need to increase the field size or, if you know you will be generally inserting very large strings, change the field to a clob. Hope this helps.

  • Batch Script using System Varriable for Hostname and FQDN results in large space between

    I have a batch script running on Windows 7 that I've created to help a physical computer, connect to his virtual cousin.  Problem is when I try to make
    it use the FQDN (required by the View Client) it puts a large space between the hostname and the domain.
    Result
    ECHO Connecting View Client to PREFIX-SERIAL .domain.comOR"C:\Program Files\VmWare\View.exe" -Args -serverURL PREFIX-SERIAL       .domain.com
    Our computers are named a combination of a prefix and the serial number.  Our virtual computer names are the same, but with a different prefix.  So my attempt was to make a connection
    script, using the computer serial number.  My Process:
    Setting %serial% variable.
    for /F "skip=1 tokens=*" %%b in ('wmic bios get serialnumber') do if not defined serial set serial=%%b
    Set %hostname% variable.
    set hostname=PREFIX-%serial%
    Installation command line
    "C:\Program Files\VmWare\View.exe" -Args -serverURL %hostname%.domain.com
    That results in the output at the beginning of my post.
    I've also tried
    %hostname%.%userdomain%.com
    PREFIX-%serial%.%userdomain%.com
    PREFIX-%serial%.domain.com
    SET FQDN=.domain.com
    PREFIX-%serial%%FQDN%
    %hostname%%FQDN%
    I also tried carets and quotes on set commands without any improvement.
    I'm sure I'm missing something simple here.  Any advise?
    There's no place like 127.0.0.1

    Will something like this get you what you are looking for?
    (gwmi win32_bios).SerialNumber+(gwmi WIN32_ComputerSystem).Domain
    Or
    $hostname=(gwmi win32_bios).SerialNumber+"."+(gwmi WIN32_ComputerSystem).Domain
    Sorry just realized your looking to do this in a Batch file...so maybe something like this
    @echo off
    for /F "skip=1 delims=" %%j in ('powershell "[System.Net.Dns]::GetHostByName((hostname)).HostName"') do (
    set Host=%%j
    goto :DONE
    :DONE
    echo %HOST%

  • Exchange POST data between servlets?

    Hello all
    First of all, my apologies for my English. This is the first time writing to forum.
    I�m new to java and I need a little help with servlets.
    I have the servlets A, B and C.
    Servlet A just display a page with a form tag witch send the data to Servlet C via POST method. What I want is to intercede the Servlet B between them and check the integrity of those POST data.
    For example: Servlet A send data to Servlet B via POST method, Servlet B check the integrity of those data, and finally Servlet B send those data to Servlet C via POST method.
    For now the only I have done is to send the data to B and transfer the data to C with GET method.
    How can I send data with POST method in a servlet?
    The code so far:
         String urlstr = new String();
         String str1 = request.getParameter("st_name");
    String str2 = request.getParameter("st_birth");
    String str3 = request.getParameter("st_class");
    ��some check ����
         urlstr = "/student/check_st?st_name=" + str1 + "&st_birth=" + str2 + "&st_class=" + str3;
         response.sendRedirect(urlstr);
    Thanks in advanced.
    Ilias

    You should use the RequestDispatcher.forward(request,response) method.
    For example, inside Servlet B do this:
    public void doPost(ServletRequest request, ServletResponse response) {
        ... validate parameters ...
        RequestDispatcher dispatcher = request.getRequestDisplatcher("ServletC");
        dispatcher.forward(request,response);
    }This prevents an extra request-response cycle to the client and between the .forward() and .include() methods of the RequestDispatcher, should be considered the preferred way of server-side redirection unless there is a specific need to go to the client first.
    See the J2EE API:
    http://java.sun.com/javaee/5/docs/api/

  • Can I run 2 different domains with same name but on 2 different machines?

    I am trying to setup 2 domains with same name (sharedcds1) on 2 different machines (Machine1 and Machine2).
              When I start the weblogic managed server 1 (sharedcds1managedserver1) on Machine2, it throws an error saying it has some conflicts with the managed server 1 running on Machine1. How did the managed server of one machine know about the other server. Can I run 2 different domains with same name but on 2 different machines?
              Here is the error in the log -
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 4596206652609838848S:130.170.61.153:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              <Jun 14, 2005 10:53:29 AM EDT> <Error> <Cluster> <BEA-000123> <Conflict start: You tried to bind an
              object under the name weblogic.transaction.coordinators.sharedcds1managedserver1 in the JNDI tree.
              The object from 8842351474821025197S:130.170.61.154:[9505,9505,-1,-1,9505,-1,-1,0,0]:sharedcds1:s
              haredcds1managedserver1 is non-clusterable, and you have tried to bind more than once from two or m
              ore servers. Such objects can only be deployed from one server.>
              Thanks
              Satish

    Yes you can. Make sure that domains configured to use different multicast address. WLS uses multicast for communications between nodes in domain.
              although your configuration will work, you could have troubles if you going to execute inter-domain calls between domains/servers with the same names.

  • How can I send multiple string commands into a VISA write?

    Hi Fellow LabVIEW users
    I am very new to LabVIEW (2.5 months) so please forgive me if my lingo is not up to par.
    How can I send multiple string commands to a VISA write. For example each string command looks like this
    1) 3A00 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0033 (Scenario 1)
    2) 3A01 0000 0000 FFFF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0034 (Scenario 2)
    3) 3A01 0000 0000 33FF FFFF FFFF 0000 0000 FF00 0000 0000 0000 0000 0067 (Scenario 3).
    and so on and so forth. And there are a number of scenarios.
    Each String scenario will give a different string output which will be interpreted differently in the front panel.
    Right now I have to manually change the string commands on the front panel to give me the desired output. How can I do this without manually changing the commands i.e. hard coding each scenario into the block diagram?
    Thanks, any feedback will help.
    mhaque

    Please stick to your original post.

Maybe you are looking for

  • IPod nana will not sync to PC

    My iTunes software will no longer sync to my iPod nano. Under the Files menu, 'Sync iPod' is greyed out; therefore it's not a choice now. I have reinstalled iTunes to no avail. I can't be the only one with this problem. Any help would be great. Thank

  • How to insert a Web Page in other Web Page in Web Page Composer

    Hi, I´m trying to insert a Web Page in a contaner of other web page in web page composer. I allready allow all web content types that´s make some reference of web pages in properties of my container (page, wpc_page, ...) After that i select a web pag

  • Joining Line Segments in CS6

    I am drawing a simple diamond shape made with one rectanlge shape and multiple line segments.  As I drew the design, I made sure to connect all the segments at the anchors.  When I select all of the segments and try to join the paths, the end points

  • Removing Leading Spaces in the field to be displayed

    Hi, Could you please tell me how to remove leading spaces in currency field in write statement? the length of the field cannot be changed by writing fieldname(length). is there any other method to do the same. the length should vary according to the

  • Illustrator CS4: My keyboard shortcuts aren't working.

    Let me begin by stating that I have used Illustrator for over 15 years,  and I have become accustomed to using the drag + alt shortcut to copy an  item. However, when I try this now (this has only starting happening  within the past week) it simply m