• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Object as a parameter

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 :
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic