Re: Global values as Tag parameters....How???

2001-06-27 Thread Calvin Yu



I imagine you'll have to parse that attribute 
yourself and use reflection to get that value.  I don't think Struts has 
support for this.  It might be difficult to keep it generic however, since 
I don't think there is way you can access the imports that are declared in a JSP 
page.
 
Of course, there's always this:
 

 
Calvin

  - Original Message - 
  From: 
  Jonathan 
  
  To: [EMAIL PROTECTED] 
  
  Sent: Wednesday, June 27, 2001 10:03 
  AM
  Subject: Global values as Tag 
  parametersHow???
  
  I am creating a custom Struts tag which needs to 
  search for an object in a HashMap.  I want the 'key" for the object in 
  the HashMap to be some agreed upon, pre-defined, final global value defined in 
  a file available to the whole application.  How do I refer to this value 
  in a Tag attribute?
   
  eg.
  
   
  where "Globals.MESSAGES_OBJECT" is some static 
  final variable in a file


Re: Fast Hashmap doubt .

2001-07-02 Thread Calvin Yu



If you look at FashHashMap.get(Object key), you'll 
notice that the call to map.get() is not synchronized.  If 
FashHashMap.put() isn't implemented like this, you'll run into a race condition 
when one thread calls map.put() and another calls map.get().
 
Calvin

  - Original Message - 
  From: 
  suhas 
  To: [EMAIL PROTECTED] 
  
  Sent: Saturday, July 01, 2000 5:47 
  AM
  Subject: Fast Hashmap doubt .
  
  I was going through put ( ) and putAll ( ) 
  methods in Fast HashMap code in the struts . But did not get why we need to 
  clone the HashMap and add a entry to that cloned map then move that cloned map 
  to original HashMap . In multi- threaded enviornment anyway we synchronized 
  the code that accesses the HashMap in the put method .. ?
   
      public Object put(Object key, 
  Object value) {
   
      if 
  (fast) {    
  synchronized (this) {            
                  
                  // 
  IF U synchronize the code like this then easily only one thread can 
  manipulate the HashMap
      
  HashMap temp = (HashMap) map.clone();        // 
  What this do then 
  ?    
  Object result = temp.put(key, value);        
          
  //    
  map = 
  temp;   //    
  return 
  (result);    
  }    } else 
  {    
  synchronized (map) 
  {    
  return (map.put(key, 
  value));    
  }    }
   
      }
   
   
   
   


Re: pls Help Invalid Package Declartions .java File Wont compile

2001-07-02 Thread Calvin Yu



What is it exactly are you trying to do?  
Compile?  Run a webapp?  What is the exact error output you are 
getting?
 
Calvin

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  
  Sent: Monday, July 02, 2001 8:30 AM
  Subject: pls Help Invalid Package 
  Declartions .java File Wont compile
    Hi, Can anyone suggest why i might be 
  recieving the following invalid package declarations. My Path as 
  follows- C:\jakarta-tomcat-3.2.1\webapps\bbnpa\ thus continued- 
  WEB-INF\classes\org\breconbeacons\it\java(classes). Thus i am 
  aware that they haven't compiled to .class file any help would be extremly 
  recieved this has been posted a few times so i assume this is a difficult 
  enquiry . I have ensured the jar files ,tld ( xml ),package title and 
  declarations are in order. So if anyone out there has 
  got a poniters giv's us some hlep 
  Cheers Chuckie -- 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.   



Re: SV: pls Help Invalid Package Declartions .java File Wont compile

2001-07-03 Thread Calvin Yu



Well, one problem I see is that your class is 
declared as ApplicationMapping and the name of your .java file is 
ActionMapping.java.  Either change the class declaration or rename the java 
file.  If that doesn't fix your other problems, then it means that javac 
can't find the struts libraries.
 
Calvin

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  
  Sent: Tuesday, July 03, 2001 6:55 
