How to work with request, response and sessions in JSC

Hi
I have two Servlets ServletA and ServletB. ServletA creates a session and add some attributes to this session. Then it forwards the request to ServletB where the attributes of this session are retrieved and used in response object.
Here is what I am doing in ServletB
- Get the session attrribute. This attribute is of type byte[]
byte[] mydata = (byte[]) request.getSession.getAttribute(data);
response.setContentLength(mydata.length);
OutputStream stream = response.getOutputStream();
stream.write(mydata,0,mydata.length);
stream.close();
My question is ...
How do I achieve this in Creator. ?
Thanks in advance
Srinivas

Hi
I have two Servlets ServletA and ServletB. ServletA
creates a session and add some attributes to this
s session. Then it forwards the request to ServletB
where the attributes of this session are retrieved
and used in response object.
Here is what I am doing in ServletB
- Get the session attrribute. This attribute is of
type byte[]
byte[] mydata = (byte[])
request.getSession.getAttribute(data);
response.setContentLength(mydata.length);
OutputStream stream = response.getOutputStream();
stream.write(mydata,0,mydata.length);
stream.close();
My question is ...
How do I achieve this in Creator. ?
Thanks in advance
SrinivasBy "this" do you mean "how do I access a session attribute that has been placed there by another servlet?"
The base class for all page beans has a bunch of convenience methods available. The simplest one to use for this purpose is getBean(), which searches through request scope, session scope, and application scope for a bean with the name you specify -- and, if its a managed bean, will create it for you as well. So, your code would look like this:
  String data = ...; // Name of the attribute you want
  byte[] mydata = (byte[]) getBean(data);There is an additional quirk related to what you're actually trying to do, though ... it looks like you are trying to write out binary content (perhaps an image loaded from the database or something). It is not possible to mix binary and text output in a single response.
