When i18n isn't Needed

2003-02-02 Thread Dave Ford
It seems to me that for apps that do not need i18n, i18n constructs shouldn't be 
forced upon the user. Is there a way to return an error message from 
ActionForm.validate(..) without dealing with a resource file?


Dave Ford
Smart Soft - The Developer Training Company
http://www.smart-soft.com



Dates in Form Objects

2003-02-02 Thread Frost, Gary [IT]
Hi,

I've got struts going using a nightly build from about a month ago.

Anyway, I'd like to have a form

public class InputForm extends Form
{
Integer volume;
java.util.Date  transferDate;
String  notes;
}

And on a JSP page, effectively

Volume
Transfer Datedd/mm/

Notes


So that 
a) When the JSP is called, if the values are completed (not null)
then they are correctly rendered to the page, i.e. how can I have an
appropriate date formatter in their (I am also using JSTL, so would be happy
to put  in their somewhere).
b) When the page is submitted, the form converts the transferDate
into a java.util.Date object.

At the moment I am getting an exception in  BeanUtils.populate

But looking at the BeanUtils javadoc I should be able to do something with
org.apache.commons.beanutils.locale.converters.DateLocaleFormater correct?
All input greatly appreciated.

Thanks
Gary


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




Pre Population Problem with FormBean - Urgent

2003-02-02 Thread ashokd
Hi,

 In my application in Action Class we are setting FormBean values for  next
screen.

 In this scenario first time the values are not pre populating in next
screen.

If we refreshed the page i.e: the action invoking once again then  the
values are prepopulating.


 Scope of the Next FormBean : Session

 Code in Action class:

 TestForm unitForm =
 (TestForm)aRequest.getSession().getAttribute("unitselForm");
 if(unitForm == null){
  unitForm = new TestForm( );
 }
   unitForm.setUnit("2");
unitForm.setUserId("Ashok");



 Thanks in Advance,
 Ashok.D



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




RE: [OT] So much time, so little to do ...

2003-02-02 Thread Richard Mixon
I believe it was Martin Fowler referring to JUNIT. - Richard

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 02, 2003 4:10 PM
To: [EMAIL PROTECTED]
Subject: [OT] So much time, so little to do ... 


"No, stop. Rewind and reverse that." =:0)

Okay trivia geeks, who said "Never has so much been owed by so many to 
so few lines of code" and what "so few lines of code" are we talking about?

Yet another autographed copy of Struts in Action to the first lucky 
emailer with the correct answers. (Prior winners excluded.)

Hint: It wasn't Gene Wilder =:0)

-Ted.

-- 
Ted Husted,
Struts in Action 


-
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 access Form object from my -JSP

2003-02-02 Thread Sakis Chatzinikolaou
Hi,
Try to use bean:define to define a variable from the FormBean
I think 

But you better check the documentation for the bean:define tag

Hope this helps

Regards
Sakis

- Original Message -
From: "Souravmay Das" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 03, 2003 7:35 AM
Subject: How to access Form object from my -JSP


> Hi,
> I have a JSP which get redirected from the Controller servlet
> now how do
> I access the Form objects from Tag class.
>
> Now my struts-config looks some thing like this
>
> 
>  type="org.apache.struts.example.LogonForm"/>
> 
> 
>   
> 
>
> Now in index.jsp I have a tag which tries to get some thing from the
> LogonForm.
>
> How can I get the form object from my custom Tag.
>
> Any idea , how to make it work.
>
> Regards,
> Sourav Das
>
>


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




How to access Form object from my -JSP

2003-02-02 Thread Souravmay Das
Hi,
I have a JSP which get redirected from the Controller servlet
now how do
I access the Form objects from Tag class.
 
Now my struts-config looks some thing like this
 




  

 
Now in index.jsp I have a tag which tries to get some thing from the
LogonForm.
 
How can I get the form object from my custom Tag.
 
Any idea , how to make it work.
 
Regards,
Sourav Das
 



Re: blank html:option elements

2003-02-02 Thread Charles H. Baker
Todd Pierce wrote:

Off the top of my head :

 

...should do the trick. But why do you want a blank option? If it's for a
divider, I suggest -- would work better.


Thanks. Wonder why an actual space between the  and 
 would throw an exception?

{{SNIP}}

--
Charles H. Baker
[EMAIL PROTECTED]
http://www.charleshbaker.com/
http://www.charleshbaker.com/~chb/
You'll wish that you had done some of the hard things when they were 
easier to do.


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



RE: blank html:option elements

2003-02-02 Thread Todd Pierce
Off the top of my head :

 

...should do the trick. But why do you want a blank option? If it's for a
divider, I suggest -- would work better.

-Original Message-
From: Charles H. Baker [mailto:[EMAIL PROTECTED]]
Sent: Monday, 3 February 2003 3:12 PM
To: [EMAIL PROTECTED]
Subject: blank html:option elements


How can I create a blank entry in a selection list using the
html:option tag? Everytime I try something like

 

I get an exception which just so happens to be missing it's Message 
Resource. What am I doing wrong?
-- 
Charles H. Baker
[EMAIL PROTECTED]
http://www.charleshbaker.com/
http://www.charleshbaker.com/~chb/
Darth Vader sleeps with a Teddywookie.


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




blank html:option elements

2003-02-02 Thread Charles H. Baker
How can I create a blank entry in a selection list using the
html:option tag? Everytime I try something like

 

I get an exception which just so happens to be missing it's Message 
Resource. What am I doing wrong?
--
Charles H. Baker
[EMAIL PROTECTED]
http://www.charleshbaker.com/
http://www.charleshbaker.com/~chb/
Darth Vader sleeps with a Teddywookie.


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



Re: question re. struts

2003-02-02 Thread Paul Linden
Sundar Narasimhan wrote:


   - set each individual attribute of my model into request
 parameters
 

