[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: remoteID() use



On Wed, 01 Aug 2001, you wrote:
> Jose,
> 
> Understand that JSP is really a servlet created dynamically.  I work with servlets
> to do the same thing.  I make sure that the ID I send to the HTML form is the "name"
> ozone expects in objectForName(), then when ever a page is submitted the servlet
> opens a connection to the ozone database and (very simplified) gets the proxy object
> using objectForName().  In a JSP you just have to understand how the JSP code has to
> be written so that it behaves the same way a servlet would.  My recomendation would
> be to have a servlet handle the web server connections so you don't have to
> duplicate so much code.  I say this because each JSP page would have to use the same
> exact code to connect to ozone and perform the database access.  Let me know if you
> need any code examples.

Using names is one solution. should work without problems but produces many
names. Probably you would need to generate the names but then the names act
like IDs which is not intended.

If you know the the type of the proxy you can simple do something like:

	long id = // get it from the request params	
	Car car = (Car)new CarImpl_Proxy(new ObjectID(id), db );

Note that this is not totally future proof. ObjectID is not part of the client
API and _may_ (not very likely) change in the future which could break this
code. 

David has started an effort to provide a client API version of the ObjectID
which should provide a robust object handle/reference that can be send between
VMs or made persistent outside the server etc. David?


Falko

> 
> Tim
> 
> 
> José Carlos Meira e Silva wrote:
> 
> > How can I (client side) get an OzoneProxy from an remoteID. This is because
> > I am using JSP and I send to the clients collections of pairs
> > ObjectId+string field. When the client submit the form I receive the
> > ObjectID value and, then, I must restore the selected object.
> >
> > José Carlos Meira
> >
> > ----------------------------------------------------------------------
> > Post a message:         mailto:ozone-users@ozone-db.org
> > Unsubscribe:            mailto:ozone-users-request@ozone-db.org?body=unsubscribe
> > Contact administrator:  mailto:ozone-users-owner@ozone-db.org
> > Read archived messages: http://www.ozone-db.org/
> > ----------------------------------------------------------------------
> 
> ----------------------------------------------------------------------
> Post a message:         mailto:ozone-users@ozone-db.org
> Unsubscribe:            mailto:ozone-users-request@ozone-db.org?body=unsubscribe
> Contact administrator:  mailto:ozone-users-owner@ozone-db.org
> Read archived messages: http://www.ozone-db.org/
> ----------------------------------------------------------------------
-- 
______________________________________________________________________
Falko Braeutigam                              mailto:falko@smb-tec.com
SMB GmbH                                        http://www.smb-tec.com

----------------------------------------------------------------------
Post a message:         mailto:ozone-users@ozone-db.org
Unsubscribe:            mailto:ozone-users-request@ozone-db.org?body=unsubscribe
Contact administrator:  mailto:ozone-users-owner@ozone-db.org
Read archived messages: http://www.ozone-db.org/
----------------------------------------------------------------------