RE: Scalability

2001-08-09 Thread Kevin McLain

The only thing I would add to your argument is the fact that Struts relies
fairly heavily on Reflection to set attributes on beans. Since Reflection
incurs a much higher overhead than a straight method call (although I have
heard that JDK 1.4 improves this performance considerably) - I did a rough
test and found that this could be as much as three times as long - it could
become a scalability issue as well...

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 09, 2001 7:46 AM
To: [EMAIL PROTECTED]
Subject: RE: Scalability


 but I'm getting feedback from other developers that don't
 feel that Struts is a very scaleable framework.

What exactly are they saying? I don't have any personal
experience in this area but it seems to me that Struts is a
rather thin layer on top of normal Java Servlets. All
it really changes is that two pages (Model and View) are
called instead of the usual one. The other features don't
seem like the kind of things that would affect scaleability.
So any criticism of Struts should probably be generalizable
(if that's a word ;-) to Servlets if it's got any validity.
Please send more details.

Devon




RE: unsubscribe !!!!!!!!!!!!!!!!!!!!!!

2001-08-07 Thread Kevin McLain

unsubscribe

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Siping Liu
Sent: Tuesday, August 07, 2001 10:05 AM
To: [EMAIL PROTECTED]
Subject: unsubscribe !!


please unsubscribe me




RE: save dynamic jsp content

2001-08-01 Thread Kevin McLain

This will get you an input stream containing the content for the resource. 

try {
Url url = new Url(PATH_TO_RESOURCE_HERE);
InputStream is = url.openStream();

// use input stream to get content to pass through SMTP session

} catch (MalformedURLException ignored) {
} catch (IOException ignored) {
} finally {
try { 
is.close(); 
}
catch (IOException ignored) {
}
}


-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 11:07 AM
To: [EMAIL PROTECTED]
Subject: Re: save dynamic jsp content


The easiest way would be to write a client that makes a HTTP request to
the server and captures the HTML output that way.

Calvin


On 01 Aug 2001 13:40:58 -0400, Mustapha Essalihe wrote:
 
 Hi,
  I am new to struts. In my action class (perform) I want to run a jsp
page
 in background and save its content in  an html file. How Can i do that
in
 perfom method ?. After that i know how i will send this html file by
e-mail
 (usinj java smtp) and forward the user to an adequate location
(success).
 Thanks in adavance.
 Mustapha Essalihe
 





Reflection vs. Direct Method Call

2001-07-26 Thread Kevin McLain

Hello All,

Just a general performance question

Does anyone know the performance difference between a direct method call and
introspection like Struts uses? I would be interested in hearing the
differences for different Java implementations (I have heard that JDK 1.4
will be making huge improvements in this area) because I have heard that
there can be significant differences. The application I am considering using
Struts with would require large amounts of numerical data to be posted
through the introspection and therefore if introspection performance is a
problem I would have to choose another framework or roll my own.

Thanks for any help,

Kevin

-Original Message-
From: Andreas Amundin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 26, 2001 2:50 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Use of form beans - design issue...


First let me preface with the fact that I have been dabbling with struts for
about 6 weeks, so please take what I say with a grain of salt.  And anyone
else out there please correct me if I am wrong.

See my inserted replies below.

 From: Burleson, Thomas [mailto:[EMAIL PROTECTED]]
snip
 Currently -- as I understand it -- the ActionForm (bean) is
 populated by the ActionServlet using introspection. And the
 Bean is then used by the Action (handler) to modify/update
 the business
 layer or model data. Then the actionForward is used to
 indicate which JSP the Servlet should forward/dispatch to.
 The page (which could be a different JSP page or the same
 used for the request) then searches for the ActionForm (bean)
 and creates one if it does not exist in the request scope.

This is where my understanding differs.  As I understand it the ActionForm
is created by the JSP if none exists.  As far as I know it is possible to
directly load a JSP page with a form without invoking any pre-processing
action servlet.

 So (finally) here is the issue:
 The controller and handler uses a dumb bean to modify the
 model (MVC). Cool!
 But to gather information for use on a JSP, the bean must
 know how to gather that data from
 the business layer (model). BAD!!

Following your understanding of how things work I completely agree with what
you are writing above.

However, let me now state that I don't think beans used in a JSP should ever
have any dependencies on the model.  IMHO beans for use in JSPs should be
dumb holders of information.  They are the input and output parameters of
the JSP.  To populate beans for a JSP a pre-processing action servlet should
use model classes or EJB entity beans.  The action servlet controls how
information from the model is propagated to the view.

 The handler should configure the bean BEFORE dispatching to
 the JSP. This way, the bean remains
 dumb and the handler centralizes all knowledge of the
 business layer.

Exactly.

 Struts seems to use 2 different patterns/approaches: the
 incoming processing is very different than the processing
 used during display of the JSP.

I would say Struts have an approach for incoming, from the form, processing
that automatically populates the form bean with the information from the
form.

For the processing during the display of a JSP all that happens is that the
form bean is created if one cannot be found.  The found form bean, newly
created or not, is used to populate the default values of the form.

I hope this explanation makes sense.

Andreas




RE: Missing type on declaration - any poniters 1 error left

2001-07-25 Thread Kevin McLain

You need to close the brace on your class declaration I believe.

Like this:

  public class ActionForward {
 
public perform(ActionMapping mapping,
ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
{
  try {
  javax.sql.DataSource dataSource =
  servlet.findDataSource(null);
  java.sql.Connection myConnection =
  dataSource.getConnection();
 
  //do what you wish with myConnection
  } catch (SQLException sqle) {
  getServlet().log(Connection.process, sqle);
  } finally {
 
  //enclose this in a finally block to make
  //sure the connection is closed
  try {
  myConnection.close();
  } catch (SQLException e) {
  getServlet().log(Connection.close, e);
  }
  }
  }
 } -- Add this brace here

-Original Message-
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 7:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Missing type on declaration - any poniters 1 error left



I think your compiler can't find the initial class declaration.  Chances
are your actual syntax error occured before that line.  Make sure you
don't have too many '}' and that you're making a valid class
declaration.

It seems that a lot of your problems has more to do with your
understanding of Java than with Struts.  You might want to check out
some general java language message groups, as they might be better at
explaining the problems you are experiencing.

Calvin



On 25 Jul 2001 12:51:08 +0100, Chuck Amadi wrote:
 Hi i have got it done to 1 error as below


 webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java
 [9:1] 'class' or 'interface' keyword expected.
 public ActionForward  perform (ActionMapping mapping,
^
 1 error
 Errors compiling ActionForward.

 Chuck Amadi wrote:
 
  Hi, can someone take a peek at my ActionFoward Class

 --
---
 
webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java
  [10:1] Missing type on declaration
  public perform(ActionMapping mapping,
^
 
webapps/bbnpa/WEB-INF/classes/org/apache/struts/action/ActionForward.java
  [35:1] Type expected or missing '}'
  ^
  2 errors
  Errors compiling ActionForward.
 

 --
---
 
  package classes.org.apache.struts.action;
 
  /*Accessing Relational Databases
   *Struts can define the datasources for an application from within its
  standard configuration file. A simple JDBC connection pool is also
  provided.
   *See The Action Mappings Configuration File section and the Utilities
  Developer Guide for details.
   *After the datasource is defined, here is an example of establishing a
  connection from within a Action perform method.*/
 
  public class ActionForward {
  public perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response){
  try {
  javax.sql.DataSource dataSource =
  servlet.findDataSource(null);
  java.sql.Connection myConnection =
  dataSource.getConnection();
 
  //do what you wish with myConnection
  } catch (SQLException sqle) {
  getServlet().log(Connection.process, sqle);
  } finally {
 
  //enclose this in a finally block to make
  //sure the connection is closed
  try {
  myConnection.close();
  } catch (SQLException e) {
  getServlet().log(Connection.close, e);
  }
  }
  }
 
  The path is C:/jakarta-tomcat-3.2.2/webapps/bbnpa/WEB-INF/classes/
  do i need to creatE a base dir i.e
 
C:/jakarta-tomcat-3.2.2/webapps/bbnpa/action/WEB-INF/classes/org/apache/stru
ts/action/ActionForward
  Cheers Chuck
  --
  The views expressed by the sender of this message don't
  necessarily represent those of Brecon Beacons National Park
  Authority. This message is intended for the addressee(s) only
  and is sent in confidence; if you receive it in error, please can you
  let us know (at [EMAIL PROTECTED]) and then destroy all copies.
  Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
  adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
  Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
  yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
  mewn camgymeriad, a fyddech gystal â rhoi gwybod i
  ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.

 --
 The views expressed by the sender of this message don't
 necessarily represent those of Brecon Beacons National Park
 

RE: newbie question

2001-07-25 Thread Kevin McLain



What 
steps did you take to get to that point? What web container are you 
using?

  -Original Message-From: Jonathan Yang 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, July 25, 2001 
  8:35 PMTo: strutsSubject: newbie 
  question
  Hi,all
   
   Why can't correctly run the 
  "struts-example"?
  When I click the url in 
  index.jsp,it throw the a error like 
  following:
  "The requested 
  URL /struts-example/tour.do;jsessionid=5ox6pc4q91 
  was not found on this server."
  
   why? pls help me, thx. 

  
  Regards,Jonathan
   



Concurrency with ActionForms

2001-07-18 Thread Kevin McLain

Does anybody know how Struts handles concurrency when it uses Reflection to
update ActionForm attributes? I am assuming that it doesn't but this can be
problematic if, in the case of a web application, you have two browser
windows - for the same session (this can de done in IE but opening a new
browser window from inside a current one) - accessing the same session
object concurrently. Just wondering

Cheers,

Struts Newbie