Why would you do this if you have the form bean from the previous
step?
   


Hi, Paul: Thanks for your thoughtful reply. Your above statement is
what I guess I'm having trouble with. (i.e. if I have a Point model
object.. say read from the db.. according to a unique ID..
	 Point -- getX(), getY(), setX(int x), setY(int y) .. 
now I need a 
PointForm 
with similar methods.. may be getting and setting with String instead
of ints :). and Let's postulate a PointAction. 

The point of confusion I have is.. I understand that the struts
servlet instantiates PointAction, and can map "parameter" X, and Y from/to
PointForm's X and Y.. but in my perform method .. I still need to
have:

	perform.. () {
	 Point p = new Point(id);
	 request.setAttribute("X", p.getX());
	 ..
	 call the jsp
	}
do I not? 

You don't have a form here - where are you using PointForm?

The code should be something like - assuming you're using struts 1.0.x:

  execute (... mapping, ... form, ... request, ... response) {
  form = new FooBarBlahForm();
  ...
  // Get model object
  ...
  myForm.setFoo(model.getFoo());
  myForm.setBar(model.getBar());
  myForm.setBlah(model.getBlah());
  return mapping.findForward("success");
   }

I'll leave it up to you to find out how to set up your struts-config so 
that the form is available in the JSP.

This may be annoying if you have say 15 different items to get and set, 
but it provides a clean break between the action and the model and I, 
for one, can live with it.

I'll just add that reducing the number of lines of code shouldn't be a 
goal - generally, code reductions come about as a result of good design. 
Keeping the business logic out of the action as in struts may initially 
produce longer source files, but when you find you can start reusing 
your model code unchanged in the next release of your project, or when 
management makes the decision that you shouldn't be using opensource 
software so you have to write your own framework, you'll see where the 
code reductions lie.

If it does, what I'd like to know is what people do to reduce the
amount of code.. is there a tool that can perhaps 'generate' the form
given a model.. ? Or something.. I have tens of objects w/ hundreds of
attributes and I'm overwhelmed w/ the amount of code Struts seems to
imply. 


How is it even possible to produce a usable input form in your UI if you 
have hundreds of attributes - or do you mean each of your tens of 
objects has tens of attributes?

Paul


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



Re: [OT] So much time, so little to do ...

2003-02-02 Thread Regis Melo
Winston Churchill sad:

'Never in the history of human conflict has so much been owed by so many to
so few.'

Ok! I'm not the first But, I'm original!

What do You think Ted? :-)  ;-)

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 02, 2003 8:09 PM
Subject: [OT] So much time, so little to do ...


> "No, stop. Rewind and reverse that." =:0)
>
> Okay trivia geeks, who said "Never has so much been owed by so many to
> so few lines of code" and what "so few lines of code" are we talking
about?
>
> Yet another autographed copy of Struts in Action to the first lucky
> emailer with the correct answers. (Prior winners excluded.)
>
> Hint: It wasn't Gene Wilder =:0)
>
> -Ted.
>
> --
> Ted Husted,
> Struts in Action 
>
>
> -
> 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: question re. struts

2003-02-02 Thread Sundar Narasimhan
>You should really go back through some of the archives to review the
>pro and con arguments; and (among other things)
>you will find that I am adamantly against what you propose -- it would
>encourage people to reuse the wrong thing for the wrong reasons.
Craig -- thanks for your response. Will go and read them, since this
list seems like a really useful resource and undoubtedly people have
run against this sort of issue before.

But your suggestion doesn't help me.. because I am on 1.0 (I tried to
go to 1.1b2 this afternoon and failed -- 1.1 seems like several jars
-- 17M? yikes, and undoubtedly was interacting w/ some tomcat jars
that I've yet to fully debug) and I think even though I may not have
the right solution -- I think this remains a problem. 

So I guess it's back for me to try and put in the 1.1 stuff and give
that a go again. Sigh. 

Thanks.






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




RE: html:text tag "indexed" attribute

2003-02-02 Thread John Espey
I think this is how you'd do it using JSTL and Struts-EL (I may have messed
the names up)