AM
  Subject: Re: SV: pls Help Invalid Package 
  Declartions .java File Wont compile
  Basic Q, I have concluded that Web Applications handlers must 
  reside in one of the following standard locations for java classes:- 1) in 
  a JAR file in the WEB-INF\l ib dir. 2) in a dir in the \WEB-INF\ classes 
  dir. 3) checked xml file for the necessary tld's look ok (pls state any 
  ambiguous code/typo problems that could cause Invalid Package Declarations). 
  4) gone over typo's and snippets.   
  Thus my java .file's confirm to the above have declared my package's and 
  imports with the correct syntax. i.e. Capitol letter to begin name of java 
  class also name within the file itself. The package path is as follows 
  WEB-INF\classes\org\breconbeacons\it\ActionMapping. The name within the 
  .java file is package org.breconbeacons.it; within this java file i 
  have an import declaration as below import 
  org.apache.struts.action.ActionMapping; 
  Hence i receive the following errors 
  WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [66:1] Class 
  ActionMapping not found in type declaration or import. import 
  org.apache.struts.action.ActionMapping; 
      
  ^ WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [85:1] 
  Class ActionMapping not found in type declaration or import. public 
  final class ApplicationMapping extends ActionMapping { 
    
  ^ WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [85:1] 
  Public class org.breconbeacons.it.ApplicationMapping is defined in 
  C:\jakarta-tomcat-3.2.1\webapps\bbnpa\WEB-INF\classes\org\breconbeacons\it\ActionMapping.java 
  and must be defined in a file called "ApplicationMapping.java". 
  public final class ApplicationMapping extends ActionMapping { 
     
  ^ 3 errors Errors compiling ActionMapping. 
  Chuck Amadi wrote: 
  Hi, here is a copy of my clipboard. 
 Cheers Chuckie 
WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [66:1] 
Class ActionMapping not found in type declaration or import. 
import org.apache.struts.action.ActionMapping; 
    
^ WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [85:1] 
Class ActionMapping not found in type declaration or import. 
public final class ApplicationMapping extends ActionMapping { 
  
^ WEB-INF/classes/org/breconbeacons/it/ActionMapping.java [85:1] 
Public class org.breconbeacons.it.ApplicationMapping is defined 
in 
C:\jakarta-tomcat-3.2.1\webapps\bbnpa\WEB-INF\classes\org\breconbeacons\it\ActionMapping.java 
and must be defined in a file called "ApplicationMapping.java". 
public final class ApplicationMapping extends ActionMapping { 
   
^ 3 errors Errors compiling 
  ActionMapping.
  HELP I can't think of anything else why my .java files won't comile 
  into .class files.+ Cheers Chuckie 
    
Mikkel Bruun wrote: 
>    Part 1.1    Type: Plain Text 
(text/plain) 
>    
Encoding: quoted-printable 
-- 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 dilwch 
bob copi.
  -- 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ëw

Re: question in user state management using Session

2001-07-03 Thread Calvin Yu



Try HttpServletRequest.getCookies()
 
Calvin

  - Original Message - 
  From: 
  suhas 
  To: [EMAIL PROTECTED] 
  
  Sent: Tuesday, July 03, 2001 9:15 
AM
  Subject: Re: question in user state 
  management using Session
  
  Thanks Jon but I want some  more 
  clarification .
  I just want to show one of my friend that 
  
  the browser sends the unique id back to the 
  server .  That's the reason I was printing the request header keys from 
  the browser . ( It wil be returned to the server if Server had set that using 
  request.getSession() method before ) .  But  printing those request 
  parameters does not show such key ???
  How can I prove that  ??
   
  Suhas 
   
   
   
   
   
   
  
- Original Message - 
From: 
Jon.Ridgway 
To: [EMAIL PROTECTED] 

Sent: Tuesday, July 03, 2001 9:45 
AM
Subject: RE: question in user state 
management using Session


Hi Suhas,
 
You might try 
something like this:
 
HttpSession session = request.getSession();
 
If (session != null)
{
   id = 
session.getId();
}
 
Hope this 
helps,
 
Jon.
 
 
-Original 
Message-From: suhas 
[mailto:[EMAIL PROTECTED]] 
Sent: 03 July 2000 
12:28To: [EMAIL PROTECTED]Subject: question in user state 
management using Session
 

Hi 


I want to know the http request 
header key  -

 

I'm writing 
request.getSession(true)  in the jsp .  This method 
in turn might be settting the browser header key .( dunno exactly name of 
that key) .But I think that header key is "set-cookie = 12313 " ( 
this can be the unique session id that server has to set for 
identifying a user) .

So whenever server receives this 
key in the http request , server identifies the user , if the key is present 
in the request

 

 Server checks the 
hashtable stored in the server  and retrieves the information 
for that 

 

In another jsp page I tried to 
print all the request header keys , But there wasn't any such key found . 
?

 

Can u tell how to check for that 
key 

 

 


Re: SV: pls Help Invalid Package Declartions .java File Wont compile

2001-07-03 Thread Calvin Yu

Is struts.jar in WEB-INF/lib?  If so, check to make sure
ActionMappings.class is in it.  The package name is correct, its just that
javac cannot find the struts.jar.

Calvin

- Original Message -
From: "Chuck Amadi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 03, 2001 9:13 AM
Subject: Re: SV: pls Help Invalid Package Declartions .java File Wont
compile


> Hi, pls can some one confirm the package name for ActionMappings as i
> recieve the following error.
>
> I am aware that i have the incorrect package thus were does ActionMappings
> reside.
> Cheers Chuck
>
> WEB-INF/classes/logon/LogonForm.java [70:1] Class ActionMapping not found
> in type declaration or import.
> import org.apache.struts.action.ActionMapping;
> ^
> WEB-INF/classes/logon/LogonForm.java [69:1] Class ActionForm not found in
> type declaration or import.
> import org.apache.struts.action.ActionForm;
> ^
> WEB-INF/classes/logon/LogonForm.java [68:1] Class ActionErrors not found
in
> type declaration or import.
> import org.apache.struts.action.ActionErrors;
> ^
> WEB-INF/classes/logon/LogonForm.java [67:1] Class ActionError not found in
> type declaration or import.
> import org.apache.struts.action.ActionError;
> ^
> WEB-INF/classes/logon/LogonForm.java [85:1] Class ActionForm not found in
> type declaration or import.
> public final class LogonForm extends ActionForm {
>  ^
> WEB-INF/classes/logon/LogonForm.java [159:1] Class ActionMapping not found
> in type declaration or import.
> public void reset(ActionMapping mapping, HttpServletRequest request) {
>   ^
> WEB-INF/classes/logon/LogonForm.java [177:1] Class ActionErrors not found
> in type declaration or import.
> public ActionErrors validate(ActionMapping mapping,
>^
> WEB-INF/classes/logon/LogonForm.java [177:1] Class ActionMapping not found
> in type declaration or import.
> public ActionErrors validate(ActionMapping mapping,
>  ^
> 8 errors
> Errors compiling LogonForm.
>
> Chuck Amadi wrote:
>
> > Hi, pls could anyone confirm the ActionMappings package & ActionForward
> > package name within WBE-INF\classes\. dir as im lead to believe this
> > might be the cause of my problems.
> >
> > Chuck Amadi wrote:
> >
> > >Part 1.1Type: Plain Text (text/plain)
> > >Encoding: 8bit
> >
> > --
> > 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 dilwch bob copi.
>
> --
> 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.
>



Re: pls help java files wont compile - take a look ****

2001-07-05 Thread Calvin Yu

Chuck,

This error in NetBeans is due some other compilation error or some problem
with the way your source is setup in the project.  I would recommend that
you do *not* use NetBeans for now and try to figure this thing out via the
command line.  Also, one problem you might be having is that your java files
have a package declaration of 'org.apache.struts.action' and your file is in
/WEB-INF/classes/example.  It should be in
/WEB-INF/classes/org/apache/struts/action.

In any case, using NetBeans and describing how it is behaving for you is not
giving me enough information about what exactly your problem is.  If you
could try to compile it via the command line (via ant preferrably), that
should give me the sufficiently data I need to fix your problem.

Calvin


- Original Message -
From: "Chuck Amadi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 05, 2001 5:56 AM
Subject: Re: pls help java files wont compile - take a look 


> Hi, can anyone work this one out visual attached.
> Cheers Chuck.
>
> Chuck Amadi wrote:
>
> >Part 1.1Type: Plain Text (text/plain)
> >Encoding: 8bit
>
> --
> 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.
>
>



Re: Java files won't compile- compilation errors/utlise Ant's

2001-07-10 Thread Calvin Yu

I'm not sure why you'll need to download netbeans, but instead of tomcat you
can get servlet.jar from
http://jakarta.apache.org/builds/jakarta-tomcat/release/v3.2.2/bin/jakarta-s
ervletapi-3.2.2.zip

I don't think that you'll need optional.jar, as the 

Re: SV: just d/l & installed ANT'S need some guidance!!

2001-07-11 Thread Calvin Yu

It doesn't look like you're using the right ant.bat file.  Did you modify
it, or are you using an ant.bat that you wrote yourself?  Make sure you use
/bin/ant.bat.  Try fully declaring it ([prompt:]
C:\jakarta-ant-1.3\bin\ant.bat).  It you're still seeing the problem, send
me the ant.bat file.

Calvin

- Original Message -
From: "Chuck Amadi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 11, 2001 10:15 AM
Subject: Re: SV: just d/l & installed ANT'S need some guidance!!


> I have since removed the TOMCAT_HOME path that resulted the fact that my
> classpath is directing towards the tool.jar.
>
> I haven't got a tool.jar in the ant dir.
> Cheers Chuck.
>
>
> Peter Alfors wrote:
>
> > print out your classpath and see which ant.jar is being used.
> >
> > Pete
> >
> > Chuck Amadi wrote:
> >
> > > Oops forgot to mention that i am running Netbeans v 3.2.2 wereby ant's
is
> > > apparently alreay bundled nevertheless i would like a standalone , as
the
> > > ant 1.3 download is the current realease.
> > > Anyway would this cause any problems .
> > > Cheers Chuck
> > >
> > > Mikkel Bruun wrote:
> > >
> > > > please post the exception so we can look into it...
> > > >
> > > > Mikkel
> > > >
> > > > -Oprindelig meddelelse-
> > > > Fra: Chuck Amadi [mailto:[EMAIL PROTECTED]]
> > > > Sendt: 11 July 2001 14:43
> > > > Til: [EMAIL PROTECTED]
> > > > Emne: Re: just d/l & installed ANT'S need some guidance!!
> > > >
> > > > Hi, tried that and just ant from the ms-dos command line and got
> > > > Exception in Thread - I assume that i have a classpath issue
regarding
> > > > multithreading .
> > > > Any Suggestions Cheers Chuck
> > > >
> > > > suhas wrote:
> > > >
> > > > >Part 1.1Type: Plain Text (text/plain)
> > > > >Encoding: quoted-printable
> > > >
> > > > --
> > > > 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 dilwch bob copi.
> > >
> > > --
> > > 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 dilwch bob copi.
>
> --
> 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.
>
>




Re: XML/XSL/Struts Architecture

2001-07-11 Thread Calvin Yu

You are aware that there are other ways to do this, instead of using XSL,
right?  One way would be to use taglibs that makes a call to include a
client-specific form.  I'm not sure if your reason is good enough to use
XSL.

Calvin


- Original Message -
From: "Mahesh Bhagia" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 11, 2001 12:34 PM
Subject: RE: XML/XSL/Struts Architecture


Hi Greg,

we are planning to use XSL because structure of HTML forms will differ
on client basis.


-Original Message-
From: Greg Reddin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 10:16 AM
Subject: RE: XML/XSL/Struts Architecture


Using XSL, you can recreate the majority of what the taglibs do.
However, that
begs the question of why you would use XSL in the first place.  I've
worked on a
Struts-based XSL project for about 6 months now, and we've had to
recreate so
much of the Struts functionality in our architecture that we find
ourselves
always asking why we're doing this.  Our data comes from the backend in
XML, so
it seemed logical to leave it in XML and use the parsers to access it.
But the
parsers (Xalan/Xerces) turn out to be a lot of overhead and got in our
way quite
a bit.  I'd like to go back and convert it to JSP.

-Original Message-
From: [EMAIL PROTECTED] at INTERNET
Sent: Wed 7/11/2001 3:41 AM
To: Reddin, Greg; [EMAIL PROTECTED] at INTERNET
Cc:
Subject: RE: XML/XSL/Struts Architecture



Hi Mahesh,
We have started using Struts for an application that uses XSP/XML/XSL
(using
Cocoon).  Instead of specifying a  JSP page in the struts configuration
file
we specify a XSP page.  This server page is responsible for getting XML
data
from some data object set up in the action classes (we are using
attributes
in the session object for now).  We also have extended ActionMapping to
allow us to specify the XSL stylesheet in the struts configuration file.
You are right about the use of tag libraries - that is one aspect of
struts
that you potentially lose out on using the above approach.
Regards,
John


> -Original Message-
> From: Mahesh Bhagia [SMTP:[EMAIL PROTECTED]]
> Sent: 10 July 2001 17:24
> To: Apache Struts (E-mail)
> Subject: XML/XSL/Struts Architecture
>
> Hi,
>
> In our application, we are using XML/XSL to generate JSP and plan to
use
> Struts for submitting data from HTML forms. Has anyone used / know
> if this architecture works. my thinking is ( correct me if wrong ) ,
we
> will not be able to use tag libraries coz of XML/XSL combination for
> generating pages. unique thing about this application is structure of
> HTML is different for each client.
>
> Thanks
> Mahesh
>
>




Re: XML/XSL/Struts Architecture

2001-07-11 Thread Calvin Yu


I had a similar problem, where the backend delivered model data in an XML
format.  We initially used XML/XSL, but we later went with JSPs.  What I did
to handle the XML data was write some taglibs that accessed XML data via
XPath.  I also wrote a taglib that will perform an XSL transformation and
include the resulting output to a JSP, which was used for handling the more
complexed XML structures.  I don't have any source code (as I'm not working
at that company any more), but I believe JavaWorld had an article that
talked about something similar.

Calvin

- Original Message -
From: "Greg Reddin" <[EMAIL PROTECTED]>
Cc: 
Sent: Wednesday, July 11, 2001 10:16 AM
Subject: RE: XML/XSL/Struts Architecture


> Using XSL, you can recreate the majority of what the taglibs do.  However,
that
> begs the question of why you would use XSL in the first place.  I've
worked on a
> Struts-based XSL project for about 6 months now, and we've had to recreate
so
> much of the Struts functionality in our architecture that we find
ourselves
> always asking why we're doing this.  Our data comes from the backend in
XML, so
> it seemed logical to leave it in XML and use the parsers to access it.
But the
> parsers (Xalan/Xerces) turn out to be a lot of overhead and got in our way
quite
> a bit.  I'd like to go back and convert it to JSP.
>
> -Original Message-
> From: [EMAIL PROTECTED] at INTERNET
> Sent: Wed 7/11/2001 3:41 AM
> To: Reddin, Greg; [EMAIL PROTECTED] at INTERNET
> Cc:
> Subject: RE: XML/XSL/Struts Architecture
>
>
>
> Hi Mahesh,
> We have started using Struts for an application that uses XSP/XML/XSL
(using
> Cocoon).  Instead of specifying a  JSP page in the struts configuration
file
> we specify a XSP page.  This server page is responsible for getting XML
data
> from some data object set up in the action classes (we are using
attributes
> in the session object for now).  We also have extended ActionMapping to
> allow us to specify the XSL stylesheet in the struts configuration file.
> You are right about the use of tag libraries - that is one aspect of
struts
> that you potentially lose out on using the above approach.
> Regards,
> John
>
>
> > -Original Message-
> > From: Mahesh Bhagia [SMTP:[EMAIL PROTECTED]]
> > Sent: 10 July 2001 17:24
> > To: Apache Struts (E-mail)
> > Subject: XML/XSL/Struts Architecture
> >
> > Hi,
> >
> > In our application, we are using XML/XSL to generate JSP and plan to use
> > Struts for submitting data from HTML forms. Has anyone used / know
> > if this architecture works. my thinking is ( correct me if wrong ) , we
> > will not be able to use tag libraries coz of XML/XSL combination for
> > generating pages. unique thing about this application is structure of
> > HTML is different for each client.
> >
> > Thanks
> > Mahesh
> >
> >




Re: Ant problem - build.xml file does not exist

2001-07-12 Thread Calvin Yu



Ok, this means that your ant installation is 
correct, but the directory in which your dos-prompt is in doesn't have a 
build.xml file.  'cd' into a directory with a build.xml and (making sure 
ant.bat is in your path) run ant again.
 
Calvin

  - Original Message - 
  From: 
  Chuck Amadi 
  To: [EMAIL PROTECTED] 
  
  Sent: Thursday, July 12, 2001 9:04 
  AM
  Subject: Ant problem - build.xml file 
  does not exist
  Hi all i have just downloaded a exampl from netbeans of a 
  sample build.xml Thus i have installed in the ant's dir at the 
  same level as bin,doc,&lib is this correct as when i run the 
  ms- dos prompt C:>C:\ant\bin\ant.bat -find I recieve a 
  responce stating  build.xml does not exist. Any Suggestions 
  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.   



Re: Unable to run both Ant & Tomcat (set classpath)

2001-07-17 Thread Calvin Yu


This shouldn't be the case.  Set both TOMCAT_HOME and ANT_HOME, empty
your CLASSPATH ('set CLASSPATH='), and send the error that you get when
you run ant.bat and tomcat.bat.  It'll also be helpful if you edit the
batch files and echo the command that is being executed by those files.

Calvin


On 17 Jul 2001 11:30:31 +0100, Chuck Amadi wrote:
> Hi,all
> I have just installed and configured the ant's build and thus ran a
few
> examples and it running ok.Albeit on trying to run the tomcat
container i have
> recieved a bad command on startup.
> I have still got the set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2 in my
classpath.
> If this is the case i assume i can't set both Tomcat and Ant within
the same
> classpath.I if i require to run the tomact container i must reset the
set
> classpath and rem the set ANT_HOME=C:\ant
> 
> Cheers Chuck Pls Confirm.
> 
> Gregor Rayman wrote:
> 
> > "Chris Callaghan" <[EMAIL PROTECTED]> asks:
> >
> > > Hey all,
> > >
> > > I want to be able to map a URL to certain JSPs which may or may
not have
> > > an action involved with them e.g
> > > map /logon to logon.jsp which also has as action also called logon
> > > also /tour to tour.jsp which has no associated action.
> > >
> > > How can I do this with struts?
> > >
> > > Cheers
> > > Chris
> >
> > You can do it with your http server, not with struts.
> >
> > --
> > gR
> 
> --
> 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.
> 





Re: Unable to run both Ant & Tomcat (set classpath)

2001-07-17 Thread Calvin Yu


This really shouldn't be the case.  You should be able to set both
TOMCAT_HOME and ANT_HOME.  What you should do is not set CLASSPATH at
all b/c ant.bat and tomcat.bat should handle the classpath for you.
Empty the CLASSPATH ('set CLASSPATH='), and send the error that you are
getting when you run the batch files.

Also, if you can edit the ant.bat and tomcat.bat and echo the command
that is being run, that would be helpful.

Calvin


On 17 Jul 2001 11:30:31 +0100, Chuck Amadi wrote:
> Hi,all
> I have just installed and configured the ant's build and thus ran a
few
> examples and it running ok.Albeit on trying to run the tomcat
container i have
> recieved a bad command on startup.
> I have still got the set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2 in my
classpath.
> If this is the case i assume i can't set both Tomcat and Ant within
the same
> classpath.I if i require to run the tomact container i must reset the
set
> classpath and rem the set ANT_HOME=C:\ant
> 
> Cheers Chuck Pls Confirm.
> 
> Gregor Rayman wrote:
> 
> > "Chris Callaghan" <[EMAIL PROTECTED]> asks:
> >
> > > Hey all,
> > >
> > > I want to be able to map a URL to certain JSPs which may or may
not have
> > > an action involved with them e.g
> > > map /logon to logon.jsp which also has as action also called logon
> > > also /tour to tour.jsp which has no associated action.
> > >
> > > How can I do this with struts?
> > >
> > > Cheers
> > > Chris
> >
> > You can do it with your http server, not with struts.
> >
> > --
> > gR
> 
> --
> 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.
> 





Re: Working with Ant - Confirm package name

2001-07-17 Thread Calvin Yu


It doesn't have to be.  Package names have very little association with
the directory that a java file is in.  With ant, all you should have to
do is point it to a source directory (C:\development), and it'll try to
compile all java files in that directory.  However, you probably want to
declare a package structure for organization and access control
purposes.

If you are going to define a package, it is recommend that you build a
complimentary package structure that is *relative* to your source
directory.  So if your class's package is 'com.mycompany', your java
file should be in 'C:\development\com\mycompany'.  The reason you would
want to do this is because javac will look for this kind of directory
structure to compile the source files that are required by the source
file you are currently compiling.  I believe you can have all java files
under one directory despite their package declaration and javac will
resolve the dependencies, but your project organization will suffer.

So just remember, package declaration is *relative* to the source
directory.

Calvin



On 17 Jul 2001 13:44:34 +0100, Chuck Amadi wrote:
> Hi,
> I have just installed ant, thus i am toying with a few simple
> examples. Nevertheless i just like to confirm that when creating .java
> files i save them into a C:\development directory  (as text doc) thus
i
> am led to believe that this dir isthe name of my package name   i.e
> package development;
> 
> 
> class ProjectForm
> {
> public static void main (String etc etc
> 
> Pls could you confirm 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.
> 





Re: Unable to run both Ant & Tomcat (set classpath)rectified

2001-07-17 Thread Calvin Yu


Keep servlet.jar in TOMCAT_HOME/lib.

I usually follow Ant build structure, which for you would be something
like this:

capture/
build.xml
samples/
src/
conf/
etc/
main/
VKCapture.java
build/
classes/
VKCapture.class

depending on what you do with sp.tif, it'll go in src/etc, src/conf,
samples/, or under src/main.

If it is just a sample tif, I would put it under samples.  If it is
necessary for the code to run properly, I'd put it in etc.

Calvin



On 17 Jul 2001 14:40:17 +0100, Chuck Amadi wrote:
> Hi Calvin your right , i mispelt jakarta,within the classpath. I would
also
> like to know does it matter that i have copied from tomcat/lid dir to
my
> webapp/WEB-INF/lib dir the servlet.jar as at first when i edit the
> tomcat.bat it stated it couldn't locate the servlet.jar.
> 
> I recall the struts-group stating it should stay at tomvat/lib.
> Secondly when one constructs ant's builds do thet reside in the same
dir as
> i have a dir named C:\development and within the ms-dos it works fine
thus i
> have downloaded an example containing a .java file and a build.xml
file thus
> do both these file reside in a separate dir i.e
> 
> VKCapture.java , sp.tif & build.xml to a new folder named C:\capture
dir.
> am i on the right lines of thinking.
> Cheers All
> Calvin Yu wrote:
> 
> > This really shouldn't be the case.  You should be able to set both
> > TOMCAT_HOME and ANT_HOME.  What you should do is not set CLASSPATH
at
> > all b/c ant.bat and tomcat.bat should handle the classpath for you.
> > Empty the CLASSPATH ('set CLASSPATH='), and send the error that you
are
> > getting when you run the batch files.
> >
> > Also, if you can edit the ant.bat and tomcat.bat and echo the
command
> > that is being run, that would be helpful.
> >
> > Calvin
> >
> > On 17 Jul 2001 11:30:31 +0100, Chuck Amadi wrote:
> > > Hi,all
> > > I have just installed and configured the ant's build and thus ran
a
> > few
> > > examples and it running ok.Albeit on trying to run the tomcat
> > container i have
> > > recieved a bad command on startup.
> > > I have still got the set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2 in my
> > classpath.
> > > If this is the case i assume i can't set both Tomcat and Ant
within
> > the same
> > > classpath.I if i require to run the tomact container i must reset
the
> > set
> > > classpath and rem the set ANT_HOME=C:\ant
> > >
> > > Cheers Chuck Pls Confirm.
> > >
> > > Gregor Rayman wrote:
> > >
> > > > "Chris Callaghan" <[EMAIL PROTECTED]> asks:
> > > >
> > > > > Hey all,
> > > > >
> > > > > I want to be able to map a URL to certain JSPs which may or
may
> > not have
> > > > > an action involved with them e.g
> > > > > map /logon to logon.jsp which also has as action also called
logon
> > > > > also /tour to tour.jsp which has no associated action.
> > > > >
> > > > > How can I do this with struts?
> > > > >
> > > > > Cheers
> > > > > Chris
> > > >
> > > > You can do it with your http server, not with struts.
> > > >
> > > > --
> > > > gR
> > >
> > > --
> > > 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
> 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.
> 





Re: Ant Q regarding deployment of jar's

2001-07-18 Thread Calvin Yu


I wouldn't do this.  What kind of jars are you dealing with?  If the
jars are used by Ant to run tasks, then put them in ANT_HOME/lib.  If
they belong to your project and only required to build your project, I
would recommend putting them in a 'lib' directory under your project
directory.  You could put them in C:\jars, but that might cause some
confusion later on if you're building different projects with
conflicting libraries in C:\jars.

Calvin


On 18 Jul 2001 13:52:26 +0100, Chuck Amadi wrote:
> Hi, I am currently working thru ant's and from a few articles and
example they
> lay claim to create & deploying all jar's to C:\jar .
> 
> Thus within the - the property name- value would
be
> "C:\jars"/>
> Is this the correct procedure as i will be downloading the auxillary
jars and i
> want to no do i deploy to by ant/lib dir with the ant.jar , parser.jar
&
> jaxp.jar. Or as long as i add them to my classpath ie
> 
> 
> set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2
> set ANT_HOME=C:\ant
> set classpath=%ANT_HOME%\lib\ant.jar
> set ANT_HOME=C:\jars --// will this locate all my
jars
> set PATH=%PATH%;%ANT_HOME%\bin
> set JAVA_HOME=C:\JDK1.3
>  Pls advise Cheers Chuck
> 
> "Hampton, Paul" wrote:
> 
> > Chuck,
> > The error that you mentioned was on line 35 of your build
file, for
> > some reason though word is corrupting the xml & all I get on line 35
is
> > Error! Hyperlink reference not valid.  which I
assume
> > has been added by word as it attempts to interpret the xml as html.
Could
> > you open your build.xml up in notepad & copy+paste the entire thing
into an
> > email to me? - hopefully I'll be able to spot your problem...
> >
> > Paul
> >
> > > -Original Message-
> > > From: Chuck Amadi [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, July 16, 2001 10:39 AM
> > > To:   Hampton, Paul
> > > Subject:  Ant Problem - Copy of Build.xml File
> > >
> > >
> > > Cheers 4 taking a peek.
> > > --
> > > 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.
> > >  << File: buildxml.doc >>
> >
> > This private and confidential e-mail has been sent to you by Egg.
> > The Egg group of companies comprises Prudential Banking plc
> > (registered no. 2999842), Egg Financial Products Ltd (registered
> > no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
> > carries out investment business on behalf of Egg and is regulated
> > by the Personal Investment Authority.  All members of the Egg group
> > are registered in England and Wales. Registered offices: 142
> > Holborn Bars, London EC1N 2NH
> >
> > If you are not the intended recipient of this e-mail and have
> > received it in error, please notify the sender by replying with
> > 'received in error' as the subject and then delete it from your
> > mailbox.
> 
> --
> 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.
> 





Re: Server Side Validation not firing for Validator whenJava Script is off

2001-07-19 Thread Calvin Yu


On 18 Jul 2001 16:09:37 -0600, Scott Ryan wrote:
> Java script has the great benefit of failing
> but not indicating where the problem is.  
> 

If you're not using this already, you can type 'javascript:' in the
address bar and it'll open the javascript console.

Calvin





RE: Using Frames within STRUTS

2001-07-19 Thread Calvin Yu


Change the 'success' forward back to PCATable.jsp.  To use frames, all
you have to do is change your starting point, which should now be
PCAFrames.jsp.  In your PCAFrames.jsp, make sure you have a frameset
that links to /editQuoteSummary, and not PCATables.jsp.

Calvin


On 19 Jul 2001 10:08:25 +0100, Alexander, Glynn (LIT) wrote:
> Hi Devon,
> Thanks for your reply.  I think that my understanding of the framework is
> sparse as I dont understand how this works.  I have an app which collects
> insurance quote information.  We are using an EJB to store the information
> as it is collected from the user on multiple screens.  My starting point is
> /editQuoteSummary which looks up the EJB and populates the quotesummaryForm
> with default user data using the class
> com.libertymutual.lit.pca.EditQuoteSummaryAction.  In my original version I
> then had the 'success' forwarding to a PCATable.jsp file (rather than
> PCAFrame.jsp as is shown below) which had 2 jsp includes(PCANavigation.jsp
> and PCAQuoteSummary.jsp), the latter of which had the definition for the
> form .  This seemed to work OK. 
> 
> 
> 
> type="com.libertymutual.lit.pca.EditQuoteSummaryAction"
>  name="quotesummaryForm"
>  scope="request"
>   validate="false">
>  
>  
> 
> 
>  
> type="com.libertymutual.lit.pca.SaveQuoteSummaryAction"
>  name="quotesummaryForm"
>  scope="request"
>   validate="false">
>  
>   path="/editPropertyQuestions.do"/>
> 
> 
> Our user then wished to implement frames.  So I changed the PCATable.jsp to
> a frames implementation (PCAFrame.jsp).  However when I access the
> PCAFrame.jsp I get the following error in the frame asscociated with
> PCAQuoteSummary.jsp:
> Error 500
> An error has occured while processing
> request:http://localhost/PCAWebAppEJB2/PCAQuoteSummary.jsp
> Message: Server caught unhandled exception from servlet [jsp]: Cannot find
> bean quotesummaryForm in scope request
> 
> Can you see what I am doing wrong ?
> 
> Thanks
> Glynn
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 18 July 2001 13:50
> To: [EMAIL PROTECTED]
> Subject: RE: Using Frames within STRUTS
> 
> 
> > I would like to make use of frames within my STRUTS application but am
> > unsure how the framework handles frames.  For example, if I 
> > have a form
> > within a JSP page (form.jsp) and that page is presented to 
> > the user within a
> > frame (frame.jsp), how should I associate the ActionForm to 
> > the form.jsp
> > within the struts-config.xml file.  I want the app to navigate to the
> > frame.jsp page but cannot associate the ActionBean to this 
> > jsp as it does
> > not have a form tag.  Is there a recommended solution ?
> 
> Not sure I fully understand but here goes...
> 
> When form.jsp starts generating the HTML for the form, it will look for
> an ActionForm from which it can get default values. The name it will
> use to look for this bean is defined in the struts-config.xml under the
> Action to which you will be submitting the form. So the ActionForm name
> is associated with the Action that receives it rather than the JSP that
> generates it. So the fact that the JSP that generates it is wrapped
> inside a frame isn't really an issue.
> 
> There are at least two other possible problems, though:
> 
>   1) If you want the previous Action to preload the ActionForm with
>  some information (from a database, for example) you can do
>  this by making your own ActionForm bean, filling it in, and
>  then saving it in the session scope under the name which is
>  declared in the Action that will receive it. It will then be
>  found automatically when form.jsp generates the HTML.
> 
>   2) If you choose to automatically validate the ActionForm, you
>  need to specify the "input" page so that Struts can
>  automatically send you back there in case of an error. I don't
>  have experience with this but you should be able to specify
>  your frame.jsp file as the input source. When it then
>  renders form.jsp within, this inner page will still find the
>  ActionForm in the context if it were the highest level page.
> 
> Does that help?
> 
> Devon





Re: Problem with iterate tag

2001-07-19 Thread Calvin Yu

A stack trace would be helpful.

Calvin


On 19 Jul 2001 16:45:41 -0700, Vimal Kansal wrote:
> Hi,
> 
> I am getting JSP parse exception, in the following
> code snippet :
> 
> 
> 
>   
>   <%-- This table will be
> generated, if at all any users were found --%>
>scope="request" >
>  name="USERS" type="java.util.Vector" scope="request"
> toScope="request" />
> 
>   
>  
>   
>   
> Login Name
>   
>   
> Full Name
>   
>   
> Company
>   
>   
> Department
>   
> Groups
>   
> 
>  name="users"
> type="com.netfish.xdi.struts.beans.UserSummaryData"
> collection="<% users% >">
>
>   
>  1
>   
>
>  page="/logon.do"> 
> name="usr" property="userID" />
>  
>   
>   
> name="usr" property="fullName" />
>   
>   
> name="usr" property="company" />
>   
>   
> name="usr" property="department" />
>   
>
> 
>
> 
> ===
> 
> The error is happening on the line  .
> 
> Can somebody help me?
> 
> Vimal
> 
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/





Re: Any Pointers regarding Action Classes

2001-07-20 Thread Calvin Yu


If you don't figure out why ApplicationMappings.java and
ActionForward.java isn't compiling, it isn't going to help you to
compile an Action class.  I imagine the problem that is causing the
compilation of those two classes is going cause the compilation failures
of many of your other classes.

The best thing you can do is start from scratch.  Move all your java
files somewhere else and start adding them back one by one, compiling
each file along the way. 

Calvin


On 20 Jul 2001 15:34:40 +0100, Chuck Amadi wrote:
> Hi , i require to create another Action Class contoller as the
> ApplicationMappings & ActionForward.java won't compile so i would like
> to create an Action.java and run ant to compile. Thus is there a n
> example of this class and is it a abstract class with no
> methods(uniplemented methods-empty bodies ) as my java is only at
> fundamental level.
> 
> I have checked the struts-example no joy
> albiet there is at 4.2 Action Classes   userGuide/building_controller 
> thus appears Abstract enough.
> 
> 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.





Re: web application initialization

2001-07-21 Thread Calvin Yu


Another thing you can do is use the ServiceManager extension that's
under the contrib 
directory in CVS.  I've just started to look at it myself.  Its seems to
be a fairly
new contributions, so documentation is pretty scarse.

Calvin



19 Jul 2001 21:05:32 -0700, Fabien Le Floc'h wrote:
> Thank you for the tip, this is definitely working and is not too ugly.
> 
> However I still find a little bit stupid we have to create a new Servlet just to use 
>its init method. Or maybe not if your Log4j servlet allows you to modify the logging 
>/ the log4j properties remotely (but that is another project, and it is bad not to 
>use struts for that).
> 
> I tried just to extend the ActionServlet and rewrite the init method (adding lines 
>to it). After modifying the web.xml, it still did not work. Has anyone a clue why? 
>Did anybody try to extend ActionServlet?
> 
> Regards,
> 
> Fabien
> 
> "Abraham Kang" <[EMAIL PROTECTED]> writes:
> 
> > Hi Fabien,
> > 
> >I typically do this in a StartupServlet in my web.xml.
> > 
> >Here is an example of how I initialize Log4j:
> > 
> > 
> > 
> >   
> > weblogic.jsp.keepgenerated
> > true
> >   
> > 
> >   
> > log4j
> > 
> > com.infogain.DOG.logging.servlet.Log4jServlet
> > 
> >   debug
> >   2
> > 
> > 
> >   wlpi_log4j_conf
> >   /WEB-INF/wlpi_log4j_conf.properties
> > 
> > 
> >   base_category
> >   com.infogain.DOG
> > 
> > 
> >   base_priority
> >   info
> > 
> >   1
> >   
> > 
> > ...
> > 
> >The init() method of Log4jServlet handles stuff that needs to run before
> > Struts (struts's  is 2).
> > 
> > --Abraham
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
> > > Fabien Le Floc'h
> > > Sent: Wednesday, July 18, 2001 10:58 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: web application initialization
> > >
> > >
> > > Hi,
> > >
> > > I would like to know if it is possible to have some code called
> > > at the web application initialization (something like the init()
> > > method of the first servlet called by the web app - which here is
> > > ActionServlet).
> > >
> > > Should I just extend ActionServlet?
> > >
> > >
> > > regards,
> > >
> > > Fabien
> > >
> > >





Re: Basic Question in Servlet/JSP ?

2001-07-23 Thread Calvin Yu

On 23 Jul 2001 16:29:52 +0530, suhas wrote:

> Better can't we get this from the container specific implementaion
> something like PageContext in the Servlet too? . 
>  

Why would we need to?

Calvin




Re: SV: pls Help .java File Wont compile/wrong name packages

2001-07-23 Thread Calvin Yu


What exactly is the package declaration?  What is the file structure?
When you compile this class, what is the error?

Calvin


On 23 Jul 2001 11:07:49 +0100, Chuck Amadi wrote:
> Hi , cheers 4 the return within the IDE when i go to
ApplicationMappings
> a mouseover prompt states invalid package declaration. Thus path is as
u
> noted plus the name of my package is package action;
> 
> Thus i intend to create another Action Class From the package
> com.ora.jsp.servlets.
> Thus can i just modify the package path 
> 
> 
> Peter Alfors wrote:
> > 
> >Part 1.1Type: Plain Text (text/plain)
> >Encoding: 8bit
> 
> -- 
> 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.





Re: Basic Question in Servlet/JSP ?

2001-07-23 Thread Calvin Yu


Here are somethings I can think of:

1) The PageContext class not only encapsulates these objects, but
container specific behavior as well (handlePageException, pushBody,
etc.).  I would imagine the availability of request and response objects
here are mainly used to support these features, and not necessarily for
general accessibility.

2) Also, PageContext provides some convience methods for commonly used
tasks (include, forward, etc.)  which helped minimize the size of
scriplet block in JSPs.

3) PageContext allows a JSP engine to easily initialize a tag library
with a page's state by initializing it with one object instead of many.


Why isn't there a similar PageContext for Servlets?  Because:

1) Behavior such as exception handling (handlePageException) and output
control (pushBody, popBody) are handled by the developer of the servlet.

2) In servlets, any kind of delegation to other layers are handled by
the servlet developer, whereas delegation in JSPs are handled by the
container (JSP taglib).

3) The JSP Spec is a later spec than the Servlet spec, and benefits from
lessons learn from the earlier Serlvet spec.

Calvin


On 23 Jul 2001 17:41:06 +0530, suhas wrote:
> Hi Cyu ,
> I was going through JSPService method -when the jsp gets translated
into
> Servlet where generally we see pageContext instance obtained from the
> JSPFactory  which is actually container specific implementation .
> 
> My question was - Instead of this container only need to pass
> HttpServletRequest and HttpServletResponse objects  as parameters to
the
> _JSPservice method .  We can get the Session object from above
> HttpServletRequest that container sends as parameter . The out object
could
> have been instantiated using JSPWriter.So why was there a need to have
a
> PageContext Class when everything was possible without that  ,in JSP .
> 
> Suppose  PageContext class comes in JSP , then why the same concept
was not
> in Servlet ???
> 
> suhas
> 
> - Original Message -
> From: Calvin Yu <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 23, 2001 5:24 PM
> Subject: Re: Basic Question in Servlet/JSP ?
> 
> 
> On 23 Jul 2001 16:29:52 +0530, suhas wrote:
> 
> > Better can't we get this from the container specific implementaion
> > something like PageContext in the Servlet too? .
> >
> 
> Why would we need to?
> 
> Calvin
> 





Re: How to integrate flash request into struts ...

2001-07-24 Thread Calvin Yu


Since loadVariables is an internal flash call, I imagine the problem
will most likely be in flash, and not with JSPs.

What you can try is to reconfigure your mappings so that *.asp will be
treated as a JSP, and rename your JSP files to *.asp.  If this works, it
means flash (or the flash host - IE or other flash runner) is doing some
extension processing and doesn't handle the jsp extension properly.

Another thing to check is that the HTTP headers written when using the
JSP solution is comparable to what the working CGI or ASP solution is
writing.

Good luck.

Calvin


On 23 Jul 2001 20:02:40 +0200, Philippe Dion wrote:
> Hello!
> I have a problem. A strange problem.
> I'm new to struts tougth i have a strong programming background.
> I wish to use flash with struts. What I want is to use the
"loadVariables"
> function of flash. What this function do is to open a http connection
to the 
> server and read and process the stdout.(println in jsp). To do that i
connect
> to a "jsp" file and pass variables in the http header (just as any
HTML form) 
> to the "jsp". My problem is the jsp file redirect the swf to the jsp
and load
> the jsp in place of the swf. Can you help? Are there a way to connect
and read
> to the jsp script without reloading the page just as I can do with
ASP???
> This trick work fine with ASP,CGI and other. 
> What I would do in CGI is to write a script reading the query string
> and print out on the stdout. Without the swf to be reloading. 
> Thank for any help or for pointing me somewhere I can find a
solution!!
> 
> Pi Guy





Re: Cant compile my .java files to a class - is it a path issue --

2001-07-25 Thread Calvin Yu

I'm not exactly sure what you're trying to do.  If your web app
directory is C:\jakarta-tomcat-3.2.2\webapps, then your structure needs
to look like this:

C:\jakarta-tomcat-3.2.2\webapps\bbnpa\WEB-INF\classes\helloworld\HelloWorldResources.properties
C:\jakarta-tomcat-3.2.2\webapps\bbnpa\WEB-INF\classes\helloworld\HelloWorld.java

if you HelloWorld.java class has a package declaration of:

package helloworld;

Calvin


On 25 Jul 2001 12:10:25 +0100, Chuck Amadi wrote:
> Hi , I have been posting this problem for a while now - sorry. Albeit i
> was on a role until i modified my Action Class. Thus or hell broke
> loose. I had got to the stage whereby i had exstablished a connection to
> PostgreSQL v6( though posted a bug on PostgreSQL v7.1- same code don't
> work) and created a jsp submit form, an jsp extraction database form &
> jsp select page .
> Nevertheless i have come to a ground halt due to my inquisitiveness . I
> have transfered my original classes files but on commencing again , hit
> the same hurdle.
> 
> my path is
> C:\jarkarta-tomcat-3.2.2\webapps\bbnpa\WEB-INF\classes(package
> name)\.java file
> 
> Thus do i have to implement a base dir above /WEB-INF/  --  example
> below --
> /bbnpa/helloworld/WEB-INF/classes/helloworld/HelloWorldResources.prperties
> /bbnpa/helloworld/WEB-INF/classes/(package name)/.java file
>or
> As my path above without the base dir (helloworld)
> Note all my other jsp work with my current path set-up except i won't to
> utilise form beans instead of html/javascript pages so need to get this
> class issue sorted for the next level.
> 
> 
> Sorry 4 this long winded Q. Pls Help Cheers Chuck 8^{
> 
> -- 
> 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.





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

2001-07-25 Thread Calvin Yu


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/struts/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 
> 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.






Re: XML screen generation

2001-07-30 Thread Calvin Yu


I'm not sure if this is what you're looking for, but Jakarta Taglibs has
an library called XTags that you might be interested in.

Calvin



On 30 Jul 2001 08:58:04 -0400, Will Spies/Towers Perrin wrote:
> 
> This is an odd ball question but ...nothing ventured ...nothing
gained.
> 
> We use struts. It's working well for us. However, one thing it's
missing is
> rapid screen generation functionality. For example, in the spirit of
an
> MVC, we would like to generate screens in our views based on XML data
> derived from ActionForms ( which were just pushed to our views ). Does
> anyone know of any open source tools which makes this easier? Rather
than
> coming up with our own XSLT to build HTML from an ActionForm converted
to
> XML ourselves we would like to find something open source ( or 3rd
party )
> to facilitate this.
> 
> Thanks for any help/info,
> 
> Will
> 
> 





RE: some comparision between JSP/struts and velocity

2001-07-30 Thread Calvin Yu


On 30 Jul 2001 18:20:29 -0700, Tim Colson wrote:
> While a custom tag is an option; this bit of functionality would have
> required embedding  javascript code and html inside the custom tag lib. To
> me, putting view specific code like inside a tag library is also a slippery
> slope in the quest to keep thing separated.

Although I would agree that HTML should probably be best kept outside of a taglib, I
don't think JavaScript can be generalized that way.  JavaScript can sometimes becomes
a heavy development task.  This is especially the case with client side validation.  I
think the same thing that motivates a designer to get their scripts from an archive
would probably drive them to use developer tag lib.

Also, being that JSP and taglibs, like Velocity, is essentially Java, you can still
manage view specific code in a designer friendly way, given some though.



Calvin





Re: Custom tags hiding JSP error messages

2001-08-01 Thread Calvin Yu


Usually when struts taglib captures an error, it is stored as a request
attribute under the key Action.EXCEPTION_KEY.  What I ended up doing is
write a custom error JSP and set that as my default error page in
web.xml.

I'm not sure if the template taglibs are storing their exception there
however.


Calvin



On 01 Aug 2001 09:44:29 -0700, Jamie Tsao wrote:
Hi,

I was curious whether other people encountered this problem.  I've
used tag libraries before, and am currently using struts' template
tag library.  I have found that runtime JSP errors, such as null
pointer exceptions, are hard to debug because the custom tags "hide"
the error message.  The only message that usually comes up is a
JSPException, which isn't really too helpful.  Without custom tags,
you get exact line numbers with exact errors
(NullPointerException).  Perhaps I'm doing something wrong.  Can
anybody give an opinion ?

Thanks,

Jamie





Re: save dynamic jsp content

2001-08-01 Thread Calvin Yu

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
> 





Re: save dynamic jsp content

2001-08-01 Thread Calvin Yu


Fantastic idea!  This would be an easier way.

Calvin


On 01 Aug 2001 14:31:44 -0500, Chris Nokes wrote:
> An eaiser way may be to create a BodyTagSupport to capture the output
in the
> "doAfterBody" method and send it to the mail input stream or write to
the
> file
> system first if desired.  This doesn't require an extra network call
and
> thread.
> 
> Chris
> 
> ----- Original Message -
> From: "Calvin Yu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 01, 2001 1:06 PM
> 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
> >
> 
> 





Re: custom XSL struts taglib (was: Re: Taglibs decrease theseparation between designer and developer?)

2001-08-01 Thread Calvin Yu


Jakarta TagLibs also have a taglib that does XSL, have you thought about
merging your result with theirs?

What I think is the big disadvantage with using XSL it is very complex
to use, especially if you want to take advantage of its more powerful
features.  If designers are going to have problems understanding
scriplets and velocity, they're not going to fair much better with XSL
(probably worse, in fact).

One good thing about having model data as XML, however, is that you can
utilize the xpath to access the XML data if you don't need all the bells
and whistles of XSL (fortunately Jakarta TagLib also provides a taglib
that does this).

Calvin


On 01 Aug 2001 16:10:02 -0500, Jon Brisbin wrote:
> Thought I'd put a plug in for my own custom XSL taglib I use in my STRUTS
> apps...it helps me clean up the whole scriplet/custom tag thing by letting
> me use plain 'ol XSLT templates to output my forms with pre-filled values,
> etc...from my EJB's...i also use the struts form tags and a custom property
> copier that copies things from my ejb to my form, but this is considerably
> slower than using my session bean to extract raw xml from a sql statement,
> then transform it into a list or form...
> 
> this XSL tag caches the compiled stylesheet into the application scope,
> keyed on the filename...this to increase performance, which it does well...
> 
> you can nest xml tags and scriptlets in the body of the tag to get dynamic
> xml (you could theoretically do a full page of xml this way, with no HTML
> whatever...i just haven't migrated that far yet to have my app do that), or
> you can get your xml from an attribute...and transform *into* an attribute,
> if you wish...
> 
> i'm quite pleased with the results of incorporating my xsl into struts this
> way...this might also help some out there that would like to try it
> too...email me if you want the source code and .tld file...
> 
> Jon Brisbin
> www.jbrisbin.net
> Lamar, MO
> 
> - Original Message -
> From: "Greg Maletic" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, August 01, 2001 3:07 PM
> Subject: RE: Taglibs decrease the separation between designer and developer?
> 
> 
> > Hi, Bill--
> >
> > I completely agree that Struts Taglibs are much cleaner than the pure HTML
> > alternative, so I concur that your "select box" example is very simple and
> > nice.  I love all of the Struts form input tags, all of which are a real
> > pain to implement with pure HTML and JSP.
> >
> > But I don't think I'm exaggerating very much when I say that the Struts
> > taglibs are a new language:  they include tags to define variables,
> looping
> > constructs, and if-then-else constructs, none of which correspond to
> actual
> > HTML tags, and all of which I'll need to employ if I'm to completely rid
> my
> > JSPs of scriptlets.  I view that as pretty much a complete language.  So
> my
> > novice reaction to the Struts taglibs is that I've swapped a language that
> I
> > know (Java) for a language that I don't know (Struts taglibs), and my
> > designer has swapped a language that he knows (pure HTML) for a language
> he
> > doesn't know (Struts taglibs), at the benefit of giving the designer the
> > potential to write virtual code when I know that he--and at least 95% of
> the
> > designers I've worked with--won't write view code that I would trust no
> > matter what the language is.  (I'm not claiming they're stupid.  My
> > experience has been similar to Chris's earlier post, where I let them
> > control the look and feel and I write the view code.)
> >
> > I'm not saying that the Struts taglibs are useless by any stretch of the
> > imagination.  But the real benefit I see with taglibs is to clean up the
> > JSPs, not usher in a new age of empowered designers capable of building
> > views with no developer assistance.
> >
> > I should have prefaced my comments by saying that I'm quite new to Struts,
> > am not an expert, so my comments should be taken in that light.  I am
> > impressed with Struts and am absolutely not giving up on it.  My beef
> isn't
> > so much with Struts as it is with the whole concept of taglibs being "the
> > solution" to the MVC separation problem.  The only solution to this
> problem
> > is to keep business logic out of the view, period.  Scriptlets don't solve
> > the problem, but I don't think taglibs do either.  The only real solution
> I
> > see is developer restraint.
> >
> > --Greg
> >
> > ==
> > Greg Maletic
> > Chief Technical Officer
> > Zero G Software, Inc.
> > 514 Bryant Street
> > San Francisco, CA 94107
> >
> > tel: +1.415.512.7771 x303
> > fax: +1.415.723.7244
> > mailto:[EMAIL PROTECTED] 
> > http://www.ZeroG.com 
> >
> > The leading provider of multi-platform software deployment solutions.
> > ==
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> 

Re: struts - webapps confirmation

2001-08-03 Thread Calvin Yu


You want to use the second one.  Just remember that the WEB-INF
directory has to be at the root of your web application directory, which
in your case is /helloworld.

Calvin


On 03 Aug 2001 15:22:16 +0100, chuck amadi wrote:
> Hi , Im back again - unfortunately i am left to my own devices thus 
> after making good progress i fell flat when i made modifications to mt

> action classes (Windows box). Nevertheless i am to try again albeit
this 
> time on a linux box running v7.1. Thus it may sound a stupid question 
> but i have downloaded the jakarta-struts-1.0-b2. Thus i have renamed  
> the struts-blank to bbnpa (acronym) thus i am going to tackle the 
> Struts-trail exercises thus i want to know to i create a directory 
> structure for my application as follows: -
> 
> /home/chucka/j-tcat-3.2.2/webapps /bbnpa/helloworld/WEB-INF/lib/
> 
> /classes/helloworld/
> 
> 
> or  /home/chucka/j-tcat-3.2.2/webapps/helloworld/WEB-INF/lib/
>   
> /classes/helloworld/
> 
> I just want to make sure as i am aware that helloworld is an
application.
> Previously i commenced with the first option everthing decending from
my 
> web app named bbnpa - on a windows box.
> 
> Pls aid as this time i intend to use the ant and cvs.
> 
> Cheers Chuckie
> 





Re: Performance, Reflection, and Object Creation vs. Cacheing(was: Barracuda talk)

2001-08-29 Thread Calvin Yu

On Tue, 2001-08-28 at 00:02, Bryan Field-Elliot wrote:

> 
> Also, you go on to say 'ditto for objection creation", and that it's 
> "more expensive to cache an object than recreate it". Where are you 
> getting this information? It goes against the design considerations of 
> virtually every "highly optimized" Java system I've seen, including EJB 
> which goes to EXTREME lengths to reuse rather than recreate. You see the 
> same pattern with JSP custom tags (nowadays they are pooled), and you 
> even see the same thing in the Servlet spec design (which is to have one 
> multithreaded instance of the servlet class, rather than one per user 
> which would make more logical sense).

Object creation is rather fast, but that doesn't mean caching is always
frowned upon.  Caching for performance at the enterprise level is really
to reduce object initialization rather than object creation.  The
problem with EJBs, Tags, and Servlets is that they potentially do a lot
of up front initialization.  All three has to at least read an XML to
load some kind of deployment information, and then there are resources
(db, networking) that can be allocated by containers or developers.
Struts objects generally don't a lot of object initialization, therefore
isn't necessarily a really good candidate for caching.


Calvin




System level properties?

2001-04-15 Thread Calvin Yu

Hi,

I apologize in advance if this question has been asked
before, but I've search the mail archives and docs and
haven't come up with an answer.

Is there a place to specify system-level properties in
Struts?  For example, if the the Model components
needed to retrieve environment related properties
(remote server host and port, location of
initialization files, etc), where would we get them
from?  I saw the 'application' initialization
parameter, but that didn't seem to be the same context
of properties I'm trying to retrieve.

Another way to ask the question would be, where is the
equivalent of overriding init() in HttpServlet to
initializing the system?  Is subclassing ActionServlet
the preferred way?


Calvin

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: System level properties?

2001-04-15 Thread Calvin Yu

Yeah, that's a pretty good way to do it, better than
subclassing ActionServlet.  I'm still hoping though
that there is something that is built into Struts that
will make this cleaner than having to create a new
Servlet.


Calvin

--- Tharwat Abdul-Malik <[EMAIL PROTECTED]>
wrote:
> I don't know if this answers the first part of your
> question. But in your
> third paragraph where you seem to reframe the
> question. What I've done in
> that case was to create servlet who's sole purpose
> is to initialize certain
> parameters (database properties, other static
> properties, etc). The servlet
> loads at startup before the struts servlet. I hope
> this helps. I've been
> doing struts for a whole 2 days now!
> - Original Message -
> From: "Calvin Yu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, April 15, 2001 11:01 AM
> Subject: System level properties?
> 
> 
> > Hi,
> >
> > I apologize in advance if this question has been
> asked
> > before, but I've search the mail archives and docs
> and
> > haven't come up with an answer.
> >
> > Is there a place to specify system-level
> properties in
> > Struts?  For example, if the the Model components
> > needed to retrieve environment related properties
> > (remote server host and port, location of
> > initialization files, etc), where would we get
> them
> > from?  I saw the 'application' initialization
> > parameter, but that didn't seem to be the same
> context
> > of properties I'm trying to retrieve.
> >
> > Another way to ask the question would be, where is
> the
> > equivalent of overriding init() in HttpServlet to
> > initializing the system?  Is subclassing
> ActionServlet
> > the preferred way?
> >
> >
> > Calvin
> >
> > __
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> 


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: Packaging Question - Include Source in Binary Distributions?

2001-04-24 Thread Calvin Yu

I would prefer to have the source available.  I like
the ease doing an installation without having to run a
build, and the ability to look at the source if
anything goes wrong.

I'd suggest jaring up the source in a src.jar, like
the JDK.

Calvin


--- Wong Kok Wai <[EMAIL PROTECTED]> wrote:
> Just the binary with docs and examples (with
> sources).
> Thanks!
> 
> --- "Craig R. McClanahan" <[EMAIL PROTECTED]>
> wrote:
> > As we move towards a 1.0 release of Struts
> (really! 
> > :-), one of the
> > things I am cleaning up is the way that binary
> > distributions are
> > packaged.  Currently, we follow the typical
> Jakarta
> > pattern of including
> > the source code for Struts in the binary
> > distribution (in the "etc",
> > "src", and "web" directories), as well as in a
> > separate download.
> > 
> > My question is, do people find the fact that the
> > binary distribution
> > includes source code useful, or would it be OK to
> > just point you at the
> > download URL for the source distribution if you
> want
> > it?  For recent
> > builds, this would cut the size of the binary
> > distribution by about one
> > third.
> > 
> > I'm fine with doing it either way, but wanted to
> get
> > some feedback from
> > the community before making a final decision.
> > 
> > Craig
> > 
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great
> prices
> http://auctions.yahoo.com/


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: FW: Session scope

2001-04-24 Thread Calvin Yu

Here's my experience with this issue.  We used
in-memory session failover in WL, but due to problems
with the WL proxy we switched to JDBC session
persistence.  We then dropped clustering and session
persistence altogether because of performance reasons
and used switches to make sure that users always hit
the same WL instance.

Things to note about my experience:

 * There were ways to optimize the session database
(Oracle) which we didn't explore.

 * Session failover wasn't as important as we thought.
 At least not more so than performance.

Calvin

--- "Chen, Yong" <[EMAIL PROTECTED]> wrote:
> Application server level load balancing is the
> answer to the problem.
> I don't see there is a strong reason to synchronize
> two sessions on two different app servers. Because
> the web server or proxy server will establish the
> link between the client and app server the very
> first time the connection is made. After that, the
> client (browser) will bind to the same app server.
> So, session info should only be kept in that
> particular app server. 
> 
> However, if you want to do session level fail-over,
> then like Weblogic app server, you will utilize
> their cluster feature to sync the secondary app
> server with the primary app server in case the
> primary is down. This requires to use BEA's weblogic
> proxy feature to detect such failure of primary app
> server down.
> 
> In current generation of web apps, should any
> services is needed to be distributed, you can use
> EJB, RMI, CORBA or COM/COM+. Session related info
> should be in the memory of app server. Session is
> transient, not persistent. 
> 
> 
> Yong Chen
> 
> -Original Message-
> From: Peter Smith [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 23, 2001 5:38 PM
> To: [EMAIL PROTECTED]
> Subject: Re: FW: Session scope
> 
> 
> I'm definitely considering running Struts with at
> least 2 JVMs - one on each of 2 boxes.  At first I
> didn't even consider the effects of running multiple
> JVMs - never done it!
> 
> Currently, my company has a big Oracle focus. 
> There's
> only one Oracle instance so they're using it to
> maintain session info across multiple app servers. 
> This requires a db hit for every HTTP request.
> 
> I can handle the memory requirements.  I just want a
> better way to coordinte session info across JVM's.
> 
> In the past I've written a poor-man's
> 'serialization'
> module for PERL which just kicked-out all the
> accumulated HTML parameters into  tags. 
> Wonder if I can do something similar for Struts
> environment w/o giving up too much of the
> functionality I'm using Struts for in the first
> place.
> 
> Are there any gotchas we can think of with using
> Struts across JVM's?
> 
> P.S. I wonder if Tomcat project is planning some
> kind
> of session-sync technology.
> 
> --- "Maguire, James" <[EMAIL PROTECTED]> wrote:
> > Obviously, design decisions have been made on the
> > session context.
> > 
> > Is anyone running (or considering running) Struts
> in
> > a truly distributed
> > server infrastructure?
> > Does Craig's suggestion of Serializable session
> > beans stand up under volume?
> > 
> > Just looking for some pointers.
> > 
> > Jim
> > 
> > -Original Message-
> > From: Craig R. McClanahan
> > [mailto:[EMAIL PROTECTED]] 
> > Sent: Friday, April 13, 2001 11:03 PM
> > To: Struts-User@Jakarta. Apache. Org (E-mail)
> > Subject: Re: Session scope
> > 
> > 
> > 
> > 
> > On Tue, 10 Apr 2001, Girish Baxi wrote:
> > 
> > > I am a new strut user  as far as i know ,
> isnt
> > it a bad idea to store
> > > data in the session scope simply becoz its not
> > scalable for a multiple web
> > > server scenario ...
> > > is there any work around to using session scope
> in
> > case of form beans that
> > > span more than one html page ???
> > > 
> > > any guidance is appreciated,
> > > thanx
> > > 
> > > 
> > > 
> > 
> > Let's understand what is really happening in order
> > to understand what the
> > potential impacts are:
> > 
> > * An HttpSession, as implemented by your servlet
> > container, typically
> >   uses something like a Hashtable or a HashMap to
> > store session
> >   attributes.
> > 
> > * When you create a bean instance, the bytecodes
> > that make up the
> >   executable methods of your bean are shared
> across
> > all instances -- the
> >   only thing that takes memory is the bean
> > properties themselves.
> > 
> > * Let's assume that your bean uses about 1000
> bytes
> > for the properties
> >   that are unique to that bean, and you want to
> save
> > a bean in each
> >   user's session because it represents information
> > you need over more
> >   than one request.
> > 
> > * If you have 10,000 simultaneous users, that
> means
> > you need roughly
> >   ten megabytes (10,000 * 1000) of memory to store
> > these objects.  Whether
> >   that is a problem or not depends on how much
> free
> > memory you have.
> > 
> > * Some application servers support load balancing
> > and distribution

Re: Interm page

2001-04-24 Thread Calvin Yu

Here are your options:

  You can deliver the interim page but hold the
connection until the action finishes.  The interim
page should have javascript that onload will redirect
to a resolution page.  The resolution page will look
into the session for errors and redirect to the error
page if an error is found, otherwise redirect to the
success page.  This solutions is the best visually,
but has the draw back of breaking most Struts-like
architectures.  I can't say if Struts can support
this, but from what I've seen it can't.  You could do
this in a generic servlet outside of Struts however. 
Also, holding the connections caused a lot of
low-level headaches as far as dealing with web server
proxies, browser behavior, and application servers.

  The other way it can be done is to make the interim
page a frame set that has a frame that takes up the
full frameset.  This page will show the wait message. 
Then have a hidden frame which hits a url that does
the actual action and returns an HTML containing
javascript to redirect to the success or failure URL. 
This should be doable in Struts, but has disadvantages
visually where in some browsers the loading icon is
not spinning and the hourglass will show up only over
certain hotspots.

Calvin

--- Biggs <[EMAIL PROTECTED]> wrote:
> Greetings,
> 
> What I wish to develop is an intermediate page
> after certain actions. For example, one situation
> would be the user edits and saves changes to a form,
> in which I wish to take them to a interim page
> indicating we are processing their action. Once the
> action is complete the appropriate page is
> displayed; success (the changes to form is displayed
> along with a message indicating the changes were
> saved successfully.) or an error( indicating why the
> changes were unable to be saved ). Can anyone
> provide some assistance?
> 
> Thanx in advance.
> 
> Biggz
> 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Help me defend Struts taglibs!!!

2001-04-26 Thread Calvin Yu

What are their arguments for using scriplets?

Calvin

--- Firmin David <[EMAIL PROTECTED]> wrote:
> Hi all,
> Members of my team are gradually turning against
> using the Struts taglibs
> and resorting to scriptlets.
> IMHO: scriptlets bad,  tags good. I've had more
> experience in using them
> than the others, but I'm finding it difficult to
> fight my corner in the face
> of ever increasing skepticism.
> Could anyone out there with really valid arguments
> as to why the use of the
> Struts taglibs (especially the logic tags as they're
> getting the most grief
> from my team at the moment) or taglibs in general is
> "good", or why the use
> of scriptlets is "bad" help me out (in the interest
> of fairness, vice versa
> arguments also happily received!)??
> 
> Thanks in advance
> 
> Regards
> David
> 
>

> The information in this email is confidential and is
> intended solely
> for the addressee(s).
> Access to this email by anyone else is unauthorised.
> If you are not
> an intended recipient, you must not read, use or
> disseminate the
> information contained in the email.
> Any views expressed in this message are those of the
> individual
> sender, except where the sender specifically states
> them to be
> the views of Capco.
> 
> http://www.capco.com
>
***
> 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Help me defend Struts taglibs!!! (XML/XSL GUI tool)

2001-04-27 Thread Calvin Yu

Check out Excelon's Stylus.  I looked at their beta
more than a year ago an it was very promising.  I
think it only works for HTML output though.

Calvin

--- "Duffey, Kevin" <[EMAIL PROTECTED]> wrote:
> scriplets are faster from what I understand as
> taglibs require some object
> creation, and they use the PrintWriter for output.
> Scriplets are much uglier
> though..and are much like adding html to servlets.
> Its much harder to
> manage.
> 
> Personally, I prefer using XSL and JSP for dynamic
> XML output. That way,
> scriplets in JSP are for conditional dynamic XML
> output, and XSL handles the
> layout of the site.
> 
> I just wish I could find a tool that could allow gui
> building of pages using
> XSL and XML.
> 
> > -Original Message-
> > From: Chris Butler
> [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, April 26, 2001 2:33 AM
> > To: [EMAIL PROTECTED];
> '[EMAIL PROTECTED]'
> > Subject: Re: Help me defend Struts taglibs!!!
> > 
> > 
> > * unified API
> > * consistent behavior, performance
> > * growing industry support
> > * single-point of functionality management
> > 
> > scriptlets tend to be ad-hoc, slap-together and
> > not consistent across all JSPs.
> > 
> > performance-wise, i'm unsure.  i'm don't have
> enough
> > experience in JSPland to know the subtle details,
> but
> > i'm definitely sure that taglibs can be tuned
> whereas
> > scriptlets would have to be handled one-by-one.
> > 
> > just my $0.02 though.  i really believe that most
> java
> > code should vanish from JSPs.  it's a separation
> of
> > church and state sort of belief...  why should UI
> guys
> > have to know any java?
> > 
> > also, of interest, is the jakarta taglibs project
> which
> > has a very interesting XSL taglib which seems to
> have all
> > kinds of potential when thinking about XML...
> > i think craig contributed to it, so there must be
> some
> > struts interest in its functionality.
> > 
> > c
> > 
> > At 09:46 AM 4/26/2001 +0100, Firmin David wrote:
> > >Hi all,
> > >Members of my team are gradually turning against
> using the 
> > Struts taglibs
> > >and resorting to scriptlets.
> > >IMHO: scriptlets bad,  tags good. I've had more
> experience 
> > in using them
> > >than the others, but I'm finding it difficult to
> fight my 
> > corner in the face
> > >of ever increasing skepticism.
> > >Could anyone out there with really valid
> arguments as to why 
> > the use of the
> > >Struts taglibs (especially the logic tags as
> they're getting 
> > the most grief
> > >from my team at the moment) or taglibs in general
> is "good", 
> > or why the use
> > >of scriptlets is "bad" help me out (in the
> interest of 
> > fairness, vice versa
> > >arguments also happily received!)??
> > >
> > >Thanks in advance
> > >
> > >Regards
> > >David
> > >
> >
>
>*
> > ***
> > >The information in this email is confidential and
> is intended solely
> > >for the addressee(s).
> > >Access to this email by anyone else is
> unauthorised. If you are not
> > >an intended recipient, you must not read, use or
> disseminate the
> > >information contained in the email.
> > >Any views expressed in this message are those of
> the individual
> > >sender, except where the sender specifically
> states them to be
> > >the views of Capco.
> > >
> > >http://www.capco.com
> >
>
>*
> > **
> > 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Potential Security Flaw in Struts MVC

2001-05-07 Thread Calvin Yu


I think that this potential exploit should probably be
thoroughly documented, along with potential
workarounds.  Last thing we want is to have Struts
being tagged as being unsecure.

Calvin

--- David Winterfeldt <[EMAIL PROTECTED]> wrote:
> If you share a bean between two security groups, you
> can still have separate actions.  Only an authorized
> user of the group could access its action.  Then the
> non-administrative action doesn't save the
> administrative only field.
> 
> David
> 
> --- Jeff Trent <[EMAIL PROTECTED]> wrote:
> > That is not what my thinking was.  But that could
> be
> > an issue also.  My
> > concern is someone intentionally and maliciously
> > creating a form to supply
> > more parameters than originally intented by the
> > developer.  For instance,
> > consider the UserForm fields:
> > 
> > Name(available to enrollment &
> > administrative interface)
> > Address(available to enrollment &
> administrative
> > interface)
> > Phone(available to enrollment & administrative
> > interface)
> > Email(available to enrollment & administrative
> > interface)
> > ApprovedUserFlag(available to administrative
> > interface only)
> > AdministrativeUserFlag (available to
> administrative
> > interface only)
> > 
> > If a user knows your naming concention, they can
> > write their own form to
> > override the administrative-level fields above.
> > 
> > 
> > - Original Message -
> > From: "Anthony Martin" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, May 07, 2001 11:59 AM
> > Subject: RE: Potential Security Flaw in Struts MVC
> > 
> > 
> > > Jeff,
> > >
> > > Are you asking if book marking a URL that
> contains
> > query parameters might
> > be
> > > a security risk?
> > >
> > >
> > > Anthony
> > >
> > > -Original Message-
> > > From: Jeff Trent [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, May 07, 2001 8:37 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Potential Security Flaw in Struts MVC
> > >
> > >
> > > I may be wrong about this (only been working w/
> > Struts for a week now).
> > But
> > > I do see a potential security flaw in struts
> that
> > I would like to hear
> > from
> > > others regarding.
> > >
> > > Consider a simple set of struts classes that
> > represent a user in a system.
> > > You would probably have classes that look
> > something like this:
> > > User(the model representing
> > the user)
> > > UserForm(an enrollment form for a
> new
> > user)
> > > UserAction(Saves the UserForm
> > information to db, etc)
> > >
> > > The User class would have accessors and
> modifiers
> > like getFirstName(),
> > > setFirstName(), getAdministrativeUserFlag(),
> > setAdministrativeUserFlag(),
> > > etc.  The basic implementation of the UserForm
> is
> > to take the UI form
> > data,
> > > introspect the beans, and call the correct
> > modifier of the UserForm bean
> > > based on the fields contained within the UI
> > submission/form.  A developer
> > of
> > > course would not expose the "Administrative User
> > Flag" option on the UI
> > for
> > > enrollment (that would be found possibly in some
> > other
> > administrative-level
> > > module).  However, if someone is familiar with
> the
> > db schema and the
> > naming
> > > convention the developer used, that user could
> > subvert the application by
> > > writing his own version of the UI which contains
> > an "Administrative User
> > > Flag" field (or any other field for that matter)
> > and the basic form
> > > processing in Struts will kindly honor the
> request
> > and set the
> > > "Administrative Flag" on the user.  Unless, of
> > course, the developer makes
> > > special provisions to prevent this behavior. 
> > However, its not entirely
> > > obvious to the struts user (in my opinion) that
> > this is even a concern.
> > Am
> > > I making sense here?
> > >
> > > - jeff
> > >
> > 
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great
> prices
> http://auctions.yahoo.com/


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Application Scoped Object Initialization

2001-05-08 Thread Calvin Yu

I asked this question a few weeks ago and believe the
answer is to write a servlet, override init() and
destroy(), and set up the servlet to load the servlet
at server startup.

With Servlet 2.3, you can add ServletContextListeners
in the web.xml to do the same thing.

Calvin

--- Jeff Trent <[EMAIL PROTECTED]> wrote:
> What is the suggested method for singleton,
> application scoped object initialization?  Where &
> how does it happen?
> 
> I want to create a singleton containing shared
> cached lists to be used in populating html:options
> with.
> 
> Thanks.
> 
> 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Potential Security Flaw in Struts MVC

2001-05-08 Thread Calvin Yu


Here's a quick write up.  Let me know if you have
problems with it.  I tried to use an example that is
as real world as possible and that cannot necessarily
be fixed with some user realm/role solution.

Calvin

--- Ted Husted <[EMAIL PROTECTED]> wrote:
> Feel free. If you would like to document it, I'd be
> happy to find a
> place for it in the users guide.
> 
> Calvin Yu wrote:
> > 
> > I think that this potential exploit should
> probably be
> > thoroughly documented, along with potential
> > workarounds.  Last thing we want is to have Struts
> > being tagged as being unsecure.


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

Security considerations when reusing ActionForms and Actions


Because Struts will blindly copy fields from an HTML form to a ActionForm object, 
developers should take caution when reusing ActionForms and Actions.  For example, 
suppose you have a subclass of ActionForm called UserForm which allows a user to 
update their profile information.  This form has common user related attributes like 
'password', 'firstName', and 'lastName'.  Now if your web application is a co-branded 
application, a common occurence is to have users of one brand have features that are 
not available to users of other brands.  To accommodate this, you add attributes to 
the UserForm such as 'wirelessAccess' and 'emailReports', and have your Action 
determine that these fields are disabled if null.  Well, what can happen now is that a 
very knowlegdeable user of any brand can submit a custom HTML form that has those 
attributes and enable them.  Note that this problem does not exist only for co-branded 
web applications but can occur for other web application as well.

Workarounds

  * Perform validation in the ActionForm or Action that makes sure that you are 
getting the values you are expecting to get in the given context.

  * Create separate forms for the different contexts.



Re: Struts and DAO pattern. Expensive?

2001-05-08 Thread Calvin Yu


--- Vanderlei Silva <[EMAIL PROTECTED]> wrote:
> The 
> problems with this approach are: the DAOs are not a
> member of the Business 
> objects, but work in parallel with them. Thus, the
> controller deals with 
> both the business objects and the DAOs, and makes
> all the "control", serving 
> also as a bridge, or facade.

I'm having trouble seeing the disadvantage here.

Calvin

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Struts and DAO pattern. Expensive?

2001-05-08 Thread Calvin Yu

Why not have your Managers create a connection as well
as taking in a connection?

Calvin

--- Shunhui Zhu <[EMAIL PROTECTED]> wrote:
> That opens up lots of questions I also have, I'm
> sure many of you have
> some
> solutions to these:
> 
> (1)I went through a similar exercise, I first
> followed the Petstore
> example, 
> to have a getConnection() method in my DAOs (well, I
> have BaseDAO, so at
> least the code is not duplicated). The good thing,
> as pointed out, is
> that the
> business object plus the DAO become self-contained.
> The bad thing is
> there
> are too many connections open. At first I thought
> that since I'm using 
> connection pool, getting a connection is not too
> expensive. But I
> quickly found
> out there are a huge number of connections open at
> anytime for a not so
> complicated object hierarchy. So now all my save,
> delete methods now
> take
> a connection parameter (which is also for
> transaction purposes).
> 
> But this leads to another problem
> 
> (2) I follow the convention that all my business
> objects have: Foo,
> FooDAO, 
> FooManager (and even FooFactory). FooManager
> contains the finder methods
> (getByID,
> getAll, etc.), now these also take a connection as a
> parameter. But I
> also made
> a decision to hold id references rather than object
> reference in my
> business objects
> (to avoid huge object hierarchy loading), and only
> lazily load a
> dependent object
> when getFooChild() is called (which has no
> parameter, as usual), which
> calls the 
> manager classes, but now there doesn't seem to be a
> good place to get
> the connection 
> to pass to getByID.
> 
> What is a better way? anything should be done
> differently with or
> without entity EJBs?
> 
> Any comments are appreciated.
> 
> Thanks.
> 
> Shunhui
> 
> -Original Message-
> From: Vanderlei Silva
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 6:00 PM
> To: [EMAIL PROTECTED]
> Subject: Struts and DAO pattern. Expensive?
> 
> 
> Hi all,
> 
> I'm right now having to deal with some tough design
> decisions concerning
> 
> Data Access Objects (DAOs). I know this is really
> not a direct related 
> Struts question, but I also understand that
> everybody in this list
> already 
> faced this issue while integrating Struts in their
> model.
> 
> I'm not using EJBs but this should really not be an
> issue, as the DAOs
> are 
> supposed to be reusable in non-EJBs designs as well.
> What I have is
> struts 
> dealing with controllers, and these controllers
> dealing with business
> ojects 
> and DAOs. Let's see what I found/have:
> 
> - J2EE Pet Store, in their DAO objects, for every
> new business method,
> they 
> get a new connection from the pool and later release
> it. This makes the
> code 
> cleaner at the controller side, but VERY repetitive
> at the DAO side
> (note 
> that they replicate the
> getConnection,closeConnection, closeResultSet, 
> etc... all over the DAOs. It's kind of amazing to
> see such a replication
> in 
> a reference implementation. It also sounds very,
> very expensive to get a
> new 
> connection every time. In some cases, a business
> method makes a call to 
> another business method, and they are getting the
> connection twice for
> this. 
> Imagine a call where the controller needs to talk to
> 3 DAOs and perform 
> about 10 business method calls. They will get and
> close the connection
> 10 
> times. The connection pool, managed by the
> application server, will more
> 
> than likely create a bottle neck in this whole
> thing.
> 
> - in my approach, while testing, the controller is
> responsible for
> getting a 
> new connection and forwarding it (through
> parameters) to the DAOs. The 
> problems with this approach are: the DAOs are not a
> member of the
> Business 
> objects, but work in parallel with them. Thus, the
> controller deals with
> 
> both the business objects and the DAOs, and makes
> all the "control",
> serving 
> also as a bridge, or facade. The advantage of this
> approach is that 
> basically, for every user request, you will have
> only one connection
> lookup, 
> doesn't matter how many DAOs methods you call from
> different objects in 
> order to full fill the request.
> 
> I need to confess I'm lost. The PetStore approach
> sounds cleaner in some
> 
> sence, but also sounds too repetite in other, and
> mostly, sounds way to 
> expensive (or it isn't?).
> 
> How do you see all this?
> 
> Regards,
> 
> Vanderlei
> 
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com
> 
> 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: Basic Design Question...

2001-05-10 Thread Calvin Yu


I think some people are missing the point you're
trying to make, so I I'm going to take a stab at it.

Yes, the Servlet and Action APIs are very similar, but
a Servlet and an Action really have are two different
entities.  A Servlet's set of interfaces covers what
is required of an Action and much more.  You usually
want to have a set of interfaces that describes
succinctly what an entity is suppose to do.  An Action
performs a particular web action.  This does not
necessarily describe a servlet.  You would risk
bringing in a lot of confusion into the whole
framework.  Can an Action be setup as a standalone
Servlet?  To what extent should an Action adhere to
the Servlet spec?  What would the init() and destroy()
methods do?

Calvin

--- Prakash Dominic <[EMAIL PROTECTED]> wrote:
> 
> I understand MVC/Model 2.  And I don't
> think Action layer in Struts map to Model in MVC. 
> Actions in Struts are -Controllers- in the MVC
> pattern as they translate user actions to the Model
> and select the appropriateView.
> 
> The point I was trying to make was that, instead of
> creating a whole new set of APIs why not leverage
> the
> existing Servlet API/spec for the -Controller-
> layer. 
> 
> And I am not still clear what the problem is with
> having
> many Servlets(still java instances under the hood).
> 
> --Prakash
> 
> 
> -Original Message-
> From: Jason Chaffee <[EMAIL PROTECTED]>
> Date: Wed, 9 May 2001 14:03:01 -0700 
> To: "'[EMAIL PROTECTED]'"
> <[EMAIL PROTECTED]>
> Subject: RE: Basic Design Question...
> 
> 
> > Read up on the MVC/Model 2 design pattern.  Struts
> is based on this design
> > pattern.  It much better to have one servlet
> (controller) and several
> > actions (models), than to have serveral servlets.
> > 
> > -Original Message-
> > From: Prakash Dominic
> [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, May 09, 2001 2:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: Basic Design Question...
> > 
> > 
> > Hello Folks,
> > 
> > A quick design question. This might be nit 
> > picking from a design standpoint but still a
> > valid question.
> > 
> > Struts uses the Action.perform(...) API for 
> > action hadling/controller. I am curious to know
> > why Servlets can't be used for the Action Handling
> > layer. That way there is no need to introduce
> > 2 new APIs to learn - Action and
> struts-config.xml.
> > 
> > The web.xml could replace the struts-config for 
> > action mapping. And framework users simply
> implement
> > Servlets instead of Action subclasses.
> > 
> > Does this make sense or am I am missing something
> > here ?
> > 
> > Thanks,
> > Prakash
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 
> > ===
> > 
> > Another FREE service from Jayde Online <  HREF="http://www.jayde.com>" TARGET="_new"> COLOR="BLUE">http://www.jayde.com>
> > Private, Web-based email accounts at   HREF="http://www.jaydemail.com"; TARGET="_new"> COLOR="BLUE">http://www.jaydemail.com
> > 
> > Powered by Outblaze
> > 
> 
> -- 
> 
> ===
> 
> Another FREE service from Jayde Online
> 
> Private, Web-based email accounts at
> http://www.jaydemail.com
> 
> Powered by Outblaze


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: RES: handling exceptions

2002-01-28 Thread Calvin Yu

At 11:04 AM 1/28/2002 -0500, you wrote:
>Aside from functional differences, it is not practical or advisable for
>everyone to adopt JDK 1.4 as soon as it hits release. For one thing, Sun
>only releases the JDK for Windows and Solaris platforms. What if you are
>using Linux? Or AIX? Or HP-UX? Or AS/400?

I believe that since 1.3.1, Sun has release of their latest JDK's to the 
Windows, Solaris, and *Linux* platforms simultaneously.  Just a small 
clarification.

Calvin


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: