|
 |
pro_jsp thread: Seprate Display logic from busniess logic in Jsp
Message #1 by "amitj" <amit_jeswani@d...> on Tue, 27 Aug 2002 11:37:27 +0530
|
|
I don't understand what you mean by the "same dynamisum", but if you mean
the same GUI based interface as your Swing application you'll need to use an
applet. You will have browser compatibility issues, IE users will need to
download and install Sun's JRE in order to view it.
Your question regarding how to present your information in JSP is very
broad. It depends on various factors. Is your current business logic in
Beans? If so they would be the obvious choice. Very basically, Beans use
Setter and Getter methods to calculate and return objects. For example you
could have a bean class called TableBean with a setTable method that queries
a database and generates an HTML table and stores it as a String, and a
getTable object that simply returns that String. You put a tag in your JSP
which tells it where the bean is:
<jsp:useBean id="TableBean" scope="page" class="beans.TableBean" />
Scope determines how long the bean persists, you can have page, response,
session or application scope.
The setProperty tag will pass parameters to the method in the bean, for
example to add to your SQL query of the database. You can use information
entered in forms here:
<jsp:setProperty name="TableBean" property="variable1" value="foo" />
Then you put a getProperty tag in your JSP where you want the table HTML
displayed:
<jsp:getProperty name="TableBean" property="table" />
Tag libraries or basic servlets are other possibilities, and you might want
to look into Struts as well. This is just the very basics, you can do a lot
more than this. You should get your hands on a good JSP book or tutorial on
the web.
Greg
-----Original Message-----
From: amitj [mailto:amit_jeswani@d...]
Sent: Tuesday, August 27, 2002 1:07 AM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] Seprate Display logic from busniess logic in Jsp
Hi!
I have a Java application built using swing. The aplication is working
perfectly fine, the busniess & Display logic is present in application
What is need is instead of showing the application in java envoirnemnt i
want to display it using jsp in browser with same dynamisum.
Can some1 tell me whats the best and fastest way to do it.
Is it Java beans if yes how to use it and how to retrive value from bean.
is there any other way?
Thanks in Advance for your suggestions.
Regards,
Amit Jeswani,
Software Engineer,
Decision Technologies (India) Pvt. Ltd.
www.dtindia.com
91-022-6901797/6844111
|
|
 |