-Original Message-
From: Charlie Toohey [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 02, 2003 4:10 PM
To: Struts Users Mailing List
Subject: Re: html:text tag "indexed" attribute


Thanks David. I appreciate your help.

My conclusion is that the html:text "indexed" attribute is only intended for
collections of beans which have properties, not for collections of Strings
which do not have properties. The generated "name" attribute for the HTML
tag
of name[nn].property simply does not apply to a collection of some object
which does not have properties.

I figured out how to do it using the "indexId"  of the logic:iterate tag.
This solves both the problem of populating the HTML text tag with the
correct
value, and creating the correct "name" attribute for the HTML text tag, so
that my form bean is populated correctly on submit.


  
 

I'm sure that there is a slicker way to do this with Struts-EL or JSTL, but
I
haven't gotten there yet. Need more time !

Thanks for all your help.

- Charlie


On Saturday 01 February 2003 11:24 pm, you wrote:
> > "Charlie" == Charlie Toohey <[EMAIL PROTECTED]> writes:
>
> Charlie> Thanks David. That worked for the value attribute:
> Charlie>  id="aString" > Charlie> value='<%= aString.toString() Charlie>  %>' />
> Charlie> 
>
> Charlie> BUT, this resolves to an HTML text tag of:
> Charlie>  name="org.apache.struts.taglib.html.BEAN[0].aString" Charlie>
> value="somevalue">
>
> Charlie> This is my larger question --- what I'm trying to get is
> Charlie> 
>
> Charlie> Using the Struts html:text tag with indexed="true", I am
> iterating over a Charlie> collection of String objects, NOT a collection
of
> bean objects with Charlie> properties. Therefore, instead of using the
bean
> name for the "name" Charlie> attribute and the bean property for the
> "property" attribute, like all of the Charlie> examples I have seen, I do
> not know what to put for the "name" and "property" Charlie> attributes,
> because this is a collection of Strings, not beans, and the Charlie>
String
> objects do NOT have a property.
>
> Charlie> Please help ! I've been trying to get this to work for 2
> days now.
>
> This is where it gets a little tricky to visualize, and I'm not sure I'm
> going to get this right, but I'll give it a try.
>
> First of all, you should change "aString" to something that doesn't have a
> capital in the first two characters of the property name.  I believe that
> triggers some funny behavior in the JavaBeans spec.  If you just change it
> to "astring" or "someString", that would work fine.
>
> Now, try adding a "name" parameter to your "html:text" tag.  I don't know
> what to call it yet, but let's call it "stringObj".
>
> Now, add an indexed getter (may not need the getter) and setter to your
> form bean, for the "stringObj" property.  The value parameter will be a
> "String".
>
> That may work.  Personally, I find "indexed" tags confusing, but I haven't
> tried to use them very much.  It seems to me that it's more understandable
> to build the array reference expression manually, and this is easier to do
> if you use Struts-EL, as the EL expressions are more concise than
scriptlet
> expressions.

-
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: Issues with using Modules

2003-02-02 Thread Craig R. McClanahan


On Sun, 2 Feb 2003, Sharma, Sanjay (LNG-DAY) wrote:

> Date: Sun, 2 Feb 2003 15:19:54 -0500
> From: "Sharma, Sanjay (LNG-DAY)" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED] '" <[EMAIL PROTECTED]>
> Subject: Issues with using Modules
>
>
> 1) There are no real global forwards and exceptions. The global are only
> visibale within a module. How can I define forwards and exceptions that are
> used in multiple module.

As you (correctly) point out, the term "global" in a struts-config.xml
file is currently only global within the scope of a module.  In 1.1,
modules are (essentially) totally independent of each other.

Designing some sort of mechanism where modules could "inherit from" or
"subclass" each other is likely to be a popular topic on STRUTS-DEV when
we start laying out the roadmap for Struts 1.2.  That way, you could put
parent resources of various types in a parent module, and then specialize
as desired.

> 2) Forwarding between mdoules is awakward. First, if you want to forward
> from an action to a jsp in another module, context-relative forward looks
> attractive.  But it doesn't really swicth the modules when forwarding so it
> won't work.
>

As I responded earlier to this question, that is what SwitchAction is for.
If you want to do it programmatically, use RequestUtils.selectModule()
instead.  That will guarantee that you don't have to worry about all the
messy internal details required to actually perform the switch.

> So to make the forward really work, you need to:
> i) Parse the path in the context-relative forward to determine the module
> and module-realtive path
> ii) Create a forward to a Swicth Action and specify the module-relative path
> (of the JSP) as the page attribute and modules as the prefix and forward to
> the Switch Action.
>
> This seems to be a lot of work just to accomplish a forward and also
> introduces unnecessary intermediate forward. Is there a better way?
>

See above.  RequestUtils contains an amazing number of handly utility
methods for all sorts of things like this, so the Struts Javadocs can
really be your friend :-).

> Sanjay

Craig

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




Re: question re. struts

2003-02-02 Thread Craig R. McClanahan


On Sun, 2 Feb 2003, Sundar Narasimhan wrote:

> What I would have liked to be able to do is..
>
> class PointForm extends Point implements SomeStrutsFormInterface {
> }
>
> in cases where this is possible. The advantage of this is that it
> still maintains and allows for the *Form classes to be decoupled from
> the Model classes, but allows for "code" re-use.. I don't have to
> write several lines of repeated code.. or just spend a lot of time
> writeing to string and from string methods for every single
> attribute. In a language such as Java where no pointers exist taking
> the reflection overhead seems like a big waste -- and writing all
> these repeated methods seems such a productivity reducer :)
>
> Am I making sense?
>

The question about "why isn't ActionForm an interface" is one of the
largest producers of mail volume on STRUTS-USER in the almost-three-year
history of the mailing list.  You should really go back through some of
the archives to review the pro and con arguments; and (among other things)
you will find that I am adamantly against what you propose -- it would
encourage people to reuse the wrong thing for the wrong reasons.

What you really want to do is reuse business logic components and value
objects.  ActionForms are part of the view tier, and their design should
really be under the control of the page author, or whoever is determining
what properties go on the input form.  In addition, the data types in a
form bean should generally be strings, while model tier objects and value
objects should generally use the underlying native data types.

> If it does, what I'd like to know is what people do to reduce the
> amount of code.. is there a tool that can perhaps 'generate' the form
> given a model.. ? Or something.. I have tens of objects w/ hundreds of
> attributes and I'm overwhelmed w/ the amount of code Struts seems to
> imply.
>

There's certainly tools around for this purpose (like XDoclet), but I just
use Struts 1.1 out of the box.  DynaActionForm form beans let you
configure the properties of a form bean in struts-config.xml with no need
to actually create a form bean class at all, unless you need a custom
reset() or validate() method.  And, even then, those are the only methods
you need to implement -- not all the property getters and setters.

Also, dynamic forms work just fine with the validator framework as well,
so it's getting more uncommon to have to write a real form bean class any
more ...

> Thanks.

Craig McClanahan

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




Re: [OT] So much time, so little to do ...

2003-02-02 Thread Scott Barr
martin fowler, talking about junit

On Mon, 2003-02-03 at 09:39, Ted Husted wrote:

> "No, stop. Rewind and reverse that." =:0)
> 
> Okay trivia geeks, who said "Never has so much been owed by so many to 
> so few lines of code" and what "so few lines of code" are we talking about?
> 
> Yet another autographed copy of Struts in Action to the first lucky 
> emailer with the correct answers. (Prior winners excluded.)
> 
> Hint: It wasn't Gene Wilder =:0)
> 
> -Ted.



