aspose file tools*
The moose likes JSF and the fly likes Object as a parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Object as a parameter" Watch "Object as a parameter" New topic
Author

Object as a parameter

Ali Yuruz
Greenhorn

Joined: Oct 10, 2007
Posts: 8
Hallo,
Here is my JSF page. I try to send current HyperlinkBean Object to HyperlinkVerwalterObject.
It will be saved in that class. The class has a method which accepts HyperlinkBean as a parameter.

How is it possible? I didn't find any way to solve it..

Method in HyperlinkVerwalter:


JSF Page :


SCJP
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

A JSF View is (normally) rendered as HTML. HTML is a text-only format (no binary information). Objects are binary constructs.

That means that to pass an object on a web page (HTML View), you'd have to convert the object to text format as part of the page rendering process and convert the text representation of the object back to binary form when the page is submitted. And as a bonus, it won't actually be the same object as what you started with (so the "==" test fails).

Actually, in addition to the trouble and overhead, passing internal objects back and forth across web pages makes for a very insecure webapp, since a hacker can tinker with the object while it's on the client side.

More commonly, one would pass the identifier of an object and use that to reference the original object back on the server. Session-scope objects work that way, for example.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object as a parameter