Your best bet for this particular purpose, then, is to continue using ServletA and ServletB just as you have been. The applications created by Creator are standard servlet-based web applications, so you can use additional servlets and all the other goodies (although you'll have to declare them yourself in the web.xml file, as usual).
Craig

Similar Messages

  • How netflow works with ASA Firepower and Virtual Defense ?

    Hi,
     In the discovery rules of the Virtual Defense, i can see that's it's possible to configure netflow source. I have a pair of Cisco 4500X as the core switch L3, and would like to send a flow to the IPS.
     I configure the switch like that :
    flow record IPV4-FLOW-RECORD
     match ipv4 tos
     match ipv4 protocol
     match ipv4 source address
     match ipv4 destination address
     match transport source-port
     match transport destination-port
     collect interface input
     collect interface output
     collect counter bytes long
     collect counter packets long
    flow exporter Firepower
     source Vlan12
     destination IP_OF_tHE_ASA_IPS_MODULE
    flow monitor IPV4-FLOW
     exporter Firepower
     cache timeout inactive 30
     cache timeout active 60
     cache entries 1000
     record IPV4-FLOW-RECORD
    vlan configuration 100-102 ip flow monitor IPV4-FLOW input
    It's the correct configuration ? Can't see how to check in Virtual Defense if it's receive netflow packets

    SOLUTION!
    Install a second NIC bind vmnet0 to eth1 instead of eth0
    Details:
    Goal was to have the Host OS (Ubuntu 8.04) which is running an Apache web server also serve as an e-mail gateway (SpamTitan) since on a heavy day the web server might hit 5% CPU.
    Why but a whole new machine, right?
    When it did not work right away I went into troubleshooting mode and tried several different things as mentioned above. Which led me to the idea to create my own VM of SpamTitan and bind it to a different NIC.
    Before I went that far I tried reassigning vmnet0 from eth0 to my newly installed eth1 and running it. That seems to have done the trick!
    So now the setup is:
    eth0 192.168.2.4
    eth1 192.168.2.5
    vmnet0 192.168.2.6
    With vmnet0 bridged to eth1
    Why is it working now and not before?
    I am unsure. It is not a Linux thing because I tried both Windows XP and OS X 10.5 with the same result. I think it has more to do with primary network and associated services than Host OS.
    If anyone has any insight please let me know. Otherwise I am going to chase it down later.
    Thanks again for your responses!

  • How to work with crystal reports and boe3.1

    Hello!!! Forums,
             Please suggest me some tutorials and sample code to work with crystal reports that can be viewed in boe3.1. What software to use to deveelop reports? How to view it in boe3.1?
    Regards,
    grace

    At the top of the forums you will see posts that say read this first, read those first.
    [BOE Enterprise|Read Before Posting - Where to find Business Objects .NET SDK Resources;
    [Crystal Reports .NET|Read Before Posting - Where to find Crystal Reports .NET SDK resources;
    Jason

  • How to work with both desktop and Surface pro 3

    Hello,
    I have a desktop for my normal use of Adobe Creative Cloud for Photoshop and Lightroom.  I have my lightroom catalog on a separate external drive.  I just got Surface pro 3 to do Adobe on it.  I am now confused on how to work on Surface and how to access my Lightroom catalog.
    Thanks for your help.
    Mo

    Just install Lightroom on your Surface Pro, plug-in the external drive, and double-click the LR catalog file.

  • How Mail work with image attachements and HTML image ?

    Hello,
    I'm writing an application that sends html emails with images to Mail.app. When Mail display the mail, everything is okay, images are correctly embedded in html code, using inline attachements.
    But there's still a problem : The images are also displayed at the bottom of the email, as file attachements. I know that Mail's template can hide these attachements, but I cannot reproduce it when sending my own emails.
    Is there anybody here that already get such problem and find the solution ? (apparently, Windows User get the same problem with Outlook, but they have an API under Windows...I'm using my own email API..)
    David

    David can you share how you managed to get the inline images to work. I've got the general idea of how to do it. But I do not seem to be able to change the Content-Type to multipart/mix. Can you point me in the right direction. Should the Content-Type definition and everything else be part of the body? Or should some headers (namely the multipart) be defined in the mailto URL format?
    In other words do you do: mailto:?subject=test&Content-Type=multipart/mix;%20boundary=myBoundary&body=--m yBoundary etc...
    Or id it: mailto:?subject=test&body=Content-Type=multipart/mix;%20boundary=myBoundary%20- -myBoundary etc..
    Neither seems to work for me so I am really stuck. But knowing what the right way is would help me figure things out a bit better.
    Thanks in advance

  • How to work with EEWB tool in CRM and how to assign it to PCUI

    Hi Friends,
    Can any body will suggest me how to work with EEWB tool in CRM to add new fields ,i need to attach the fields to a GUI screen and same to PCUI also,
    And how to attach a search help for those fields,is the tool will automatically will create the search helps or it is similar as we do in abap,
    So can any body suggest me to get a material on this ,
    Thaking you
    Regards
    Raghavendra Prasad

    Prasad
    Following are the steps involved in general :
    1. Select the filter Worklist and enter your name in the input field of the object list selection. Press the enter key. Your object list is displayed.
    2. Place your cursor on the highest node(PROJECT BY XXXXXX). Select Create project from the context menu by right-clicking on it. You see the dialog box Create project.
    3. Enter a project name, description, packages, and namespaces for each system used. Leave the dialog box by pressing the enter key.
    Specify transport requests. The Project is created and appears in the object list.
    4. Place your cursor on the new project in the object list and select Create extension in the context menu. You see the dialog box Create extension.
    5. Enter a name and description. Define a Business Object and extension type. Press the enter key.The extension is created and appears in the object list below the project.
    6. Place your cursor on the new extension in the object list and select Call wizard in the context menu. The wizard for the extension action starts automatically.
    7. Fill in the input fields following the notes on screen and end the wizard by clicking on Complete.The extension tasks have been created and appear in the object list.
    Project and extension are created !
    Also take care that you have the Transport Requests and Save the Project and Extensions against a Development Class !
    In general , EEW will automatically puts the fields on the Screen. We donot want to worry abt that !
    The generated BADIs can be implemented to do some Checks(for example) !
    I hope this helps !
    Thanks
    <b>Allot points if this helps !</b>

  • How to work with Premiere Pro cs5.5 and After Effects cs5 together?

    I have edited my movie in premiere pro cs5.5 and made the rough cut. In premiere, i have edited the video, put in soundtrack and foley. Now, i need to add muzzle flashes & blood splatters in some scenes and final color correction using After Effects cs5.
    When i import the premiere project in AE and make the changes, and then i export it back as premiere project. When i open this prmiere project, it shows vaious kind of errors and no changes are retained that i did in AE. Also, when i import the premiere project (which has 4 different sequences) in AE, all the media that has been imported in the premiere project also opens in AE making it difficult to organize the media.
    How should i work now so that i add vfx and color correction using AE cs5?
    I thought of exporting the video from Premiere pro and then open the video in AE and add vfx to some scenes and color correction to the full video and render it out again. But, this is the first time i am using AE and i am not sure if this is the best way. PLEASE HELP.
    Or, i could import the whole project in AE, add vfx, do color correction AND then export to video from AE. But i think, it will be better if i export the video from Premiere as it has loads of options to choose from while exporting to a movie.
    The dynamic link does not work between Premiere Pro Cs5.5 and After Effects cs5. Even if it does, its not working on my pc.
    All the footage is in HD and i want the final result in best quality HD too. PLEASE Help!

    If you are working between After Effects and Premiere Pro but with versions that are not the same number, you need to just work with movies rendered and exported as intermediate, lossless files.
    Dynamic Link only works between After Effects and Premiere Pro of the same version number, and only when they are installed as part of the same suite.

  • I am working with Acrobat XI and when I try to add text to geopdf file I get a popup screen that says this is a secured document and editing is not permitted. How do I fix this?

    I am working with Acrobat XI and when I try to add text to a geopdf file I get a popup screen that says this is a secured document and editing is not permitted. How do I fix this?

    I figured it out...needed to use comment tool set, not the editing tool set.

  • How do you copy, for example I work with blue prints and I want to copy a section and copy into another new page?

    How do you copy, for example I work with blue prints and I want to copy a section and copy into another new page?

    Forgot to add that it would be an adjustment layer with some kind of mask on it already. The mask is uncentered when copy and pasted which throws it off.
    I guess the same question would go towards doing the same for an object. How to copy and paste it over to a new doc, keeping its position within the document? is this possible?

  • Which version of camera raw will work with elements 9 and a Nikon D5100? How do I download photos to it?

    I have Photoshop Elements 9 and use a Nikon D5100.  I have downloaded camera raw 6.5 but cannot download photos to it.  Does camera raw start automatically or do I have to manual start it?

    That did I, thanks.
    99jon <[email protected]> wrote:
    99jon  created the discussion
    "Which version of camera raw will work with elements 9 and a Nikon D5100? How do I download photos to it?"
    To view the discussion, visit: https://forums.adobe.com/message/7178756#7178756
    >

  • How to work with DTR  and CBS?

    Hi
    I have designed one web dynpro application. Now I want to work on this application through DTR. Means i want to do versioning and all. How to work with DTR..? I have gone through lot of blogs and help available in SDN but i am unable to understand how to work with it.
    One more thing how to work with CBS. How to configure CBS. I have NWDS latest version 7.0.7. In window perspective i am unable to find JDI. can any one please explain me if u have worked on this with example
    If possible can any one send me the screen shots how to work with these ?
    Best Regards
    Ravi Shankar B

    Hi Ravi
    For you to work with DTR and CBS, firstly u will have to configure JDI on server.
    To configure the NWDI, please go through the links given below:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/07/f6bc3d42f46c33e10000000a11405a/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/71/0369404c65587ee10000000a155106/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/43/26b84d6c823f66e10000000a11466f/frameset.htm
    In Nutshell, following steps will be performed:
    1) logon to Portal Devinf.
    2) click on CMS
    3) Go to landscape configurator
    4) create domain
    5) create tracks and add Software components in that track
    6) runtime systems ( dev/qa etc are configured
    7) in the transport studio, all the files listed are checked in through check - in tab.
    8) they move to developement tab.
    Once all these things are done, in your NWDS:
    1) Setting the devbox host name and server port in Window -> Preferences -> SAP
    J2EE Engine
    2) Setting Portal URL in Window -> Preferences -> JDI -> DC Pool and ping server,
    to check whether server is getting accessed from NWDS.
    3) Once server is set, login to DTR and go to DTR perspective. Create a client there, by doing a right click and filling up the required details.
    4) In the DC perspective, in the Local DCs view, perform import configuration.
    5) the dev track is not configured
    6) Under this, after logging into DTR, now you can create your project, check them in and create new versions.
    Thanks & regards,
    Anupreet

  • I have Outlook 2011 installed on my Mac Pro, but I can not install it icloud. I can only get through imail, iCal and Address Book in Mac native anyone know teach me how to work with Outlook 2011 icloud? thank you

    I have Outlook 2011 installed on my Mac Pro, but I can not install it icloud. I can only get through imail, iCal and Address Book in Mac native anyone know teach me how to work with Outlook 2011 icloud? thank you

    "iCloud requires iOS 5 on iPhone 3GS or later, iPod touch (3rd and 4th generation), iPad, or iPad 2; a Mac computer with OS X Lion; or a PC with Windows Vista or Windows 7 (Outlook 2007 or 2010 or an up-to-date browser is required for accessing email, contacts, and calendars). Some features require a Wi-Fi connection. Some features are not available in all countries. Access to some services is limited to 10 devices."
    From here >  http://www.apple.com/icloud/

  • Correlation with request response port

    I created a correlation type and correlation set on the behalf of File.ReceivedFilName context property.
    I am getting the initializing correlation set property in the send port as follows:
    But in Receive Port I am not getting the Following correlation sets property as follows:
    Why this is occuring ?
    Am I doing something wrong ?
    Is correlation supports with request response  port ?
    Prakash

    Hi Prakash,
    When you drop the Receive shape in your Orchestration, you would see both the “Initializing Correlation Set” and “Following Correlation Set” properties for the Receive Shape (same case for the Send Shape).
     When you have linked the Receive Shape to the Request-Response port in your Orchestration (Request-Response port whose Port direction of communication is set to “I’ll be sending a request and receiving a response” property), the “Following
    Correlation Set” property for the Receive Shape disappears (same case for the send shape). Because you have connected the send/Receive shape to the two send port and BizTalk can in turn handle the correlation. You don’t need to specify the correlation set
    properties explicitly. These properties need to be configured only when you configure your send/Receive shape to one-way ports where you need to instruct BizTalk on how to handle the correlation not when you configure send/Receive shape to two way send port.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • BC eCart to work with mobile responsive.

    How set the BC eCart to work with mobile responsive.
    Web Site is already a responsive theme but the eCart comes from BC is not.
    I've been setting items in modulestyleesheets.css sizes to 100%, and float left but the cart wants to be very wide.
    http://www.firstnightva.org/fnv_store.html

    Hopefully these will help you:
    http://css-tricks.com/responsive-data-tables/
    http://elvery.net/demo/responsive-tables/

  • How to work with 360 video?

    I am new to AE and am trying to work with a 360 equirectangular video I shot with a Freedom 360 and 6 go pros.
    Are there any tutorials on how to work with 360 spherical videos? Do I need to download additional plugins?
    Thank you,
    Phil

    Phil,
    Of course, the image needs to be big for this, but the plugin you would use is CC Sphere.
    Drop your movie into a composition and apply CC Sphere to the video.
    Then set the Render option in the effect to "Inside".
    Under Shading set Ambient to 100% and Diffuse to 0%.
    Then scale inside the effect until the image fills the screen.
    Then you'll be able to use the Rotate Y controls in CC Sphere to spin around inside your video!
    You can also add Optics Compensation and Reverse the Lens Distortion to straighten out your image.
    Let me know if you have any questions!
    Trent

Maybe you are looking for

  • How do I limit the  number of emails showing in the inbox.  (iOS 7)

    When using iOS 6 I was able to limit the inbox emails under Mail, Show and pick the number I wanted. Can't find any control like this in Mail with iOS 7.

  • I can't see my view in new application

    Hi all! I create new application with integration Repository Framework. And create new view wich consist tree of my repository. But I received this error:(does anybody know what's happens?) com.sap.tc.webdynpro.services.exceptions.WDRuntimeException:

  • Flash Player Autoupdate Not Working On Any Of My Computers

    Hi there, have several computers on different networks. All Windows 7 (32bit), some installed from scratch, some with a image based solution, all on current Patch Level. Can't Autoupdate get to work on any of them... All have Version 11.2.202.235 Ins

  • How to do part of material's stock not valuated

    Hi ALL, I have a problem: For some of materials ( Material Type is FERT, Price Control 'S') part of stock is damaged. For example, Material xxxxxxx Total Stock Quantity - 100 Units Price per unit - 5 $ Good Quantity - 80 Un. Damage Qty - 20 Un. Stock

  • Is it possible to insert a playlist in the search field

    hi ! I want to purchase a playlist from spotify is it possible to paste this playlist in the search field, or do i have to paste one and one tune to get them all?