[OT] So much time, so little to do ...

2003-02-02 Thread Ted Husted
"No, stop. Rewind and reverse that." =:0)

Okay trivia geeks, who said "Never has so much been owed by so many to 
so few lines of code" and what "so few lines of code" are we talking about?

Yet another autographed copy of Struts in Action to the first lucky 
emailer with the correct answers. (Prior winners excluded.)

Hint: It wasn't Gene Wilder =:0)

-Ted.

--
Ted Husted,
Struts in Action 


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



Re: logic-el and the request object

2003-02-02 Thread Jeff Born
I wasn't looking in the JSTL spec, once I looked there I found an
example I could extrapolate from.  Thanks for pointing me in the right
direction David.  BTW your example was exactly what I needed also, so
thanks again.

jb


-Original Message-
From: David M. Karr [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 02, 2003 3:35 PM
To: [EMAIL PROTECTED]
Subject: Re: logic-el and the request object

> "Jeff" == Jeff Born <[EMAIL PROTECTED]> writes:

Jeff> I have been unsuccessfully trying to figure out how to do
something like
Jeff> the following:
 
Jeff>  do
something
Jeff> 
 
Jeff> if this possible? Am I going about it all wrong?  I really
want to check
Jeff> for the existence of getParameter("body") and if the body tag
exists do
Jeff> something.  After playing with it I couldn't even get the
other example
Jeff> to work right, and pretty much have fell back to the following
code?
 
Jeff> <% if ((String tempBody = request.getParameter("body")) ==
null) { %>
Jeff> do something
Jeff> <% } else { %>
Jeff> do something else
Jeff> <% } %>
 
Jeff> How do I do this!!!?!?
 
If you're using "logic-el", then you might as well use the JSTL, which
is more
suited for this.  Note that your sample code differs slightly from what
you
said in english, but this should be close enough for you.  If you want
to
reverse the test, change "empty" to "not empty".  Note that this code
hasn't
been compiled.

  
   
Do something.
   
   
Do something else.
   
  

I suggest you read the JSTL specification.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




-
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: question re. struts

2003-02-02 Thread Sundar Narasimhan
>> - set each individual attribute of my model into request
>>   parameters
>Why would you do this if you have the form bean from the previous
>step?

Hi, Paul: Thanks for your thoughtful reply. Your above statement is
what I guess I'm having trouble with. (i.e. if I have a Point model
object.. say read from the db.. according to a unique ID..
 Point -- getX(), getY(), setX(int x), setY(int y) .. 
now I need a 
 PointForm 
with similar methods.. may be getting and setting with String instead
of ints :). and Let's postulate a PointAction. 

The point of confusion I have is.. I understand that the struts
servlet instantiates PointAction, and can map "parameter" X, and Y from/to
PointForm's X and Y.. but in my perform method .. I still need to
have:

perform.. () {
 Point p = new Point(id);
 request.setAttribute("X", p.getX());
 ..
 call the jsp
}
do I not? 
What I would have liked to be able to do is..

class PointForm extends Point implements SomeStrutsFormInterface { 
}

in cases where this is possible. The advantage of this is that it
still maintains and allows for the *Form classes to be decoupled from
the Model classes, but allows for "code" re-use.. I don't have to
write several lines of repeated code.. or just spend a lot of time
writeing to string and from string methods for every single
attribute. In a language such as Java where no pointers exist taking
the reflection overhead seems like a big waste -- and writing all
these repeated methods seems such a productivity reducer :)

Am I making sense? 

If it does, what I'd like to know is what people do to reduce the
amount of code.. is there a tool that can perhaps 'generate' the form
given a model.. ? Or something.. I have tens of objects w/ hundreds of
attributes and I'm overwhelmed w/ the amount of code Struts seems to
imply. 

Thanks.

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




Re: html:text tag "indexed" attribute

2003-02-02 Thread Charlie Toohey
Thanks David. I appreciate your help.

My conclusion is that the html:text "indexed" attribute is only intended for 
collections of beans which have properties, not for collections of Strings 
which do not have properties. The generated "name" attribute for the HTML tag 
of name[nn].property simply does not apply to a collection of some object 
which does not have properties.

I figured out how to do it using the "indexId"  of the logic:iterate tag. 
This solves both the problem of populating the HTML text tag with the correct 
value, and creating the correct "name" attribute for the HTML text tag, so 
that my form bean is populated correctly on submit.


  
 

I'm sure that there is a slicker way to do this with Struts-EL or JSTL, but I 
haven't gotten there yet. Need more time !

Thanks for all your help.

- Charlie


On Saturday 01 February 2003 11:24 pm, you wrote:
> > "Charlie" == Charlie Toohey <[EMAIL PROTECTED]> writes:
>
> Charlie> Thanks David. That worked for the value attribute:
> Charlie>  id="aString" > Charlie> value='<%= aString.toString() Charlie>  %>' />
> Charlie> 
>
> Charlie> BUT, this resolves to an HTML text tag of:
> Charlie>  name="org.apache.struts.taglib.html.BEAN[0].aString" Charlie>
> value="somevalue">
>
> Charlie> This is my larger question --- what I'm trying to get is
> Charlie> 
>
> Charlie> Using the Struts html:text tag with indexed="true", I am
> iterating over a Charlie> collection of String objects, NOT a collection of
> bean objects with Charlie> properties. Therefore, instead of using the bean
> name for the "name" Charlie> attribute and the bean property for the
> "property" attribute, like all of the Charlie> examples I have seen, I do
> not know what to put for the "name" and "property" Charlie> attributes,
> because this is a collection of Strings, not beans, and the Charlie> String
> objects do NOT have a property.
>
> Charlie> Please help ! I've been trying to get this to work for 2
> days now.
>
> This is where it gets a little tricky to visualize, and I'm not sure I'm
> going to get this right, but I'll give it a try.
>
> First of all, you should change "aString" to something that doesn't have a
> capital in the first two characters of the property name.  I believe that
> triggers some funny behavior in the JavaBeans spec.  If you just change it
> to "astring" or "someString", that would work fine.
>
> Now, try adding a "name" parameter to your "html:text" tag.  I don't know
> what to call it yet, but let's call it "stringObj".
>
> Now, add an indexed getter (may not need the getter) and setter to your
> form bean, for the "stringObj" property.  The value parameter will be a
> "String".
>
> That may work.  Personally, I find "indexed" tags confusing, but I haven't
> tried to use them very much.  It seems to me that it's more understandable
> to build the array reference expression manually, and this is easier to do
> if you use Struts-EL, as the EL expressions are more concise than scriptlet
> expressions.

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




