RE: STRUTS and EJB

2001-08-23 Thread Derek Longmuir
Title: RE: STRUTS and EJB





Why not make a Value object for passing the information around, and have the form hold an instance of the value object?


Derek.


-Original Message-
From: Juha Paananen [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 1:47 PM
To: [EMAIL PROTECTED]
Subject: RE: STRUTS and EJB



I also agree on that stuff that has references to STRUTS should not be
transmitted to the EJB level. The problem here is simply that I would
not want to make another, exactly similar (except extends ActionForm),
class for transporting the information to the EJB. Of course, I can do
that, but I don't like the idea. My question is, is this inheritance of
ActionForm really necessary in Struts design?


 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: 23. elokuuta 2001 20:29
 To: [EMAIL PROTECTED]
 Subject: Re: STRUTS and EJB
 
 
 I agree with Gregor. The ActionForm beans are best left as ActionForm
 beans, and used only as an extension of the html:form tags. Once the
 data is validated, it should be transferred to persistent 
 stoarge, or to
 another bean that is not bound to the HTTP layer (and could be re-used
 in other environments). This bean can then use the right data-type for
 the job, and perform other business tasks that have nothing to do with
 gathering input from HTTP. 
 
 On the way back, a good way to repopulate an ActionForm bean, or other
 string-based helper, is to have your data access objects return a Map,
 and then use it with the standard BeanUtils.populate() method. Struts
 does the same thing with the HTTP request, which is basically a Map.
 
 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel +1 716 737-3463
 -- http://www.husted.com/about/struts/
 
 Gregor Rayman wrote:
  
  Juha Paananen [EMAIL PROTECTED] wrote:
  
   I want to fill in a form JavaBean using a struts form, and after
   validating it in my Action class, store it into the db 
 using a session
   EJB component. The proble here is that I have to extend 
 ActionForm class
   to make the bean work with Struts.
  
  You can use containment instead of inheritance. You should 
 avoid using
  Struts ActionForm on the business logic level.
  
  --
  gR
 





RE: STRUTS and EJB

2001-08-23 Thread Derek Longmuir
Title: RE: STRUTS and EJB





html:text property=valueObjectA.someNumber size=5 maxlength=5 /


Where the form has a Value object ValueObjectA, along with a public ValueObjectA getValueObjectA() method. The value object has a String someNumber in it, with a public String getSomeNumber() method.

Doesn't one of the sample applications or Ted's examples show this a lot better?


Derek.


-Original Message-
From: Narayan, Anand [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 1:47 PM
To: '[EMAIL PROTECTED]'
Subject: RE: STRUTS and EJB



If a value object is used within the ActionForm for holding the form data,
how should the html elements be named so that the data elements in the value object
is automatically populated. Or should the data elements also reside in the ActionForm as
separate fields, for which the setters and getters would go and get the information from the value object ?
Anand Narayan 


-Original Message-
From: Derek Longmuir [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 1:46 PM
To: '[EMAIL PROTECTED]'
Subject: RE: STRUTS and EJB



Why not make a Value object for passing the information around, and have the form hold an instance of the value object? 

Derek. 
-Original Message- 
From: Juha Paananen [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 23, 2001 1:47 PM 
To: [EMAIL PROTECTED] 
Subject: RE: STRUTS and EJB 



I also agree on that stuff that has references to STRUTS should not be 
transmitted to the EJB level. The problem here is simply that I would 
not want to make another, exactly similar (except extends ActionForm), 
class for transporting the information to the EJB. Of course, I can do 
that, but I don't like the idea. My question is, is this inheritance of 
ActionForm really necessary in Struts design? 
 -Original Message- 
 From: Ted Husted [mailto:[EMAIL PROTECTED]] 
 Sent: 23. elokuuta 2001 20:29 
 To: [EMAIL PROTECTED] 
 Subject: Re: STRUTS and EJB 
 
 
 I agree with Gregor. The ActionForm beans are best left as ActionForm 
 beans, and used only as an extension of the html:form tags. Once the 
 data is validated, it should be transferred to persistent 
 stoarge, or to 
 another bean that is not bound to the HTTP layer (and could be re-used 
 in other environments). This bean can then use the right data-type for 
 the job, and perform other business tasks that have nothing to do with 
 gathering input from HTTP. 
 
 On the way back, a good way to repopulate an ActionForm bean, or other 
 string-based helper, is to have your data access objects return a Map, 
 and then use it with the standard BeanUtils.populate() method. Struts 
 does the same thing with the HTTP request, which is basically a Map. 
 
 -- Ted Husted, Husted dot Com, Fairport NY USA. 
 -- Custom Software ~ Technical Services. 
 -- Tel +1 716 737-3463 
 -- http://www.husted.com/about/struts/ 
 
 Gregor Rayman wrote: 
  
  Juha Paananen [EMAIL PROTECTED] wrote: 
  
   I want to fill in a form JavaBean using a struts form, and after 
   validating it in my Action class, store it into the db 
 using a session 
   EJB component. The proble here is that I have to extend 
 ActionForm class 
   to make the bean work with Struts. 
  
  You can use containment instead of inheritance. You should 
 avoid using 
  Struts ActionForm on the business logic level. 
  
  -- 
  gR 





Re: Struts UML ....

2001-08-16 Thread Derek Longmuir
Title: Re: Struts  UML 





I know you are looking for UML, but if you are looking for something to show the (partial) flow of your webapplication, you can take a look at what I've done at:

http://members.home.com/dlongmuir/struts.html


The main problem with it is that it doesn't parse the jsps to look for links, so basically every JSP is a leaf node. 


Anyways, it is a work in progress (slowly), and other people have said that it helped them out. 


If you decide to try it, there is one gotcha - the latest version of Xalan doesn't like my xsl. If you try it with an older version of Xalan, then everything is fine (I really did generate the pictures on the page! :-) ).

Derek.





RE: Struts Action Graphs

2001-03-22 Thread Derek Longmuir
Title: Struts Action Graphs



I'm 
glad that it helped you out. 

I will 
look into adding colours for you. I think you meant the struts-config.xsl for 
the colour definitions, right? I'm not planning on changing any of the struts 
files.

Derek.

  -Original Message-From: Nanduri, Amarnath 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, March 22, 
  2001 9:58 AMTo: '[EMAIL PROTECTED]'Subject: 
  RE: Struts Action Graphs
  Derek,
  
   That is super 
  cool. I showeda graphto my lead designer (of the struts_config.xml 
  we are using in our project) and he was jumping up and down with joy. Kudos to 
  your XSL . One question i have is... can it be colorcoded ? I would like 
  the jpeg image to have some fancy colors in it.. maybe just for the image, the 
  struts-config.xml file can have additional properties like color codes for 
  different kinds of objects.
  
  cheers,
  Amar..
  
-Original Message-From: Bryan Field-Elliot 
[mailto:[EMAIL PROTECTED]]Sent: Thursday, March 22, 2001 
9:31 AMTo: [EMAIL PROTECTED]Subject: Re: 
Struts Action GraphsDerek,That is really 
cool!Thanks,BryanDerek Longmuir wrote:
[EMAIL PROTECTED]">
  
  Hi everyone,
  I have created some XSL that takes the (old) action.xml 
  and (new) struts-config.xml files and produces a graph showing the various 
  forwards, forms, actions, etc. You can then use dot to convert the graph 
  into an image.
  I threw together a website where you can check this out 
  at:
  http://members.home.net/dlongmuir/struts.html
  It isn't quite as enlightening as I thought it would be, 
  but certainly produces interesting pictures. :-) This is primarily due to 
  the fact that the struts-config.xml doesn't hold all the information. I 
  think to produce a better overview you would have to also parse the 
  corresponding JSPs for their tags, and maybe even the action classes 
  themselves. 
  Let me know if you have comments, bugs, 
  whatever.
  Thanks, Derek. 



Struts Action Graphs

2001-03-21 Thread Derek Longmuir
Title: Struts Action Graphs





Hi everyone,


I have created some XSL that takes the (old) action.xml and (new) struts-config.xml files and produces a graph showing the various forwards, forms, actions, etc. You can then use dot to convert the graph into an image.

I threw together a website where you can check this out at:


http://members.home.net/dlongmuir/struts.html


It isn't quite as enlightening as I thought it would be, but certainly produces interesting pictures. :-) This is primarily due to the fact that the struts-config.xml doesn't hold all the information. I think to produce a better overview you would have to also parse the corresponding JSPs for their tags, and maybe even the action classes themselves. 

Let me know if you have comments, bugs, whatever.


Thanks, Derek. 





RE: How can a Struts Action developer best document the system fo r a JSP developer?

2001-03-19 Thread Derek Longmuir
Title: RE: How can a Struts Action developer best document the system fo r a JSP developer?





Hi Bryan and John,


I have created something like this with XSL that converts the (old) action.xml and (new) struts-config.xml files and produces a graph showing the various forwards, forms, actions, etc. I then use dot to convert the graph into a gif.

It isn't quite as enlightening as I thought it would be, but certainly produces interesting pictures. :-) This is primarily due to the fact that the struts-config.xml doesn't hold all the information - I think to produce a better overview you would have to also parse the corresponding JSPs for their tags, and maybe even the action classes themselves. 

I was planning on refining it a little more before releasing it to the list, but I'll work on getting it up on a web page in the next couple of days for you. John, maybe you can take it and add what you think is missing. :-)

Thanks, Derek.



-Original Message-
From: Brugge, John [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 19, 2001 9:56 AM
To: '[EMAIL PROTECTED]'
Subject: RE: How can a Struts Action developer best document the system fo r a JSP developer?



Bryan, 
You might check out a recent article on JavaWorld called Doclet your Servlet (http://www.javaworld.com/javaworld/jw-03-2001/jw-0302-doclets.html) that describes a custom doclet that understands some custom doc tags. It would probably take some customization to work with Struts Actions, since it looks like it uses introspection to look for instances of true servlets.

I've been thinking of the same problem, and think that you could get pretty good mileage out of a simple XSL template that transformed the struts-config.xml into a clearer HTML description of the actions, their navigation and form expectations. It could handle #2 and #3 below easily; #4 and #5 would be harder. You could even tie this into the JavaDoc of the ActionForms by creating links from the form names to the area where your JavaDoc lives.

I'm not an XSL expert, but I've done some transforms before and figure this wouldn't take very long to create - the key for me is just finding the time now ;-). If I come up with something, I'll forward it to the group, unless someone beats me to it.

John 



-Original Message- 
From: Bryan Field-Elliot [SMTP:[EMAIL PROTECTED]] 
Sent: Saturday, March 17, 2001 6:12 PM 
To: [EMAIL PROTECTED] 
Subject: How can a Struts Action developer best document the system for a JSP developer? 
I am struggling right now with how to properly and efficently document 
my Struts application for my JSP developer (who is by no means a Java 
expert). Specifically, I want to document each Action as well as each 
ActionForm that I code, including things like: 
1. the pages I expect the user to have come from 
2. the pages to which I might forward, or redirect, the user after 
completing the action 
3. The beans I expect to be in place prior to submitting to my action 
4. The beans I will set up with values for the resulting JSP page to 
work with 
5. The errors (html:errors) I may set up 
And anything else that might be appropriate. I'd like to do so in a way 
that lets me rely on Javadoc, so that I can keep my documentation inside 
my code. Javadoc when used correctly will also let me do things like 
see also the Bean documentation (from the Action documentation). 
I am curious if anyone has developed a template action or bean, which 
makes best use of Javadoc and which I can cut-and-paste at the head of 
every one of my Action classes, etc? 
Thanks, 
Bryan