MappingDispatchAction

2004-01-29 Thread Graham Lounder
Hey All,

I grabbed the nightly build for struts yesterday and notice the
MappingDispatchAction.  Can I used this function in my Struts 1.1 code?  It
looks like a regular extension to the Action class (through the
DispatchAction).

Also, is Struts 1.2 far off?  I'd really like to use the wildcard matching
in my current project.  I've got about 20 lookup tables and the action
mappings are getting out of hand (view,search,insert,update,delete x 20).
If its possible, can I grabbed the classes responsible for this
functionality and update by Struts 1.1 code?

Cheers,
Graham

Graham Lounder - Java Developer
Spatial Components Division
CARIS www.caris.com
Tel: +1-506-458-8533 Fax: +1-506-459-3849
CARIS has expanded to new office facilities. Our new mailing address is:
115 Waggoners Lane, Fredericton, New Brunswick, E3B 2L4, Canada.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



BeanUtils Date Converter

2004-01-19 Thread Graham Lounder
Hey all,

I know this question has been addressed numerous times but I can't seem to
find the answer.

I'm trying to convert strings in my forms to java.sql.Date in my dto.  Its
throwing a conversion error when my form value is null or blank.  Is there a
way to get nulls or passed through the BeanUtils.copyProperties function?  I
read that I may be able to create my own converters too.  Is there any
documentation on this?

Cheers,
Graham

Graham Lounder - Java Developer
Spatial Components Division
CARIS www.caris.com
Tel: +1-506-458-8533 Fax: +1-506-459-3849
CARIS has expanded to new office facilities. Our new mailing address is:
115 Waggoners Lane, Fredericton, New Brunswick, E3B 2L4, Canada.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: BeanUtils Date Converter

2004-01-19 Thread Graham Lounder
Of course, right after I sent the email, I figured out my problem.  I
created the following class, then registered it in my ContextListener using
this line:

ConvertUtils.register(new SqlDateConverter(), java.sql.Date.class);




package com.caris.pmis.util;
import java.sql.Date;
import org.apache.commons.beanutils.Converter;
import org.apache.commons.beanutils.converters.*;

public class SqlDateConverter implements Converter
{
  private org.apache.commons.beanutils.converters.SqlDateConverter
sqlDateConverter = new
org.apache.commons.beanutils.converters.SqlDateConverter();


  public Object convert(Class type, Object value)
  {
if(value == null || value.toString().length()  1)
  return null;

return sqlDateConverter.convert(type, value);
  }
}



Cheers,
Graham


-Original Message-
From: Graham Lounder [mailto:[EMAIL PROTECTED]
Sent: January 19, 2004 3:30 PM
To: [EMAIL PROTECTED]
Subject: BeanUtils Date Converter


Hey all,

I know this question has been addressed numerous times but I can't seem to
find the answer.

I'm trying to convert strings in my forms to java.sql.Date in my dto.  Its
throwing a conversion error when my form value is null or blank.  Is there a
way to get nulls or passed through the BeanUtils.copyProperties function?  I
read that I may be able to create my own converters too.  Is there any
documentation on this?

Cheers,
Graham

Graham Lounder - Java Developer
Spatial Components Division
CARIS www.caris.com
Tel: +1-506-458-8533 Fax: +1-506-459-3849
CARIS has expanded to new office facilities. Our new mailing address is:
115 Waggoners Lane, Fredericton, New Brunswick, E3B 2L4, Canada.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



New Tag Files vs Tiles??

2003-12-17 Thread Graham Lounder
Hey all,

I just learned about the new tag files in the JSP 2.0 spec by playing around
with the tomcat 5 examples.  I'm wondering since these tag files seem so
easy to create, could they be used as another templating mechanism similar
to tiles?  Does anyone see any reason why you would want to use one over the
other?  Any comments?

Cheers,
Graham


Graham Lounder - Java Developer
CARIS Spatial Components Division
[EMAIL PROTECTED]
Phone:  (506) 458-8533
Fax:(506) 459-3849

NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME
AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Action Design Question

2003-09-26 Thread Graham Lounder
Hey all,

After reading the [Poll] action mappings thread, I now have a couple of
design questions.  I've got a lot of actions right  now and I'd like to
group related functionality into one action.  I'm thinking of extending the
DispatchAction and creating functions to
search/view/create/update/delete/load my objects.  I'd like to create
separate action mappings for each function.  My question is, can I
hardcode my dispatch parameter in the action mapping or do I have to send
it in ever request from the page?

Thanks in advance,
Graham


Graham Lounder - Java Developer
CARIS Spatial Components Division
[EMAIL PROTECTED]
Phone:  (506) 458-8533
Fax:(506) 459-3849

NO BINDING CONTRACT WILL RESULT FROM THIS EMAIL UNTIL SUCH TIME
AS A WRITTEN DOCUMENT IS SIGNED ON BEHALF OF THE COMPANY.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DisplayTag library

2003-09-26 Thread Graham Lounder
I've got a quick question about the new version of the display tag library.
All my database queries are paged at the database level with a start and end
index.  Could I modified the display tag libraries to support this without
much work?

Cheers,
Graham

-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Friday, September 26, 2003 12:33 PM
To: 'Struts Users Mailing List'
Subject: RE: DisplayTag library


Here's a temporary demo site - this URL will self-destruct as soon as the
live examples is working:

http://raibledesigns.com/displaytag

;-)

-Original Message-
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED]
Sent: Friday, September 26, 2003 9:27 AM
To: Struts User List ([EMAIL PROTECTED])
Subject: DisplayTag library


I saw the announcement of the SidplayTag library here a couple of days
ago, and it looks useful. But Clicking the Live Examples link on its
web page yields a 404 (page not found). And I would like to use a
ColumnDecorator, but where's the documentation on that? In the ZIP download
file, there are *two* ColumnDecorator classes, one in
/org/displaytag/decorator package, the other in org/apache/taglibs/display
package. But there's no mention of this package at the Apache site. So
where's the documentation?


--
Tim Slattery
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [OT] Rendering Large ResultSet - Value List Handler Design Pattern

2003-08-14 Thread Graham Lounder
Have you checked out OJB yet?  I use google like paging in all my
applications and OJB lets me use any database I want.  Its worth a look at
any rate.

http://db.apache.org/ojb

Cheers,
Graham



-Original Message-
From: Paananen, Tero [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 2:13 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] Rendering Large ResultSet - Value List Handler Design
Pattern


 Some databases let you specify a LIMIT clause, which limits
 the results
 to whatever you specify, and an OFFSET clause, which starts
 the results
 at the indicated offset.  Using these you can achieve an
 elegant subset
 of results based on start and end position (and it is IMHO
 the best way
 to implement the kind of feature you're describing).

The disadvantage of this approach is that you'll be
tieing your implementation to a specific db vendor
at that point. DB vendors implement such functionality
differently, from what I've seen.

I've yet to see an application that does NOT target a
specific db though. YMMV.

-TPP

-
This email may contain confidential and privileged material for the sole use
of the intended recipient(s). Any review, use, retention, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact the
sender by reply email and delete all copies of this message.  Also, email is
susceptible to data corruption, interception, tampering, unauthorized
amendment and viruses. We only send and receive emails on the basis that we
are not liable for any such corruption, interception, tampering, amendment
or viruses or any consequence thereof.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Odd logging message

2002-12-10 Thread Graham Lounder
Hey all,

Since I upgraded to Struts 1.1b  I have been getting the following messages
in my standard output:

processActionForward(/secure/index.jsp, false)
  '/secure/index.jsp' - processed as uri

Does anyone know why these messages show up?  Also does anyone know how to
turn them off short of commenting them out and recompiling.

Thanks in advance,
Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4263
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Odd logging message

2002-12-10 Thread Graham Lounder
I would assume it was a commons logging message but the message is not
formatted that same as my other logging messages which makes me think its a
System.out.println message.

Here is a larger snippet to show you what I mean:

// START SNIPPET ---

DEBUG TimerFilter - /nsprd/secure/map/generate.do: Requested By loundernt
DEBUG MapGenerateAction - Init Time: 0.0
DEBUG MapGenerateAction - Action Time: 0.0
DEBUG MapGenerateAction - Layer Time: 0.08
DEBUG MapController - refresh()  Time: 184.455 seconds
processActionForward(/secure/map/map.jsp, false)
  '/secure/map/map.jsp' - processed as uri
DEBUG TimerFilter - /nsprd/secure/map/generate.do: Time 184.706 seconds

// END SNIPPET --


Any more ideas?

Graham

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]]
Sent: December 10, 2002 11:13 AM
To: [EMAIL PROTECTED]
Subject: Re: Odd logging message


That looks like a Tiles message which are controlled with the commons
logging properties.

David






From: Graham Lounder [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Odd logging message
Date: Tue, 10 Dec 2002 10:54:33 -0400

Hey all,

Since I upgraded to Struts 1.1b  I have been getting the following messages
in my standard output:

processActionForward(/secure/index.jsp, false)
   '/secure/index.jsp' - processed as uri

Does anyone know why these messages show up?  Also does anyone know how to
turn them off short of commenting them out and recompiling.

Thanks in advance,
Graham


   Graham Lounder
   Java Developer
   Spatial Components Division
   CARIS
   264 Rookwood Ave
   Fredericton NB E3B-2M2
   Office 506 462-4263
   Fax506 459-3849
   [EMAIL PROTECTED]
   http://www.spatialcomponents.com



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


_
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Remote User and Logoff

2002-07-25 Thread Graham Lounder

In my logoff action, I'm invalidating my session.  The problem is, the
getRemoteUser still returns the username when I forward to my jsp page.
Once I process another request, the remote user is set to null.

Is there any way in my LogoffAction servlet to set the remote user to null
before forwarding to the jsp page?

Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Login Question

2002-07-24 Thread Graham Lounder

I've searched the archives on this one.  There is a lot of information but I
can't seem to find what I'm looking for.

I'm currently using form based authentication in my application.  Works
great.  The problem is that now I need to add some business logic checks to
the mix (such as 'does the current user have an active account').  What is
the recommended way of doing this?  Add a filter?  Session Listener?  Do I
need to get rid of my form based authentication and role my own solution?

Any Ideas?
Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Struts Persistence

2002-07-23 Thread Graham Lounder

I've been using OJB for the past couple of weeks so I'm by no means an
expert.  What I can tell you is that OJB requires an OJB_SEQ table in the
database.  This allows OJB to hanlde autoincrementing fields on its own, and
not on any one specific implementation.

I have been using OJB with MsAccess and haven't had a problem yet (crossing
my fingers) :-)

Graham

-Original Message-
From: Joe Barefoot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 4:04 PM
To: Struts Users Mailing List
Subject: RE: Struts  Persistence


I haven't had time to play with OJB yet, but does anyone know if it works
properly with Oracle?  I mean, I know it should work fine with any DB for
generating select and update statements, but what about inserts when you are
using sequence numbers?  The increments are handled differently in different
databases, so I'm curious how OJB addresses this (if at all).

thanks,
Joe

-Original Message-
From: Mete Kural [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 11:42 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: Struts  Persistence


OJB is great. (jakarta.apache.org/ojb) You can easily
map your tables to objects. It works with MySQL. I
recommend that you implement DAO objects that call
OJB's APIs and keep all the persistence operations
there.

Good luck,
Mete

--- James Mitchell [EMAIL PROTECTED] wrote:
 I'll be uploading a modified version of the example
 app (struts-example.war)
 which uses OJB as soon as I can finish it.

 Basic O/R mapping using JDO API w/MySql on the
 backend.

 It's not there yet, but here's the url:
 http://sourceforge.net/projects/struts/


 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://www.open-tools.org/struts-atlanta




  -Original Message-
  From: Elderclei R Reami
 [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, July 23, 2002 2:54 PM
  To: [EMAIL PROTECTED]
  Subject: Struts  Persistence
 
 
  Hi again,
 
  Does anyone know about usage of persistence
 frameworks, like Torque  OJB
  from Apache Group, with Struts?
 
  Thanks for all the help with code generation. I
 downloaded StrutsBuilder
  and Eclipse+EasyStruts to evaluate and they are
 great tools. About self-
  generated apps from database schema and beer...
 Huhr! Sounds nice and we
  can start a new project from the idea :)
 
  Best Regards,
  Elder
 
  --
  To unsubscribe, e-mail:
 
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
 
 


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]



__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




dynamic links

2002-07-18 Thread Graham Lounder

Hello All,

I'm trying to make a link that sends a parameter containing the URL of the
page which called it.  I have all the URLEncoding figured out, my problem is
getting it into the html:link tag.

I have tried

html:link page=/bla/bla.jsp?returnURL=%= returnURL %bla/html:link

and

html:link page=%= /bla/bla.jsp?returnURL= + returnURL
%bla/html:link

neither of which work.


Right now what I'm doing is:

% String myLink = /bla/bla.jsp?returnURL= + returnURL; %
html:link page=%= myLink%bla/html:link

but this is very ugly.  I don't want to have to make a String variable for
each link on my page.  Any ideas?  Am I missing something?

Graham



  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: dynamic links

2002-07-18 Thread Graham Lounder

Yes, thats right!  I remember this problem now :)  I just don't have enuf
post-its on my computer to remind me of all these things.

Thanks for the insight!

Graham