Re: struts 1.1 b2 messes up w/ CSS?

2003-02-02 Thread Sundar Narasimhan
Hi, David: Thanks for your notes.

Sundar> Does 1.1. interfere w/ the the loading/reading of css attributes? 
Sundar> Thanks.
>You'll have to be much more specific, showing exactly what you mean by
>"doesn't
>work", along with showing relevant portions of your pages, and the
>resulting
>output.  What container and version are you using?

Well I tracked it down to the foll. I don't quite understand why it
happens, but at least I now have a workaround. 

The tool I'm using WSAD / eclipse generates struts pages with css like
so:






Now, I'd moved the jsp which had the above lines into a sub-directory
called jsp (I now have tens of jsps and it was becoming unweildy to
have them all at the same root level). 

The tool changed the lines to 


That should work.. but go figure, it doesn't. I tried both 1.0 and
1.1b2 of struts.

Now if I change it to 

it works again.

When I say it doesn't work, it means that css styles are just silently
ignored.. my output pages appear from the jsp, but it looks ugly :)

Thanks for your time and help.

ps. hmm.. I wonder if WSAD/Eclipse should be generating html:link in
this case.



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




Re: logic-el and the request object

2003-02-02 Thread David M. Karr
> "Jeff" == Jeff Born <[EMAIL PROTECTED]> writes:

Jeff> I have been unsuccessfully trying to figure out how to do something like
Jeff> the following:
 
Jeff>  do something
Jeff> 
 
Jeff> if this possible? Am I going about it all wrong?  I really want to check
Jeff> for the existence of getParameter("body") and if the body tag exists do
Jeff> something.  After playing with it I couldn't even get the other example
Jeff> to work right, and pretty much have fell back to the following code?
 
Jeff> <% if ((String tempBody = request.getParameter("body")) == null) { %>
Jeff> do something
Jeff> <% } else { %>
Jeff> do something else
Jeff> <% } %>
 
Jeff> How do I do this!!!?!?
 
If you're using "logic-el", then you might as well use the JSTL, which is more
suited for this.  Note that your sample code differs slightly from what you
said in english, but this should be close enough for you.  If you want to
reverse the test, change "empty" to "not empty".  Note that this code hasn't
been compiled.

  
   
Do something.
   
   
Do something else.
   
  

I suggest you read the JSTL specification.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




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




Re: struts 1.1 b2 messes up w/ CSS?

2003-02-02 Thread David M. Karr
> "Sundar" == Sundar Narasimhan <[EMAIL PROTECTED]> writes:

Sundar> Hi, I have a web application that was working fine w/ struts 1.0. I
Sundar> updated to 1.1 (by update the tld's the jars etc.), and now the
Sundar> web pages that had css attributes just don't seem to work!!!

Sundar> Does 1.1. interfere w/ the the loading/reading of css attributes? 
Sundar> Thanks.

You'll have to be much more specific, showing exactly what you mean by "doesn't
work", along with showing relevant portions of your pages, and the resulting
output.  What container and version are you using?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




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




Re: ok.. but how?

2003-02-02 Thread David M. Karr
> "Sundar" == Sundar Narasimhan <[EMAIL PROTECTED]> writes:

Sundar> David -- Apologies.. but I'm a newbie to struts, and can't understand
Sundar> your statement. Can you perhaps show me what you mean by concatenate
Sundar> strings together? In short, are you saying struts cannot do somehting
Sundar> like this?
Sundar> ps. I have tried different syntaxes such as:
Sundar>...
Sundar> etc. but none of them seem to work. 

Try this:

  
   
  

> "Sundar" == Sundar Narasimhan <[EMAIL PROTECTED]> writes:

Sundar> Hi, I have a variable "type" which I'd like to use like so
Sundar> 
Sundar>  
Sundar>  /> 
Sundar> 

Sundar> But no matter what I try I don't seem to be able to get
Sundar> the link to do
Sundar> the right thing.. Ideas?

Sundar> Well, one problem is that if you use a scriptlet expression for a
Sundar> custom tag
Sundar> attribute, the expression scriptlet has to be the entire attribute
Sundar> value, not
Sundar> just a portion of it.  You'll have to concatenate strings together.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




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




Issues with using Modules

2003-02-02 Thread Sharma, Sanjay (LNG-DAY)
 
1) There are no real global forwards and exceptions. The global are only
visibale within a module. How can I define forwards and exceptions that are
used in multiple module.
2) Forwarding between mdoules is awakward. First, if you want to forward
from an action to a jsp in another module, context-relative forward looks
attractive.  But it doesn't really swicth the modules when forwarding so it
won't work. 

So to make the forward really work, you need to:
i) Parse the path in the context-relative forward to determine the module
and module-realtive path
ii) Create a forward to a Swicth Action and specify the module-relative path
(of the JSP) as the page attribute and modules as the prefix and forward to
the Switch Action. 

