Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / January 2005

Tip: Looking for answers? Try searching our database.

Change data in a bean

Thread view: 
AllIsPossible - 30 Jan 2005 08:45 GMT
Hi,

Sorry if this is a basic, simple, question :-P

I have a bean that retrieves data. I "set a property" for a field in
the bean that I would like to call ("the key") and it brings back the
data I want from the database - yippee!!

Now, I want to change what has been retrieved (using the bean) but it
looks as though before the .jsp is displayed *all* actions associated
with the use of the bean:

<jsp:useBean ...>
<bean:write ...
<jsp:setProperty name="....>

are executed BEFORE the display of the .jsp page (which really turns
into HTML). Is this the case? If so, then the only way that one can
change any data brought into the HTML page is when he/she hits the
SUBMIT button and the page goes to the server? Then, does that mean
that the bean is ONLY good for reading data INTO a page - in other
words, you can come in through the bean but you can't get out through
the bean?

That would be such a bummer :-|

TIA ..
Tom Dyess - 30 Jan 2005 21:35 GMT
> Hi,
>
[quoted text clipped - 23 lines]
>
> TIA ..

I'm not really sure what you're asking, but if you want to retrieve user
input from an HTML form, you need to go through either a submit button, or a
dynamicly created querystring with a redirect (which is kinda strange to me
for a form). Either of which need to be clicked and handled by a servlet or
jsp or whatever. That's just web architecture, you can't do much about that
unless you change from a HTML/JS container to an Applet or ActiveX or
something.

Signature

Tom Dyess
OraclePower.com

John C. Bollinger - 31 Jan 2005 14:00 GMT
This is not really about Javabeans, and certainly not about databases.
Followups directed to comp.lang.java.programmer.

> Hi,
>
[quoted text clipped - 14 lines]
> are executed BEFORE the display of the .jsp page (which really turns
> into HTML). Is this the case?

It depends what you mean.  In an HTML / HTTP setting, JSP is a
technology for dynamically creating HTML pages in response to HTTP
requests.  A JSP runs on the server, and the client only ever sees the
HTML results.  (This is much like other web scripting technologies such
as PHP and ASP.)  Thus, if you mean that bean manipulation happens
before the browser renders the page on the client then you're right.

>                                If so, then the only way that one can
> change any data brought into the HTML page is when he/she hits the
> SUBMIT button and the page goes to the server? Then, does that mean
> that the bean is ONLY good for reading data INTO a page - in other
> words, you can come in through the bean but you can't get out through
> the bean?

If you want to modify an HTML page on the client side (without making a
new request to the server) then you need to use a client-side
technology, such as Javascript.  Your JSP can very easily output
Javascript code as part of its HTML response.

Beans are useful for a wide variety of things in a JSP, but in that
context they are limited by the servlet request / response model.  That
does, however, mean that people without Java-enabled browsers can use
your JSPs.

John Bollinger
jobollin@indiana.edu


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.