-Original Message-
From: Bartley, Chris P [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 11:42 AM
To: 'Struts Users Mailing List'
Subject: RE: dynamic links


The key is in the crazy single and double quotes--your second example is
really close, just change the outer double quotes to singles, like this:

   html:link page='%= /bla/bla.jsp?returnURL= + returnURL
   %'bla/html:link

That should do it.

 -Original Message-
 From: Graham Lounder [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 18, 2002 9:38 AM
 To: Struts Users Mailing List
 Subject: dynamic links


 Hello All,

 I'm trying to make a link that sends a parameter containing
 the URL of the
 page which called it.  I have all the URLEncoding figured
 out, my problem is
 getting it into the html:link tag.

 I have tried

 html:link page=/bla/bla.jsp?returnURL=%= returnURL
 %bla/html:link

 and

 html:link page=%= /bla/bla.jsp?returnURL= + returnURL
 %bla/html:link

 neither of which work.


 Right now what I'm doing is:

 % String myLink = /bla/bla.jsp?returnURL= + returnURL; %
 html:link page=%= myLink%bla/html:link

 but this is very ugly.  I don't want to have to make a String
 variable for
 each link on my page.  Any ideas?  Am I missing something?

 Graham


 
   Graham Lounder
   Java Developer
   Spatial Components Division
   CARIS
   264 Rookwood Ave
   Fredericton NB E3B-2M2
   Office 506 462-4218
   Fax506 459-3849
   [EMAIL PROTECTED]
   http://www.spatialcomponents.com
 


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




ValidatorPlugIn ClassCastException

2002-07-16 Thread Graham Lounder

I'm not sure what I did, but when my app starts up, the validator fails to
load.  The commons-logging.jar is in both the lib and WEB-INF/lib directory
(tomcat 4.0.4).  I searched the mail archive and came up dry.  Any ideas?



PEI-iCIS: 2002-07-16 09:04:27,983 ERROR   ValidatorPlugIn:
java.lang.ClassCastException: org.apache.commons.logging.impl.Log4jFactory
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassCastException: org.apache.commons.logging.impl.Log4jFactory
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:497)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:340)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:400)
at org.apache.commons.digester.Digester.init(Digester.java:310)
at
org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknow
n Source)
at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.ja
va:219)
at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:167)
at
org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.
java:884)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:420)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
8)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3279)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at
org.apache.catalina.startup.CatalinaService.start(CatalinaService.java:261)
at
org.apache.catalina.startup.CatalinaService.execute(CatalinaService.java:172
)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.BootstrapService.main(BootstrapService.java:428)
Caused by: java.lang.ClassCastException:
org.apache.commons.logging.impl.Log4jFactory
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:495)
... 27 more




  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: ValidatorPlugIn ClassCastException

2002-07-16 Thread Graham Lounder

Ok, I found my problem.  Foolish me, I put jar files in my WEB-INF/lib
directory.  I moved all the commons and xerces jar files to the common/lib
directory and everything works.

Graham

-Original Message-
From: Graham Lounder [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 16, 2002 9:11 AM
To: Struts Users Mailing List
Subject: ValidatorPlugIn ClassCastException


I'm not sure what I did, but when my app starts up, the validator fails to
load.  The commons-logging.jar is in both the lib and WEB-INF/lib directory
(tomcat 4.0.4).  I searched the mail archive and came up dry.  Any ideas?



PEI-iCIS: 2002-07-16 09:04:27,983 ERROR   ValidatorPlugIn:
java.lang.ClassCastException: org.apache.commons.logging.impl.Log4jFactory
org.apache.commons.logging.LogConfigurationException:
java.lang.ClassCastException: org.apache.commons.logging.impl.Log4jFactory
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:497)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:340)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:400)
at org.apache.commons.digester.Digester.init(Digester.java:310)
at
org.apache.commons.validator.ValidatorResourcesInitializer.initialize(Unknow
n Source)
at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.ja
va:219)
at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:167)
at
org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.
java:884)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:420)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:91
8)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3279)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3421)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:638)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at
org.apache.catalina.startup.CatalinaService.start(CatalinaService.java:261)
at
org.apache.catalina.startup.CatalinaService.execute(CatalinaService.java:172
)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.catalina.startup.BootstrapService.main(BootstrapService.java:428)
Caused by: java.lang.ClassCastException:
org.apache.commons.logging.impl.Log4jFactory
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:495)
... 27 more




  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Using Reset to Load Drop Downs?

2002-07-10 Thread Graham Lounder

Yeah, that is what I started to do, loading my drop downs in the get method
if the list is null.  In the reset method I set my drop down lists to null.
I thought about putting them in the session and came to the same conclusion
as you, no way to determin when to get rid of them.

Does anyone have a better solution to this problem?  I feel all dirty
putting logic in my forms.

Graham

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 10, 2002 4:15 PM
To: Struts Users Mailing List
Subject: Re: Using Reset to Load Drop Downs?


I do that. The problems include getting error messages out when
something goes wrong, and potentially fetching huge lists if the
parameters are wrong. Can't think of any others.

I used to get the dropdown lists in the action, and store them in the
session, but I couldn't think of a way of getting rid of them from the
session easily.

Adam



Graham Lounder wrote:
 Hell All,

 I'm having a small problem with loading my drop downs after a validation
 error (since my action is not being called again).  It is recomended/good
 practice to load my drop downs in the reset method of the form?  Is it
 possible?  I would load them once my application starts, but I need to
 modify the list before it is displayed.

 Any Ideas?
 Graham

 
   Graham Lounder
   Java Developer
   Spatial Components Division
   CARIS
   264 Rookwood Ave
   Fredericton NB E3B-2M2
   Office 506 462-4218
   Fax506 459-3849
   [EMAIL PROTECTED]
   http://www.spatialcomponents.com
 


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]





