RE: [OT] Lightweight helper libraries for reporting?

2003-09-21 Thread Mohd Amin Mohd Din
Maybe you could use http://jasperreports.sourceforge.net/

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 22, 2003 12:23 AM
To: Struts Users Mailing List
Subject: RE: [OT] Lightweight helper libraries for reporting?

David:

The main reason I'm not ready to use displaytag is because I need to 
generate reports for more than just HTML output; my users will have 
the choice to get a delimited file as well, or instead of HTML, and 
they'll have the option to get the report mailed to them as well as 
generated while-they-wait.  I know that displaytag has some support 
for export files, but I'm figuring it's more work than it's worth to 
use a JSP tag library for asynchronous generation of a CSV file sent 
as an email attachment.

My design is to have a model-level report returned from a report 
service to a controller which can then send the report to various 
renderers.  I just haven't yet written classes to deal with common 
report functions like grouping and totalling, and it seems like 
something that would be generally useful.

I think displaytag is pretty impressive, and totally appropriate for 
a model where the web page is the primary output form.  I actually 
find the decorator model a little frustrating, as it requires writing 
and compiling code for view things which I'd prefer to have more 
flexibly changeable in a JSP (at least it did a year ago when I used 
it last) -- I'm pretty sure I had to compile a date format into a 
column decorator; what happens when the client decides they want that 
to change?  I have to recompile the class?  Or find someplace other 
than displaytag to set a runtime property for the date format; that 
seems awkward.

I think instead of a single "table" tag, it would be nice to have a 
"table" tag which defined beans and made them available to nested 
tags for various purposes, like many Struts tags do (html:messages, 
logic:iterate, etc).  This might be hard to do and still achieve 
everything that displaytag does, but if I were really motivated, I'd 
look at adapting displaytag to a model more like that...

Joe

At 22:59 -0400 9/19/03, David G Friedman wrote:
>Joe,
>
>I've been planning on using the displaytag library for that stuff when
I get
>to it next week.  Why won't the decorator classes work for you to
perform
>summations of rows, groups, and so forth?  I'm wondering why it won't
work
>for you in case the same reasons might apply to my application
>
>For reference, an example of the decorators for summations of groups
and
>rows is here:
>http://edhill.its.uiowa.edu/display-examples/example-callbacks.jsp
>
>With their Java decorator class code example code here:
>http://edhill.its.uiowa.edu/display-examples/TotalWrapper.java.txt

-- 
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"If nature worked that way, the universe would crash all the time." 
--Jaron Lanier

-
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: how to change this logic into tags

2003-09-21 Thread Mohd Amin Mohd Din
This could/should be put into an Action

/*   ArrayList al = (ArrayList) request.getAttribute("al");

if (al != null) {
for (int i=0;i
*/

for writing out properties you could use 

for html link 

Look here for more info http://jakarta.apache.org/struts/userGuide/

Amin
-Original Message-
From: Mohd Fadhly [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 22, 2003 12:05 PM
To: Struts Users Mailing List
Subject: how to change this logic into tags

hello,

how do i change this scriptlet logic into struts tag,

<%
ArrayList al = (ArrayList) request.getAttribute("al");

if (al != null) {
for (int i=0;i

<%=spd.getName()%>



><%=spd.get
SentCount()%>



<% }
}
%>


-
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]



[ANNOUNCE] JSFCentral.com site expanded

2003-09-21 Thread Kito D. Mann
I'm pleased to announce that JSFCentral.com has been expanded to cover 
news, products, and links related to JavaServer Faces, in addition to the 
FAQ that has been there for the past few months. You can find the site at 
http://www.jsfcentral.com.

Kito D. Mann
Author, JSF in Action  

tag

2003-09-21 Thread Kalra, Ashwani
hi,
I could not understand the use of base tag from the example.  Can any one
explain ?
 
 

Regds 
Ashwani Kalra 
http://www.geocities.com/ashwani_kalra
  



This message contains information that may be privileged or confidential and
is the property of the Cap Gemini Ernst & Young Group. It is intended only
for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy, disseminate,
distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all copies
of this message.


Re: [OT] STL startup times - is caching going on?

2003-09-21 Thread Craig R. McClanahan
On Sat, 20 Sep 2003, Richard Mixon (qwest) wrote:

> Date: Sat, 20 Sep 2003 21:34:45 -0700
> From: "Richard Mixon (qwest)" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: [OT] STL startup times - is caching going on?
>
> This is a little off-topic, but I am using the Struts EL taglibs in the applications 
> this is happening. Any suggestions, ideas are
> appreciated. (I also posted on the Jakarta taglibs list).
>
> I am having an issue with large startup times the first time one of my pages runs 
> that uses JSTL mostly the core library. Subsequent
> requests (even for different users on different data) take much, much less time.
>
> Here is a little more detail. Any ideas are much appreciated. My ISP is pretty irate 
> because we suck up huge amounts of CPU each
> time it happens.
>
> We are using Tomcat 4.1.24, Java 1.4.1 and Struts 1.1.
>
> OK, the page uses a couple of nested foreach loops to generate a grid/chart of SVG 
> markup language. It also uses a couple of small
> foreach loops to generate tick marks on an axis. It looks something like:
>
>   Chart  page
>  tag
> include JSP/JSTL page to generate footer.
> include JSP/JSTL page to generate x and y axis
> JSTL markup to generate main body of chart
> include JSP/JSTL page to generate footer.
>
> The request takes a half second to build the Java objects that the JSTL code uses to 
> render on the page. But the rendering takes 45
> second on a 650MHZ Sun SPARC III machine and almost that long on a fast Windows 
> machine (2500 MHZ).
>
> The second and subsequent times the chart rendering drops down to less than 200 
> milliseconds. Then about five minutes later, if the
> chart is requested again, it takes the 45 seconds to generate, then 200 milliseconds 
> for subsequent requests.
>
> Thanks in advance - Richard

The time delay you're describing sounds more like the typical "compile a
JSP page the first time it is encountered" delay more than anything
specific to a particular tag library.  Are you seeing this kind of thing
on JSP pages that do not include JSTL tags, or is it specific to this
library.  If it's the usual generic case, you should investigate using
tools like "jspc" (shipped with Tomcat) to precompile your JSP pages into
the corresponding servlets.

One other factor to note -- if by "include" in your description above you
mean  or , then each individual page you're
importing also has to be compiled that very first time.

Craig

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



Re: Problems using the optionsCollection tag

2003-09-21 Thread James JKE95 Kerridge
PLEASE IGNORE THIS PROBLEM. NOW RESOLVED.


The optionsCollection tag does work properly. I was using it properly. 
Just had a build issue that caused the strange behaviour.

Thanks and sorry

James



From:   "James JKE95 Kerridge" <[EMAIL PROTECTED]> on 22/09/2003 
14:38
Please respond to "Struts Users Mailing List" 
<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: 
Subject:Problems using the optionsCollection tag