This seems to be a lot of work just to accomplish a forward and also
introduces unnecessary intermediate forward. Is there a better way?

Sanjay

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




Re: question re. struts

2003-02-02 Thread Paul Linden
Sundar Narasimhan wrote:


Hi, I have a master form that displays a bunch of object.

I'd like for the user to select a radio button corresponding to one of
those objects and then click Edit.

The editaction should obviously display a form corresponding to the
selected object.

What I'm failing to understand is what I need to do? (i.e. in
order to do something like this)..
 - i need to create an editaction


Yes


 - in it's perform method I need to create/get my model class


Yes


 - write a form class with getter/setter for my model class
   (this largely reproduces methods from the model, but this
class derives from ActionForm)?


Or use a dynamic form.


 - set each individual attribute of my model into request parameters


Why would you do this if you have the form bean from the previous step?


 - forward to the jsp that contains an input form with the
   same input parameters


You have to forward to a JSP, yes, and you use struts tags to display 
the form bean data set in your action class.

All this to do something as simple as display a bunch of fields? :)
I must be missing something. 

Each of the steps outlined above will have to be done no matter what 
framework you use - you have to get the data, put it into some format 
that your UI can use. then display it. Go ahead and try to do this 
outside struts and you'll see what you would miss.

Or you could use PHP.

Is there a way to reduce the number of classes, and maybe reduce the
individual getting and setting code everywhere?


There is nothing, except for good design principles, that prevents you 
combining the model and action code. However, I don't know what your 
model is, but if the code could conceivably be reused outside your 
particular application, then it should be kept separate. Perhaps it's 
not a requirement now that your UI is to be customizable for different 
customers - but who knows what will be decided in the future? Or what if 
the database/store containing your data changes? You may have to change 
your actions code, and if you combine action/model you have to change 
more of your code, and no longer have a common code base.

Or there's nothing preventing you setting each individual data item in 
the request scope and displaying them with JSTL - that way you don't 
have a form bean. Or getting rid of the action by using a scriptlet or 
custom tag in your JSP to get the data from your model, and displaying 
it using JSTL or custom tags. There's lots you could do, but really all 
you're doing is moving the code around, *and* losing customizability, 
flexibility, maintainability and introducing potential breakage points 
into your code.

Paul


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



logic-el and the request object

2003-02-02 Thread Jeff Born
I have been unsuccessfully trying to figure out how to do something like
the following:
 
 do something

 
if this possible? Am I going about it all wrong?  I really want to check
for the existence of getParameter("body") and if the body tag exists do
something.  After playing with it I couldn't even get the other example
to work right, and pretty much have fell back to the following code?
 
<% if ((String tempBody = request.getParameter("body")) == null) { %>
do something
<% } else { %>
do something else
<% } %>
 
How do I do this!!!?!?
 
Thanks in advance,
 
Jeff Born
 



struts 1.1 b2 messes up w/ CSS?

2003-02-02 Thread Sundar Narasimhan
Hi, I have a web application that was working fine w/ struts 1.0. I
updated to 1.1 (by update the tld's the jars etc.), and now the
web pages that had css attributes just don't seem to work!!!

Does 1.1. interfere w/ the the loading/reading of css attributes? 
Thanks.



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




ok.. but how?

2003-02-02 Thread Sundar Narasimhan
David -- Apologies.. but I'm a newbie to struts, and can't understand
your statement. Can you perhaps show me what you mean by concatenate
strings together? In short, are you saying struts cannot do somehting
like this?
ps. I have tried different syntaxes such as:
   ...
etc. but none of them seem to work. 

--

> "Sundar" == Sundar Narasimhan <[EMAIL PROTECTED]> writes:

Sundar> Hi, I have a variable "type" which I'd like to use like so
Sundar> 
Sundar>
Sundar>  
Sundar> 

Sundar> But no matter what I try I don't seem to be able to get
Sundar> the link to do
Sundar> the right thing.. Ideas?

Well, one problem is that if you use a scriptlet expression for a
custom tag
attribute, the expression scriptlet has to be the entire attribute
value, not
just a portion of it.  You'll have to concatenate strings together.

-- 

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




question re. struts

2003-02-02 Thread Sundar Narasimhan
Hi, I have a master form that displays a bunch of object.

I'd like for the user to select a radio button corresponding to one of
those objects and then click Edit.

The editaction should obviously display a form corresponding to the
selected object.

What I'm failing to understand is what I need to do? (i.e. in
order to do something like this)..
  - i need to create an editaction
  - in it's perform method I need to create/get my model class
  - write a form class with getter/setter for my model class
(this largely reproduces methods from the model, but this
 class derives from ActionForm)?
  - set each individual attribute of my model into request parameters
  - forward to the jsp that contains an input form with the
same input parameters
All this to do something as simple as display a bunch of fields? :)
I must be missing something. 

Is there a way to reduce the number of classes, and maybe reduce the
individual getting and setting code everywhere??




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




Re: Handling i18n dates in forms.

2003-02-02 Thread Ted Husted
Most of the real work can occur on the back end in POJOs (Plain Old Java 
Objects). In practice, the way to accept dates in a form is through a 
select box and/or JavaScript calendar. So you start by sending out a set 
of three select boxes with the year/month/day (localised if need be). 
When those come back, you can paste them together into a String and 
convert that into a date.

To render the display form of a date, you can use sql.Date.toValue or 
the text.DateFormat.parse stuff. DateFormat can be a pain, but it will 
jump through all the hoops for you. (Note that DateFormat is NOT 
thread-safe, so don't use it as a member field or save a copy in the 
session. Request scope only.)

I just finished an omnibus object to cope with maintaining dates as a 
binary, a String, and a set of year/month/day Strings. It will make its 
way to the Commons eventually, but there's a hot-off-the-pixels copy here:



