Forwarding specific object to a servlet

Hi!
In my servlet, I want to 'attach' some data as an integer and a specific object I have created. The servletOne is located in a server, servletTwo in another one. I need to pass objects.
I want to do something like that:
int myInteger = 1;
client myClient = new client();
myClient.setName("carlos");
request.getRequestDispatcher("servletTwo").forward(request, response);In this case, I want to passa an integer (myInteger) and client (myClient) object.
How can I do that?
Thanks in advanced,
Carlos

About cookies... I really prefer do it with session
(if it is the only way to do that).Most sessions are implemented using Cookies behind the scenes. :)
How can I share a session for 2 different context?I believe that is entirely up to the Servlet container you are using, as the servlet spec is silent on this issue (IIRC). Check your container documentation. But keep in mind that a Cookie might be the only feasable way to go.

Similar Messages

  • Using forward(request, response) in Java Servlet

    Hi
    I need help on how to use the forward() method in a java servlet passing a List object and riderecting to another jsp.
    when I use the following code;
    request.getRequestDispatcher(path).forward(request, response);
    I'm getting this message:
    Content modified /content...
    Status
    200
    Message
    OK
    Location
    /content...
    Parent Location
    /content
    Path
    /content...
    Referer
    Thanks,

    Looking at your traces seems like you are forwarding during POST. Seems like issue with your component implementation missing with POST & proxy scripts. Please eloborate more on the exact steps you are following. Alternatively See if this helps.
    org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper req =
    new org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper(slingRequest) {
    public String getMethod() {
    return "GET";
    String path = "/content/.../test.html";
    javax.servlet.RequestDispatcher dispatcher = slingRequest.getRequestDispatcher(path);
    dispatcher.include(req, slingResponse);

  • How can I call COM object in a servlet?

    Hi,
    Does oracle provide a bridge to call COM objects in a servlet? Is there any sample for doing this?
    Thanks,
    Archie

    Archi,
    Take a look at the following link:
    http://technet.oracle.com/products/ids/daily/jul12.html
    You can use J-Integra, one of JDeveloper's Extensions, in your Servlet to call any MS COM objects.

  • Accesing same object from different servlets

    Hello all!
    I am developing a web control project. I am using a simulator of a factory (with java). The engineers are supposed to be able to change some variables from the web.
    I am using servlets to change this variables. My problem is that, to be able to change variables, I need to create an instance of this FactorySimulator object.
    If each servlet ( there are many servlets) calls an instance, they will be updating different FactorySimulator objects.
    How can I make reference, or have acces to the SAME object, from any servlet?
    Thanks! I hope my question is clear =)

    package com.yourcompany.somepackage;
    public class TheFactory
        private static FactorySimulator factory = new FactorySimulator();
        private TheFactory() {} // Static methods only, do not instantiate TheFactory
        public FactorySimulator instance()
            return factory;
    }From each of your servlets you can call TheFactory.instance().doWhataver(). Methods in FactorySimulator need to be suitably synchronized of course.

  • Retrieve a set of specific objects

    I am looking for a way in JDO to retrieve and update sets of specific
    objects using a single SQL statement of the form:
    SELECT * FROM <ManagedEntity> WHERE <pk> IN (<pk1,pk2,...>)
    This is a relatively frequent and important use case for the types of
    applications that deal with graphs, such as for modeling telecommunications
    networks. I will describe below the specific behavior as taken from JSR 142:
    OSS Inventory API, specifically the Resource Inventory EJB Session Facade.
    (See http://jcp.org/jsr/detail/142.jsp and
    http://jcp.org/jsr/detail/144.jsp, which defines the API design patterns
    followed by http://java.sun.com/products/oss/ .)
    (1) ResourceInventoryEntityValue[]
    getResourceInventoryEntitiesByKeys(ResourceInventoryEntityKey[] keys,
    String[] attrNames)
    This is one occurrence of the operation pattern get<ManagedEntities>ByKeys.
    When the ResourceInventoryEntityValue implementation is a JDO
    PersistenceCapable class, and the ResourceInventoryEntityKey holds the
    primary key of each object of interest, the result set should be selected
    with a single SQL statement.
    (2) void removeResourceInventoryEntitiesByKeys (ResourceInventoryEntityKey[]
    keys)
    This is one occurrence of the operation pattern
    remove<ManagedEntities>ByKeys. The identified instances should be deleted
    with a single SQL statement.
    The problem is I do not see any obvious JDOQL syntax or operations on the
    JDO interfaces that would allow me to accomplish the above. On the positive
    side, Kodo is handling the other patterns extremely elegantly (pretty Java
    in WebLogic Server) and efficiently (pretty SQL). It is only this one ByKeys
    pattern that I can't see a way of doing nicely in JDO.
    Any help would be appreciated.
    Ben

    Thanks Abe. Your response was most helpful.
    Ben
    "Abe White" <[email protected]> wrote in message
    news:[email protected]...
    Actually, JDOQL does offer a way of doing what you want assuming you'reusing
    application identity and you use only a single primary key field:
    q.declareParameters ("Collection pks");
    q.setFilter ("pks.contains (myPKField)");
    Collection results = (Collection) filter.execute (pkCollection);
    Now the bad news: Collection parameters were added to the spec between the
    proposed final draft and the 1.0 release, and the were not noted in the
    spec ChangeLog. Unfortunately, that means that we here at Solarmetricdidn't
    notice the addition until someone pointed it out to us recently, and we
    haven't implemented it yet. Or actually, we've implemented it internally
    as part of a major query rework, but it won't be available publicly for
    awhile. You do, however, have other options:
    You could do it with "||" clauses:
    StringBuffer filter = new StringBuffer ();
    for (Iterator itr = pks.iterator (); itr.hasNext ();)
    filter.append (pkFieldName).append (" == ").append (itr.next ());
    if (itr.hasNext ())
    filter.append (" || ");
    q.setFilter (filter.toString ());
    Collection results = (Collection) q.execute ();
    You can also use our filter extensions (assuming you have the enterprise
    edition or have purchased the filter extensions module). You could usethe
    lit:sqlEmbed extension to embed whatever custom SQL you wanted:
    q.setFilter ("lit:sqlEmbed (\"IDX IN (...)\")");
    Collection results = (Collection) q.execute ();
    Good luck.
    I am looking for a way in JDO to retrieve and update sets of specific
    objects using a single SQL statement of the form:
    SELECT * FROM <ManagedEntity> WHERE <pk> IN (<pk1,pk2,...>)
    This is a relatively frequent and important use case for the types of
    applications that deal with graphs, such as for modeling
    telecommunications
    networks. I will describe below the specific behavior as taken from JSR142:
    OSS Inventory API, specifically the Resource Inventory EJB SessionFacade.
    (See http://jcp.org/jsr/detail/142.jsp and
    http://jcp.org/jsr/detail/144.jsp, which defines the API design patterns
    followed by http://java.sun.com/products/oss/ .)
    (1) ResourceInventoryEntityValue[]
    getResourceInventoryEntitiesByKeys(ResourceInventoryEntityKey[] keys,
    String[] attrNames)
    This is one occurrence of the operation patternget<ManagedEntities>ByKeys.
    When the ResourceInventoryEntityValue implementation is a JDO
    PersistenceCapable class, and the ResourceInventoryEntityKey holds the
    primary key of each object of interest, the result set should beselected
    with a single SQL statement.
    (2) void removeResourceInventoryEntitiesByKeys(ResourceInventoryEntityKey[]
    keys)
    This is one occurrence of the operation pattern
    remove<ManagedEntities>ByKeys. The identified instances should bedeleted
    with a single SQL statement.
    The problem is I do not see any obvious JDOQL syntax or operations onthe
    JDO interfaces that would allow me to accomplish the above. On thepositive
    side, Kodo is handling the other patterns extremely elegantly (prettyJava
    in WebLogic Server) and efficiently (pretty SQL). It is only this oneByKeys
    pattern that I can't see a way of doing nicely in JDO.
    Any help would be appreciated.
    Ben

  • Using 'Preview Layouts' on specific objects

    Hi everyone,
    I would want to know if it is possible to import CR layouts in SBO, and use it with the menu "Preview Layouts" on personalized objects.
    When I try to import a CR layout with the Report And Layout Manager of SBO, I choose my RPT file, check the Layout radio button, and open the List Of Documents. But in this list, there are no items which correspond to my specific objects, so I can't link my report and my objects, and when I open a record of my object, the menu "File -> Preview Layouts" is disabled.
    So my question is : is it possible to create new Document Types to be able to link my layout and my objects? Or any other solution which can allow me to use "Preview Layouts" on my specific objects?
    Thanks.

    Hello Charly,
    There is a way to add layout on User object. Using a piece of code, you can add your report in the table RDOC putting it in a BLOB field
    SAPbobsCOM.ReportLayoutsService rptService = (SAPbobsCOM.ReportLayoutsService)oCompany.GetCompanyService().GetBusinessService(SAPbobsCOM.ServiceTypes.ReportLayoutsService);
    SAPbobsCOM.ReportLayout newReport = (SAPbobsCOM.ReportLayout)rptService.GetDataInterface(SAPbobsCOM.ReportLayoutsServiceDataInterfaces.rlsdiReportLayout);
    newReport.Author = oCompany.UserName;
    newReport.Category = SAPbobsCOM.ReportLayoutCategoryEnum.rlcCrystal;
    newReport.Name = "APRS";
    newReport.TypeCode = "TypeCode";
    SAPbobsCOM.ReportLayoutParams newReportParam = rptService.AddReportLayout(newReport);
    newType = rptTypeService.GetReportType(newTypeParam);
    newType.DefaultReportLayout = newReportParam.LayoutCode;
    rptTypeService.UpdateReportType(newType);
    SAPbobsCOM.BlobParams oBlobParams = (SAPbobsCOM.BlobParams)oCompany.GetCompanyService().GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlobParams);
    oBlobParams.Table = "RDOC";
    oBlobParams.Field = "Template";
    SAPbobsCOM.BlobTableKeySegment oKeySegment = oBlobParams.BlobTableKeySegments.Add();
    oKeySegment.Name = "DocCode";
    oKeySegment.Value = newReportParam.LayoutCode;
    FileStream oFile = new FileStream("D:\\DEV\\Layouts\\Demo.rpt", System.IO.FileMode.Open);
    int fileSize = (int)oFile.Length;
    byte[] buf = new byte[fileSize];
    oFile.Read(buf, 0, fileSize);
    oFile.Dispose();
    SAPbobsCOM.Blob oBlob = (SAPbobsCOM.Blob)oCompany.GetCompanyService().GetDataInterface(SAPbobsCOM.CompanyServiceDataInterfaces.csdiBlob);
    oBlob.Content = Convert.ToBase64String(buf, 0, fileSize);
    oCompany.GetCompanyService().SetBlob(oBlobParams, oBlob);
    Then you have to associate your form to the reportType using this line of code in your form's constructor:
    oForm.reportType = "ReportType"
    Hoping that can help you
    Best regards

  • How to remove blocks from buffer cache for a specific object

    hi everybody,
    is it possible to remove blocks which belogns to a specific object (a table for ex) from buffer cache.
    as you know, there is
    alter system flush buffer_cache;command but it does it's job for all buffer cache. if you ask me why i want this, for tuning reasons. I want to test some plsql codes when they run as if they are running for the first time (reading from disk).
    ps: I use oracle 11g r2

    Hi mustafa,
    Your performance will not degrade if you run the query second time ( if i understood correctly, you worry about the performance if you execute the procedure second time). Executing/running the code/sql statements over and over again will have following two good benefits.
    1) This will avoid hard parsing (Hard parsing is resource intensive operation and this generally increase the overall processing time.
    2) This will avoid physical read IO (You gonna see the benefits if data blocks already cached and you dont have to spend time in reading blocks from disk. Reading from disk is much costlier and time consuming operation as compared to data in RAM)
    Having that said sometime bad written queries will acquire more blocks then required and consume most part of buffer cache, and this can some times effect the other important blocks and force to flush out from buffer cache.
    Oracle have built some intelligence for large full table scan operations for e.g will doing full table scan(I hope you already know what is fts) oracle will put its blocks at end of LRU chain. So these will be the buffers will would flush out first then any other.
    From oracle documentation:
    "When the user process is performing a full table scan, it reads the blocks of the table into buffers and puts them on the LRU end (instead of the MRU end) of the LRU list. This is because a fully scanned table usually is needed only briefly, so the blocks should be moved out quickly to leave more frequently used blocks in the cache.
    You can control this default behavior of blocks involved in table scans on a table-by-table basis. To specify that blocks of the table are to be placed at the MRU end of the list during a full table scan, use the CACHE clause when creating or altering a table or cluster. You can specify this behavior for small lookup tables or large static historical tables to avoid I/O on subsequent accesses of the table."
    Regards
    Edited by: 909592 on Feb 6, 2012 4:37 PM

  • Navto a page to a specific object status

    hello
    I want a link to a different page (different stack) in a specific object state, is this possible?
    The client wants all pictures in a separate image slideshow. For example, when i click on a small image (no.1), i want to jump to a different stack with that image slideshow, and the correct object state is shown (no.1)
    If i click on an other small picture (no.2) i jump to the same object state, and the object state no. 2 is shown.
    i cant find any solutions for this - not possible?
    thank you very much for any help.
    daniel

    I don’t work for Adobe and I have no inside knowledge for this.
    If you’d like to get that point across, here’s the place to do it: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    If you go that route, make sure include not only details on how you want this work but why it would beneficial to you and other DPS users.
    Bob

  • Passing objects from two servlets residing in  two  servers

    Suppose i need to pass an object from one servlet to another servlet ,that are residing in two servers(Tomcat).How can i achieve this.
    Plz help me in this regard.
    Thanks in Advance......

    Serialize them to XML and send as POST parameter

  • How do I pass an object to a Servlet?

    Hello,
    I have a fully initailized object called x.
    I need to invoke a servlet from an application and pass this object x to the
    servlet.
    This object contains all the necessary parameters which the servlet needs.
    How can I invoke a servlet from a class and pass this object?
    For Example:
    class SendObjToServlet
    try
    URL u = new URL("servlet_path");
    }catch(Exception e)
    Now how and where do I pass an object to this servlet??
    Please can any one respond?

    http://www.j-nine.com/pubs/applet2servlet/
    this website will give you the basic idea. It shows you how to do it with an applet the same idea will work for an applcation.
    lee

  • LSMW - Access to Specific Objects Permissions to specific users

    Hi guys,
    I want to know if it is possible to allow access to specific users that are in charge of the execution of a specific object of and LSMW.
    Regards,
    Eric

    Hi guys,
    One solution i got right now (but it isn't the ideal), is to debug the execution step of the LSMW in order to find the name of the program that iit's been call and the one that its call inthe step in wich the files are been specify. Then develop a "Z" program that calls both of them and give the user the access to this new transaction.
    Any better sugestion?.
    Regards,
    Eric

  • Audit specific objects for specific users

    audit statement has the option to choose audit by user list
    audit object has the option to choose audited objects
    now i need to audit specific objects, i.e. user A's tables accessed by a specific group of users, let's say ALL users other than A
    Is it a simple way to achieve this goal? (audit A's tables that accessed by all database users other than A)
    Thanks!

    sorry, the link works now. However, there is nothing new in 10G, same as I read from 9i document. See my highlight below in the quoted document text, my requirements is the combination of them ( specific users and specific objects). Thanks anyway.
    <quote
    Table 8-1 Auditing Types and Descriptions
    Type of Auditing (link to discussion)      Meaning/Description
    Statement Auditing      Enables you to audit SQL statements by type of statement, not by the specific schema objects on which they operate. Typically broad, statement auditing audits the use of several types of related actions for each option. For example, AUDIT TABLE tracks several DDL statements regardless of the table on which they are issued. You can also set statement auditing to audit selected users or every user in the database.
    Privilege Auditing
         Enables you to audit the use of powerful system privileges that enable corresponding actions, such as AUDIT CREATE TABLE. Privilege auditing is more focused than statement auditing, which audits only a particular type of action. You can set privilege auditing to audit a selected user or every user in the database.
    Schema Object Auditing
         Enables you to audit specific statements on a particular schema object, such as AUDIT SELECT ON employees. Schema object auditing is very focused, auditing only a single specified type of statement (such as SELECT) on a specified schema object. Schema object auditing always applies to all users of the database.
    Fine-Grained Auditing
         Enables you to audit at the most granular level, data access and actions based on content, using any Boolean measure, such as value > 1,000,000. Enables auditing based on access to or changes in a column.
    /quote>

  • Error generating client-specific objects

    Dear all,
    while generating environment in maintain operating concern i am getting following error
    Message no. KE007
    Diagnosis
         The system automatically adjusted operating concern PAPL, or the
         environment of operating concern PAPL was regenerated. An error occurred
         while the system was generating client-specific objects in client 600.
    System Response
         Operating concern PAPL cannot be used in client 600.
    Procedure
         If this message is contained in the generation log, see the messages
         that occurred before it for details about the error.
         If this message appeared during the automatic adjustment, try to
         generate the environment using the Customizing transaction KEA0.
    Activate data structures, generate environment
    so i could not generate the environment in development server
    kindly help me ..
    Thanks and regards
    vijay

    Dear paul,
    Thanks for you reply
    Actually the problem is when op.concern was generated in dev.server it was transported to test and production server,but while transporting some request from development my client got dump in development server and so operating concern was changed to transport the requests.Also in old operating concern some characteristics and value fields were added and deleted by user .Now when trying to activate environment (client specific part) it gives above error message.
    also we have got reply from sap which is as under:
    1)Thanks for the log in details. I was logged in to your system and checked the issue. I found few inconsistencies in the system. Please let me know if you have deleted any characteristic or value fields or if you have done any COPA transports recently.
    2)Thanks for the reply, we have changed and deleted characteristicsand value fields. Since we have changed our operating concern PAPL TO PAP1 and then assigned to controlling area PAPL which is not transported
    to production server then again we have changed as usual PAPL so we are facing this activation problem .please guide us to solve this problem as early as possible
    3)) I am not sure if I can help you resolving the issue as this is purely an inconsistency created by user action. These kinds of issues can be solved only by our remote consulting colleagues. However if you want to restore the old settings you can transport the operating concern through KE3I from your quality or production where the system is working fine.
    In test and production my operating concern is working fine ,is it possible to transport request from test or production to development ?
    also kindly suggest any other solutions
    Thanks and Regards
    vijay

  • How to get customer-specific objects into PCUI ?

    Hello,
    we want to get an Z-table as tab page of the business partner-application into PCUI. It should 'only' be possible to create new entries - today there is no need to modify or delete records.
    Does there exist something like a "cookbook" on this task or has anyone of you experience how to get customer-specific objects (without using EEWB) into PCUI ?
    Thanks in advance
    Martin

    Option 1:
    If you are good in ABAP.
    You can add new tab in which create a new Field group. Assign it to a model access clas in which handle the table update.You can get the details in PCUI cookbook itsel.
    Option 2:
    If you are good at java
    Develop an FM to update the table.
    Call the FM from webdynpro
    Include this webdynpro as HTML viewer in PCUI.
    Regards,
    Abdul Raheem S

  • Assigning Magic Move to Specific Objects

    I'm creating a presentation where multiple, identical items need to be placed at different positions on screen. The first object moves from the center of the screen to it's place, but for subsequent slides, instead of moving the newly-placed center item, it moves the first item to the second position. How do I assign specific objects to use during magic move transitions?

    Thanks for your reply. I'm finding that doing things slowly, and methodically produces the best results, but there are a few actions that I'm unable to pinpoint the cause. I've uploaded part of the file here: http://bit.ly/1aMWQz
    Slides 7, 8 & 9: The bottom row of coins rearranges between transitions.
    Slide 9 & 10: The caption "6 Ways" uses the anagram transition which is intended only for the title.
    Slides 11 & 12: The captions "6 Ways" and "15 Ways" disappear briefly. The same occurs in subsequent frames.
    How do I remedy this?
    Thanks.

Maybe you are looking for