All,

I am having a problem using the optionsCollection tag.

I get this error:

javax.servlet.jsp.JspException: No getter method for property 
reasonsForTicketIssueOptions of bean org.apache.struts.taglib.html.BEAN
at 
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:219)
at 
org.apache.strutsel.taglib.html.ELOptionsCollectionTag.doStartTag(ELOptionsCollectionTag.java:220)
at 
jsp_servlet._jsp._qf._ticketissuerequest.__ticketissuerequestformstep1._jspService(__ticketissuerequestformstep1.java:1140)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


My JSP has this in it:

...


 

...


My form extends ValidatorForm and has these code fragments in it:

...

/**
 * holds the multiple selections of 'reason for ticket issue' from the 

form.
 */
private String[] reasonsForTicketIssue;

/** 
 * Getter for property reasonsForTicketIssue.
 * @return Value of property reasonsForTicketIssue.
 */
public String[] getReasonsForTicketIssue() {
return this.reasonsForTicketIssue;
}
 
/** Setter for property reasonsForTicketIssue.
 * @param reasonsForTicketIssue New value of property 
reasonsForTicketIssue.
 *
 */
public void setReasonsForTicketIssue(String[] reasonsForTicketIssue) {
this.reasonsForTicketIssue = reasonsForTicketIssue;
}

/**
 * gets the collection of values to support the 'reasons for ticket 
issue' property.
 */
public List getReasonsForTicketIssueOptions() {
return 
ReasonForTicketRequestOptionsProvider.getOptionsCollection();
}

...


Having traced through the code I find that the correct bean is looked up 
successfully (i.e. the form bean) but that there is no property for the 
'reasonsForTicketIssueOptions' property in the property descriptors that 
are used by PropertyUtils.

Am I correctly using the optionsCollection tag?

Is my 'public List getReasonsForTicketIssueOptions()' method correct?

Does any one have an example of using this tag where the form bean returns 

the collection of LabelValueBeans?

Surely what I am doing is standard hence the existence of the 
optionsCollection tag.

Thanks for any help.

James


***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au






***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au



Problems using the optionsCollection tag

2003-09-21 Thread James JKE95 Kerridge
All,

I am having a problem using the optionsCollection tag.

I get this error:

javax.servlet.jsp.JspException: No getter method for property 
reasonsForTicketIssueOptions of bean org.apache.struts.taglib.html.BEAN
at 
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
at 
org.apache.struts.taglib.html.OptionsCollectionTag.doStartTag(OptionsCollectionTag.java:219)
at 
org.apache.strutsel.taglib.html.ELOptionsCollectionTag.doStartTag(ELOptionsCollectionTag.java:220)
at 
jsp_servlet._jsp._qf._ticketissuerequest.__ticketissuerequestformstep1._jspService(__ticketissuerequestformstep1.java:1140)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at 
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at 
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2546)
at 
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


My JSP has this in it:

...


 

...


My form extends ValidatorForm and has these code fragments in it:

...

/**
 * holds the multiple selections of 'reason for ticket issue' from the 
form.
 */
private String[] reasonsForTicketIssue;

/** 
 * Getter for property reasonsForTicketIssue.
 * @return Value of property reasonsForTicketIssue.
 */
public String[] getReasonsForTicketIssue() {
return this.reasonsForTicketIssue;
}
 
/** Setter for property reasonsForTicketIssue.
 * @param reasonsForTicketIssue New value of property 
reasonsForTicketIssue.
 *
 */
public void setReasonsForTicketIssue(String[] reasonsForTicketIssue) {
this.reasonsForTicketIssue = reasonsForTicketIssue;
}

/**
 * gets the collection of values to support the 'reasons for ticket 
issue' property.
 */
public List getReasonsForTicketIssueOptions() {
return 
ReasonForTicketRequestOptionsProvider.getOptionsCollection();
}

...


Having traced through the code I find that the correct bean is looked up 
successfully (i.e. the form bean) but that there is no property for the 
'reasonsForTicketIssueOptions' property in the property descriptors that 
are used by PropertyUtils.

Am I correctly using the optionsCollection tag?

Is my 'public List getReasonsForTicketIssueOptions()' method correct?

Does any one have an example of using this tag where the form bean returns 
the collection of LabelValueBeans?

Surely what I am doing is standard hence the existence of the 
optionsCollection tag.

Thanks for any help.

James


***Confidentiality and Privilege Notice***

This email is intended only to be read or used by the addressee. 
It is confidential and may contain legally privileged information. 
If you are not the addressee indicated in this message (or 
responsible for delivery of the message to such person), you 
may not copy or deliver this message to anyone, and you should 
destroy this message and kindly notify the sender by reply email. 
Confidentiality and legal privilege are not waived or lost by
reason of mistaken delivery to you.

Qantas Airways Limited
ABN 16 009 661 901

Visit Qantas online at http://www.qantas.com.au



how to change this logic into tags

2003-09-21 Thread Mohd Fadhly
hello,

how do i change this scriptlet logic into struts tag,

<%
   ArrayList al = (ArrayList) request.getAttribute("al");
   if (al != null) {
   for (int i=0;i
   SystemProfileData spd = (SystemProfileData) al.get(i);
   if (i==0)
   int topmsg = spd.getSentCount();
%>
   
   <%=spd.getName()%>
   
   
   
   ><%=spd.getSentCount()%>
   
   
   
<% }
   }
%>

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


JAAS Login using LoginAction...

2003-09-21 Thread Keith Pemberton
I'm having a bit of trouble trying to login to a Database Realm that I
have setup with JBoss.  What I would like to do is to be able to login
to the JAAS SecurityManager using a LoginAction.  How is the best way to
go about this.  I have tried just doing it by calling the LoginContext
login method after having passed the LoginModule and CallbackHandler. 
Do I need to create a specialized ActionServlet to do this?  What are
all the important things that I should know on how to authenticate users
by using a Struts Action class?  Thanks in advance for your tips!

Keith Pemberton
-- 
Keith Pemberton <[EMAIL PROTECTED]>


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



Action/Form Design Q

2003-09-21 Thread Michael Thompson
I've hit a stumbling block and I'm not quite sure how to work around 
it.  I've written struts apps in the past and I've taken the approach of 
putting everything in the ActionForm so that the jsp has a one stop shop 
for all it's display needs.  So where I've hit an issue is when say I 
have jsp A that is rendered with form A.  When user submits data to 
action A, the ActionForm pushed to execute is form A.  What happens when 
I need to forward from action A to jsp B which is rendered with form B?  
I need to populate an ActionForm B to send to jsp B, but I don't have 
one.  Is it "normal" to create a form of a different type in your 
Action?  So essentially the code would look something like:

public void execute(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response)
 throws Exception
{
   FormA inputForm = (FormA)form;
   Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm);
  
   FormB outputForm = getInstanceOfFormB(mapping, request);  //this 