I needed to use like four dates in the same ActionForm and set this up 
so I could just pass all the references back and keep the ActionForm 
properties dirt simple.



I haven't put the Locale stuff in yet, but the idea would be to have the 
ActionForm snag the Locale object from the session and make it available 
to the DateDisplay object. Since this is a non-input property, you can 
use the binary here and pass it right up to the business layer.


-Ted.

--
Ted Husted,
Struts in Action 


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



Re: design question about action chaining

2003-02-02 Thread Ted Husted
In Patterns of Enterprise Application Architecture [1], Martin Fowler
[2] lays out two basic patterns for handling business logic [3].

* Transaction Script - "Organizes business logic by procedures where
each procedure handles a single request from the presentation.

* Domain Model - "An object model of the domain that incorporates both
behavior and data."

The Struts MailReader example uses the Transaction Script pattern. This
is a fine way to go for simple applications. I used it myself in my
first significant Struts application (an online auction), still do, and
probably always will. It's simple and efficient, and when the logic is
not complex, does the job quite well, thank you.

The Artimus example [4] from Struts in Action uses the domain model.
Here a stub Action is used to call a domain object. The domain object
does all of the processing for this transaction and returns a response.
The stub Action analyzes the domain's response and bundles everything
into a HTTP response.

The Artimus example is not so complex that it really needs to use Domain
Model, but I wanted it to contrast the MailReader example.

My second significant Struts application was a telemarketing and
inventory manager for the first auction application. Here, the logic is
sometimes quite complex, and I *do* need to use the domain model.
Compared to the public auction application, there's an extra layer of
indirection, but it can do ~whatever~ I need it to do.

It's my belief that when people start to chain Actions, they are trying
to move from a Transaction Script to a Domain Model. Problem is, they
are trying to do it with Struts Actions rather than POJO's (Plain Old
Java Objects).

There are several problems with using Struts Action classes as Domain
Objects:

* First, you must embed complex business logic inside of a HTTP
presentation tier class. As long you use Struts and nothing but Struts,
this is not necessarily a problem. But you never know what nutty idea
the suits will have next =:0)

* Second, the Action interface is not designed so that one Action can
call another. In more complicated applications, use-case "C" is really a
combination of cases "A" and "B". With Actions, to get to C, you need to
forward through A and B (hence the "chain"). With POJO, C can cleanly
call A and B and return the result. The presentation tier doesn't know,
or need to know, that C is a combination of A and B. Such "chains of
responsibility" are the concern of application controllers, but should
not be delegated to a presentation tier controller, like Struts.

* Third, Struts Test Case [5] makes testing Struts actions relatively
simple, but the tests are still more complicated that testing POJOs
alone. With PODOs (Plain Old Domain Objects), you can have two layers of
tests: a pure TestCase against the business logic, and a Struts TestCase
against the interaction between the business layer and the presentation
layer.

It's my thinking that you should be able to look at any given
ActionMapping and say "this uses Transaction Script" or "this uses
Domain Model". If you can't, then I would suggest that you may be
letting the tail wag the dog =:0)

Struts uses a number of very excellent patterns. I am continually amazed
at how well it all fits together. The trick is to use the same patterns
in your enterprise architecture. The "dark side" is letting Struts
~become~ your enterprise architecture. Faster yes, better no.

-Ted.

Resources
-

[1] Patterns of Enterprise Application Architecture


[2] Martin Fowler also wrote "Refactoring", among others. He is
definitely one of our favorite ~non-fiction~ authors.

[3] Business logic - An oxymoron akin to "military intelligence".
Business logic is whatever nutty stuff the client wants to do with the
data that we have so carefully obtained, stored, and retrieved (using
system logic). Sadly, implementing the business logic is what they
actually ~pay~ us to do, rather than the other interesting stuff that we
enjoy doing on the way. (The voyage is the reward.)

[4] Artimus CVS


[5] My new best friend 


--
Ted Husted, Struts in Action 


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




Re: HTTP to HTTPS

2003-02-02 Thread BaTien Duong
I am wondering whether the SecureRequestProcessor of SSL extension for
Struts 1.1 can embrace TilesRequestProcessor so the http/https switching can
recognize Tiles definitions. If not, can this be a feature?

BaTien

- Original Message -
From: "Alireza Fattahi" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Saturday, February 01, 2003 10:22 PM
Subject: RE: HTTP to HTTPS


> See http://struts.ditlinger.com/
>



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




Re: scope of a tool

2003-02-02 Thread James Mitchell
Are you talking about Velosurf?


--
James Mitchell





- Original Message -
From: "Aislan Fernandes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 01, 2003 7:22 AM
Subject: scope of a tool


> hi again,
>
> Before i have said about scope of a tool and seem that nobody undestood me
> (my question), but now i have a text about this:
>
> "the scope of the tool (as specified in your toolbox.xml) determines when
> your tool is created and what data is passed to the init() method (if an
> instance of ViewTool).
>
> a.  if the scope is "request", then a new instance of the tool is
> created for each request (and lives only that long).  it will be
> instantiated with the current ViewContext (which is a ChainedContext when
> using the provided servlets).
> b. if the scope is "session", then the tool is created and initialized
> only once for session.  if a ViewTool, then init() will be passed the
> ViewContext that is current for the request on which the session tools are
> first made.  you should also note that since session tools are kept in a
> HashMap within the session object, it is recommended (but not necessary)
> that they be serializable.
> c. "application" scoped tools are instantiated when the toolbox
manager
> is first loaded (at servlet init time).  if these implement the ViewTool
> interface, then the init() method will be passed the ServletContext to
give
> access to application resources."
>
> so, the my question is: is right the code below?
>
> 
>   
>  requer
>  RequerTool
>   
>   
>  user
>  UserTool
>   
>   
>  app
>  AplicationTool
>   
> 
>
> _
> Voce quer um iGMail protegido contra vírus e spams?
> Clique aqui: http://www.igmailseguro.ig.com.br
>
>
> -
> 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: Validator and business rule