--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Using Reset to Load Drop Downs?

2002-07-08 Thread Graham Lounder

Hell All,

I'm having a small problem with loading my drop downs after a validation
error (since my action is not being called again).  It is recomended/good
practice to load my drop downs in the reset method of the form?  Is it
possible?  I would load them once my application starts, but I need to
modify the list before it is displayed.

Any Ideas?
Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Displaying a dynamically created Image.

2002-07-05 Thread Graham Lounder

You can read in any file and encode it to jpeg and send it as a response.
Look up the Java Advanced Imaging API to find the JPEG Encoder/Decoder.  You
will also have to set your content type to image/jpeg.  Here is a sample
function I use to send my generated map image to the client.

private void sendImage(HttpServletResponse response, BufferedImage bi) {
try {
ServletOutputStream out = response.getOutputStream();
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
encoder.encode(bi);
} catch (IOException ioe) {
servlet.log(DrawMapAction: IO Exception encoding JPEG to
ServletOutputStream., ioe);
}
}

Then in my html, I make an image tag which points to my struts action such
as

html:img page=/secure/map/draw.do?ForceRefresh=%= (new
java.util.Date()).getTime() % border=0/

The force refresh is to make sure the client browser doesn't cache the
image.

http://java.sun.com/products/java-media/jai/

Hope this helps,
Graham



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 05, 2002 10:05 AM
To: [EMAIL PROTECTED]
Subject: Displaying a dynamically created Image.



How do I display a dynamically created Image with struts
without saving it to my local harddisc and link the image on it?
thanks matthias



Hanel Matthias
Fachinformatiker (Anwendungsentwicklung) in Ausbildung
Logistik World GmbH Fon:+49-841-9014-300
Marie-Curie-Strasse 6   Fax:+49-841-9014-302
D- 85055 Ingolstadt mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




bean:write format

2002-06-25 Thread Graham Lounder

Hello All,

I can't seem to find much documentation on the format option of the
bean:write tag.  I've search the mail archive and couldn't find anything.

I was able to format numbers by using ###.##0.00 in the format option.  My
question is, can you also format dates? Strings(etc phone numbers, postal
codes)?  What is the best way to do this in struts.

If there is no easy way to do this in struts, what else can you recomend?  I
believe there is a jakarta taglib which does some of this stuff.  Has anyone
used it?

Thanks in advance,
Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Printing on predesign form from html

2002-06-11 Thread Graham Lounder