would stash in request/session also
   populateFormBWithResults(outputForm, result);

   return mapping.findForward("success");
}
getInstanceOfFormB is a little hazy, but I did notice a method in 
RequestUtils that might help.  Seems like this might be breaking some 
struts abstractions by knowing what form to create etc.

Is this the correct way to approach this or should I think about a 
redesign of my forms and actions?  Thanks in advance!
 --m



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


RE: Action Form Design Question

2003-09-21 Thread Robert Taylor
H. Well, yes, you could call this chaining to some degree.
But I think its necessary chaining or even (dare I say it?) good chaining :)

IMHO the following is a good design pattern:

SetupPageAAction ==> PageA ==> ProcessPageAAction ==> SetupPageBAction ==>
PageB ==> ProcessPageBAction

The only coupling here is that SetupPageBAction needs to know that
the data needed to populate the form used for PageB is found in
some scope (request, session, or application) under a name.
The only reason to do this is to prevent from having to manually
create the form needed for PageB in ProcessPageAction. Yes, there
is some loose coupling but the cohesion is tighter within actions
and as we discussed before, we allow Struts to do it is allowed to
manage the action form life cycle.

So, the bottom line is that somewhere you have to prepare PageB
for display. Should you do it in ProcessPageAction or should you
place the data in request scope and pass it along to an action
dedicated to preparing PageB?

I think when you here others speak of chaing as bad, they mean using
actions as business components and trying to use (or reuse) them in a
sequence.
This type of logic or use of objects should be reserved for the business
tier and not the presentation tier.

robert


