Results 1 to 4 of 4

Thread: Return an object in a view

Hybrid View

  1. #1

    Default Return an object in a view

    Hi

    I need to return an object in a view (an ObjectOutputStream, for example).

    Is this possible ? How ?


    Thanks in advance

    C

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney
    Posts
    503

    Default

    Can you elaborate on what you're trying to do? What's in the ObjectOutputStream?

    If you want to build your own view, just subclass org.springframework.web.servlet.view.AbstractView, and then in your controller do something like this:

    Map myModel = new HashMap();
    myModel.put("blah", "xyz");
    return new ModelAndView(new MyView(myObjectOutputStream), myModel);

    You might need to explain what you're doing a bit more.

  3. #3

    Default

    Quote Originally Posted by gmatthews
    Can you elaborate on what you're trying to do? What's in the ObjectOutputStream?

    If you want to build your own view, just subclass org.springframework.web.servlet.view.AbstractView, and then in your controller do something like this:

    Map myModel = new HashMap();
    myModel.put("blah", "xyz");
    return new ModelAndView(new MyView(myObjectOutputStream), myModel);

    You might need to explain what you're doing a bit more.
    Thanks for your reply.

    My application will do the following:

    1 - Retrieve some data from a DB
    2 - Create a model with this data
    3 - Send it as an object stream

    This will be retrieved by a desktop application using a rpc axis webservice call.

    I' m now using webflow to process the request and as webflow use modelandevents I wonder how can I do what you told me....

    C

  4. #4
    Join Date
    Jul 2005
    Posts
    246

    Default

    Quote Originally Posted by cacho
    Quote Originally Posted by gmatthews
    Can you elaborate on what you're trying to do? What's in the ObjectOutputStream?

    If you want to build your own view, just subclass org.springframework.web.servlet.view.AbstractView, and then in your controller do something like this:

    Map myModel = new HashMap();
    myModel.put("blah", "xyz");
    return new ModelAndView(new MyView(myObjectOutputStream), myModel);

    You might need to explain what you're doing a bit more.
    Thanks for your reply.

    My application will do the following:

    1 - Retrieve some data from a DB
    2 - Create a model with this data
    3 - Send it as an object stream

    This will be retrieved by a desktop application using a rpc axis webservice call.

    I' m now using webflow to process the request and as webflow use modelandevents I wonder how can I do what you told me....

    C
    If you're calling it via Axis then you don't need to (shouldn't) create a serialized object. SOAP handles the serialization/de-serialization for you. The problem with ObjectOutputStream is that if your users on the desktop have a different JVM version than your server then they may not be able to read the stream. SOAP handles that for you transparently.

    You should just be able to send the HashMap via SOAP without serializing it manually first.

    Bob

Similar Threads

  1. Replies: 9
    Last Post: Nov 1st, 2005, 10:36 PM
  2. Replies: 2
    Last Post: Oct 10th, 2005, 05:12 PM
  3. Odd behaviour when injecting TransactionTemplate
    By damon311 in forum Container
    Replies: 3
    Last Post: Jul 23rd, 2005, 11:21 AM
  4. Loosing my SecureContext
    By sklakken in forum Security
    Replies: 3
    Last Post: Jul 21st, 2005, 01:44 PM
  5. Replies: 0
    Last Post: Jan 6th, 2005, 08:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •