Re: JSP/Servlet --EJB

2001-11-23 Thread Huaxin

But is this the way a JSP calling EJB?
the examples is just a JB, not EJB

On Fri, 23 Nov 2001, Ludovic Maitre wrote:

 you can instantiate a bean from a JSP page with the jsp:use-bean
 statements as mentionned in the example packaged with tomcat 4 (and 3).
 For more informations read the fine manual or specification of JSP on
 the Sun website (their tutorial are also very good).

 in tomcat 4, file webapps/examples/jsp/checkbox/checkresult :

 %! String[] fruits; %
 jsp:useBean id=foo scope=page class=checkbox.CheckTest /

 jsp:setProperty name=foo property=fruit param=fruit /
 hr
 The checked fruits (got using request) are: br
 %
 fruits = request.getParameterValues(fruit);
 %
 ul
 %
 if (fruits != null) {
   for (int i = 0; i  fruits.length; i++) {
 %
 ...

 regards,
 Ludovic.

 Huaxin wrote:
 
  A little bit off topic, sorry about that.
 
  I see most of the examples using EJB from Servlet.
  However, is there any example of using JSP with
  EJB directly? (without too much scriplet, and
  hopefully more efficient than create a bean to
  interact with the EJB)
 
  thanks a lot

 --
  [EMAIL PROTECTED]

  INRIA - 2004 route des lucioles - BP 93Tel: (33/0) 4 92 38 50 41
  06902   SOPHIA-ANTIPOLIS cedex (France)Fax: (33/0) 4 92 38 76 02

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




AW: JSP/Servlet --EJB

2001-11-23 Thread Lauer, Oliver

You can e.g. define a tag on your own that makes a lookup and a call to an
EJB whereas I believe it ain't gotta be well designed.


 AXA eSolutions GmbH
 AXA Konzern AG Germany
 Oliver Lauer 
 Web Architect
 Wörthstraße 34
 D-50668 Köln
 Germany
 Tel.: +49 221 148 31277
 Fax: +49 221 148 43963
 Mobil: +49 179 59 064 59
 e-Mail: [EMAIL PROTECTED]
 _
 


-Ursprüngliche Nachricht-
Von: Huaxin [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 23. November 2001 17:19
An: Tomcat Users List
Betreff: Re: JSP/Servlet --EJB


But is this the way a JSP calling EJB?
the examples is just a JB, not EJB

On Fri, 23 Nov 2001, Ludovic Maitre wrote:

 you can instantiate a bean from a JSP page with the jsp:use-bean
 statements as mentionned in the example packaged with tomcat 4 (and 3).
 For more informations read the fine manual or specification of JSP on
 the Sun website (their tutorial are also very good).

 in tomcat 4, file webapps/examples/jsp/checkbox/checkresult :

 %! String[] fruits; %
 jsp:useBean id=foo scope=page class=checkbox.CheckTest /

 jsp:setProperty name=foo property=fruit param=fruit /
 hr
 The checked fruits (got using request) are: br
 %
 fruits = request.getParameterValues(fruit);
 %
 ul
 %
 if (fruits != null) {
   for (int i = 0; i  fruits.length; i++) {
 %
 ...

 regards,
 Ludovic.

 Huaxin wrote:
 
  A little bit off topic, sorry about that.
 
  I see most of the examples using EJB from Servlet.
  However, is there any example of using JSP with
  EJB directly? (without too much scriplet, and
  hopefully more efficient than create a bean to
  interact with the EJB)
 
  thanks a lot

 --
  [EMAIL PROTECTED]

  INRIA - 2004 route des lucioles - BP 93Tel: (33/0) 4 92 38 50 41
  06902   SOPHIA-ANTIPOLIS cedex (France)Fax: (33/0) 4 92 38 76 02

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



Aus Rechts- und Sicherheitsgruenden ist die in dieser E-Mail gegebene Information 
nicht rechtsverbindlich. Eine rechtsverbindliche Bestaetigung reichen wir Ihnen gerne 
auf Anforderung in schriftlicher Form nach. Beachten Sie bitte, dass jede Form der 
unautorisierten Nutzung, Veroeffentlichung, Vervielfaeltigung oder Weitergabe des 
Inhalts dieser E-Mail nicht gestattet ist.Diese Nachricht  ist ausschliesslich fuer 
den bezeichneten Adressaten oder dessen Vertreter bestimmt. Sollten Sie nicht der 
vorgesehene Adressat dieser E-Mail oder dessen Vertreter sein, so bitten wir Sie, sich 
mit dem Absender der E-Mail in Verbindung zu setzen.

For legal and security reasons the information provided in this e-mail is not legally 
binding. Upon request we would be pleased to provide you with a legally binding 
confirmation in written form. Any form of unauthorised use, publication, reproduction, 
copying or disclosure of the content of this e-mail is not permitted. This message is 
exclusively for the person addressed or their representative. If you are not the 
intended recipient of this message and its contents, please notify the sender 
immediately.
---



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: JSP/Servlet --EJB

2001-11-23 Thread Ludovic Maitre

you can instantiate a bean from a JSP page with the jsp:use-bean
statements as mentionned in the example packaged with tomcat 4 (and 3).
For more informations read the fine manual or specification of JSP on
the Sun website (their tutorial are also very good).

in tomcat 4, file webapps/examples/jsp/checkbox/checkresult :

%! String[] fruits; %
jsp:useBean id=foo scope=page class=checkbox.CheckTest /
 
jsp:setProperty name=foo property=fruit param=fruit /
hr
The checked fruits (got using request) are: br
%
fruits = request.getParameterValues(fruit);
%
ul
%
if (fruits != null) {
  for (int i = 0; i  fruits.length; i++) {
%
...

regards,
Ludovic.

Huaxin wrote:
 
 A little bit off topic, sorry about that.
 
 I see most of the examples using EJB from Servlet.
 However, is there any example of using JSP with
 EJB directly? (without too much scriplet, and
 hopefully more efficient than create a bean to
 interact with the EJB)
 
 thanks a lot

-- 
 [EMAIL PROTECTED]

 INRIA - 2004 route des lucioles - BP 93Tel: (33/0) 4 92 38 50 41
 06902   SOPHIA-ANTIPOLIS cedex (France)Fax: (33/0) 4 92 38 76 02

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




JSP/Servlet --EJB

2001-09-11 Thread Huaxin

A little bit off topic, sorry about that.

I see most of the examples using EJB from Servlet.
However, is there any example of using JSP with
EJB directly? (without too much scriplet, and
hopefully more efficient than create a bean to
interact with the EJB)

thanks a lot





Re: JSP/Servlet --EJB

2001-09-11 Thread Craig R. McClanahan



On Wed, 11 Sep 2002, Huaxin wrote:

 Date: Wed, 11 Sep 2002 18:53:04 -0600 (Mountain Daylight Time)
 From: Huaxin [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: Tomcat User List [EMAIL PROTECTED]
 Subject: JSP/Servlet --EJB

 A little bit off topic, sorry about that.

 I see most of the examples using EJB from Servlet.
 However, is there any example of using JSP with
 EJB directly? (without too much scriplet, and
 hopefully more efficient than create a bean to
 interact with the EJB)


You could use beans or custom tags to interact with an EJB from inside a
JSP page.  However, wanting this leads me to believe that you wish to
intermix business logic and presentation logic in the page -- a practice
that is discouraged by the Model 2 architectural approach recommended by
most web application frameworks.  An example of a framework that lets you
maintain this separation is Struts http://jakarta.apache.org/struts/.

 thanks a lot

Craig






Re: JSP/Servlet --EJB

2001-09-11 Thread Bojan Smojver

Huaxin wrote:
 
 A little bit off topic, sorry about that.
 
 I see most of the examples using EJB from Servlet.
 However, is there any example of using JSP with
 EJB directly? (without too much scriplet, and
 hopefully more efficient than create a bean to
 interact with the EJB)
 
 thanks a lot

Every JSP eventually becomes a servlet, so there shouldn't be any
technical difficulties in doing that.

But, is this really the design you want to have? Embedding EJB call
machinery into JSP will make the code contain a lot of the stuff that
has nothing to do with presentation. Unless, of course, you're using the
JSP's for non presentational purposes here... But if you do, then
straight servlets or beans are a better choices anyway, therefore the
lack of examples :-)

Here is an article that explains the Model 2 architecture:
http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

Bojan



Re: JSP/Servlet --EJB

2001-09-11 Thread Huaxin

Thanks Craig and Bojan

I always kept the module 2 in mind, as well as efficiency. Using
JSP for presentation, forward request to Servlet, then forward to
EJB, and the same procedure back involves lots of overhead.

Using JSP for presentation, invoke a JSP bean, and from that
bean to EJB...  I think this is also module 2, but may be faster.

Using JSP for presentation, doing something else to EJB.. ? I am
eager to see this example. If it is not available, I would like to
see some examples of the JSP--JPS Bean--EJB solution.

Thanks again


On Wed, 12 Sep 2001, Bojan Smojver wrote:

 Huaxin wrote:
 
  A little bit off topic, sorry about that.
 
  I see most of the examples using EJB from Servlet.
  However, is there any example of using JSP with
  EJB directly? (without too much scriplet, and
  hopefully more efficient than create a bean to
  interact with the EJB)
 
  thanks a lot

 Every JSP eventually becomes a servlet, so there shouldn't be any
 technical difficulties in doing that.

 But, is this really the design you want to have? Embedding EJB call
 machinery into JSP will make the code contain a lot of the stuff that
 has nothing to do with presentation. Unless, of course, you're using the
 JSP's for non presentational purposes here... But if you do, then
 straight servlets or beans are a better choices anyway, therefore the
 lack of examples :-)

 Here is an article that explains the Model 2 architecture:
 http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc.html

 Bojan