> -Original Message-
> From: Michael Thompson [mailto:[EMAIL PROTECTED]
> Sent: Sunday, September 21, 2003 5:43 PM
> To: Struts Users Mailing List
> Subject: Re: Action Form Design Question
>
>
> Thanks Robert!
>
> I agree on letting struts do it's job where available, that's why I
> thought my code snippet below was a little goofy.  My only question
> about your suggestions is in solution 2 you mention having a second
> action.  You're not suggesting action chaining are you?  If not, how do
> you hook into second action "the struts way"?   Or would this be one
> place where action chaining is accepted?
>
> Thanks again!
>
> --m
>
>
> Robert Taylor wrote:
>
> >I would say the solution depends on the process.
> >
> >If the process of going from pageA to pageB to ... pageN, is
> >a wizard style process then you might think of placing all
> >your data in the same form and putting the form in session scope.
> >
> >If you don't want to put your form in session scope AND the
> >data you capture along the way can be stored in hidden fields,
> >then you could also use a single form placed in request scope.
> >
> >If the process is somewhat disjoint and you have separate forms,
> >then is the data to be rendered in pageB unique to the user? Is
> >it static data? If so, place that data in ServletContext and
> >make it available to all users and you don't need a set up action
> >for pageB.
> >
> >If the data IS unique to the user AND you have separate forms then
> >in this situation, I would still let Struts perform the form creation.
> >-Soluation 1:
> >Place the data retrieved from processing pageA in request scope
> >and forward to the page and tell the particular html component to look
> >for the data in the request under some defined name.
> >-Solution 2:
> >Insert and additional preparation action in between the action processing
> >pageA and pageB; call it ShowPageB or something of the sort. ShowPageB
> >action would access the data out of request scope and populate the form
> >defined for pageB and forward to pageB.
> >
> >There are so many ways to approach this solution. It's subjective to the
> >complexity of the process. I wouldn't stress over the fact of having
> >to place data in the request scope temporarily.
> >
> >What I would stress is let Struts do its job where possible - like
> >creating action forms.
> >
> >robert
> >
> >
> >
> >
> >
> >
> >>-Original Message-
> >>From: Michael Thompson [mailto:[EMAIL PROTECTED]
> >>Sent: Saturday, September 20, 2003 11:09 AM
> >>To: Struts Users Mailing List
> >>Subject: Re: Action Form Design Question
> >>
> >>
> >>//
> >>///
> >>//I've been having issues with posting to this list, so I apologize if
> >>this is a repost.
> >>//
> >>///
> >>
> >>That hits on some points, I did read that thread earlier this week(I'll
> >>even read it again), and I'm starting to agree on not shoving
> everything
> >>in the ActionForm, but I don't recall it hitting on an Action needing
> >>one form for input and one form for output.  If I totally
> ignore it, the
> >>second page will render, but what if I need my html form in the second
> >>JSP(JSPB) to be prepopulated with the results of the processing
> >>in ActionA?
> >>
> >>Scenario:
> >>I have jspA that is rendered with ActionFormA.  Now user submits that
> >>data to ActionA.  ActionA recieves an ActionFormA as its input form in
> >>execute.  Now ActionA needs to forward to jspB which expectes an
> >>ActionFormB, what is the clean

Re: asp.net developer roadmap

2003-09-21 Thread Ted Husted
As mentioned, start with the WebServices tutorial (I *so* wish we had 
this four years ago). This will ground you on the Java spin on all the 
underlying technologies. (Most of which you may already know.) There is 
also a nice roundup at the beginning of the Struts User Guide 
.

If you looking for the simplest development roadmap, use Struts with the 
JSTL taglib, with your choice of OJB, Hibernate, or iBatis on the 
backend. OJB  and Hibernate 
 are roughly equivalent ways to automatically 
store objects in a SQL database. iBatis  is a simpler 
approach that just tries to give a clean way to call SQL queries from 
your program, but you do have to BYOQ (bring your own queries).

For IDEs, be sure to evaluate IDEA by IntelliJ  
before making a final decision. It's not free, but some people (like me) 
think it's worth the price. Otherwise, as mentioned, Eclipse is a fine 
choice.

There are several books about Struts. Struts in Action is probably the 
least how-to-ish and the most how-why-ish. (It tries to teach you to 
fish.) But, Mastering Jakarta Strut is also highly regarded. Many people 
find them complementary.

If you're looking for a truly great Struts example, see the JPetstore3 
 application. The nice part 
here is you can compare it to the infamous .NET version. (JP3 is *not* 
the original Sun Petstore application, which was a meant as a 
"reference" application. This one is written the way real developers 
write real Struts applications (or at least should). Clinton's really 
done a fantastic job here!)

JPetstore3 uses iBatis on the backend, but does so through a Data Access 
 Object framework that is a separate part of the iBatis package. This 
DAO framework should work just as well with OJB or Hibernate if you 
decide to switch later. You just have to change the classnames in a XML 
configuration file, and you're good to go.

Though, if the only reason you're dropping .NET is free tools, there are 
quite a few available for .NET now, many of which have been ported from 
Java. Here's a quick roundup:

Mavnet - Production/stable (final release 15/may/03).
  http://mavnet.sourceforge.net/
NVelocity - Production/stable - release 0.4 10/jan/03.
  http://sourceforge.net/projects/nvelocity
NORM (iBATIS) - Alpha but active 
http://www.gotdotnet.com/Community/Workspaces/Workspace.aspx?id=6bf91dea-dea3-4949-9602-ea1ea32a22b4

OJB.NET - Alpha but active - release v0.1.04 02/Sep/03
  http://ojb-net.sourceforge.net/
NUnit - Production/Stable - release 2.1 02/sep/02
  http://sourceforge.net/projects/nunit/
DotNetMock (Mock Objects) - Beta - release 0.4 12/apr/03
  http://sourceforge.net/projects/dotnetmock/
NMock (DynaMocks) - release 1.0 10/may/03
  http://sourceforge.net/projects/nmock/
Log4Net - Production/Stable - release 1.1.1 13/apr/02, 1.2 B8 15/jul/03
  http://sourceforge.net/projects/log4net/
NAnt - Beta - release 0.8.3 final 3/sep/03
  http://sourceforge.net/projects/nant/
Lucene.Net - Production/Stable - release 1.3rc1.001 31/aug/30
  http://sourceforge.net/projects/lucenedotnet
iTextSharp - Production/Stable -  release 0.04 21/aug/2003
  http://sourceforge.net/projects/itextsharp
These are just the ones that have Java/.NET corrolaries that I may be 
using myself sometime. If you poke around SourceForge, I'm sure you'll 
find many open-source .NET gizmos.

IMHO, it's open source that will ultimately be doing the assimilating. =:0)

HTH, Ted.

Duraid wrote:
Hi, Im an ASP.NET developer and i decided to using JSP. The problem is 
that there are many names jumping in my head: JSP..Jakarta, Tomcat, 
Struts, Velocity..Webshere.. J2EE..etc. I don't know where to start: 
should i learn JSP first, what technologies should i use? i mean with 
ASP.NET it's much easier, you get VS.NET and start working, not the case 
with JSP. Please help me to develop a road map for starting to develop 
web application using JSP, here is what im looking for:

1- Using open source tools where ever possible because the reason im 
switching from .NET is that it doesn't make sense to use expensive 
technology when you can do the same with free tools.

2- I'm an IDE guy so i prefer to have all the tools in one place than 
using switching between different ones bach and forth.

3- i like reading books more than  reading howto's.

that's it!! Can you please tell me where to start and how to go?


--
Ted Husted,
  Junit in Action  - ,
  Struts in Action - ,
  JSP Site Design  - .
"Get Ready, We're Moving Out!!" - 



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


RE: Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati
About your suggestion of avoiding repopulating... I guess this cannot be
done using DynaActionForms, or am missing something?

I agree that the step code should be part of the logic but still the
action should activate it somehow, by calling it. 

I can't see how chaining actions has to be an indication of logic code
creeping into the action code - It see how it can indicate but IMMO it's
not always the case. In the wizard example, I can't see why not having
each step in its own Struts action. Clicking next on the page1,
activates the submit on that step action, which may call some business
logic delegate to perform whatever is necessary, and then directing to
the next step dispatching its init method. After page2 step init()
method is done, it directs to something like 'viewForm' and next step is
displayed populated as required.

Erez

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2003 5:00 PM
To: Struts Users Mailing List
Subject: Re: Wizard pages in Struts design question

To prevent repopulation of an ActionForm's properties, you just need to 
provide a property that observes that status of another property that 
indicates whether the form is readonly or not. So, instead of just doing

this.property = property

you have

if (mutable) this.property = property

Or do something more sophisticated, like have it look at the page number

and then decide whether to set itself or not.

Though, IMHO, the behavior for a step is so complicated that you want to

put it in its own action, it should probably be outside of Struts all 
together, and part of the business logic layer.

(This is why chaining is frowned upon. It's a red flag that indicates 
business logic is creeping into your Action classes. When the business 
logic is sufficiently fine-grained, you should just be able to whatever 
you need to do from whatever Action you happen to be in. As work 
progresses on Commons Chain, I think this will provide a solution many 
people will prefer to chaining Struts Action).

I haven't had a chance to abstract it into a standard class, but here's 
a wizard Action that I'm working with now. It submits back to the same 
class, but uses a dispatch action so that if a step needs more behavior 
it can be encapsulated that way.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap
ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java

The steps are laid out as ActionForwards to the instant ActionMapping, 
making it very easy to rewrite.

-Ted.

Erez Efrati wrote:
> I read the HowTo write a wizard on the Struts web-site but I wasn't
> really happy with the solution, and I am looking for a better one. I
> came up with another way and I would appreciate your comments. 
> 
> The design consists of: 
> - The 'form' is a session scope form
> - WizardAction class (a DispatchAction based) with following methods:
>   * init () - starting the wizard and redirect to the first page
>   * finish () - (or save()) finish the wizard and save the
> information in the form using some business logic
> delegate.
>   
> - Each Page or step in the wizard is a separate Action class,
extending
> a WizrardBaseAction (a DispatchAction based) which contains some
> sharedmethods.
> 
>   For example: Page1Action extends WizardBaseAction {
> 
>   // initializes the page (done only on first
> encounter)
>   ActionForward init (mapping,...) throws
> Exception;
>   ActionForward back (mapping,...) throws
> Exception;
>   ActionForward next (mapping,...) throws
> Exception;ActionForward finish
> (mapping,...) throws Exception;
>   }   
> 
> - Each page/step has a separate action-mapping item in the
configuration
> with local forwards for : 'back' (if not the first page), 'next',
> 'finish' (if allowed from that page).
> 
>  I apologize for not sketching the whole idea down to the last bit but
I
> hope you get the picture. 
> 
> Only problem is that this design touches the question of chaining
> actions verses forward redirection (not just dispatching). 
> 
> For example the Page1Action.next() does the following:
>   1. validate the page
>   2. perform whatever processing required
>   3. return the next action to forward to (redirect or chain with
> all   its illness..)
> 
> In my opinion (humble one of course :) having such a separation
keeping
> each step in its own class is better and clearer design than having
them
> all in the same Action class. 
> 
> Isn't there a way to prevent the reset + pre-population of the form
done
> while chaining actions? Furthermore, is it so bad to redirect between
> actions? 
> 
> Thanks in advance,
> Erez
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, 

RE: Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati
Ted,

>From reading your WizardAction code it seems that in a way it maintains
an internal mechanism of redirection between the submitting of the
current step and preparation of the next step sub-actions, while keeping
Struts out of it. So in the end - not exposing the internal redirection
avoids the famous Struts action chaining issue.

Erez

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2003 5:00 PM
To: Struts Users Mailing List
Subject: Re: Wizard pages in Struts design question

To prevent repopulation of an ActionForm's properties, you just need to 
provide a property that observes that status of another property that 
indicates whether the form is readonly or not. So, instead of just doing

this.property = property

you have

if (mutable) this.property = property

Or do something more sophisticated, like have it look at the page number

and then decide whether to set itself or not.

Though, IMHO, the behavior for a step is so complicated that you want to

put it in its own action, it should probably be outside of Struts all 
together, and part of the business logic layer.

(This is why chaining is frowned upon. It's a red flag that indicates 
business logic is creeping into your Action classes. When the business 
logic is sufficiently fine-grained, you should just be able to whatever 
you need to do from whatever Action you happen to be in. As work 
progresses on Commons Chain, I think this will provide a solution many 
people will prefer to chaining Struts Action).

I haven't had a chance to abstract it into a standard class, but here's 
a wizard Action that I'm working with now. It submits back to the same 
class, but uses a dispatch action so that if a step needs more behavior 
it can be encapsulated that way.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap
ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java

The steps are laid out as ActionForwards to the instant ActionMapping, 
making it very easy to rewrite.

-Ted.

Erez Efrati wrote:
> I read the HowTo write a wizard on the Struts web-site but I wasn't
> really happy with the solution, and I am looking for a better one. I
> came up with another way and I would appreciate your comments. 
> 
> The design consists of: 
> - The 'form' is a session scope form
> - WizardAction class (a DispatchAction based) with following methods:
>   * init () - starting the wizard and redirect to the first page
>   * finish () - (or save()) finish the wizard and save the
> information in the form using some business logic
> delegate.
>   
> - Each Page or step in the wizard is a separate Action class,
extending
> a WizrardBaseAction (a DispatchAction based) which contains some
> sharedmethods.
> 
>   For example: Page1Action extends WizardBaseAction {
> 
>   // initializes the page (done only on first
> encounter)
>   ActionForward init (mapping,...) throws
> Exception;
>   ActionForward back (mapping,...) throws
> Exception;
>   ActionForward next (mapping,...) throws
> Exception;ActionForward finish
> (mapping,...) throws Exception;
>   }   
> 
> - Each page/step has a separate action-mapping item in the
configuration
> with local forwards for : 'back' (if not the first page), 'next',
> 'finish' (if allowed from that page).
> 
>  I apologize for not sketching the whole idea down to the last bit but
I
> hope you get the picture. 
> 
> Only problem is that this design touches the question of chaining
> actions verses forward redirection (not just dispatching). 
> 
> For example the Page1Action.next() does the following:
>   1. validate the page
>   2. perform whatever processing required
>   3. return the next action to forward to (redirect or chain with
> all   its illness..)
> 
> In my opinion (humble one of course :) having such a separation
keeping
> each step in its own class is better and clearer design than having
them
> all in the same Action class. 
> 
> Isn't there a way to prevent the reset + pre-population of the form
done
> while chaining actions? Furthermore, is it so bad to redirect between
> actions? 
> 
> Thanks in advance,
> Erez
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
Ted Husted,
   Junit in Action  - ,
   Struts in Action - ,
   JSP Site Design  -
