Announcement Announcement Module
Collapse
No announcement yet.
Return an object in a view Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment


    • #3
      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

      Comment


      • #4
        Originally posted by cacho
        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

        Comment

        Working...
        X