I just started looking at solutions for writing reports for my project.  We
need to print off 5 reports at once, complete with page breaks, and it still
has to work in Netscape 4.  What I found was a free java library to create
dynamic PDF files called iText (http://www.lowagie.com/iText/).  I tested
this out in a struts action servlet and it works great.  Have a look and see
if it can help you out.

Graham

-Original Message-
From: Drago Jenko [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 6:54 AM
To: 'Struts Users Mailing List'
Subject: Printing on predesign form from html


Has someone solution, how to print from html (jsp) on predesign form (like
printing bills)!

Thanks, Drago





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




DispatchAction Default Method?

2002-06-06 Thread Graham Lounder

Is there any way to execute a default method on a DispatchAction in case the
user bookmarks a page where the dispatch request parameter has been submited
as a POST?  Overide the process method perhaps?  I couldn't find anything in
regard to this in the Javadoc.

Thanks in advance,
Graham


  Graham Lounder
  Java Developer
  Spatial Components Division
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Struts + Tiles: Design Question

2002-05-22 Thread Graham Lounder

Just a quick suggestion.  Couldn't you use javascript in your nav.jsp to
submit the form in the intro.jsp?  Or do you need form fields in the
nav.jsp?

Graham

- Original Message -
From: Sri Sankaran [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, May 22, 2002 2:53 PM
Subject: Struts + Tiles: Design Question


 Struts version: 1.0.2
 Servlet engine: Tomcat 4.0.2

 I am trying to build a wizard framework using Tiles.  It follows the
standard Windows wizard metaphor with a body panel and navigation buttons
below.  I am running into a problem and would like any opinions/suggestions.

 A logical use of Tiles would call for the body and nav buttons to be
separate tiles that are combined using the tileDefinitions file.  For
example:

   definition name=Wizard path=/wizardLayout.jsp
 put name=titlevalue=Title.jsp/
 put name=body  value=/
 put name=navigation   value=Nav.jsp/
   /definition

   !-- Intro page --
   definition name=Intro extends=Wizard
 put name=bodyvalue=workflow/intro/intro.jsp/
   /definition

 Here, the wizardLayout.jsp is solely responsible, as the name suggests,
for laying out the various tiles using necessary HTML tags.

 The problem with this strategy is that by separating the body and nav into
separate tiles limits the use of the Struts html:form tag.  Firstly, the
begin and end form tag must be in the same JSP.  This prevents the tag from
beginning in the 'body' tile and ending in the 'navigation' tile.  There are
other complications, even if I'm willing to compromise the design and place
the html:form tag in the layout page (wizardLayout.jsp above).  This would
require some convoluted JavaScript that sets the form's action attribute on
each page.

 The only workaround I have found is to have the body  the navigation in
the same tile; in other words -- not have a 'navigation' tile at all.  This
has a serious shortcoming in that it forces every body panel (i.e. every
page in the wizard) to have knowledge of layout and therefore responsible
for its maintenance.

 I really like the concept of Tiles and would love to use it to its
fullest.  Do you have any suggestions?  Am I missing something fundamental?


 Sri

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




JSTL

2002-05-21 Thread Graham Lounder

Is there any word on if Struts will be moving to the JSP Standard Tag Library?  I'm 
finding that there is a lot of similar functionality.  Any Comments whether this is a 
good idea or not?

Graham

==
  Graham Lounder   
  Java Developer   
  Spatial Components Division  
  CARIS
  264 Rookwood Ave
  Fredericton NB E3B-2M2
  Office 506 462-4218 
  Fax506 459-3849
  [EMAIL PROTECTED]
  http://www.spatialcomponents.com
==



Re: Propertie files in a war file

2002-05-17 Thread Graham Lounder

Just to make sure I'm getting this.  The web.xml will hold all the default
values for an application in the env-entry and resource-ref tags.  These
default values can be modified by the container during deployment (in tomcat
this would be the server.xml) so the war file does not have to be touched?.

Sorry If I'm just repeating what others have said, I just went through
deploying my first war file under a time limit and found that after the file
was uncompressed, I had to go in manually and start making changes in all my
config files.  If what was said is correct, I'll be changing all my
properties to JNDI resources.

Graham

- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, May 17, 2002 1:00 PM
Subject: Re: Propertie files in a war file




 On Fri, 17 May 2002, Nicolas De Loof wrote:

  Date: Fri, 17 May 2002 16:12:47 +0200
  From: Nicolas De Loof [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: Propertie files in a war file
 
  Hello,
 
  I will have to deploy a webapp (on WAS4) using a war file, but I'm not
sure
  on how to let my client set some configuration datas that are placed in
  propertie files (in WEB-INF/classes), or update the
  ApplicationResource.propertie to change application texts.
 
  I would like it to be simple for the client (not have to unjar the war,
  change datas and re-war the files).
 
  Do you have any idea ?
 

 Besides the approaches that Kevin suggests, you could try the standard
 J2EE approach -- environment entries and resource references in the JNDI
 namespace provided by the container.

 In the particular case of configuration information, a typical approach is
 to put an env-entry in your web.xml file with a default value:

 env-entry
 description
 Is debugging mode enabled?
 /description
 env-entry-name
 debugMode
 /env-entry-name
 env-entry-value
 false
 /env-entry-value
 /env-entry

 which you can read from within your application like this:

 InitialContext context = new InitialContext();
 Boolean debugEntry = (Boolean)
   context.lookup(java:comp/env/debugMode);
 boolean debugMode = debugEntry.booleanValue();

 The important issue, and the reason for doing all of this, is that your
 container will (or at least should) provide mechanisms to customize the
 values of environment entries at deployment time, without having to modify
 the WAR file yourself.  For example, in Tomcat 4 you can do this in
 server.xml files.

 The same basic principles apply to resource references like connection
 pools -- this makes it very easy, for example, to use the same application
 WAR file in environments where you have a test server and a production
 server that are (naturally enough) connected to databases with different
 URLs, and you don't want to record the connection details inside the WAR.

 For Tomcat-specific directions, but a good way to get the general idea of
 what should be possible, check out:


http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html


  Nico
 

 Craig McClanahan


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




logic:match question

2002-05-15 Thread Graham Lounder

Hello all,

I'm not sure what is happening here but I think it's an obvious fix, I just can't see 
it.  When I'm looping through a logic:iterate tag, I want to display a message on the 
first iteration.  I used the IndexId attribute and created an index and compare it to 
the value 0.  For some reason, this evalutates to true for 0 and 10 (and maybe 20 
etc... my results don't go that high).

logic:match name='index' value='0'
I like cheese!
/logic:match

Any Ideas?
Graham



Re: logic:match question

2002-05-15 Thread Graham Lounder

Rats! I knew once I heard the explanation that it was going to be something
stupid.  Thanks for the help.

Graham

- Original Message -
From: Nicolas De Loof [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, May 15, 2002 10:12 AM
Subject: Re: logic:match question


 logic:match tag looks for value substring in it's body or in bean setted
 by name and optionnaly property (using toString() for non String
 objects).

 Your index is an Integer, and this tag uses toString() value, taht is
 decimal view of your index. So 0 and 10 and so on have the 0
substring
 and match.

 Use logic:equal to detect your first item.

 Nico


 - Original Message -
 From: Graham Lounder [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, May 15, 2002 3:02 PM
 Subject: logic:match question


 Hello all,

 I'm not sure what is happening here but I think it's an obvious fix, I
just
 can't see it.  When I'm looping through a logic:iterate tag, I want to
 display a message on the first iteration.  I used the IndexId attribute
and
 created an index and compare it to the value 0.  For some reason, this
 evalutates to true for 0 and 10 (and maybe 20 etc... my results don't go
 that high).

 logic:match name='index' value='0'
 I like cheese!
 /logic:match

 Any Ideas?
 Graham



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Application State == View or Business Logic

2002-05-14 Thread Graham Lounder

Hi all,

I'm starting to rethink my current code structure.  One of the question I came up with 
is where the application state is supposed to be.  Currently I have a bean which holds 
my state in the session.  If I moved this application to a new client, the state bean 
could end up in the database.  So my question is what is appllication state 
considered, model, view or controller?

My guess would be model, and that you just save it in the session instead of the 
database because it is faster for web applications.  

Any ideas?

Graham



Template Engine of Choice

2002-05-06 Thread Graham Lounder

What is the main choice for a template engine in struts?  I know there is a template 
tag lib with the version of struts I currently have but I hear a lot of people using 
Tiles.  I have also heard a lot about the velocity template engine.  My question is, 
what are the pros and cons of each? Should I be using one over the other?

Thanks,
Graham



Re: Changing Content Type

2002-05-03 Thread Graham Lounder

After my day of searching about this topic, I found that using the
multipart/mixed content type involves a server push (as opposed to the usual
client pull).  This functionality is not supported in Internet Explorer.
There is some example code being used in Netscape 4.X browsers and email but
nothing else.

Hopefully someone can prove me wrong and find a way this can be done, but
for now I've given up for more productive work.

Thanks for the information.

Graham



- Original Message -
From: Malcolm Dew-Jones [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, May 03, 2002 3:09 PM
Subject: RE: Changing Content Type





  -Original Message-
  From: Graham Lounder [mailto:[EMAIL PROTECTED]]
  Sent: Dienstag, 30. April 2002 17:18
  To: [EMAIL PROTECTED]
  Subject: OT: Changing Content Type
 
 
  Sorry, this is a little off topic.  Is there any way to change your
  content type mid way through a reponse?  What I want to do is generate a
  dynamic html page, but I want to change content type and put a
  dynamically generated jpeg image in the page.  Is this possible?
 
  Right now I'm having to make an image tag which points to a seperate
  servlet which generates the image.  I'm trying to make a tag out of my
  code and it would help if I could put the html and image generation code
  together in the same request.  Any ideas if this is even possible?
 
  Graham
 

 I've read info on how to do this in a mime group.

 The technique is mostly used within mail, but I'm sure I've read about
 using it in browsers as well.

 The content type of the entire page is set to multipart/?something? and
 then you must generate the mime struture of each part.

 One part (presumably the first part) is text/html.  The hrefs in the
 html can refer to the other parts of the multipart.  The notation to do
 this *may* involve the word CID but I've never done it so I'm not sure.

 It must be documented in one of the RFC's.

 I do not know which browsers support the multipart structure, though I
 recall people talking about the latest netscape, and much as I dislike IE,
 I suspect the latest version also handles them.



 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Forms Beans and DAO (Best Practices)

2002-05-03 Thread Graham Lounder

This is a really good description.  I do have one small question, where does
the connection pooling, transaction handling come into play? I know you use
transactions in your BO but do you initialize this code in the DAOs? Do you
use some sort of JNDI reference for your connection pooling?  What is the
best practice for this?  I know there is datasources and connection pooling
in struts, but shouldn't these things be in the data access objects?

Graham



- Original Message -
From: Pruthee, Ranjan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, May 03, 2002 4:25 PM
Subject: RE: Forms Beans and DAO (Best Practices)


 In general, I use the Struts action classes as proxies to my business
objects and my business objects serve as proxies to my data access objects
and I pass data across tiers using DTO  (DataTransportObject [use to be
ValueObject]).  In this fashion, I can keep my business logic reusable in
say a Java
 Swing client as well as an HTML client. IMO, I would not access DAO (data
access objects) directly in the Struts ction classes. This means you would
have to manage transaction boundries (getting JDBC connection or JDO
PersistanceManager) in your web tier where as it would probably be better to
isolate these details to your business tier. We don't use EJB, so the
general data flow is as follows:

 Client === Action === BusinessObject === DataAccessObject(s) ===
Database

 This keeps BusinessObjects resuseable among Action classes and DAO
objects reusable in BusinessObjects. The BusinessObject manages the
transaction boundries and the DAO just uses the JDBC connection. We maintain
all SQL as static final Strings in the DAO's. (reduces object creation) The
BusinessObjects and DAO don't maintain any state, so they are singletons.
(reduces object creation)

 So for example if I wanted to retrieve and display a customer list.

 1. Client sends HTTP request

 2. Struts delegates request to ShowCustomersAction

 3. ShowCustomersAction delegates to CustomerBO

 4. CustomerBO starts a transaction

 5. CustomerBO delegates to CustomerDAO

 6. CustomerDAO executes the query and gets results

 7. CustomerDAO maps results into a collection of CustomerDTO

 (DataTransportObject)

 8. CustomerDAO returns collection to CustomerBO

 9. CustomerBO ends transaction

 10. CustomerBO returns collection to ShowCustomerAction

 11. ShowCustomersAction places the connection in the HttpServletRequest as

 an attribute

 12. ShowCustomersAction forwards to showCustomersView (some jsp)

 13. ShowCustomersView accesses customer collection using a custom tag

 14. ShowCustomersView renders customer list

  PS. If we did switch to using EJB, then the BusinessObjects become
BusinessDelegates to actual EJBs and  nothing in the web tier has to change
and both DAOs and DTOs can be reused.


 -Original Message-
 From: Chen, Dean (Zhun) [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 03, 2002 2:23 PM
 To: 'Struts Users Mailing List'
 Subject: RE: Forms Beans and DAO (Best Practices)


 This might be a stupid question, but what are DAO and Value Object
supposed
 to be?

 Does DAO encapsulate the logic to make JDBC calls?  For example, would it
 contain the name of a stored procedure or would that be passed to it?

 Is ValueObject a generic object that stores the result sets?  For example,
a
 Collection of somesort? or a Collection of Collections?

 Thanks, I am also trying to figure out what the most performant way to
 design this.


 Dean Chen



 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, May 03, 2002 1:17 PM
 To: Struts Users Mailing List
 Subject: Re: Forms Beans and DAO (Best Practices)





 I see what you're doing and agree it seems easier.

 But coupling the form beans to the DAO's so tightly I wouldn't call a best
 practice. Here is another approach:


 - Have the DAO's return Value Objects. But then have a setValueObject() on
 the form bean so you can store the entire value object in it.

  First, in your action class, do something like:

   myFormBean1.setValueObject1(myDao1.getValueObject1());

  Then either,

  1. Have your get/set methods for the form bean properties use the
 value object for storage internally, like:

   // in the form bean.java file

   private ValueObject valueObject1
   public void setValueObject1(ValueObject val1) {
this.valueObject = val1;
   }

   // Note: no property1 field needed!
   public String getProperty1() {
return this.valueObject.getProperty1();
   }
   public void setProperty1(String property1) {
this.valueObject.setProperty1(property1);
   }


  - or -

  2. Have the setValueObject() in the form bean deconstruct the value
 object and store its components in the form bean

   // again, in the form bean.java file

   // 

OT: Changing Content Type

2002-04-30 Thread Graham Lounder

Sorry, this is a little off topic.  Is there any way to change your content type mid 
way through a reponse?  What I want to do is generate a dynamic html page, but I want 
to change content type and put a dynamically generated jpeg image in the page.  Is 
this possible?  

Right now I'm having to make an image tag which points to a seperate servlet which 
generates the image.  I'm trying to make a tag out of my code and it would help if I 
could put the html and image generation code together in the same request.  Any ideas 
if this is even possible?

Graham



Re: Changing Content Type

2002-04-30 Thread Graham Lounder

That's what I thought may be the case.  Thanks for the confirmation.

Graham


- Original Message -
From: Galbreath, Mark [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, April 30, 2002 2:14 PM
Subject: RE: Changing Content Type


 No.  The content type must be specified before the output stream begins.

 Mark

 -Original Message-
 From: Graham Lounder [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 30, 2002 11:18 AM
 To: [EMAIL PROTECTED]
 Subject: OT: Changing Content Type


 Sorry, this is a little off topic.  Is there any way to change your
content
 type mid way through a reponse?  What I want to do is generate a dynamic
 html page, but I want to change content type and put a dynamically
generated
 jpeg image in the page.  Is this possible?

 Right now I'm having to make an image tag which points to a seperate
servlet
 which generates the image.  I'm trying to make a tag out of my code and it
 would help if I could put the html and image generation code together in
the
 same request.  Any ideas if this is even possible?

 Graham

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




OT: Free UML Tools

2002-04-26 Thread Graham Lounder

Hello all,

Using Struts, I've designed a nice web application to display mapping information.  
Now I must explain how I built it to the other developers in the office.  I was 
wondering if anyone knew any good free UML diagram software out there that would run 
on windows?  Being this is still my first month on the job, I didn't want to go out 
and ask for a version of MS Visio, bad karma and all.

Thanks,
Graham Lounder

PS.  Thanks Ida for the answer to my logic:iterate question.