2003-02-02 Thread Regis Melo
Hello David,

I think that the main problem in struts-validator is because is highly
coupled with ActionForm. Ok, I can use commons-validator. But, my idea is:

* Put the validation rules in only one place (a XML file that can be
read and interpretated by struts and my business rule);
* The validation rule also has the type of a column (indicating if is
boolean, data, String, BigDecimal, ... );
* The struts tags will generate JavaScript to validate the input of
data;
* My business rule will check if all data is ok again (because the user
can turn off JavaScript).

My business rule generaly receives a Value Object to insert or update
data. My VO is dynamic - I say which columns and rows they will have. If I
know the type of data that came from ActionForm (I always use String in
ActionForms) I can convert on fly the data between ActionForm and VO.

Theres is a sample example:

- Action --
 MyValueObject vo = new MyValueObject( form );// Works because I
will know the types of columns in ActionForm - it's defined in XML
 MyBusinessObject bo = new MyBusinessObject();

bo.insert( vo );

- MyBusinessObject -
public void insert( MyValueObject vo )
{
if not checkIfAlwaysIsOk( vo ) { throw new Exception( "..." ); }

insertIntoDatabase( );

// If a need to get some data from VO, I use - vo.get( lineNumber,
columnNumber )
}

public boolean checkIfAlwaysIsOk( vo )
{
return Validator.checkIfRulesIsOk( vo, "file with xml
definitions" );
// Validator is a generic class that will be used by
struts-validator and my business rule
}

Thanks,

Regis Melo
- Original Message -
From: "David Graham" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 01, 2003 7:03 PM
Subject: Re: Validator and business rule


> You can use the generic commons-validator in your business logic if you
> want.  The Struts version and the commons version can use the same xml
> config file for the validation rules.
>
> David
>
>
>
>
>
>
> >From: "Regis Melo" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Validator and business rule
> >Date: Sat, 1 Feb 2003 18:23:00 -0300
> >
> >Hello,
> >
> >Why Struts-validator is so highly coupled with ActionForms? I think
> >that is a good idea to use struts-validator to do some work in my
business
> >classes. How can I do that?
> >
> >Thanks,
> >
> >Regis Melo
>
>
> _
> Protect your PC - get McAfee.com VirusScan Online
> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>
> -
> 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: proper use of back button -- design patterns

2003-02-02 Thread Jerome Jacobsen
The framework could be extended to support this on a per-action basis.  In
struts-config.xml we could have an additional element or attribute of the
'action' attribute to indicate the desired ActionForm populate/validate
behavior on invalid token.

> -Original Message-
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 31, 2003 6:18 PM
> To: Struts Users Mailing List
> Subject: RE: proper use of back button -- design patterns
>
>
>
>
> On Fri, 31 Jan 2003 [EMAIL PROTECTED] wrote:
>
> > Date: Fri, 31 Jan 2003 16:11:21 -0500
> > From: [EMAIL PROTECTED]
> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> > To: [EMAIL PROTECTED]
> > Subject: RE: proper use of back button -- design patterns
> >
> > I want to bring up another issue.
> >
> > The default behavior of RequestProcessor is to save everything
> into a new
> > ActionForm then do the validation. If token is invalid, why
> should we bother
> > populating the ActionForm at all?
>
> How is the framework supposed to decide whether the app actually cares
> about an invalid token or not?  It's possible for the app to decide to do
> something specific, but different -- like maybe say "did you really mean
> to submit this twice?" and accept it if they say OK.
>
> >
> > Regards,
> >
> >
> > PQ
>
> Craig
>
> -
> 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: Running a heartbeat program in struts.

2003-02-02 Thread Robert Taylor
Looks pretty cool! Thanks for sharing.

robert

> -Original Message-
> From: Brandon Goodin [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 02, 2003 12:16 AM
> To: Struts Users Mailing List
> Subject: RE: Running a heartbeat program in struts.
>
>
> This is the BEST open source cron like timer that I have seen. It is very
> robust and extendable. I have used it in several webapps (in a virtual
> hosting environment running several webapps) doing exactly what you are
> doing. Check this link out. I think it will provide you with what
> you need.
>
> http://www.part.net/quartz.html
>
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
>
>
> -Original Message-
> From: Ron Day [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 01, 2003 11:38 PM
> To: Struts Users Mailing List
> Subject: RE: Running a heartbeat program in struts.
>
>
> Thanks for tip.
>
> R
>
> -Original Message-
> From: Robert Taylor [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 01, 2003 6:03 PM
> To: Struts Users Mailing List
> Subject: RE: Running a heartbeat program in struts.
>
>
> Take a look at java.util.Timer and java.util.TimerTask.
> More specifically Timer.scheduleAtFixedRate().
>
> It will greatly simplify your background process.
>
> robert
>
> > -Original Message-
> > From: Ron Day [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, February 02, 2003 12:47 AM
> > To: Struts Users Mailing List
> > Subject: Running a heartbeat program in struts.
> >
> >
> > I am planning on putting a small heartbeat program as part of my Struts
> > application. The heartbeat program will request HTTP headers from an
> > external web server every 5 minutes or so, and if the response is not a
> > 200,will send email to 3 people.
> >
> > I plan on using a java class that starts a thread in the init
> > method of the
> > controller servlet. This thread will sleep for 5 minutes between sending
> > requests to the external web server. It in turn will call a custom
> > mail-sending class if the response is not 200.
> >
> > First, does anyone have any code like this, before I start coding,
> > Second, any comments on my approach,
> > Third, is there a better way (in Java of course).
> >
> > Thanks for any comments you have
> >
> > Ron
> >
> >
> >
> > -
> > 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]
>
>
>
> -
> 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]