.

"Get Ready, We're Moving Out!!" - 



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




-

Re: Action Form Design Question

2003-09-21 Thread Michael Thompson
Thanks Robert!

I agree on letting struts do it's job where available, that's why I 
thought my code snippet below was a little goofy.  My only question 
about your suggestions is in solution 2 you mention having a second 
action.  You're not suggesting action chaining are you?  If not, how do 
you hook into second action "the struts way"?   Or would this be one 
place where action chaining is accepted?

Thanks again!

   --m

Robert Taylor wrote:

I would say the solution depends on the process.

If the process of going from pageA to pageB to ... pageN, is
a wizard style process then you might think of placing all
your data in the same form and putting the form in session scope.
If you don't want to put your form in session scope AND the
data you capture along the way can be stored in hidden fields,
then you could also use a single form placed in request scope.
If the process is somewhat disjoint and you have separate forms,
then is the data to be rendered in pageB unique to the user? Is
it static data? If so, place that data in ServletContext and
make it available to all users and you don't need a set up action
for pageB. 

If the data IS unique to the user AND you have separate forms then
in this situation, I would still let Struts perform the form creation.
-Soluation 1:
Place the data retrieved from processing pageA in request scope
and forward to the page and tell the particular html component to look
for the data in the request under some defined name.
-Solution 2: 
Insert and additional preparation action in between the action processing
pageA and pageB; call it ShowPageB or something of the sort. ShowPageB
action would access the data out of request scope and populate the form
defined for pageB and forward to pageB.

There are so many ways to approach this solution. It's subjective to the
complexity of the process. I wouldn't stress over the fact of having 
to place data in the request scope temporarily. 

What I would stress is let Struts do its job where possible - like
creating action forms.
robert



 

-Original Message-
From: Michael Thompson [mailto:[EMAIL PROTECTED]
Sent: Saturday, September 20, 2003 11:09 AM
To: Struts Users Mailing List
Subject: Re: Action Form Design Question
//
///
//I've been having issues with posting to this list, so I apologize if 
this is a repost.
//
///

That hits on some points, I did read that thread earlier this week(I'll 
even read it again), and I'm starting to agree on not shoving everything 
in the ActionForm, but I don't recall it hitting on an Action needing 
one form for input and one form for output.  If I totally ignore it, the 
second page will render, but what if I need my html form in the second 
JSP(JSPB) to be prepopulated with the results of the processing 
in ActionA?

Scenario:
I have jspA that is rendered with ActionFormA.  Now user submits that 
data to ActionA.  ActionA recieves an ActionFormA as its input form in 
execute.  Now ActionA needs to forward to jspB which expectes an 
ActionFormB, what is the cleanest way to handle this in struts(see code 
below).  Do struts users run across this case often or do I need to 
rethink my Action/Form design?
  --m

Robert Taylor wrote:

   

This was discussed earlier this week. 

Some solutions are addressed here:
http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg8
 

1101.html
   

robert



 

-Original Message-
From: Michael Thompson [mailto:[EMAIL PROTECTED]
Sent: Friday, September 19, 2003 6:10 PM
To: struts-user
Subject: Action Form Design Question
I've hit a stumbling block and I'm not quite sure how to work around 
it.  I've written struts apps in the past and I've taken the 
   

approach of 
   

putting everything in the ActionForm so that the jsp has a one 
   

stop shop 
   

for all it's display needs.  So where I've hit an issue is when say I 
have jsp A that is rendered with form A.  When user submits data to 
action A, the ActionForm pushed to execute is form A.  What 
   

happens when 
   

I need to forward from action A to jsp B which is rendered with 
   

form B?  
   

I need to populate an ActionForm B to send to jsp B, but I don't have 
one.  Is it "normal" to create a form of a different type in your 
Action?  So essentially the code would look something like:

public ActionForward execute(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
 FormA inputForm = (FormA)form;
 Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm);
   FormB outputForm = getInstanceOfFormB(mapping, request);  //this 
would stash in request/session also
 populateFormBWithResults(outputForm, result);

 return mapping.findForward("success

RE: [OT] Lightweight helper libraries for reporting?

2003-09-21 Thread Joe Germuska
David:

The main reason I'm not ready to use displaytag is because I need to 
generate reports for more than just HTML output; my users will have 
the choice to get a delimited file as well, or instead of HTML, and 
they'll have the option to get the report mailed to them as well as 
generated while-they-wait.  I know that displaytag has some support 
for export files, but I'm figuring it's more work than it's worth to 
use a JSP tag library for asynchronous generation of a CSV file sent 
as an email attachment.

My design is to have a model-level report returned from a report 
service to a controller which can then send the report to various 
renderers.  I just haven't yet written classes to deal with common 
report functions like grouping and totalling, and it seems like 
something that would be generally useful.

I think displaytag is pretty impressive, and totally appropriate for 
a model where the web page is the primary output form.  I actually 
find the decorator model a little frustrating, as it requires writing 
and compiling code for view things which I'd prefer to have more 
flexibly changeable in a JSP (at least it did a year ago when I used 
it last) -- I'm pretty sure I had to compile a date format into a 
column decorator; what happens when the client decides they want that 
to change?  I have to recompile the class?  Or find someplace other 
than displaytag to set a runtime property for the date format; that 
seems awkward.

I think instead of a single "table" tag, it would be nice to have a 
"table" tag which defined beans and made them available to nested 
tags for various purposes, like many Struts tags do (html:messages, 
logic:iterate, etc).  This might be hard to do and still achieve 
everything that displaytag does, but if I were really motivated, I'd 
look at adapting displaytag to a model more like that...

Joe

At 22:59 -0400 9/19/03, David G Friedman wrote:
Joe,

I've been planning on using the displaytag library for that stuff when I get
to it next week.  Why won't the decorator classes work for you to perform
summations of rows, groups, and so forth?  I'm wondering why it won't work
for you in case the same reasons might apply to my application
For reference, an example of the decorators for summations of groups and
rows is here:
http://edhill.its.uiowa.edu/display-examples/example-callbacks.jsp
With their Java decorator class code example code here:
http://edhill.its.uiowa.edu/display-examples/TotalWrapper.java.txt
--
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"If nature worked that way, the universe would crash all the time." 
	--Jaron Lanier

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


RE: [FRIDAY] So...you think M$ is evil?

2003-09-21 Thread Mark Galbreath
doh!  I thought it read, "autorobotic!"  (no batteries included)

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 21, 2003 11:07 AM
To: Struts Users Mailing List
Subject: Re: [FRIDAY] So...you think M$ is evil?


I got £57000 or so -

You obviously answered the question about autoerotic sex wrongly!

On 09/21/2003 03:12 PM Andrew Hill wrote:
> £20510 eh?
> Tempting... but I think my current employee contract already covers the
> rights to it :-(
>
> -Original Message-
> From: Mark Galbreath [mailto:[EMAIL PROTECTED]
> Sent: Sunday, 21 September 2003 20:56
> To: Struts Users Mailing List
> Subject: [FRIDAY] So...you think M$ is evil?
>
>
> http://www.wewantyoursoul.com/index.php
>
> muhahahaha!
> Mark
>
>
> -
> 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]
>
>

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9


-
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: [FRIDAY] So...you think M$ is evil?

2003-09-21 Thread Adam Hardy
I got £57000 or so -

You obviously answered the question about autoerotic sex wrongly!

On 09/21/2003 03:12 PM Andrew Hill wrote:
£20510 eh?
Tempting... but I think my current employee contract already covers the
rights to it :-(
-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Sunday, 21 September 2003 20:56
To: Struts Users Mailing List
Subject: [FRIDAY] So...you think M$ is evil?
http://www.wewantyoursoul.com/index.php

muhahahaha!
Mark
-
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]

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Wizard pages in Struts design question

2003-09-21 Thread Ted Husted
To prevent repopulation of an ActionForm's properties, you just need to 
provide a property that observes that status of another property that 
indicates whether the form is readonly or not. So, instead of just doing

this.property = property

you have

if (mutable) this.property = property

Or do something more sophisticated, like have it look at the page number 
and then decide whether to set itself or not.

Though, IMHO, the behavior for a step is so complicated that you want to 
put it in its own action, it should probably be outside of Struts all 
together, and part of the business logic layer.

(This is why chaining is frowned upon. It's a red flag that indicates 
business logic is creeping into your Action classes. When the business 
logic is sufficiently fine-grained, you should just be able to whatever 
you need to do from whatever Action you happen to be in. As work 
progresses on Commons Chain, I think this will provide a solution many 
people will prefer to chaining Struts Action).

I haven't had a chance to abstract it into a standard class, but here's 
a wizard Action that I'm working with now. It submits back to the same 
class, but uses a dispatch action so that if a step needs more behavior 
it can be encapsulated that way.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/apps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java

The steps are laid out as ActionForwards to the instant ActionMapping, 
making it very easy to rewrite.

-Ted.

Erez Efrati wrote:
I read the HowTo write a wizard on the Struts web-site but I wasn't
really happy with the solution, and I am looking for a better one. I
came up with another way and I would appreciate your comments. 

The design consists of: 
- The 'form' is a session scope form
- WizardAction class (a DispatchAction based) with following methods:
	* init () - starting the wizard and redirect to the first page
	* finish () - (or save()) finish the wizard and save the
information 			  in the form using some business logic
delegate.
	
- Each Page or step in the wizard is a separate Action class, extending
a 	WizrardBaseAction (a DispatchAction based) which contains some
shared 	methods.

	For example: Page1Action extends WizardBaseAction {

// initializes the page (done only on first
encounter)
ActionForward init (mapping,...) throws
Exception;
ActionForward back (mapping,...) throws
Exception;
ActionForward next (mapping,...) throws
Exception;  ActionForward finish
(mapping,...) throws Exception;
}   
- Each page/step has a separate action-mapping item in the configuration
with local forwards for : 'back' (if not the first page), 'next',
'finish' (if allowed from that page).
 I apologize for not sketching the whole idea down to the last bit but I
hope you get the picture. 

Only problem is that this design touches the question of chaining
actions verses forward redirection (not just dispatching). 

For example the Page1Action.next() does the following:
1. validate the page
2. perform whatever processing required
3. return the next action to forward to (redirect or chain with
all its illness..)
In my opinion (humble one of course :) having such a separation keeping
each step in its own class is better and clearer design than having them
all in the same Action class. 

Isn't there a way to prevent the reset + pre-population of the form done
while chaining actions? Furthermore, is it so bad to redirect between
actions? 

Thanks in advance,
Erez




 



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

--
Ted Husted,
  Junit in Action  - ,
  Struts in Action - ,
  JSP Site Design  - .
"Get Ready, We're Moving Out!!" - 



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


RE: Action Form Design Question

2003-09-21 Thread Robert Taylor
I would say the solution depends on the process.

If the process of going from pageA to pageB to ... pageN, is
a wizard style process then you might think of placing all
your data in the same form and putting the form in session scope.

If you don't want to put your form in session scope AND the
data you capture along the way can be stored in hidden fields,
then you could also use a single form placed in request scope.

If the process is somewhat disjoint and you have separate forms,
then is the data to be rendered in pageB unique to the user? Is
it static data? If so, place that data in ServletContext and
make it available to all users and you don't need a set up action
for pageB. 

If the data IS unique to the user AND you have separate forms then
in this situation, I would still let Struts perform the form creation.
-Soluation 1:
Place the data retrieved from processing pageA in request scope
and forward to the page and tell the particular html component to look
for the data in the request under some defined name.
-Solution 2: 
Insert and additional preparation action in between the action processing
pageA and pageB; call it ShowPageB or something of the sort. ShowPageB
action would access the data out of request scope and populate the form
defined for pageB and forward to pageB.

There are so many ways to approach this solution. It's subjective to the
complexity of the process. I wouldn't stress over the fact of having 
to place data in the request scope temporarily. 

What I would stress is let Struts do its job where possible - like
creating action forms.

robert




> -Original Message-
> From: Michael Thompson [mailto:[EMAIL PROTECTED]
> Sent: Saturday, September 20, 2003 11:09 AM
> To: Struts Users Mailing List
> Subject: Re: Action Form Design Question
> 
> 
> //
> ///
> //I've been having issues with posting to this list, so I apologize if 
> this is a repost.
> //
> ///
> 
> That hits on some points, I did read that thread earlier this week(I'll 
> even read it again), and I'm starting to agree on not shoving everything 
> in the ActionForm, but I don't recall it hitting on an Action needing 
> one form for input and one form for output.  If I totally ignore it, the 
> second page will render, but what if I need my html form in the second 
> JSP(JSPB) to be prepopulated with the results of the processing 
> in ActionA?
> 
> Scenario:
> I have jspA that is rendered with ActionFormA.  Now user submits that 
> data to ActionA.  ActionA recieves an ActionFormA as its input form in 
> execute.  Now ActionA needs to forward to jspB which expectes an 
> ActionFormB, what is the cleanest way to handle this in struts(see code 
> below).  Do struts users run across this case often or do I need to 
> rethink my Action/Form design?
>--m
> 
> 
> Robert Taylor wrote:
> 
> >This was discussed earlier this week. 
> >
> >Some solutions are addressed here:
> >http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg8
> 1101.html
> >
> >robert
> >
> >
> >  
> >
> >>-Original Message-
> >>From: Michael Thompson [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, September 19, 2003 6:10 PM
> >>To: struts-user
> >>Subject: Action Form Design Question
> >>
> >>
> >>I've hit a stumbling block and I'm not quite sure how to work around 
> >>it.  I've written struts apps in the past and I've taken the 
> approach of 
> >>putting everything in the ActionForm so that the jsp has a one 
> stop shop 
> >>for all it's display needs.  So where I've hit an issue is when say I 
> >>have jsp A that is rendered with form A.  When user submits data to 
> >>action A, the ActionForm pushed to execute is form A.  What 
> happens when 
> >>I need to forward from action A to jsp B which is rendered with 
> form B?  
> >>I need to populate an ActionForm B to send to jsp B, but I don't have 
> >>one.  Is it "normal" to create a form of a different type in your 
> >>Action?  So essentially the code would look something like:
> >>
> >>public ActionForward execute(ActionMapping mapping, ActionForm form, 
> >>HttpServletRequest request, HttpServletResponse response)
> >> throws Exception
> >>{
> >>   FormA inputForm = (FormA)form;
> >>   Result result = doSomeCrunchingOnDataSubmittedViaFormA(inputForm);
> >> FormB outputForm = getInstanceOfFormB(mapping, request);  //this 
> >>would stash in request/session also
> >>   populateFormBWithResults(outputForm, result);
> >>
> >>   return mapping.findForward("success");
> >>}
> >>
> >>getInstanceOfFormB is a little hazy, but I did notice a method in 
> >>RequestUtils that might help.  Seems like this might be breaking some 
> >>struts abstractions by knowing what form to create etc.
> >>
> >>Is this the correct way to approach this or should I thin

Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati

I read the HowTo write a wizard on the Struts web-site but I wasn't
really happy with the solution, and I am looking for a better one. I
came up with another way and I would appreciate your comments. 

The design consists of: 
- The 'form' is a session scope form
- WizardAction class (a DispatchAction based) with following methods:
* init () - starting the wizard and redirect to the first page
* finish () - (or save()) finish the wizard and save the
information   in the form using some business logic
delegate.

- Each Page or step in the wizard is a separate Action class, extending
a   WizrardBaseAction (a DispatchAction based) which contains some
shared  methods.

For example: Page1Action extends WizardBaseAction {

// initializes the page (done only on first
encounter)
ActionForward init (mapping,...) throws
Exception;
ActionForward back (mapping,...) throws
Exception;
ActionForward next (mapping,...) throws
Exception;  ActionForward finish
(mapping,...) throws Exception;
}   

- Each page/step has a separate action-mapping item in the configuration
with local forwards for : 'back' (if not the first page), 'next',
'finish' (if allowed from that page).

 I apologize for not sketching the whole idea down to the last bit but I
hope you get the picture. 

Only problem is that this design touches the question of chaining
actions verses forward redirection (not just dispatching). 

For example the Page1Action.next() does the following:
1. validate the page
2. perform whatever processing required
3. return the next action to forward to (redirect or chain with
all its illness..)

In my opinion (humble one of course :) having such a separation keeping
each step in its own class is better and clearer design than having them
all in the same Action class. 

Isn't there a way to prevent the reset + pre-population of the form done
while chaining actions? Furthermore, is it so bad to redirect between
actions? 

Thanks in advance,
Erez






 



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



RE: [FRIDAY] So...you think M$ is evil?

2003-09-21 Thread Mark Galbreath
But I understand you can get a second mortgageif you have any equity
left.

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 21, 2003 9:13 AM
To: Struts Users Mailing List
Subject: RE: [FRIDAY] So...you think M$ is evil?


£20510 eh?
Tempting... but I think my current employee contract already covers the
rights to it :-(

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Sunday, 21 September 2003 20:56
To: Struts Users Mailing List
Subject: [FRIDAY] So...you think M$ is evil?


http://www.wewantyoursoul.com/index.php

muhahahaha!
Mark


-
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: The future of Struts...

2003-09-21 Thread Ted Husted
See the Struts Roadmap for plans that have been discussed on the Struts 
DEV list.



It's important to note that the tags have always been a extension of the 
core framework. The framework originally shipped with a custom tag 
library, because that's what people needed most. Since then, support for 
many other display technologies have been added, including JSTL and JSF, 
as well as XLST and Velocity. For some time, we have been emphasizing 
that Struts is a Controller framework that supports various presentation 
layers.

I'm sure many Struts developers will start using JSF, once the 
specification is finalized and implementations are available -- just as 
many Struts developers are using JSTL today. (While even others use 
XLST, Velocity, and so forth.) For the most part, Struts and JSF are 
complementary. Struts provides a flexible, pluggable request processor. 
JSF provides a rules-based navigational system. Some teams may be able 
to JSF rules that instead of the Struts Controller, others might use the 
Struts controller with JSF tags, or perhaps one for this workflow and 
another for that workflow. It's not an election of remedies. There are a 
lot of gaps in JSF (as well as in Struts 1.1) that can be filled by 
standard, open-source extensions maintained by projects like this one.

If you plan to use JSP tags, and can use Servlet 2.3/JSP 1.2, the best 
longterm JSP tag strategy right now would be to go with JSTL. The 
conventional tags will be supported so long as someone volunteers to do 
the work, but no one seems to be stepping forward. However, tens of 
thousands of applications have shipped with the original tags, so they 
must be doing something right =:0)

But, the thing with a project like Struts, is that it's not about 
planning. It's about doing. The future of Struts lies in the hands of 
people who contribute to the codebase and "make it so".

-Ted.

Marco Tedone wrote:
Hi, is now the future of Struts the integration with JSF and JSTL? Does it
mean that Struts will be only a background framework leaving the
presentation (HTML, JSP) to JSF and JSTL? Is Sun going to open a new project
to build a background framework (a sort of Sun-Struts)?
In this case I wouldn't say that this would be bad (maybe on the opposite!)
but I would like to know it to take strategic decisions for my projects.
Marco



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

--
Ted Husted,
  Junit in Action  - ,
  Struts in Action - ,
  JSP Site Design  - .
"Get Ready, We're Moving Out!!" - 



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


RE: [FRIDAY] So...you think M$ is evil?

2003-09-21 Thread Andrew Hill
£20510 eh?
Tempting... but I think my current employee contract already covers the
rights to it :-(

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]
Sent: Sunday, 21 September 2003 20:56
To: Struts Users Mailing List
Subject: [FRIDAY] So...you think M$ is evil?


http://www.wewantyoursoul.com/index.php

muhahahaha!
Mark


-
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]



[FRIDAY] So...you think M$ is evil?

2003-09-21 Thread Mark Galbreath
http://www.wewantyoursoul.com/index.php

muhahahaha!
Mark


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



The future of Struts...

2003-09-21 Thread Marco Tedone
Hi, is now the future of Struts the integration with JSF and JSTL? Does it
mean that Struts will be only a background framework leaving the
presentation (HTML, JSP) to JSF and JSTL? Is Sun going to open a new project
to build a background framework (a sort of Sun-Struts)?

In this case I wouldn't say that this would be bad (maybe on the opposite!)
but I would like to know it to take strategic decisions for my projects.

Marco




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



RE: [OT] STL startup times - is caching going on?

2003-09-21 Thread Edgar P Dollin
Custom tags are cached in most containers (tag pooling).  If the parameters
to a tag are the same the same instance of a tag object is used.  It is up
to the container when to discard / garbage collect the tag instances.

I don't know if this is the problem / issue here but hope it helps.

Edgar

> -Original Message-
> From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, September 20, 2003 11:35 PM
> To: Struts Users Mailing List
> Subject: [OT] STL startup times - is caching going on?
> 
> 
> This is a little off-topic, but I am using the Struts EL 
> taglibs in the applications this is happening. Any 
> suggestions, ideas are appreciated. (I also posted on the 
> Jakarta taglibs list).
> 
> I am having an issue with large startup times the first time 
> one of my pages runs that uses JSTL mostly the core library. 
> Subsequent requests (even for different users on different 
> data) take much, much less time.
> 
> Here is a little more detail. Any ideas are much appreciated. 
> My ISP is pretty irate because we suck up huge amounts of CPU 
> each time it happens.
> 
> We are using Tomcat 4.1.24, Java 1.4.1 and Struts 1.1.
> 
> OK, the page uses a couple of nested foreach loops to 
> generate a grid/chart of SVG markup language. It also uses a 
> couple of small foreach loops to generate tick marks on an 
> axis. It looks something like:
> 
>   Chart  page
>  tag
> include JSP/JSTL page to generate footer.
> include JSP/JSTL page to generate x and y axis
> JSTL markup to generate main body of chart
> include JSP/JSTL page to generate footer.
> 
> The request takes a half second to build the Java objects 
> that the JSTL code uses to render on the page. But the 
> rendering takes 45 second on a 650MHZ Sun SPARC III machine 
> and almost that long on a fast Windows machine (2500 MHZ).
> 
> The second and subsequent times the chart rendering drops 
> down to less than 200 milliseconds. Then about five minutes 
> later, if the chart is requested again, it takes the 45 
> seconds to generate, then 200 milliseconds for subsequent requests.
> 
> Thanks in advance - Richard
> 
> 
> 

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



Re: org.apache.struts.taglib.html.BEAN

2003-09-21 Thread Reto Badertscher
Hello,

in the meantime if have found the error:

 --> mistakenly closed the tag

   .



Sorry for the trouble

Reto

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



Re: org.apache.struts.taglib.html.BEAN

2003-09-21 Thread Reto Badertscher
After tracking the STRUTS code i found out that it happens when the form tag 
is processed:
org.apache.struts.taglib.html.HiddenTag contains a property name with value 
'org.apache.struts.taglib.html.BEAN'

BaseFieldTag.jave
...
   results.append(" value=\"");
if (value != null) {
results.append(ResponseUtils.filter(value));
} else if (redisplay || !"password".equals(type)) {
  -- name is not found -->  
Object value = RequestUtils.lookup(pageContext, name, property, null);
 --
if (value == null)
value = "";
results.append(ResponseUtils.filter(value.toString()));
}

Hope this helps

Reto

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



org.apache.struts.taglib.html.BEAN

2003-09-21 Thread Reto Badertscher
Hello,

i'm new to Struts and started my first application. When displaying a form 
which extends ValidatorForm , i'll get the following message:

javax.servlet.ServletException: Cannot find bean 
org.apache.struts.taglib.html.BEAN in any scope
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.price_list_rep_jsp._jspService(price_list_rep_jsp.java:216)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

From my JSP page:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" 
session="true" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"; prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"; prefix="logic" %>


xxx



   
   
   
  
   
   



  
  

  
Year

  
  
Month

  
  

  





I've debugged the application; the named form is in the request with the name 
as indicated in the action-mapping. Can please tell me someone what this BEAN 
is, and what i'm doing wrong. Any help is very much appreciated as i already 
spent hours checking the application.

Regards

Reto


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