Re: Theoretical debate

2004-07-08 Thread Craig McClanahan
Mike Duffy wrote:
One aspect of JSF which I find troubling is, "With JSF, the component model takes care of all the
responsibilities that Struts uses an ActionForm form, so you don't need one any more."  

Most of the JSF examples I've studied use method (2) from Craig's list below: "You can bind
component *values* directly to properties in your backing bean, and then provide the business
logic as action methods in the same class."  As an example of this approach see, Developing Web
Interfaces with JSF,
http://www.fawcette.com/javapro/2004_01/magazine/features/cschalk/default.aspx 

IMHO, mixing business logic in the backing bean is not a great design. I like the clean separation
provided by the Struts action class. 

Method (3) from Craig's list below seems like a viable solution: "You can bind 
component *values*
directly to properties on a VO/DTO object, and bind action events to methods on a 
separate bean
that will either perform the logic directly or delegate to a business logic class."
I've read most of the major articles on JSF.  I have not seen method (3) implemented as an
example.  Does anyone have a link that they can send showing the implementation of method (3)? 
Does anyone know if there will be a reference implementation for JSF using method (3)?  I think it
would increase the acceptance of JSF in the Struts community if such a reference implementation
was available.

Thanks.
Mike
 

I don't have any JSF-specific examples to point to (JSF is too new for 
that), but the basic principle is pretty obvious:  if you were going to 
create a type (2) application, simply create a type (3) application 
instead.  If you've "cheated" on the separation of concerns issues in 
your existing app, this is going to seem harder.  If you have existing 
VO/DTO objects, the path is relatively simple:  use a value binding 
expression on the "value" attribute of your input components to bind 
directly to the model property expressed by your VO/DTO object.  For 
example, assume that you have an integer property named "count" on your 
VO/DTO object.  In the past, Struts would encourage you to create a 
Strring property on your form bean, to deal with the fact that users 
might actually type "1a3" instead of "123" in this field.  JSF deals 
with that sort of issue for you, so that you can safely bind the "value" 
attribute" of your input component directly to an int property of your 
VO/DTO bean ... no muss, no fuss.  JSF takes care of conversion 
problems, and redisplay in case of conversion errors, for you.

As a trivial example, assume you have a bean "mybean" that has an 
input/output int property named "mycount" that you want to render in a 
JSF-based JSP page.  It is trivially simple:

 
works fine.  The String->int and int->String conversions (including any 
errors that occur) are handled totally by JSF.  Your business logic can 
assume that, if was invoked, there were no conversion or validation errors.

Craig

--- Craig McClanahan <[EMAIL PROTECTED]> wrote:
 

Hookom, Jacob wrote:
   

Look at JSF, do you have actions? No, JSF just updates your POJO beans and
calls methods on them.  Why have an ActionForm or have to create all of
these Actions that are simply getter/setter adapters?  Please don't be too
quick to retort to my supposed anti-struts mindset, but there are other
frameworks out there that allow direct interaction with my business objects
and don't require a heck of a lot of framework specific coding.

 

(Coming into this discussion late, but figured that my experience on 
both the Struts and JSF side of things might provide some illuminating 
food for thought :-)

It's instructive, first, to go back to the beginning of Struts 
development (just over four years ago), and recall why an ActionForm 
exists in the first place.  The only reason we created that abstraction 
was to deal with some pesky real world problems in designing webapps ... 
primarily dealing with conversion (where we really punted ... see 
below), validation, and little things like maintaining the state of 
checkboxes.  Because Struts doesn't have any "user interface component" 
concept, dealing with those things had to go somewhere -- and a common 
abstraction at least made it easy to understand.

Therefore, the recommended design pattern for a Struts based app becomes:
- An ActionForm per input , normally with
 String-based properties (so you can redisplay
 invalid input the way users expect you to).
- A set of validation rules that are applied for you
 on the server side, and optionally also on the
 client side.
- If a validation error occurs, Struts takes care
 of redisplaying the page (with error messages)
- If validation succeeds,  the application Action
 is responsibe for performing conversions of the
 String valued things in the ActionForm to match
 the underlying model data types, typically by
 copying them in to DTO/VO type objects and
 passing them to business logic (although, as others
 have pointed out, lots of St

RE: struts automation

2004-07-08 Thread Steve Raeburn
Only for those with deep pockets, but WebSphere Studio's struts-config
editor will automatically create an Action class from an action-mapping
definition at the click of a button.


Steve

> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]
> Sent: July 8, 2004 3:06 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
>
>
> I think they mean to automatically create a starter class,
> based on a template, to which you would then add the specific
> functionality.
>
> IDEA does this for classes you reference in your code. If it
> doesn't exist, it will offer to create the (stub) class for
> you. A great feature when you are doing test-first development.
>
> It doesn't sound like much, but this is the sort of brainless
> nonsense that nickels and dimes you all day.
>
> -Ted.
>
> On Thu, 08 Jul 2004 14:41:34 -0700, Michael McGrady wrote:
> > My question is how can an editor of any kind create a class when it
> > has no idea what the internals of the class are?  I clearly do not
> > see what you guys are talking about because this clearly cannot be
> > done and you seem to be saying that this is just a piece of cake.
> >
> > At 02:10 PM 7/8/2004, you wrote:
> >
> >
> >>> -Original Message-
> >>> From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent:
> >>> Thursday, July 08, 2004 2:05 PM To: Struts Users Mailing List
> >>> Subject: RE: struts automation
> >>>
> >>>
> >>> At 02:00 PM 7/8/2004, you wrote:
> > Is there a struts tool out there that will create the class
> > files you name in a struts-config file automatically?  It
> > seems to me that would be really useful?
> >
> 
>  Yes there is, several of them..
> >>>
> >>>
> >>> I have the following class file named in my struts-config.xml
> >>> file.  Are
> >>> you saying this will be created automatically?  That does not
> >>> make sense to
> >>> me.  How would the xml file have a clue what was in this class
> >>> file?
> >>>
> >>
> >> Well WSAD allows you to click edit from it's struts-config
> >> editor, and if the class exists it will
> >> pop it up in the editor, and if not it will create the class,
> >> fill in some basics from a template and then
> >> pop tat up in an editor for you.  I think this is what he was
> >> asking. MyEclipse does the same thing for Eclipse, along with
> >> probably 1/2 dozen other OS struts-config editors.
> >>
> >> --
> >> --- 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]



newbie question on indexed properties

2004-07-08 Thread jthompson




I have a form bean with a string array defined as a property, with a
corresponding set/get like this:

private String[] answers = { "Answer 1","Answer 2","Answer 3","Answer
4","Answer 5" };
public String[] getAnswers() { return (this.answers);  }
public void setAnswers(String[] value) { this.answers = value; }


On my jsp I've coded the following iteration to display array 'answers' and
it works fine:


 



But rather than just display these rows, I'd like to write them as
textareas that can be read back into the form-bean.
I've read quite a few postings regarding this, but nothing I've seen and
tried seems to work.

Has anyone actually done this with any success?


Regards,
John



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



RE: some best practices questions

2004-07-08 Thread Andrew Hill
My understanding (could be wrong on this of course) was that if you dont
have sticky sessions the container has to serialise the session to its
brethren as necessary. The serialisation is what scares most people, but
what scares me is how it knows when and what to serialise (plus the fact it
stops you using non-serialisable stuff!)

I gather many (all?) containers listen for calls to the
session.setAttribute() to determine when session contents have changed,
however when the modification is in some object that is 50 levels deep
inside some wierd structure that is being modified by something that knows
nothing (and should not know anything) of the session API... well thats a
nightmare! So if you give up the ability to do that kind of thing you
basically give up the potential for doing anything non-trivial in your
application at the presentation tier.

Probably not a problem for the millions writing shopping carts, but for this
rest of us who are trying to write real applications for which the GUI
requirements are painful enough in a rich client never mind on the web...
:-( Non-sticky sessions just arent practical. (I guess this is what Michael
was trying to tell me yesterday in regards to needing a new scope!)

Luckily for complex apps one isnt (usually) talking tens of thousands of
simultaneous client logins, and the rare loss of a client session is mainly
an annoyance and so long as they can log back in again and so long as the
business layer keeps going its usually ok (in these cases its usually the
business layer that does all the work and the UI is mostly for
administration of it). For shopping carts of course, a lost session is a
lost order, and there are vast number of potential users so the need for
failover and load balancing is quite genuine...



-Original Message-
From: McCormack, Chris [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 July 2004 22:37
To: Struts Users Mailing List
Subject: RE: some best practices questions


>users will fail over to another box with nothing in their session.

In some applications this is an acceptable risk if you have high uptime
servers and very few code releases.
If you however want a solid insurable "customer session" then using sticky
sessions is not an option unfortunately.

Chris McCormack

-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED]
Sent: 08 July 2004 14:54
To: 'Struts Users Mailing List'
Subject: RE: some best practices questions


The solution to this problem is to use a load balancer which knows about
sessions. mod_jk2 for Apache does this very well.

With sticky sessions enabled the first request in a session goes, as you
say, to a low load box. All subsequent requests in that session will be sent
to the same box.

You don't have to make *any* changes to your application to support this.
The only downside (vs a 'real' cluster) is that in the event of a box dying
users will fail over to another box with nothing in their session.

Paul

> -Original Message-
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2004 14:09
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: some best practices questions
>
>
> >3) Users session is on that machine. The url for that
> machine is machine123.msn.com.
>
> You missed a few steps which outlines the problem with
> clustered servers not being able to use session scope for a user :
>
> -a user types in their login details on www.msn.com and hits "GO".
>
> -the request hits www.msn.com and the load balancer assigns
> the request to a low load box and rewrites
> the url and forwards the request on ie serv1.msn.com
>
> -the request lands at serv1.msn.com and the application on
> serv1.msn.com services the request and pops a few things in
> session scope for use later now it knows who the user is
> because they just logged on, it then sends back a valid
> response with the users page.
>
> -the user gets his response and decides to click their
> personalised news link www.msn.com/news
>
> - we are then submitting a new request to www.msn.com. The
> load balancer(front processor) may decide that serv1.msn.com
> is under load or is not available for this request and sends
> to serv24.msn.com.
>
> - The users session is not on this machine so the application
> cannot obtain the info it needs about the user to proceed
> with the request. The application has to :
>  a, get the user to relogin
>  b, fail horribly or with a nice smiley message :P
>
> The ways around this have been to :
>
>  c, use black magic to retrieve the users session
>
> by black magic I mean cookies with a state id in/a sessionid
> in the httpheader/session id in a url parameter/hidden form
> field on a page that matches to a database/file/static
> storage record containing the users session information.
>
> The point is if you use load balanced application server
> clustering its not straight forward to implement session
> handling and everyone does it differently subject to their
> appli

RE: [OT] how to calculate the size of an object

2004-07-08 Thread simarjit singh
With ByteArrayOutputStream approach, writeObject Method is also serializing
the object. Ofcourse serialization doesn't give size as it is more of a meta
data for the entire web of objects associated with the serialized object.

Rather than writing serialized object on file we  are putting it in a byte
array stream.

What u are getting is NOT bytes for object but bytes for serliazed data


Correct me if i am wrong...

-Simar



-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 10:57 PM
To: Struts Users Mailing List
Subject: Re: [OT] how to calculate the size of an object


Also remember that when you serialize an Object (if I am not mistaken),
all the Objects referred to by that Object get serialized too (unless
the references are transient). In addition, there is serialization
overhead (protocol info that is not actually part of your Object but
that is required to deserialize). Your returned size could be misleading
if you have references to, say, some "parent" Object(s) in LDIFData, or
a ton of serialization overhead (unlikely).

Erik



Erik Weber wrote:

> public static long getSize(LDIFData data) {
> try {
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> ObjectOutputStream out = new ObjectOutputStream(baos);
> out.writeObject(data);
> out.close();
> return baos.toByteArray().length;
> }
> catch (Exception e) {
> e.printStackTrace();
> return -1;
> }
> }
>
> John Moore wrote:
>
>> Navjot Singh wrote:
>>
>>>
>>> I use SAX parser to load an LDIF file into memory. Whatsoever data i
>>> read, i fill into an object.
>>>
>>> I need to know *the size of LDIFData object* at runtime. How to do
>>> that?
>>>
>>> Well the class structure is something like this
>>>
>>> public class LDIFData{
>>> ArrayList cards; // collection of Card
>>> String filename;
>>> long lastLoadedTime;
>>> }
>>>
>>> public class Card{
>>> String name;
>>> String email
>>> String mobile;
>>> }
>>>
>> Off the top of my head...
>>
>> Serialize it to a byte array output stream, see how many bytes you have
>>
>> John
>>
>
> -
> 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: Theoretical debate

2004-07-08 Thread Mike Duffy
One aspect of JSF which I find troubling is, "With JSF, the component model takes care 
of all the
responsibilities that Struts uses an ActionForm form, so you don't need one any more." 
 

Most of the JSF examples I've studied use method (2) from Craig's list below: "You can 
bind
component *values* directly to properties in your backing bean, and then provide the 
business
logic as action methods in the same class."  As an example of this approach see, 
Developing Web
Interfaces with JSF,
http://www.fawcette.com/javapro/2004_01/magazine/features/cschalk/default.aspx 

IMHO, mixing business logic in the backing bean is not a great design. I like the 
clean separation
provided by the Struts action class. 

Method (3) from Craig's list below seems like a viable solution: "You can bind 
component *values*
directly to properties on a VO/DTO object, and bind action events to methods on a 
separate bean
that will either perform the logic directly or delegate to a business logic class."

I've read most of the major articles on JSF.  I have not seen method (3) implemented 
as an
example.  Does anyone have a link that they can send showing the implementation of 
method (3)? 
Does anyone know if there will be a reference implementation for JSF using method (3)? 
 I think it
would increase the acceptance of JSF in the Struts community if such a reference 
implementation
was available.

Thanks.

Mike


--- Craig McClanahan <[EMAIL PROTECTED]> wrote:
> Hookom, Jacob wrote:
> 
> >Look at JSF, do you have actions? No, JSF just updates your POJO beans and
> >calls methods on them.  Why have an ActionForm or have to create all of
> >these Actions that are simply getter/setter adapters?  Please don't be too
> >quick to retort to my supposed anti-struts mindset, but there are other
> >frameworks out there that allow direct interaction with my business objects
> >and don't require a heck of a lot of framework specific coding.
> >
> >  
> >
> (Coming into this discussion late, but figured that my experience on 
> both the Struts and JSF side of things might provide some illuminating 
> food for thought :-)
> 
> It's instructive, first, to go back to the beginning of Struts 
> development (just over four years ago), and recall why an ActionForm 
> exists in the first place.  The only reason we created that abstraction 
> was to deal with some pesky real world problems in designing webapps ... 
> primarily dealing with conversion (where we really punted ... see 
> below), validation, and little things like maintaining the state of 
> checkboxes.  Because Struts doesn't have any "user interface component" 
> concept, dealing with those things had to go somewhere -- and a common 
> abstraction at least made it easy to understand.
> 
> Therefore, the recommended design pattern for a Struts based app becomes:
> 
> - An ActionForm per input , normally with
>   String-based properties (so you can redisplay
>   invalid input the way users expect you to).
> 
> - A set of validation rules that are applied for you
>   on the server side, and optionally also on the
>   client side.
> 
> - If a validation error occurs, Struts takes care
>   of redisplaying the page (with error messages)
> 
> - If validation succeeds,  the application Action
>   is responsibe for performing conversions of the
>   String valued things in the ActionForm to match
>   the underlying model data types, typically by
>   copying them in to DTO/VO type objects and
>   passing them to business logic (although, as others
>   have pointed out, lots of Struts developers have
>   skipped this extra layer).
> 
> With JSF, the component model takes care of all the responsibilities 
> that Struts uses an ActionForm for, so you don't need one any more.  
> Indeed, I anticipate people will choose one or more (they aren't 
> mutually exclusive) of at least three different styles for building 
> JSF-based webapps:
> 
> (1) You can bind individual *components* to backing bean properties,
>  similar to how ASP.Net "code behind files" work.  This will
>  be most comfortable to VB developers, and is useful when
>  you need to programmatically modify component properties.
> 
> (2) You can bind component *values* directly to properties in your
>  backing bean, and then provide the business logic as action methods
>  in the same class.  Because the components take care of conversion,
>  you're free to use model-oriented data types for such properties,
>  so you don't need to worry about explicit conversion any more.
>  This style will appear to Struts developers like a combination of an
>  Action and an ActionForm in the same class, and will also appeal to
>  the crowd that likes O-O encapsulation :-).
> 
> (3) You can bind component *values* directly to properties on a VO/DTO
>  object, and bind action events to methods on a separate bean that will
>  either perform the logic directly or delegate to a business logic 
> class.
>  Thi

RE: Multiple File Upload using Struts (number of files dynamic)

2004-07-08 Thread Prasad, Kamakshya
HI,

Try this one...

Put it in your form bean

private ArrayList formFiles = new ArrayList();

public void setTestFile(int iIndex, FormFile formFile)
{
this.formFiles.add(formFiles); 
}

public FormFile getTestFile(int iIndex)
{
while(this.formFiles.size() <= iIndex)
{
this.formFiles.add(new FormFile()); 
}
return (FormFile) formFiles.get(iIndex); 
}

public ArrayList getTestFiles()
{
return this.formFiles; 
}

Keep the property of input box as "testFile"

KP

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 5:40 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: RE: Multiple File Upload using Struts (number of files dynamic)


Thanks KP

Could you please elaborate on this..

What I understood is that have an ArrayList of FormFile in the form bean
class... now query is how this arraylist will get populated ?

If I need to create an ArrayList in JSP then how to get FormFile
element?

I am not aware of dynamic list control.

Could you please provide code snippet of reference?

Regards,
Viral

-Original Message-
From: kamakshya_mishra(int) 
Sent: Thursday, July 08, 2004 12:01 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: RE: Multiple File Upload using Struts (number of files dynamic)

Hi,

In the form bean keep an array list of FormFile and use it similarly as
dynamic list control.

KP

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 3:01 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: Multiple File Upload using Struts (number of files dynamic)

Hi,
 
We are trying to implement uploading file via struts framework using
form bean. According to our requirement we have two scenarios' in which
we require uploading of our file.
1)   Uploading single file (single html:file control and a single
upload button in jsp page)
2)  Uploading multiple files (Multiple html:file controls on the
screen on the same form). 
The problem is that these number of html:file controls on the screen is
not fixed, it is dynamic. The user can click on an "Add More" button to
increase dynamically the number of files he/she wants to upload.
 
We have implemented the first scenario by using html:file tag on the JSP
and keeping a form bean with html control as one of its member
variables. In the action class we extract the value from the bean and
then upload the file using I/O streams. 
 
Now, for the second scenario we need to upload an indeterminate
(determined at run time) number of files but at the same time the number
of members in the bean class cannot be changed dynamically. 
 
So we either need a way to add members to a form bean dynamically or
some other mechanism which will handle this multiple upload requirement.
 
With Regards,
Viral

-
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: Conditional validation/field chaining with Validator plugin

2004-07-08 Thread Erik Weber
Upon further reading (sorry for the lack of rtfm), I discovered requiredif.
Erik

Erik Weber wrote:
Greetings. I am using the Validator plugin with Struts ValidatorForm 
subclasses.

In one form, I have a boolean select (the labels are "Yes" and "No", 
the values are "true" and "false"). There is a companion text area for 
an explanation -- to be filled in if the boolean select value happens 
to be "true". So in otherwords, the business rule is that the text 
area must contain a value if the value of the select is "true", 
otherwise, it can be left blank. So I need conditional validation or 
field chaining.

I am assuming that the so-called "validWhen" validator rule will solve 
this problem, right?

Could someone tell me if this rule has been written? Does anyone have 
a copy of it or of the correct validation-rules.xml file that includes 
it? Do I have to upgrade my Struts distribution or can I just replace 
this file and maybe one jar?

Thanks,
Erik
-
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]


Conditional validation/field chaining with Validator plugin

2004-07-08 Thread Erik Weber
Greetings. I am using the Validator plugin with Struts ValidatorForm 
subclasses.

In one form, I have a boolean select (the labels are "Yes" and "No", the 
values are "true" and "false"). There is a companion text area for an 
explanation -- to be filled in if the boolean select value happens to be 
"true". So in otherwords, the business rule is that the text area must 
contain a value if the value of the select is "true", otherwise, it can 
be left blank. So I need conditional validation or field chaining.

I am assuming that the so-called "validWhen" validator rule will solve 
this problem, right?

Could someone tell me if this rule has been written? Does anyone have a 
copy of it or of the correct validation-rules.xml file that includes it? 
Do I have to upgrade my Struts distribution or can I just replace this 
file and maybe one jar?

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


RE: struts automation

2004-07-08 Thread Michael McGrady
I must be sick!  LOL  I like to think it through each time.  That leads in 
the end with me doing something new and really getting into what seems to 
be mundane in depth.  I am a slow learner, I guess, even though I am, of 
course, just brilliant.  ///;-)

Thanks.
Michael
At 04:22 PM 7/8/2004, you wrote:

> -Original Message-
> From: Michael McGrath [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 4:10 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
>
>
> Okay, you meant source code.  I thought you meant class.
> What are you
> talking about?  Compiling?  Loading?  Admiring?  I could
> learn from you,
> Barrows.  You are a real tool expert, as opposed to a real expert
> tool.  LOL  Thanks for the help.
Basically what Ted and I said earlier.  In WSAD, the struts-config editor 
has an edit button
next to where the class name is displayed.  Click it, and WSAD brings up 
an editor with that class
in it.  If there is no class for the name you've provided ( i.e., you've 
typed the name in by hand, or just
filled in the mapping part and hit edit.)
then it will bring up the class creation wizard, with the defaults already 
set to create a
standard Action class all stubbed out with everything you need except the 
logic to do the action.
Looks something like:
public class FooAction extends Action {

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward();
// return value
try {
// do something here
} catch (Exception e) {
// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));
}
// If a message is required, save the specified key(s)
// into the request for use by the  tag.
if (!errors.isEmpty()) {
saveErrors(request, errors);
// Forward control to the appropriate 'failure' URI (change 
name as desired)
//  forward = mapping.findForward("failure");

} else {
// Forward control to the appropriate 'success' URI (change 
name as desired)
// forward = mapping.findForward("success");

}
// Finish with
return (forward);
}
}
and you're off coding logic.
MyEclipse, IDEA and others will do something similar.
Like Ted said, really really cuts down on the nickel and dime BS quite a bit.
Any more and I think we're off topic.
>
> Michael
>
> At 02:45 PM 7/8/2004, you wrote:
>
>
> > > -Original Message-
> > > From: Michael McGrady [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 08, 2004 2:42 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: struts automation
> > >
> > >
> > > My question is how can an editor of any kind create a class
> > > when it has no
> > > idea what the internals of the class are?  I clearly do not
> > > see what you
> > > guys are talking about because this clearly cannot be done
> > > and you seem to
> > > be saying that this is just a piece of cake.
> >
> >Because the editor takes the context from the struts-config file.
> >If you're looking at an action mapping, the class is there,
> so it just
> >pops up the class
> >unless you're thinking .class as opposed to .java... when I
> say class I'm
> >talking about the source code...
> >
> >Can't be impossible since I do it every day, usually several
> times a day
> >in WSAD.
> >
> >-
> >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]


Re: Tools for JSP

2004-07-08 Thread Craig McClanahan
[EMAIL PROTECTED] wrote:
NitoX from M7 looks really nice.  I'm saving my allowance to buy it.
http://www.m7.com/other_professional.jsp
Dennis
I went by the Nitrox booth at JavaOne and saw the demo ... it is indeed 
quite nice, and nicely integrated with Struts.


You might also want to take a look at Sun Java Studio Creator, now that 
it's released.


Craig McClanahan

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


Re: Theoretical debate

2004-07-08 Thread Craig McClanahan
Hookom, Jacob wrote:
Look at JSF, do you have actions? No, JSF just updates your POJO beans and
calls methods on them.  Why have an ActionForm or have to create all of
these Actions that are simply getter/setter adapters?  Please don't be too
quick to retort to my supposed anti-struts mindset, but there are other
frameworks out there that allow direct interaction with my business objects
and don't require a heck of a lot of framework specific coding.
 

(Coming into this discussion late, but figured that my experience on 
both the Struts and JSF side of things might provide some illuminating 
food for thought :-)

It's instructive, first, to go back to the beginning of Struts 
development (just over four years ago), and recall why an ActionForm 
exists in the first place.  The only reason we created that abstraction 
was to deal with some pesky real world problems in designing webapps ... 
primarily dealing with conversion (where we really punted ... see 
below), validation, and little things like maintaining the state of 
checkboxes.  Because Struts doesn't have any "user interface component" 
concept, dealing with those things had to go somewhere -- and a common 
abstraction at least made it easy to understand.

Therefore, the recommended design pattern for a Struts based app becomes:
- An ActionForm per input , normally with
 String-based properties (so you can redisplay
 invalid input the way users expect you to).
- A set of validation rules that are applied for you
 on the server side, and optionally also on the
 client side.
- If a validation error occurs, Struts takes care
 of redisplaying the page (with error messages)
- If validation succeeds,  the application Action
 is responsibe for performing conversions of the
 String valued things in the ActionForm to match
 the underlying model data types, typically by
 copying them in to DTO/VO type objects and
 passing them to business logic (although, as others
 have pointed out, lots of Struts developers have
 skipped this extra layer).
With JSF, the component model takes care of all the responsibilities 
that Struts uses an ActionForm for, so you don't need one any more.  
Indeed, I anticipate people will choose one or more (they aren't 
mutually exclusive) of at least three different styles for building 
JSF-based webapps:

(1) You can bind individual *components* to backing bean properties,
similar to how ASP.Net "code behind files" work.  This will
be most comfortable to VB developers, and is useful when
you need to programmatically modify component properties.
(2) You can bind component *values* directly to properties in your
backing bean, and then provide the business logic as action methods
in the same class.  Because the components take care of conversion,
you're free to use model-oriented data types for such properties,
so you don't need to worry about explicit conversion any more.
This style will appear to Struts developers like a combination of an
Action and an ActionForm in the same class, and will also appeal to
the crowd that likes O-O encapsulation :-).
(3) You can bind component *values* directly to properties on a VO/DTO
object, and bind action events to methods on a separate bean that will
either perform the logic directly or delegate to a business logic 
class.
This style will feel more like traditional Struts separated 
ActionForm and
Action classes, but the Action won't have as much to do.  It's also 
a great
way to build a webapp on top of existing application infrastructure 
that
provides resuabe VO/DTO and business logic classes already.

I believe that all three approaches are valid -- which one you take for 
a particular application function depends on your use case for that 
function.  You don't have to be exclusive, either.  Combine them where 
it makes sense.

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


RE: struts automation

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Michael McGrath [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 4:10 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
> 
> 
> Okay, you meant source code.  I thought you meant class.  
> What are you 
> talking about?  Compiling?  Loading?  Admiring?  I could 
> learn from you, 
> Barrows.  You are a real tool expert, as opposed to a real expert 
> tool.  LOL  Thanks for the help.

Basically what Ted and I said earlier.  In WSAD, the struts-config editor has an edit 
button
next to where the class name is displayed.  Click it, and WSAD brings up an editor 
with that class
in it.  If there is no class for the name you've provided ( i.e., you've typed the 
name in by hand, or just
filled in the mapping part and hit edit.) 
then it will bring up the class creation wizard, with the defaults already set to 
create a 
standard Action class all stubbed out with everything you need except the logic to do 
the action.
Looks something like:
public class FooAction extends Action {

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {

ActionErrors errors = new ActionErrors();
ActionForward forward = new ActionForward();
// return value

try {

// do something here

} catch (Exception e) {

// Report the error using the appropriate name and ID.
errors.add("name", new ActionError("id"));

}

// If a message is required, save the specified key(s)
// into the request for use by the  tag.

if (!errors.isEmpty()) {
saveErrors(request, errors);

// Forward control to the appropriate 'failure' URI (change name as 
desired)
//  forward = mapping.findForward("failure");

} else {

// Forward control to the appropriate 'success' URI (change name as 
desired)
// forward = mapping.findForward("success");

}

// Finish with
return (forward);

}
}

and you're off coding logic.
MyEclipse, IDEA and others will do something similar.
Like Ted said, really really cuts down on the nickel and dime BS quite a bit.
Any more and I think we're off topic.

> 
> Michael
> 
> At 02:45 PM 7/8/2004, you wrote:
> 
> 
> > > -Original Message-
> > > From: Michael McGrady [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 08, 2004 2:42 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: struts automation
> > >
> > >
> > > My question is how can an editor of any kind create a class
> > > when it has no
> > > idea what the internals of the class are?  I clearly do not
> > > see what you
> > > guys are talking about because this clearly cannot be done
> > > and you seem to
> > > be saying that this is just a piece of cake.
> >
> >Because the editor takes the context from the struts-config file.
> >If you're looking at an action mapping, the class is there, 
> so it just 
> >pops up the class
> >unless you're thinking .class as opposed to .java... when I 
> say class I'm 
> >talking about the source code...
> >
> >Can't be impossible since I do it every day, usually several 
> times a day 
> >in WSAD.
> >
> >-
> >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: struts automation

2004-07-08 Thread Michael McGrady
Okay, you meant source code.  I thought you meant class.  What are you 
talking about?  Compiling?  Loading?  Admiring?  I could learn from you, 
Barrows.  You are a real tool expert, as opposed to a real expert 
tool.  LOL  Thanks for the help.

Michael
At 02:45 PM 7/8/2004, you wrote:

> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:42 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
>
>
> My question is how can an editor of any kind create a class
> when it has no
> idea what the internals of the class are?  I clearly do not
> see what you
> guys are talking about because this clearly cannot be done
> and you seem to
> be saying that this is just a piece of cake.
Because the editor takes the context from the struts-config file.
If you're looking at an action mapping, the class is there, so it just 
pops up the class
unless you're thinking .class as opposed to .java... when I say class I'm 
talking about the source code...

Can't be impossible since I do it every day, usually several times a day 
in WSAD.

-
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: Dynamic extension of web apps

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:22 PM
> To: Struts Users Mailing List
> Subject: RE: Dynamic extension of web apps
> 
> 
> 
> HI Jim,
> 
> Yep, that's what I'm thinking - can you expand on what your 
> indexing app
> does?

I don't have one... but if I did it would provide links to the war contexts, and 
probably be the
point at which I added new ones.  I'd probably add some sort of queue so that when new 
ones were added
a human could verify they were okay before making them live.

Any more and I'll start charging :)

> 
> Also, do you know any way to drop in a sub-application and 
> have Struts pick
> it up dynamically?

Um.. no... I don't there might be one, I don't really know.

> 
> cheers,
> 
> David
> 
> 
> 
> |-+>
> | |   "Jim Barrows"|
> | |   <[EMAIL PROTECTED]|
> | |   m>   |
> | ||
> | |   07/08/2004 06:11 |
> | |   PM   |
> | |   Please respond to|
> | |   "Struts Users|
> | |   Mailing List"|
> | ||
> |-+>
>   
> >-
> --|
>   |   
> |
>   |   To:   "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>  |
>   |   cc: 
> |
>   |   Subject:  RE: Dynamic extension of web apps 
> |
>   
> >-
> --|
> 
> 
> 
> 
> So, basically, you're thinking of letting them drop in a 
> whole new webapp
> that will
> walk them through the configuration of their device?
> If so.. then that's what I'd do... bundle a war up and drop 
> it in.  Then
> have an indexing
> application provide access to that war.  Maybe even load the 
> war through
> the index.  There are
> security risks of course, and rather severe ones with 
> allowing anyone to
> drop a war file and
> have it activated.
> Other then that.. I don't know of any easy solution.
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 08, 2004 3:00 PM
> > To: Struts Users Mailing List
> > Subject: RE: Dynamic extension of web apps
> >
> >
> >
> > Hi Jim,
> >
> > Sorry  - don't think I was clear...it's not the client that
> > will change -
> > in fact that will all be HTML - but the inner works of the 
> app itself.
> >
> > Say, for example, we allow users to configure devices through
> > our web app,
> > and we want to now allow them to configure a new device.  We
> > want them to
> > be able to drop into the webserver the files for the new 
> device - jsp,
> > html, XML, .class files - and for it to automatically pick
> > them up without
> > restarting the webserver.  Another way to look at it is that
> > the web app
> > doesn't know anything about the devices, but just picks up
> > what it finds
> > and displays that.
> >
> > I guess it links with automatically reloading the
> > struts-config and jar
> > files if we add new actions or class files, but may well not
> > be limited to
> > this.
> >
> > Does that make any more sense?
> >
> > cheers,
> >
> > David
> >
> >
> >
> > |-+>
> > | |   "Jim Barrows"|
> > | |   <[EMAIL PROTECTED]|
> > | |   m>   |
> > | ||
> > | |   07/08/2004 05:03 |
> > | |   PM   |
> > | |   Please respond to|
> > | |   "Struts Users|
> > | |   Mailing List"|
> > | ||
> > |-+>
> >
> > >-
> > --|
> >   |
> > |
> >   |   To:   "Struts Users Mailing List"
> > <[EMAIL PROTECTED]>  |
> >   |   cc:
> > |
> >   |   Subject:  RE: Dynamic extension of web apps
> > |
> >
> > >-
> > --|
> >
> >
> >
> >
> > > -Original Message-
> > > Fr

RE: Dynamic extension of web apps

2004-07-08 Thread dhay

HI Jim,

Yep, that's what I'm thinking - can you expand on what your indexing app
does?

Also, do you know any way to drop in a sub-application and have Struts pick
it up dynamically?

cheers,

David



|-+>
| |   "Jim Barrows"|
| |   <[EMAIL PROTECTED]|
| |   m>   |
| ||
| |   07/08/2004 06:11 |
| |   PM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>---|
  |
   |
  |   To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
  |
  |   cc:  
   |
  |   Subject:  RE: Dynamic extension of web apps  
   |
  
>---|




So, basically, you're thinking of letting them drop in a whole new webapp
that will
walk them through the configuration of their device?
If so.. then that's what I'd do... bundle a war up and drop it in.  Then
have an indexing
application provide access to that war.  Maybe even load the war through
the index.  There are
security risks of course, and rather severe ones with allowing anyone to
drop a war file and
have it activated.
Other then that.. I don't know of any easy solution.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:00 PM
> To: Struts Users Mailing List
> Subject: RE: Dynamic extension of web apps
>
>
>
> Hi Jim,
>
> Sorry  - don't think I was clear...it's not the client that
> will change -
> in fact that will all be HTML - but the inner works of the app itself.
>
> Say, for example, we allow users to configure devices through
> our web app,
> and we want to now allow them to configure a new device.  We
> want them to
> be able to drop into the webserver the files for the new device - jsp,
> html, XML, .class files - and for it to automatically pick
> them up without
> restarting the webserver.  Another way to look at it is that
> the web app
> doesn't know anything about the devices, but just picks up
> what it finds
> and displays that.
>
> I guess it links with automatically reloading the
> struts-config and jar
> files if we add new actions or class files, but may well not
> be limited to
> this.
>
> Does that make any more sense?
>
> cheers,
>
> David
>
>
>
> |-+>
> | |   "Jim Barrows"|
> | |   <[EMAIL PROTECTED]|
> | |   m>   |
> | ||
> | |   07/08/2004 05:03 |
> | |   PM   |
> | |   Please respond to|
> | |   "Struts Users|
> | |   Mailing List"|
> | ||
> |-+>
>
> >-
> --|
>   |
> |
>   |   To:   "Struts Users Mailing List"
> <[EMAIL PROTECTED]>  |
>   |   cc:
> |
>   |   Subject:  RE: Dynamic extension of web apps
> |
>
> >-
> --|
>
>
>
>
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 08, 2004 2:00 PM
> > To: Struts Users Mailing List
> > Subject: Dynamic extension of web apps
> >
> >
> >
> > Hi,
> >
> > I need to design a web app that is extensible dynamically.
> >
> > For example, if we decide to support a different device type,
> > we need to be
> > able to drop in info for that device type and have the web
> > app pick it up -
> > these could be files of all different types e.g. jsp's,
> html, XML, class
> > files etc..
> >
> > Has anyone done this before, or can you point me in the right
> > direction?
> >
>
> If I understand you correctly (You're looking for a write
> once, generate
> HTML, WAP or Voice XML files from that) , I believe JSF will
> help you in
> your problem.  JSF will allow device independence.
>
> ---

RE: Dynamic extension of web apps

2004-07-08 Thread Jim Barrows
So, basically, you're thinking of letting them drop in a whole new webapp that will
walk them through the configuration of their device?
If so.. then that's what I'd do... bundle a war up and drop it in.  Then have an 
indexing
application provide access to that war.  Maybe even load the war through the index.  
There are
security risks of course, and rather severe ones with allowing anyone to drop a war 
file and
have it activated.
Other then that.. I don't know of any easy solution.


> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 3:00 PM
> To: Struts Users Mailing List
> Subject: RE: Dynamic extension of web apps
> 
> 
> 
> Hi Jim,
> 
> Sorry  - don't think I was clear...it's not the client that 
> will change -
> in fact that will all be HTML - but the inner works of the app itself.
> 
> Say, for example, we allow users to configure devices through 
> our web app,
> and we want to now allow them to configure a new device.  We 
> want them to
> be able to drop into the webserver the files for the new device - jsp,
> html, XML, .class files - and for it to automatically pick 
> them up without
> restarting the webserver.  Another way to look at it is that 
> the web app
> doesn't know anything about the devices, but just picks up 
> what it finds
> and displays that.
> 
> I guess it links with automatically reloading the 
> struts-config and jar
> files if we add new actions or class files, but may well not 
> be limited to
> this.
> 
> Does that make any more sense?
> 
> cheers,
> 
> David
> 
> 
> 
> |-+>
> | |   "Jim Barrows"|
> | |   <[EMAIL PROTECTED]|
> | |   m>   |
> | ||
> | |   07/08/2004 05:03 |
> | |   PM   |
> | |   Please respond to|
> | |   "Struts Users|
> | |   Mailing List"|
> | ||
> |-+>
>   
> >-
> --|
>   |   
> |
>   |   To:   "Struts Users Mailing List" 
> <[EMAIL PROTECTED]>  |
>   |   cc: 
> |
>   |   Subject:  RE: Dynamic extension of web apps 
> |
>   
> >-
> --|
> 
> 
> 
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, July 08, 2004 2:00 PM
> > To: Struts Users Mailing List
> > Subject: Dynamic extension of web apps
> >
> >
> >
> > Hi,
> >
> > I need to design a web app that is extensible dynamically.
> >
> > For example, if we decide to support a different device type,
> > we need to be
> > able to drop in info for that device type and have the web
> > app pick it up -
> > these could be files of all different types e.g. jsp's, 
> html, XML, class
> > files etc..
> >
> > Has anyone done this before, or can you point me in the right
> > direction?
> >
> 
> If I understand you correctly (You're looking for a write 
> once, generate
> HTML, WAP or Voice XML files from that) , I believe JSF will 
> help you in
> your problem.  JSF will allow device independence.
> 
> -
> 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: struts automation

2004-07-08 Thread Ted Husted
I think they mean to automatically create a starter class, based on a template, to 
which you would then add the specific functionality.

IDEA does this for classes you reference in your code. If it doesn't exist, it will 
offer to create the (stub) class for you. A great feature when you are doing 
test-first development.

It doesn't sound like much, but this is the sort of brainless nonsense that nickels 
and dimes you all day.

-Ted.

On Thu, 08 Jul 2004 14:41:34 -0700, Michael McGrady wrote:
> My question is how can an editor of any kind create a class when it
> has no idea what the internals of the class are?  I clearly do not
> see what you guys are talking about because this clearly cannot be
> done and you seem to be saying that this is just a piece of cake.
>
> At 02:10 PM 7/8/2004, you wrote:
>
>
>>> -Original Message-
>>> From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent:
>>> Thursday, July 08, 2004 2:05 PM To: Struts Users Mailing List
>>> Subject: RE: struts automation
>>>
>>>
>>> At 02:00 PM 7/8/2004, you wrote:
> Is there a struts tool out there that will create the class
> files you name in a struts-config file automatically?  It
> seems to me that would be really useful?
>

 Yes there is, several of them..
>>>
>>>
>>> I have the following class file named in my struts-config.xml
>>> file.  Are
>>> you saying this will be created automatically?  That does not
>>> make sense to
>>> me.  How would the xml file have a clue what was in this class
>>> file?
>>>
>>
>> Well WSAD allows you to click edit from it's struts-config
>> editor, and if the class exists it will
>> pop it up in the editor, and if not it will create the class,
>> fill in some basics from a template and then
>> pop tat up in an editor for you.  I think this is what he was
>> asking. MyEclipse does the same thing for Eclipse, along with
>> probably 1/2 dozen other OS struts-config editors.
>>
>> --
>> --- 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: Simplifying struts-config.xml

2004-07-08 Thread Ted Husted
One thing people do is setup the unknown action



The ForwardToForwardToAction would example the request to see what path was requested 
and extract it for use with your ForwardAction.

The new wildcard support would also work, but only if all the root paths worked this 
way.

>  path='/*'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='{1}'/>

The patch I'd really like to see is adding support for "extends" to all the Struts 
elements, like we have for Tiles.

We should also support a properties file, so you could use ${properties} in the XML 
elements.

-Ted.


On Thu, 08 Jul 2004 14:44:59 -0700, Michael McGrady wrote:
> Is there a way to do the following using less real-estate in struts-
> config.xml?  If not, there should be:
>
>
>  path='/admin_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='admin_help'/>
>
>  path='/language_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='language_help'/>
>
>  path='/main_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='main_help'/>
>
>  path='/admin_webmaster_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='admin_webmaster_help'/>
>
>  path='/admin_host_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='admin_host_help'/>
>
>  path='/logon_webmaster_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='logon_webmaster_help'/>
>
>  path='/logon_host_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='logon_host_help'/>
>
>  path='/logon_guest_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='logon_guest_help'/>
>
>
>  path='/register_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='register_help'/>
>
>  path='/remind_me_help'
> type='com.crackwillow.struts.action.ForwardAction'
> parameter='remind_me_help'/>
>
>
> 
> - 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: Simplifying struts-config.xml

2004-07-08 Thread Nick Heudecker
Look into the wildcard plugin.
http://www.twdata.org/struts-wildcard/
Michael McGrady wrote:
Is there a way to do the following using less real-estate in 
struts-config.xml?  If not, there should be:













-
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: Dynamic extension of web apps

2004-07-08 Thread dhay

Hi Jim,

Sorry  - don't think I was clear...it's not the client that will change -
in fact that will all be HTML - but the inner works of the app itself.

Say, for example, we allow users to configure devices through our web app,
and we want to now allow them to configure a new device.  We want them to
be able to drop into the webserver the files for the new device - jsp,
html, XML, .class files - and for it to automatically pick them up without
restarting the webserver.  Another way to look at it is that the web app
doesn't know anything about the devices, but just picks up what it finds
and displays that.

I guess it links with automatically reloading the struts-config and jar
files if we add new actions or class files, but may well not be limited to
this.

Does that make any more sense?

cheers,

David



|-+>
| |   "Jim Barrows"|
| |   <[EMAIL PROTECTED]|
| |   m>   |
| ||
| |   07/08/2004 05:03 |
| |   PM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>---|
  |
   |
  |   To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
  |
  |   cc:  
   |
  |   Subject:  RE: Dynamic extension of web apps  
   |
  
>---|




> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:00 PM
> To: Struts Users Mailing List
> Subject: Dynamic extension of web apps
>
>
>
> Hi,
>
> I need to design a web app that is extensible dynamically.
>
> For example, if we decide to support a different device type,
> we need to be
> able to drop in info for that device type and have the web
> app pick it up -
> these could be files of all different types e.g. jsp's, html, XML, class
> files etc..
>
> Has anyone done this before, or can you point me in the right
> direction?
>

If I understand you correctly (You're looking for a write once, generate
HTML, WAP or Voice XML files from that) , I believe JSF will help you in
your problem.  JSF will allow device independence.

-
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: Simplifying struts-config.xml

2004-07-08 Thread Jim Barrows
Nope.. and you're probably right.  
Something like 





On the other hand I don't really care how much file space it takes up, since I use 
Xdoclet to generate
this file, or WSAD/MyEclipse to view/generate it.

> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:45 PM
> To: Struts Users Mailing List
> Subject: Simplifying struts-config.xml
> 
> 
> Is there a way to do the following using less real-estate in 
> struts-config.xml?  If not, there should be:
> 
> 
> 
>  path='/admin_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='admin_help'/>
> 
>  path='/language_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='language_help'/>
> 
>  path='/main_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='main_help'/>
> 
>  path='/admin_webmaster_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='admin_webmaster_help'/>
> 
>  path='/admin_host_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='admin_host_help'/>
> 
>  path='/logon_webmaster_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='logon_webmaster_help'/>
> 
>  path='/logon_host_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='logon_host_help'/>
> 
>  path='/logon_guest_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='logon_guest_help'/>
> 
> 
>  path='/register_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='register_help'/>
> 
>  path='/remind_me_help'
>type='com.crackwillow.struts.action.ForwardAction'
>parameter='remind_me_help'/>
> 
> 
> 
> -
> 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]



Dynamic data html generation - revisited

2004-07-08 Thread JoAnn Lemm
Hmmm ... yes, what I need is somewhat more complex as I'm trying not use
include scriptlets in the jsp --- only taglib calls.

Here's the jist...

I have an arraylist of objects in my bean representing a table.  Each
entry in the arraylist represents a row in the table. The attributes in
the object represents the columns of the row.

I'm trying to figure out how to use struts such that this dynamic set of
data is displayed properly.   Some of the columns may also contain links
to other pages.

Currently, I am generating the html in my form bean and serving it up
that way... but there's got to be a way for me to keep the html in the
jsp and the java in the bean.  I highly suspect that I'm doing this the
hard way.

Here's a snippet of the code in the form bean:

// for each row...
for (int i = 0; i < size; i++)
{
  br = (BatchResult)batchResults.get(i);
  text.append("\n");
  text.append("" +
  br.getFirstname() + "\n");
  text.append("" +
  br.getMiddleInitial() + "\n");
  text.append("" +
 br.getLastname() + "\n");
  text.append("" +
 "" +
"\n");
  text.append("\n");
  // more columns follow...
  
  list.add(text.toString());
  text = new StringBuffer();
}
return list;




In my jsp:



<%=list5%>


--JoAnn 

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 12:58 PM
To: Struts Users Mailing List
Subject: RE: Dynamic data html generation

> -Original Message-
> From: JoAnn Lemm [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 12:55 PM
> To: Struts Users Mailing List
> Subject: Dynamic data html generation
> 
> 
> 
> Hi All,
> 
> I have a set of data that needs to be displayed in an html table. Each
> column has its own formatting.  The data are stored as rows in an
> ArrayList in the Form bean.  How can I create this HTML table using
> struts without resorting to building the table in the bean.

Unless you're asking a different question then I'm reading:
All display logic is done in the JSP and not the bean.  So you'd use JSP
tags and HTML tags to 
accomplish your task.  

Given that you're here, this seems like an incredibly obvious answer to
the question, so I don't think 
it's what you're looking for.  Would you mind clarifying?




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



RE: struts automation

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:42 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
> 
> 
> My question is how can an editor of any kind create a class 
> when it has no 
> idea what the internals of the class are?  I clearly do not 
> see what you 
> guys are talking about because this clearly cannot be done 
> and you seem to 
> be saying that this is just a piece of cake.

Because the editor takes the context from the struts-config file.  
If you're looking at an action mapping, the class is there, so it just pops up the 
class
unless you're thinking .class as opposed to .java... when I say class I'm talking 
about the source code...

Can't be impossible since I do it every day, usually several times a day in WSAD.

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



Simplifying struts-config.xml

2004-07-08 Thread Michael McGrady
Is there a way to do the following using less real-estate in 
struts-config.xml?  If not, there should be:













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


RE: struts automation

2004-07-08 Thread Michael McGrady
My question is how can an editor of any kind create a class when it has no 
idea what the internals of the class are?  I clearly do not see what you 
guys are talking about because this clearly cannot be done and you seem to 
be saying that this is just a piece of cake.

At 02:10 PM 7/8/2004, you wrote:

> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:05 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
>
>
> At 02:00 PM 7/8/2004, you wrote:
> > > Is there a struts tool out there that will create the class
> > > files you name in a struts-config file automatically?  It
> > > seems to me that would be really useful?
> > >
> >
> >Yes there is, several of them..
>
>
> I have the following class file named in my struts-config.xml
> file.  Are
> you saying this will be created automatically?  That does not
> make sense to
> me.  How would the xml file have a clue what was in this class file?
Well WSAD allows you to click edit from it's struts-config editor, and if 
the class exists it will
pop it up in the editor, and if not it will create the class, fill in some 
basics from a template and then
pop tat up in an editor for you.  I think this is what he was asking.
MyEclipse does the same thing for Eclipse, along with probably 1/2 dozen 
other OS struts-config editors.

-
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: why do we need to integrate tomcat with apache webserver and how.pls urgent

2004-07-08 Thread Danilo Gurovich
We're running a fully-functional Enterprise web site, and we've made the
decision to go with a Tomcat 5/Apache 2 build.

Apache's logging was needed for our data warehouse, so we decided to use it,
also there's the modules that allow for stronger security than with Tomcat 5
alone.

That said, we've "sieged" our system with multiple URLs and found that
Tomcat 5 alone will blow the doors off the Tomcat/Apache/modjk2 connector
set up, by a factor of 2, with much more reliable connections (although the
Tomcat/Apache set-up had about a 1% failure rate with no 500s, the Tomcat
alone had no failures at all).

We also found that the Apache1/Tomcat4/modJk setup had various load
problems, and although it had more documentation available, was not very
easy to set up.

For Tomcat5/Apache2/modjk2, we found the following URL helpful...

http://www.reliablepenguin.com/clients/misc/tomcat/

hope this helps you out.

Danilo Gurovich
Manager, Web Development
LowerMyBills.com
[EMAIL PROTECTED]
2401 Colorado Ave., 2nd Floor 
Santa Monica, CA 90404
(310) 998-6412

 


-Original Message-
From: Nicolas De Loof [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 30, 2004 1:56 AM
To: Struts Users Mailing List
Subject: Re: why do we need to integrate tomcat with apache webserver and
how.pls urgent


I fully agree with you.

If you don't have to serve other static files than gif/css for your webapp,
don't need load-balancing, don't have hard
security constraints (intranet serer) just use tomcat HTTP connector. It
will be really simplier to configure

Nico.


> I agree with everything nico just said, however there is no reason if
> you're just wanting to run a basic webserver with java/jsp you cant
> just change tomcat to serve over port 80 and forget about apache.
>
> The built in http server is pretty good and in some situations performs
> as well as apache with jk, even at delivering the static content.
>
> If you just have a couple of apps in an intranet type situation (you
> know how many users) its worth considering using tomcat's http server.
>
> Mark
>
> On 30 Jun 2004, at 09:34, Nicolas De Loof wrote:
>
> >
> > Apache is handling static datas according to mod_jk rules for better
> > perfs.
> > Apache can also handle HTTPS.
> > Apache has lot's of usefull modules that can be helpfull for any usage
> > (stats, cgi, perl ...)
> > Apache security is well known, tomcat does'nt need to be visible from
> > internet (DMZ)
> > Tomcat http connector is less configurable and powerfull than a real
> > http server
> > 1 Apache + N tomcat can be used for load-balancing with session
> > affinity
> >
> > Nico.
> >
> >
> >> Hi List.
> >>
> >> i've small doubt why we need to configure tomcat with apache
> >> webserver.
> >> what is the neccessity of integration tomcat with apache webs server.
> >> and also pls give me the steps to integrate it in details.
> >> Bcoz i don't know abc of integration.
> >>
> >> awaiting ur reply
> >> Ganesh
> >>
> >> __
> >> Do You Yahoo!?
> >> Tired of spam?  Yahoo! Mail has the best spam protection around
> >> http://mail.yahoo.com
> >
> >
> > Our name has changed.  Please update your address book to the
> > following format: "[EMAIL PROTECTED]".
> >
> > This message contains information that may be privileged or
> > confidential and is the property of the Capgemini Group. It is
> > intended only for the person to whom it is addressed. If you are not
> > the intended recipient,  you are not authorized 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.
> >
> >
> > -
> > 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]



Our name has changed.  Please update your address book to the following
format: "[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and
is the property of the Capgemini Group. It is intended only for the person
to whom it is addressed. If you are not the intended recipient,  you are not
authorized 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.


-
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: Extending Request Processor

2004-07-08 Thread Lucas Gonzalez Pearson
I have this in my struts-config.xml file..








it´s strange.. everything seems to be normal..

but another thing I found out was that the problem arises when I hot-deploy
the .war file...

If I restart the jboss / tomcat , then the error is thrown, but the App
still works..

strange.. =/


- Original Message - 
From: "Venkat Maddipati" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 6:00 PM
Subject: RE: Extending Request Processor


Try to put include the following in your struts configuratin file
(struts-config.xml). Follow the  comments to understand the Tiles plugin :

I have also extended my RequesteProcessor class from TilesRequestProcessor
class.



  
  
  
  



  



Thanks,
Venkat





-Original Message-
From: Lucas Gonzalez Pearson [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 1:37 PM
To: Struts Users Mailing List
Subject: Extending Request Processor


Hi
I´ve recently extended the requestProcessor with one of my own and found
this error:

javax.servlet.ServletException: TilesPlugin : Specified RequestProcessor
not compatible with TilesRequestProcessor
at
org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.ja
va:360)

Everything seems to be fine

public class MyRequestProcessor
extends TilesRequestProcessor {  }

and in struts-config.xml


I´ve searched quite a bit on the internet and only found that you have to
extend from TilesRequestProcessor just as I did

any ideas on why this is happening?



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






If you have received this e-mail in error, please delete it and notify the
sender as soon as possible. The contents of this e-mail may be confidential
and the unauthorized use, copying, or dissemination of it and any
attachments to it, is prohibited.

Internet communications are not secure and Hyperion does not, therefore,
accept legal responsibility for the contents of this message nor for any
damage caused by viruses.  The views expressed here do not necessarily
represent those of Hyperion.

For more information about Hyperion, please visit our Web site at
www.hyperion.com

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

2004-07-08 Thread Tate Austin
Is there a struts tool out there that will create the class files you name in a 
struts-config file automatically?  It seems to me that would be really useful?

RE: struts automation

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Michael McGrady [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:05 PM
> To: Struts Users Mailing List
> Subject: RE: struts automation
> 
> 
> At 02:00 PM 7/8/2004, you wrote:
> > > Is there a struts tool out there that will create the class
> > > files you name in a struts-config file automatically?  It
> > > seems to me that would be really useful?
> > >
> >
> >Yes there is, several of them..
> 
> 
> I have the following class file named in my struts-config.xml 
> file.  Are 
> you saying this will be created automatically?  That does not 
> make sense to 
> me.  How would the xml file have a clue what was in this class file? 

Well WSAD allows you to click edit from it's struts-config editor, and if the class 
exists it will
pop it up in the editor, and if not it will create the class, fill in some basics from 
a template and then
pop tat up in an editor for you.  I think this is what he was asking.
MyEclipse does the same thing for Eclipse, along with probably 1/2 dozen other OS 
struts-config editors.

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



RE: struts automation

2004-07-08 Thread Michael McGrady
Oops, forgot the reference: 

At 02:04 PM 7/8/2004, you wrote:
At 02:00 PM 7/8/2004, you wrote:
> Is there a struts tool out there that will create the class
> files you name in a struts-config file automatically?  It
> seems to me that would be really useful?
>
Yes there is, several of them..

I have the following class file named in my struts-config.xml file.  Are 
you saying this will be created automatically?  That does not make sense 
to me.  How would the xml file have a clue what was in this class file?

-
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: struts automation

2004-07-08 Thread Michael McGrady
At 02:00 PM 7/8/2004, you wrote:
> Is there a struts tool out there that will create the class
> files you name in a struts-config file automatically?  It
> seems to me that would be really useful?
>
Yes there is, several of them..

I have the following class file named in my struts-config.xml file.  Are 
you saying this will be created automatically?  That does not make sense to 
me.  How would the xml file have a clue what was in this class file? 


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


struts automation

2004-07-08 Thread Tate Austin
Is there a struts tool out there that will create the class files you name in a 
struts-config file automatically?  It seems to me that would be really useful?

RE: Extending Request Processor

2004-07-08 Thread Venkat Maddipati
Try to put include the following in your struts configuratin file
(struts-config.xml). Follow the  comments to understand the Tiles plugin :

I have also extended my RequesteProcessor class from TilesRequestProcessor
class.



  
  
  
  



  



Thanks,
Venkat





-Original Message-
From: Lucas Gonzalez Pearson [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 1:37 PM
To: Struts Users Mailing List
Subject: Extending Request Processor


Hi
I´ve recently extended the requestProcessor with one of my own and found
this error:

javax.servlet.ServletException: TilesPlugin : Specified RequestProcessor
not compatible with TilesRequestProcessor
at
org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.ja
va:360)

Everything seems to be fine

public class MyRequestProcessor
extends TilesRequestProcessor {  }

and in struts-config.xml


I´ve searched quite a bit on the internet and only found that you have to
extend from TilesRequestProcessor just as I did

any ideas on why this is happening?



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






If you have received this e-mail in error, please delete it and notify the sender as 
soon as possible. The contents of this e-mail may be confidential and the unauthorized 
use, copying, or dissemination of it and any attachments to it, is prohibited. 

Internet communications are not secure and Hyperion does not, therefore, accept legal 
responsibility for the contents of this message nor for any damage caused by viruses.  
The views expressed here do not necessarily represent those of Hyperion.

For more information about Hyperion, please visit our Web site at www.hyperion.com

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



RE: Dynamic extension of web apps

2004-07-08 Thread Jim Barrows
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:00 PM
> To: Struts Users Mailing List
> Subject: Dynamic extension of web apps
> 
> 
> 
> Hi,
> 
> I need to design a web app that is extensible dynamically.
> 
> For example, if we decide to support a different device type, 
> we need to be
> able to drop in info for that device type and have the web 
> app pick it up -
> these could be files of all different types e.g. jsp's, html, XML, class
> files etc..
> 
> Has anyone done this before, or can you point me in the right 
> direction?
> 

If I understand you correctly (You're looking for a write once, generate HTML, WAP or 
Voice XML files from that) , I believe JSF will help you in your problem.  JSF will 
allow device independence.

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



RE: struts automation

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Tate Austin [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 1:52 PM
> To: Struts Users Mailing List
> Subject: struts automation
> 
> 
> Is there a struts tool out there that will create the class 
> files you name in a struts-config file automatically?  It 
> seems to me that would be really useful?
> 

Yes there is, several of them.. some eclipse based, some stand alone, maybe even some
for your favorite IDE.  Try googling for them.
Or you could use xdoclet to generate your struts-config.xml file from your classfiles, 
which I find
works much better. YMMV

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



Dynamic extension of web apps

2004-07-08 Thread dhay

Hi,

I need to design a web app that is extensible dynamically.

For example, if we decide to support a different device type, we need to be
able to drop in info for that device type and have the web app pick it up -
these could be files of all different types eg jsp's, html, xml, class
files etc..

Has anyone done this before, or can you point me in the right direction?

Thanks,

David




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



Re: struts automation

2004-07-08 Thread Wendy Smoak
From: "Tate Austin" <[EMAIL PROTECTED]>
> Is there a struts tool out there that will create the class files you name
in a struts-config file
> automatically?  It seems to me that would be really useful?

If you mean the form beans, you can either use dynamic forms, which get you
out of writing all those get/set methods, or you can (apparently) use
xdoclet to generate the Java code.

-- 
Wendy Smoak


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



HELP FROM THE ADMINISTRATOR re: Brian Husted not available

2004-07-08 Thread Michael McGrady
It seems that we have been getting the messages that Brian Husted is not 
available forever.  Can the administrator please solve this?  Everytime I 
send an email to the list I get this back, and others have made the same 
complaint:

Subject: Undeliverable: Re: html:image vs html:submit
To: <[EMAIL PROTECTED]>
Your message
  To:  Struts Users Mailing List
<[EMAIL PROTECTED]>@[EMAIL PROTECTED]
  Subject: Re: html:image vs html:submit
  Sent:Thu, 8 Jul 2004 16:53:00 -0400
did not reach the following recipient(s):
Brian Husted on Thu, 8 Jul 2004 20:53:00 -0400
User Brian Husted/AMS/AMSINC (Brian Husted/AMS/[EMAIL PROTECTED]) not
listed in public Name & Address Book
Original-Envelope-ID: c=us;a= ;p=AMS;l={52F5B406-3C-040708205422Z-61510
Reporting-MTA: dns; CARNEY.ams.com
Final-Recipient: RFC822; [EMAIL PROTECTED]
Action: failed
Status: 5.1.0
X-Display-Name: Brian Husted
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5.6944.0
Subject: Re: html:image vs html:submit
Date: Thu, 8 Jul 2004 16:53:00 -0400
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
Thread-Topic: Re: html:image vs html:submit
Thread-Index: AcRlLcMZx+5rrXGrQSKxkZglX8UWww==
From: "<[EMAIL PROTECTED]>@[EMAIL PROTECTED]" 
<[EMAIL PROTECTED]> 

To: "Struts Users Mailing List <[EMAIL PROTECTED]>@[EMAIL PROTECTED]" 
<[EMAIL PROTECTED]>
This tells you where the problem is.  If you look at the code there you
should be able to tell what is going wrong.
At 01:33 PM 7/8/2004, you wrote:
>org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837) 

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


Re: struts automation

2004-07-08 Thread Lucas Gonzalez Pearson
Try Camino

I believe the company that owns it is called ScioWorks

Lucas
- Original Message - 
From: "Tate Austin" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 5:52 PM
Subject: struts automation


Is there a struts tool out there that will create the class files you name
in a struts-config file automatically?  It seems to me that would be really
useful?


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



Re: struts automation

2004-07-08 Thread Michael McGrady
Not sure what you mean here.  Presumably those class files already exist?
At 01:52 PM 7/8/2004, you wrote:
Is there a struts tool out there that will create the class files you name 
in a struts-config file automatically?  It seems to me that would be 
really useful?

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


Re: html:image vs html:submit

2004-07-08 Thread Michael McGrady
This tells you where the problem is.  If you look at the code there you 
should be able to tell what is going wrong.

At 01:33 PM 7/8/2004, you wrote:
org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837) 


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


struts automation

2004-07-08 Thread Tate Austin
Is there a struts tool out there that will create the class files you name in a 
struts-config file automatically?  It seems to me that would be really useful?

log4j book out of stock

2004-07-08 Thread Michael McGrady
Is there a place to get the log4j book, and is it worth the rather hefty 
price?  Seems like everywhere I look it is not available.  Is the author 
just trying to sell it on his own?  Wazzup?


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


RE: use multiple resource bundles in Validator

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Van [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 1:12 PM
> To: Struts Users Mailing List
> Subject: Re: use multiple resource bundles in Validator
> 
> 
> On Thu, 8 Jul 2004 18:18:41 +0800, Hanna <[EMAIL PROTECTED]> wrote:
> > How can i use mulitple message bundles in validator in struts 1.1?
> > like the way of  ?
> 
> No.

Not in 1.1... 1.2 you can.

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



html:image vs html:submit

2004-07-08 Thread Darryl Smith
In an attempt to avoid using LookupDispatchAction:
I planned on just using form.getAction(), which works with submit 
buttons, but when I try it with an image button its a different story.

Here's my setup
public class CartForm extends ActionForm {
   private final Map values = new HashMap();
   private String action;
  
   // gets & sets
}

delete
delete

If I click on the button, it will process work correctly, if I click the 
image I get a nice stack trace

java.lang.IllegalArgumentException: No bean specified

org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)

org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
Anyone have any ideas?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Extending Request Processor

2004-07-08 Thread Lucas Gonzalez Pearson
Hi
I´ve recently extended the requestProcessor with one of my own and found
this error:

javax.servlet.ServletException: TilesPlugin : Specified RequestProcessor
not compatible with TilesRequestProcessor
at
org.apache.struts.tiles.TilesPlugin.initRequestProcessorClass(TilesPlugin.ja
va:360)

Everything seems to be fine

public class MyRequestProcessor
extends TilesRequestProcessor {  }

and in struts-config.xml


I´ve searched quite a bit on the internet and only found that you have to
extend from TilesRequestProcessor just as I did

any ideas on why this is happening?



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



Re: use multiple resource bundles in Validator

2004-07-08 Thread Van
On Thu, 8 Jul 2004 18:18:41 +0800, Hanna <[EMAIL PROTECTED]> wrote:
> How can i use mulitple message bundles in validator in struts 1.1?
> like the way of  ?

No.
-- 
- Mike "Van" Riper
  [EMAIL PROTECTED]

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



image tag and onmouseover attribute

2004-07-08 Thread Michael McGrady
Anyone have an example on a real, live, actual, JSP page using the 
onmouseover attribute with the struts  tag?  If so, I would be very 
appreciative of a "look see" of what the JSP code looks like.  Thanks in 
advance.

QUESTION: Did you hear what Roy Rogers said to Trigger?
ANSWER: "Why the long face?"

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


Re: can someone help me?

2004-07-08 Thread Denis Avdic
What is your action mapping for majprospect action?

Since your form is going to be submitted to majprospect.do (you need
to add .do in there)  your action mapping should basically have a
name="prospectForm" in it.

Also, to make sure your form is being named correctly:

request.setAttribute("prospectForm", form);  
(if you are setting the form in request, make sure that the action
mapping for majprospect also has scope="request" otherwise it will be
looking for the form in the wrong scope)

I assume that the form has values prepopulated  already and that you
have checked that before you exit that action all the values that need
to be there are there.

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



Re: Dynamic data html generation

2004-07-08 Thread DGraham

Use displayTag and leverage the columnDecorators
for the formatting:  www.displaytag.org

Dennis






"JoAnn Lemm"
<[EMAIL PROTECTED]> 
07/08/2004 03:54 PM



Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>





To
"Struts Users Mailing
List" <[EMAIL PROTECTED]>


cc



Subject
Dynamic data  html generation









Hi All,

I have a set of data that needs to be displayed in an html table. Each
column has its own formatting.  The data are stored as rows in an
ArrayList in the Form bean.  How can I create this HTML table using
struts without resorting to building the table in the bean.

--JoAnn 

 

-
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: Dynamic data html generation

2004-07-08 Thread Wendy Smoak
From: "JoAnn Lemm" <[EMAIL PROTECTED]>
> I have a set of data that needs to be displayed in an html table. Each
> column has its own formatting.  The data are stored as rows in an
> ArrayList in the Form bean.  How can I create this HTML table using
> struts without resorting to building the table in the bean.

I would use JSTL tags (c:forEach) to iterate over the ArrayList and display
the data.  But there are other ways, also.  Struts doesn't tie you to any
particular way to display things, so use what works best.

-- 
Wendy Smoak


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



RE: Dynamic data html generation

2004-07-08 Thread Jim Barrows
> -Original Message-
> From: JoAnn Lemm [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 12:55 PM
> To: Struts Users Mailing List
> Subject: Dynamic data html generation
> 
> 
> 
> Hi All,
> 
> I have a set of data that needs to be displayed in an html table. Each
> column has its own formatting.  The data are stored as rows in an
> ArrayList in the Form bean.  How can I create this HTML table using
> struts without resorting to building the table in the bean.

Unless you're asking a different question then I'm reading:
All display logic is done in the JSP and not the bean.  So you'd use JSP tags and HTML 
tags to 
accomplish your task.  

Given that you're here, this seems like an incredibly obvious answer to the question, 
so I don't think 
it's what you're looking for.  Would you mind clarifying?




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



RE: Dynamic data html generation

2004-07-08 Thread Hookom, Jacob
Google display taglib

-Original Message-
From: JoAnn Lemm [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 2:55 PM
To: Struts Users Mailing List
Subject: Dynamic data html generation


Hi All,

I have a set of data that needs to be displayed in an html table. Each
column has its own formatting.  The data are stored as rows in an
ArrayList in the Form bean.  How can I create this HTML table using
struts without resorting to building the table in the bean.

--JoAnn 

 

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

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



Re: [OT] how to calculate the size of an object

2004-07-08 Thread Kris Schneider
Not too surprising that it's available through a native programming interface
(JVMTI) since it's really an implementation-dependent metric:

http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#GetObjectSize

Quoting Brian Lee <[EMAIL PROTECTED]>:

> If you run this from a simple console test app, the JVM won't allocate any 
> extra objects between 2 and 4.
> 
> Unfortunatly, this is the most exact way to find out memory usage 
> (serialization size doesn't necessarily mean in memory size).
> 
> Just wait til those slackers at Sun at a Object.sizeof() method in jdk1.9 or
> 
> something lame.
> 
> BAL
> 
> >From: Navjot Singh <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: Re: [OT] how to calculate the size of an object
> >Date: Thu, 08 Jul 2004 22:16:12 +0530
> >
> >hi,
> >
> >Thanks for the link but this is very naive way of doing it. I am leaving it
> 
> >to the mercy of gc.
> >
> >What this method is doing
> >
> >1. run gc() manually (AND hope it wont run automatically again soon.)
> >2. free memory
> >3. create and object.
> >4. free memory
> >
> >and now just wish that JVM wont allocate any memory in it's heap between 
> >steps 2 & 4. so that one can assume that whatsoever output comes belongs to
> 
> >my object. I am at something better.
> >
> >Jim you are absolutely right, this technique may return a negative number.
> >
> >navjot singh
> >
> >
> >[EMAIL PROTECTED] wrote:
> >
> >>
> >>http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object
> >>
> >>The first one looks promising.
> >>
> >>Dennis
> >>
> >>
> >>
> >>
> >>*Navjot Singh <[EMAIL PROTECTED]>*
> >>
> >>07/08/2004 11:57 AM
> >>Please respond to
> >>"Struts Users Mailing List" <[EMAIL PROTECTED]>
> >>
> >>
> >>
> >>To
> >>Struts Users Mailing List <[EMAIL PROTECTED]>
> >>cc
> >>
> >>Subject
> >>[OT] how to calculate the size of an object
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>hi,
> >>
> >>I use SAX parser to load an LDIF file into memory. Whatsoever data i
> >>read, i fill into an object.
> >>
> >>I need to know *the size of LDIFData object* at runtime. How to do that?
> >>
> >>Well the class structure is something like this
> >>
> >>public class LDIFData{
> >> ArrayList cards; // collection of Card
> >> String filename;
> >> long lastLoadedTime;
> >>}
> >>
> >>public class Card{
> >> String name;
> >> String email
> >> String mobile;
> >>}
> >>
> >>--
> >>regards
> >>Navjot Singh
> >>
> >>When you jump for joy, beware that no-one moves the ground from beneath
> >>your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> >>
> >>-
> >>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]
> >
> >--
> >regards
> >Navjot Singh
> >
> >When you jump for joy, beware that no-one moves the ground from beneath
> >your feet. -- Stanislaw Lem, "Unkempt Thoughts"

-- 
Kris Schneider 
D.O.Tech   

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



Dynamic data html generation

2004-07-08 Thread JoAnn Lemm

Hi All,

I have a set of data that needs to be displayed in an html table. Each
column has its own formatting.  The data are stored as rows in an
ArrayList in the Form bean.  How can I create this HTML table using
struts without resorting to building the table in the bean.

--JoAnn 

 

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



Re: can someone help me?

2004-07-08 Thread Wendy Smoak
From: "KEBE Cheikh Silÿffe8ye" <[EMAIL PROTECTED]>
> In my editProspectAction.java, i do
> public ActionForward execute(
> ActionMapping mapping,
> ActionForm form,
   ^

Populate the 'form' that is passed into the method, don't create a new one:

> form=new ProspectForm();
> form=prospect;
> request.setAttribute(mapping.getAttribute(),form);

Actually I'm not certain what's going on in those three lines.  Take a look
at the struts-example webapp, it shows how to pre-populate a form using
BeanUtils.copyProperties.

It goes something like...
1. read Value Object from database
2. copy matching properties over to form bean
3. forward to JSP

-- 
Wendy Smoak


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



RE: can someone help me?

2004-07-08 Thread Jim Barrows
The short answer is read the java documentation better...
you don't do a new Form().  That won't work for reasons related to Java and passing 
variables.
In your struts-config.xml you should set the name, and probably validation=false.
Then something like:
MyForm myForm = (MyForm) form 
myForm.setThisField( some.getData());
return mapping.findForward("dearGodItWorked");
in your action class will fill it nicely.


> -Original Message-
> From: KEBE Cheikh Silÿffe8ye [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 2:14 AM
> To: [EMAIL PROTECTED]
> Subject: can someone help me?
> 
> 
> hi,
> i have an action class that calls a business object
> (prospect). And i want to display the information for
> a prospect in a form in jsp file (prospect.jsp)
>  Here is my struts-config.xml
>  type="com.youcompany.struts.form.ProspectForm">
>  />
>  />
>  />
> form-property name="nameP" type="java.lang.String" />
>  />
> 
>  type="java.lang.String" />
> 
>  />
> 
>  scope="request"
> 
> type="com.youcompany.struts.action.EditprospectAction"
> validate="false">
> 
> 
> 
> here is my prospect.jsp file
> 
>   type="com.youcompany.struts.form.ProspectForm">
>
>
>   
>   
>
>  nameP 
>
>
>  readonly="false" size="16"
> maxlength="30"/>
> 
>   
>  
> 
>  emailGenP 
> 
>
>  size="16" maxlength="30"/> property="emailGenP"/>
>
>  
>   
>   
>  phoneP 
>
>   
> property="phoneP" size="16"
> maxlength="15"/>
>
>   
>
> 
>  emailRhP 
>   
>   
>   property="emailRhP" size="16"
> maxlength="30"/>
>   
>   
>   
>   
>   addressP 
>   
>   
>  size="16" maxlength="50"/> property="addressP"/>
>
>  
>
>
>   emailDcP 
>
>
>size="16" maxlength="30"/> property="emailDcP"/>
>
>  
>
>
>  emailDtP 
> 
> 
>size="16" maxlength="30"/> property="emailDtP"/>
> 
>   
> 
>
>  faxP 
> 
>
>   maxlength="15"/>
>
>   
>  
> 
>  
>  
>  
>  
>  
>   
>   
> 
> 
> 
> In my editProspectAction.java, i do 
> 
> public ActionForward execute(
>   ActionMapping mapping,
>   ActionForm form,
>   HttpServletRequest request,
>   HttpServletResponse response)
>   throws Exception {
> ProspectForm prospect=new ProspectForm();
> // here, i ask my db for retrieving a prospect 
> .
> 
> form=new ProspectForm();
> form=prospect;
> request.setAttribute(mapping.getAttribute(),form);
> return (mapping.findForward("prospect"));
> }
> 
> 
> when i do editprospect.do, the prospect.jsp is
> displayed but the prospect data are not pre populate.
> can someone help me?
> thant
> 
> =
> Cheikh Silèye KEBE
> 
> 
> 
>   
> 
>   
>   
> Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
> Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
> 
> Dialoguez e

AW: Using Log4j in Struts 1.1

2004-07-08 Thread Michael Albrecht
Hi!

1. You have to put commons.logging.jar and your favourite implementation, e.g.
log4j.jar, in the WEB-INF/lib or the server directory for common libraries
(e.g. CATALINA_HOME/commons/lib).

2. The configuration of the logging framework could be done in several ways. The
most simple one to do is to copy the log4j.properties in your WEB-INF/classes
directory.
After that you can start with logging immediately, but there are two
disadvantages:
- property file is part of deployment
- changing of log4j.xml could due to a server redeployment of the web app.

I hoe this helps you a little bit to get off.

Michael
http://www.struts-it.de

--
NEUSTA Computersprachen GmbH
Ostertorsteinweg 30
28203 Bremen
Tel.: +49 421 20696-22
Fax: +49 421 20696-99
Mobil: +49 171 4289299

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



use multiple resource bundles in Validator

2004-07-08 Thread Hanna
How can i use mulitple message bundles in validator in struts 1.1?
like the way of  ?



can someone help me?

2004-07-08 Thread KEBE Cheikh Silÿffffffffffe8ye
hi,
i have an action class that calls a business object
(prospect). And i want to display the information for
a prospect in a form in jsp file (prospect.jsp)
 Here is my struts-config.xml




form-property name="nameP" type="java.lang.String" />










here is my prospect.jsp file

 
 
 


 
   nameP 
 
 
  
  

   
  
   emailGenP 
  
 
  
 
   


   phoneP 
 

 
 

 
  
   emailRhP 


   




addressP 


  
 
   
 
 
emailDcP 
 
 

 
   
 
 
   emailDtP 
  
  

  

  
 
   faxP 
  
 
   
 

   
  
   
   
   
   
   


  


In my editProspectAction.java, i do 

public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ProspectForm prospect=new ProspectForm();
// here, i ask my db for retrieving a prospect 
.

form=new ProspectForm();
form=prospect;
request.setAttribute(mapping.getAttribute(),form);
return (mapping.findForward("prospect"));
}


when i do editprospect.do, the prospect.jsp is
displayed but the prospect data are not pre populate.
can someone help me?
thant

=
Cheikh Silèye KEBE







Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !Téléchargez Yahoo! 
Messenger sur http://fr.messenger.yahoo.com

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



Re: [OT] how to calculate the size of an object

2004-07-08 Thread Brian Lee
If you run this from a simple console test app, the JVM won't allocate any 
extra objects between 2 and 4.

Unfortunatly, this is the most exact way to find out memory usage 
(serialization size doesn't necessarily mean in memory size).

Just wait til those slackers at Sun at a Object.sizeof() method in jdk1.9 or 
something lame.

BAL
From: Navjot Singh <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: [OT] how to calculate the size of an object
Date: Thu, 08 Jul 2004 22:16:12 +0530
hi,
Thanks for the link but this is very naive way of doing it. I am leaving it 
to the mercy of gc.

What this method is doing
1. run gc() manually (AND hope it wont run automatically again soon.)
2. free memory
3. create and object.
4. free memory
and now just wish that JVM wont allocate any memory in it's heap between 
steps 2 & 4. so that one can assume that whatsoever output comes belongs to 
my object. I am at something better.

Jim you are absolutely right, this technique may return a negative number.
navjot singh
[EMAIL PROTECTED] wrote:
http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object
The first one looks promising.
Dennis

*Navjot Singh <[EMAIL PROTECTED]>*
07/08/2004 11:57 AM
Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>

To
Struts Users Mailing List <[EMAIL PROTECTED]>
cc
Subject
[OT] how to calculate the size of an object



hi,
I use SAX parser to load an LDIF file into memory. Whatsoever data i
read, i fill into an object.
I need to know *the size of LDIFData object* at runtime. How to do that?
Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
--
regards
Navjot Singh
When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"
-
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]
--
regards
Navjot Singh
When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"
-
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: html:submit button

2004-07-08 Thread Wendy Smoak
From: "Denis Avdic" <[EMAIL PROTECTED]>
> Is there a way to separate those two?  I need 10 buttons, all the same
> label, but with different values submitted, depending on which button
> is pressed.   I am not sure how to achieve that with html:submit.
> Should I just throw in a regular  tag instead?

I have the same issue, only my buttons have images on them, and no label.  I
solved it with JavaScript, the onClick sets the form element to whatever
value I need, and that gets passed to the server.

-- 
Wendy Smoak


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



[Frames & HttpSession Scope]

2004-07-08 Thread Pat Quinn
Ive just converted some existing functionailty to use frames (not inline 
frames). Every thing seemed to be working fine while i used localhost in my 
url but once i try to access the web server from another machine or using 
the machine name in the url my main frame is failing to find any objects in 
HttpSession scope.

Any Ideas how i could get around this guys?
_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

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


Re: Getting the values from Popup window to Parent window if Multiple text fields in parent window

2004-07-08 Thread Henrique VIECILI
If your filefields have all the same id or name you will get an array of them, then 
you should access them like an array.

By example:

HTML:
File 1: 
...
File n: 


JAVASCRIPT
var files = document.getElementById("myFile");

for( i = 0; i < files.length; i++)
alert(files[i].value);

Henrique Viecili
  - Original Message - 
  From: Srinivas Rao 
  To: Struts Users Mailing List 
  Sent: Thursday, July 01, 2004 1:23 AM
  Subject: Getting the values from Popup window to Parent window if Multiple text 
fields in parent window




  Hi guys,


  I am facing samll problem , it's a simple one but i don't know what is the wrong i 
am doing ...
  Please help me..
  My problem is ...
  I have parent window and child window (ie popup window)..If i entered 
  the value into text field to popup window then the value come to the parent window 
if i closed the child window. Here it is working when single file but if it is 
multiple files,it's not working .I thing in child window cannot identify the relevant 
text field.

  the code is here .

  This is Parent window code.


  function showList() {
  alert("Call Show List");
  sList = window.open("/MTProd/ps/Supervisorcomment.jsp", "list", 
"width=750,height=510");
  }




  Chile window Code..


  function append()
  {
  
alert(window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value);
  document.getElementById("comment").value=
  window.opener.document.supervisorDeskActionForm.getElementById("stockBox").value;
  }

  function pickinf() {
  if (window.opener & !window.opener.closed)
  {
  window.opener.document.supervisorDeskActionForm.stockBox.value 
  = document.getElementById("comment").value;
  }
  window.close();
  }



  This is the code 

  Please tell me what is the wrong i am doing now...

  Thanks to replay to me.

  Thanks 
  Srinivas.



  -
  Do you Yahoo!?
  New and Improved Yahoo! Mail - Send 10MB messages!

  __
  Do You Yahoo!?
  Tired of spam?  Yahoo! Mail has the best spam protection around 
  http://mail.yahoo.com

Re: [OT] how to calculate the size of an object

2004-07-08 Thread Erik Weber
Also remember that when you serialize an Object (if I am not mistaken), 
all the Objects referred to by that Object get serialized too (unless 
the references are transient). In addition, there is serialization 
overhead (protocol info that is not actually part of your Object but 
that is required to deserialize). Your returned size could be misleading 
if you have references to, say, some "parent" Object(s) in LDIFData, or 
a ton of serialization overhead (unlikely).

Erik

Erik Weber wrote:
public static long getSize(LDIFData data) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(data);
out.close();
return baos.toByteArray().length;
}
catch (Exception e) {
e.printStackTrace();
return -1;
}
}
John Moore wrote:
Navjot Singh wrote:
I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do 
that?

Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
Off the top of my head...
Serialize it to a byte array output stream, see how many bytes you have
John
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Re: [OT] how to calculate the size of an object

2004-07-08 Thread Erik Weber
public static long getSize(LDIFData data) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(data);
out.close();
return baos.toByteArray().length;
}
catch (Exception e) {
e.printStackTrace();
return -1;
}
}
John Moore wrote:
Navjot Singh wrote:
I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do that?
Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
Off the top of my head...
Serialize it to a byte array output stream, see how many bytes you have
John
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Fwd: Faces Struts Tiles]

2004-07-08 Thread Craig McClanahan
Axel Groß wrote:
Thanks Craig!
Maybe we'll start switching this weekend to faces :)
So excited 8)
 

Me too :-).
*Please* try it out, and report any bugs you find to our issue tracking 
system:

 http://issues.apache.org/bugzilla/
under product "Struts" and component "Struts-Faces Library".  The 
quicker we shake out the remaining bugs, the quicker we can get this 
library released (it'll be a separate release from the Struts core 
releases, so doesn't need to be synchronized with those).

ciao,
axel
 

Craig
On 2004-07-07 at 21:53:22 -0700, Craig McClanahan wrote:
 

Hubert Rabago wrote:
   

There's an old IBM article illustrating this.
http://www-106.ibm.com/developerworks/java/library/j-integrate/
Keep in mind this article was written before the final release of JSF.
If you're looking for the nightly build of the struts-faces integration
library, there's an open bug report concerning that:
http://issues.apache.org/bugzilla/show_bug.cgi?id=28668
This bug report includes a link to the last nightlies that compiled 
properly.

And here's a related bug report:
http://issues.apache.org/bugzilla/show_bug.cgi?id=22207
This one's marked fixed, but it was the fix to this bug that caused the
integration library to stop compiling.
--- Joao Araujo <[EMAIL PROTECTED]> wrote:
 

   Is anybody using Faces, Struts, and Tiles ?
   I found an article pointing me to :
http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/
 

   

Just to bring everyone up to date, the nightly builds of the 
Struts-Faces integration library have been updated, and are now 
available again.  Included in the download is two example webapps, one 
with Tiles and one without, that use JSF components in conjunction with 
an application managed by Struts.  It works with Struts 1.1 or later.

See the README.txt (in the top level directory of the distribution) for 
all the nitty gritty details.

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

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


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


Re: [OT] how to calculate the size of an object

2004-07-08 Thread DGraham

Well, you can go the route of serializing
the object out as suggested by another.

Or, if you just need a approximate calculation
(since we don't know WHY you need the size), then add a size() method to
both classes that calculates the size of a particular instance of said
class.  Basically, LDIFData is a collection of Strings and one long.
 A long primitive is 8 bytes.  Each instance of the class can
just calculate using the length of each String.

Dennis







Navjot Singh <[EMAIL PROTECTED]>

07/08/2004 12:46 PM



Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>





To
Struts Users Mailing List
<[EMAIL PROTECTED]>


cc



Subject
Re: [OT] how to calculate
the size of an object








hi,

Thanks for the link but this is very naive way of doing it. I am leaving

it to the mercy of gc.

What this method is doing

1. run gc() manually (AND hope it wont run automatically again soon.)
2. free memory
3. create and object.
4. free memory

and now just wish that JVM wont allocate any memory in it's heap between

steps 2 & 4. so that one can assume that whatsoever output comes belongs

to my object. I am at something better.

Jim you are absolutely right, this technique may return a negative number.

navjot singh


[EMAIL PROTECTED] wrote:

> 
> http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object
> 
> The first one looks promising.
> 
> Dennis
> 
> 
> 
> 
> *Navjot Singh <[EMAIL PROTECTED]>*
> 
> 07/08/2004 11:57 AM
> Please respond to
> "Struts Users Mailing List" <[EMAIL PROTECTED]>
> 
> 
>                  
> To
>                  Struts
Users Mailing List <[EMAIL PROTECTED]>
> cc
>                  
> Subject
>                  [OT]
how to calculate the size of an object
> 
> 
>                  
> 
> 
> 
> 
> 
> hi,
> 
> I use SAX parser to load an LDIF file into memory. Whatsoever data
i
> read, i fill into an object.
> 
> I need to know *the size of LDIFData object* at runtime. How to do
that?
> 
> Well the class structure is something like this
> 
> public class LDIFData{
>                 ArrayList
cards; // collection of Card
>                 String filename;
>                 long lastLoadedTime;
> }
> 
> public class Card{
>                 String name;
>                 String email
>                 String mobile;
> }
> 
> -- 
> regards
> Navjot Singh
> 
> When you jump for joy, beware that no-one moves the ground from beneath
> your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> 
> -
> 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]

-- 
regards
Navjot Singh

When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"

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


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

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows


> -Original Message-
> From: Navjot Singh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 9:46 AM
> To: Struts Users Mailing List
> Subject: Re: [OT] how to calculate the size of an object
> 
> 
> hi,
> 
> Thanks for the link but this is very naive way of doing it. I 
> am leaving 
> it to the mercy of gc.

Look at some of the other articles.. you'll find some better articles there on how to 
do it.

> 
> What this method is doing
> 
> 1. run gc() manually (AND hope it wont run automatically again soon.)
> 2. free memory
> 3. create and object.
> 4. free memory
> 
> and now just wish that JVM wont allocate any memory in it's 
> heap between 
> steps 2 & 4. so that one can assume that whatsoever output 
> comes belongs 
> to my object. I am at something better.
> 
> Jim you are absolutely right, this technique may return a 
> negative number.
> 
> navjot singh
> 
> 
> [EMAIL PROTECTED] wrote:
> 
> > 
> > http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object
> > 
> > The first one looks promising.
> > 
> > Dennis
> > 
> > 
> > 
> > 
> > *Navjot Singh <[EMAIL PROTECTED]>*
> > 
> > 07/08/2004 11:57 AM
> > Please respond to
> > "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > 
> > 
> > 
> > To
> > Struts Users Mailing List <[EMAIL PROTECTED]>
> > cc
> > 
> > Subject
> > [OT] how to calculate the size of an object
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > hi,
> > 
> > I use SAX parser to load an LDIF file into memory. Whatsoever data i
> > read, i fill into an object.
> > 
> > I need to know *the size of LDIFData object* at runtime. 
> How to do that?
> > 
> > Well the class structure is something like this
> > 
> > public class LDIFData{
> > ArrayList cards; // collection of Card
> > String filename;
> > long lastLoadedTime;
> > }
> > 
> > public class Card{
> > String name;
> > String email
> > String mobile;
> > }
> > 
> > -- 
> > regards
> > Navjot Singh
> > 
> > When you jump for joy, beware that no-one moves the ground 
> from beneath
> > your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> > 
> > 
> -
> > 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]
> 
> -- 
> regards
> Navjot Singh
> 
> When you jump for joy, beware that no-one moves the ground 
> from beneath
> your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re: [OT] how to calculate the size of an object

2004-07-08 Thread Navjot Singh
hi,
Thanks for the link but this is very naive way of doing it. I am leaving 
it to the mercy of gc.

What this method is doing
1. run gc() manually (AND hope it wont run automatically again soon.)
2. free memory
3. create and object.
4. free memory
and now just wish that JVM wont allocate any memory in it's heap between 
steps 2 & 4. so that one can assume that whatsoever output comes belongs 
to my object. I am at something better.

Jim you are absolutely right, this technique may return a negative number.
navjot singh
[EMAIL PROTECTED] wrote:
http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object
The first one looks promising.
Dennis

*Navjot Singh <[EMAIL PROTECTED]>*
07/08/2004 11:57 AM
Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>

To
Struts Users Mailing List <[EMAIL PROTECTED]>
cc

Subject
[OT] how to calculate the size of an object



hi,
I use SAX parser to load an LDIF file into memory. Whatsoever data i
read, i fill into an object.
I need to know *the size of LDIFData object* at runtime. How to do that?
Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
--
regards
Navjot Singh
When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"
-
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]
--
regards
Navjot Singh
When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
Whoops.. that should the problem with the first one on the list.. :)

I know Bad code monkey no caffeine.

> -Original Message-
> From: Jim Barrows 
> Sent: Thursday, July 08, 2004 9:24 AM
> To: Struts Users Mailing List
> Subject: RE: [OT] how to calculate the size of an object
> 
> 
> Only problem is, that this is the size of the object with a 
> new object, rather then being something that could be done 
> dynamically.  Not to mention
> that if this is done at run time ( which is what the original 
> poster wants I believe) then you can be completely screwed by 
> a GC run, and end up 
> with a negative number.
>  
> 
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 9:10 AM
> To: Struts Users Mailing List
> Subject: Re: [OT] how to calculate the size of an object
> 
> 
> 
> http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object 
> 
> The first one looks promising. 
> 
> Dennis 
> 
> 
> 
> 
> 
> Navjot Singh <[EMAIL PROTECTED]> 
> 
> 
> 07/08/2004 11:57 AM 
> 
> 
> Please respond to
> "Struts Users Mailing List" <[EMAIL PROTECTED]>
> 
> 
> 
> To
> Struts Users Mailing List <[EMAIL PROTECTED]> 
> 
> cc
> 
> Subject
> [OT] how to calculate the size of an object
> 
>   
> 
> 
> 
> 
> hi,
> 
> I use SAX parser to load an LDIF file into memory. Whatsoever data i 
> read, i fill into an object.
> 
> I need to know *the size of LDIFData object* at runtime. How 
> to do that?
> 
> Well the class structure is something like this
> 
> public class LDIFData{
> ArrayList cards; // collection of Card
> String filename;
> long lastLoadedTime;
> }
> 
> public class Card{
> String name;
> String email
> String mobile;
> }
> 
> -- 
> regards
> Navjot Singh
> 
> When you jump for joy, beware that no-one moves the ground 
> from beneath
> your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 

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



RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
Only problem is, that this is the size of the object with a new object, rather then 
being something that could be done dynamically.  Not to mention
that if this is done at run time ( which is what the original poster wants I believe) 
then you can be completely screwed by a GC run, and end up 
with a negative number.
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 9:10 AM
To: Struts Users Mailing List
Subject: Re: [OT] how to calculate the size of an object



http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object 

The first one looks promising. 

Dennis 





Navjot Singh <[EMAIL PROTECTED]> 


07/08/2004 11:57 AM 


Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>



To
Struts Users Mailing List <[EMAIL PROTECTED]> 

cc

Subject
[OT] how to calculate the size of an object






hi,

I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do that?

Well the class structure is something like this

public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}

public class Card{
String name;
String email
String mobile;
}

-- 
regards
Navjot Singh

When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"

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






Re: [OT] how to calculate the size of an object

2004-07-08 Thread DGraham

http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=size+java+object

The first one looks promising. 

Dennis







Navjot Singh <[EMAIL PROTECTED]>

07/08/2004 11:57 AM



Please respond to
"Struts Users Mailing List" <[EMAIL PROTECTED]>





To
Struts Users Mailing List
<[EMAIL PROTECTED]>


cc



Subject
[OT] how to calculate the
size of an object








hi,

I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do that?

Well the class structure is something like this

public class LDIFData{
                
ArrayList cards; // collection of Card
                
String filename;
                
long lastLoadedTime;
}

public class Card{
                
String name;
                
String email
                
String mobile;
}

-- 
regards
Navjot Singh

When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"

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


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

RE: [OT] how to calculate the size of an object

2004-07-08 Thread Jim Barrows
java.io.File has the length() method to return the length of the file.

> -Original Message-
> From: Navjot Singh [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 8:58 AM
> To: Struts Users Mailing List
> Subject: [OT] how to calculate the size of an object
> 
> 
> hi,
> 
> I use SAX parser to load an LDIF file into memory. Whatsoever data i 
> read, i fill into an object.
> 
> I need to know *the size of LDIFData object* at runtime. How 
> to do that?
> 
> Well the class structure is something like this
> 
> public class LDIFData{
>   ArrayList cards; // collection of Card
>   String filename;
>   long lastLoadedTime;
> }
> 
> public class Card{
>   String name;
>   String email
>   String mobile;
> }
> 
> -- 
> regards
> Navjot Singh
> 
> When you jump for joy, beware that no-one moves the ground 
> from beneath
> your feet. -- Stanislaw Lem, "Unkempt Thoughts"
> 
> -
> 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]



html:submit button

2004-07-08 Thread Denis Avdic
Hello, 

>From what I understand, the value attribute on html:submit button is
both the value of the label and the value submitted to the property
attribute when the button is pressed.

Is there a way to separate those two?  I need 10 buttons, all the same
label, but with different values submitted, depending on which button
is pressed.   I am not sure how to achieve that with html:submit. 
Should I just throw in a regular  tag instead?

Thanks, 

Denis

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



Re: [OT] how to calculate the size of an object

2004-07-08 Thread John Moore
Navjot Singh wrote:
I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do that?
Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
Off the top of my head...
Serialize it to a byte array output stream, see how many bytes you have
John
--
==
John Moore - Norwich, UK - [EMAIL PROTECTED]
==
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[OT] how to calculate the size of an object

2004-07-08 Thread Navjot Singh
hi,
I use SAX parser to load an LDIF file into memory. Whatsoever data i 
read, i fill into an object.

I need to know *the size of LDIFData object* at runtime. How to do that?
Well the class structure is something like this
public class LDIFData{
ArrayList cards; // collection of Card
String filename;
long lastLoadedTime;
}
public class Card{
String name;
String email
String mobile;
}
--
regards
Navjot Singh
When you jump for joy, beware that no-one moves the ground from beneath
your feet. -- Stanislaw Lem, "Unkempt Thoughts"
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Setting the action attribute for nested:form

2004-07-08 Thread Rick Reumann
On Thu, 08 Jul 2004 11:02:30 -0400, Vinuta Nagaraddi  
<[EMAIL PROTECTED]> wrote:

I am trying to set the action attribute for the nested:form tag
dynamically.  I want to achieve this by using a property called 'url'
from the form (or maybe someone can suggest a better way).  I was
unsuccessful using the nested:write tag. Any help would be appreciated.
Why can't you just do this in the Action before you get to the form?  
That's normally where I set up any action parameters. A general rule is to  
do as little logic as you have to in the JSP. Usually you can do this kind  
of stuff before you get to the JSP.

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


RE: Multiple File Upload using Struts (number of files dynamic)

2004-07-08 Thread Viral_Thakkar

Thanks KP

Could you please elaborate on this..

What I understood is that have an ArrayList of FormFile in the form bean
class... now query is how this arraylist will get populated ?

If I need to create an ArrayList in JSP then how to get FormFile
element?

I am not aware of dynamic list control.

Could you please provide code snippet of reference?

Regards,
Viral

-Original Message-
From: kamakshya_mishra(int) 
Sent: Thursday, July 08, 2004 12:01 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: RE: Multiple File Upload using Struts (number of files dynamic)

Hi,

In the form bean keep an array list of FormFile and use it similarly as
dynamic list control.

KP

-Original Message-
From: Viral_Thakkar [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 08, 2004 3:01 PM
To: Struts Users Mailing List
Cc: Ketan_Bhat
Subject: Multiple File Upload using Struts (number of files dynamic)

Hi,
 
We are trying to implement uploading file via struts framework using
form bean. According to our requirement we have two scenarios' in which
we require uploading of our file.
1)   Uploading single file (single html:file control and a single
upload button in jsp page)
2)  Uploading multiple files (Multiple html:file controls on the
screen on the same form). 
The problem is that these number of html:file controls on the screen is
not fixed, it is dynamic. The user can click on an "Add More" button to
increase dynamically the number of files he/she wants to upload.
 
We have implemented the first scenario by using html:file tag on the JSP
and keeping a form bean with html control as one of its member
variables. In the action class we extract the value from the bean and
then upload the file using I/O streams. 
 
Now, for the second scenario we need to upload an indeterminate
(determined at run time) number of files but at the same time the number
of members in the bean class cannot be changed dynamically. 
 
So we either need a way to add members to a form bean dynamically or
some other mechanism which will handle this multiple upload requirement.
 
With Regards,
Viral

-
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: Setting the action attribute for nested:form

2004-07-08 Thread Bill Siggelkow
Hi Vinuta -- I noticed this is the second time you have posted this 
question. Usually if you don't get a response from the mailing list it 
indicates that you need to supply more information about your problem. 
Speaking for myself, I usually ignore posts that are unclear to me ... 
its not that I am rude -- I am simply don't have the time to respond to 
every post.

Okay, enough for the netiquette lecture :)
My first question is why are you trying to do this? There are times when 
you may need to dynamically change the action URL but it is typically 
the exception not the rule.

That being said, you can use a runtime expression to set the value for 
the action attribute -- so you should be able to do something like:



This reeks of ugliness, however, so I would avoid it if possible.
Vinuta Nagaraddi wrote:
Hello,
 
I am trying to set the action attribute for the nested:form tag
dynamically.  I want to achieve this by using a property called 'url'
from the form (or maybe someone can suggest a better way).  I was
unsuccessful using the nested:write tag. Any help would be appreciated.
 
Thanks,
Vinuta
 


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


Re: using Constants from JSTL .....

2004-07-08 Thread Rick Reumann
On Thu, 08 Jul 2004 09:43:11 -0400, Rick Reumann <[EMAIL PROTECTED]>  
wrote:


Duh, my bad, as David mentioned the above should be ${applicationScope..  
}. Sorry about that.

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


Setting the action attribute for nested:form

2004-07-08 Thread Vinuta Nagaraddi
Hello,
 
I am trying to set the action attribute for the nested:form tag
dynamically.  I want to achieve this by using a property called 'url'
from the form (or maybe someone can suggest a better way).  I was
unsuccessful using the nested:write tag. Any help would be appreciated.
 
Thanks,
Vinuta
 


RE: ActionForward with runtime parameter?

2004-07-08 Thread Robert Taylor
You may also want to check out ParameterActionForward:
http://www.mail-archive.com/[EMAIL PROTECTED]/msg96372.html

robert

> -Original Message-
> From: Twan Kogels [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 10:21 AM
> To: Struts Users Mailing List
> Subject: RE: ActionForward with runtime parameter?
> 
> 
> Hello,
> 
> Thanks for the replies! Yes, the parameter should be passed as a real 
> parameter. I tryed the setattribute/getattribute method but that resulted 
> in strange side effects. To remove the side effects more code lines we're 
> needed. I guess i'll stick to my new ActionForward method.
> 
> Cheers,
> Twan
> 
> At 14:32 08-7-2004, you wrote:
> >yeh. If you set it as an attribute and try to get it as a parameter your in
> >for some dissapointment ;-)
> >Doing it as an attribute would be ok though so long as its a non-redirecting
> >forward and the place you forward to knows to expect it as an attribute.
> >This does however mean you will also be passing along the baggage of all the
> >submitted request parameters for this page...
> >
> >In this case I think that its definately parameters that Twan is after, so
> >the new ActionForward technique is the way to go.
> >
> >-Original Message-
> >From: Geeta Ramani [mailto:[EMAIL PROTECTED]
> >Sent: Thursday, 8 July 2004 20:21
> >To: Struts Users Mailing List
> >Subject: RE: ActionForward with runtime parameter?
> >
> >
> >Just a couple of small notes here though, (added for the Struts beginner):
> >you will be setting and getting a "attribute" not a "parameter". Also you
> >will need to set/get it as an Integer not an int..
> >
> >Geeta
> >
> > > -Original Message-
> > > From: Kailash Vasani [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 08, 2004 8:29 AM
> > > To: 'Struts Users Mailing List'
> > > Subject: RE: ActionForward with runtime parameter?
> > >
> > >
> > > Hi,
> > >
> > > Set id and it's value in request object and just forward to
> > > mapping.findForward("success").
> > > In ur target page (where u r forwarding), get the value for
> > > parameter (id)
> > > from request object.
> > >
> > > that should do the trick
> > >
> > > Kailash
> > >
> > >
> > > -Original Message-
> > > From: Twan Kogels [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 08, 2004 5:50 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: ActionForward with runtime parameter?
> > >
> > >
> > > Hello people,
> > >
> > > I've started my first project with struts. It's working fine,
> > > clean and
> > > quick. But i have a question regarding actionforwards and
> > > parameters to the
> > > path.
> > >
> > > I have a form; when the user submits the form i forward the
> > > user to another
> > > page. This page requires one parameter (?id=x) to function.
> > > Now i use a
> > > code like:
> > >
> > > return new
> > > ActionForward(mapping.findForward("success").getPath()+"?id="+
> > > glform.getGroe
> > > p());
> > >
> > > to forward and add a parameter. The forward "success"
> > > contains the url to
> > > the page without parameters (/page.do). I then append the
> > > "id=" parameter
> > > and create a new ActionForward.
> > >
> > > The value of the id= parameter is only known when the user
> > > submits the
> > > form. So i cannot put the id parameter in the struts-config.xml file.
> > >
> > > Is the above code the best and cleanest way to do the thing i
> > > want to do?
> > >
> > > Cheers,
> > > Twan Kogels
> > >
> > >
> > >
> > > -
> > > 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]
> 

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



Re: Using struts-nested tags

2004-07-08 Thread Paride Perazzolo
Hello folks
2 days ago I wrote:


> from struts-config.xml the definition of the form follows:
>
>
>  type="org.apache.struts.validator.DynaValidatorActionForm">
> 
> 

the definition of the associated action is (note the scope parameter):



 

My approach: I extract from session the bean I use to initialize the form.
I do this in the action which is called before passing the request to the
JSP which implements canalizzazioneCLDForm:
//this bean defines the listaDanneggiati property
PartiteDanneggiatiView partite = new PartiteDanneggiatiView();
// extract from session the bean which returns the listaDanneggiati
ArrayList SessionBeanContainer beanContainer=
getSessionContainer(request);if (beanContainer != null)
{
//this is obvious
  partite.setListaDanneggiati((ArrayList)beanContainer.getListaDanneggiati());}
// puts form into the request
setFormIntoTheRequest("canalizzazioneCLDForm", partite, request);
//


Now the request is passed to the JSP:

.

  

  
 
      
       
  




when I submit the form I get the following


> I need this to manage the interactivity correctly. Infact what I
> actually get when I submit the form is the following:>
> java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>   at java.util.ArrayList.RangeCheck(Unknown Source)
>   at java.util.ArrayList.get(Unknown Source)
>   at
>   org.apache.struts.action.DynaActionForm.get(DynaActionForm.java:298) at
>   
> org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:474)
>   at
>   
> org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
>   at>
>


but if I change the scope of the action above to "session" and I call
setFormIntoTheSession() instead of setFormIntoTheRequest() all works nice.
This is obvius, but my problem is: I don't like to set the action scope to
"session". Is there a way to set it to "request" and let all working
right?

thanks in advance


-- 
Paride Perazzolo
[EMAIL PROTECTED]




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



RE: using Constants from JSTL .....

2004-07-08 Thread Karr, David
> -Original Message-
> From: Bryan Hunt [mailto:[EMAIL PROTECTED] 
> 
> But for some reason ( my stupidity and the time of the evening ) I 
> cannot get this to work.
> snip=
>  value="${scope['Constants.EMAIL_NOTIFICATIONS']">
> 
> =snip
> 
> or like this
> 
> snip=
>  value="${scope[${Constants.EMAIL_NOTIFICATIONS}]">
> 
> =snip

You should read the JSTL specification.  That would have made clear that
the latter has no chance of working, and it might have made clear what
the former is doing.

Try the following:




That has a better chance of working, assuming the correct value is in
the "EMAIL_NOTIFICATIONS" property of the "Constants" object in
application scope.

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



RE: some best practices questions

2004-07-08 Thread McCormack, Chris
>users will fail over to another box with nothing in their session.

In some applications this is an acceptable risk if you have high uptime servers and 
very few code releases. 
If you however want a solid insurable "customer session" then using sticky sessions is 
not an option unfortunately.

Chris McCormack

-Original Message-
From: Paul McCulloch [mailto:[EMAIL PROTECTED]
Sent: 08 July 2004 14:54
To: 'Struts Users Mailing List'
Subject: RE: some best practices questions


The solution to this problem is to use a load balancer which knows about
sessions. mod_jk2 for Apache does this very well. 

With sticky sessions enabled the first request in a session goes, as you
say, to a low load box. All subsequent requests in that session will be sent
to the same box.

You don't have to make *any* changes to your application to support this.
The only downside (vs a 'real' cluster) is that in the event of a box dying
users will fail over to another box with nothing in their session.

Paul

> -Original Message-
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2004 14:09
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: some best practices questions
> 
> 
> >3) Users session is on that machine. The url for that 
> machine is machine123.msn.com.
> 
> You missed a few steps which outlines the problem with 
> clustered servers not being able to use session scope for a user :
> 
> -a user types in their login details on www.msn.com and hits "GO".
> 
> -the request hits www.msn.com and the load balancer assigns 
> the request to a low load box and rewrites 
> the url and forwards the request on ie serv1.msn.com
> 
> -the request lands at serv1.msn.com and the application on 
> serv1.msn.com services the request and pops a few things in 
> session scope for use later now it knows who the user is 
> because they just logged on, it then sends back a valid 
> response with the users page.
> 
> -the user gets his response and decides to click their 
> personalised news link www.msn.com/news
> 
> - we are then submitting a new request to www.msn.com. The 
> load balancer(front processor) may decide that serv1.msn.com 
> is under load or is not available for this request and sends 
> to serv24.msn.com. 
> 
> - The users session is not on this machine so the application 
> cannot obtain the info it needs about the user to proceed 
> with the request. The application has to :
>  a, get the user to relogin
>  b, fail horribly or with a nice smiley message :P
> 
> The ways around this have been to :
> 
>  c, use black magic to retrieve the users session
> 
> by black magic I mean cookies with a state id in/a sessionid 
> in the httpheader/session id in a url parameter/hidden form 
> field on a page that matches to a database/file/static 
> storage record containing the users session information.
> 
> The point is if you use load balanced application server 
> clustering its not straight forward to implement session 
> handling and everyone does it differently subject to their 
> applications needs.
> 
> Chris McCormack
> 
> -Original Message-
> From: Bryan Hunt [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2004 13:00
> To: Struts Users Mailing List
> Subject: Re: some best practices questions
> 
> 
> The main arguments that people have against session storage 
> is the following
> 
> a) Excessive memory consumption limits scallability.
> True, just don't go crazy storing whole db's and stuff in there.
> 
>  b) Sessions can not be shared by webservers in clustered environment.
> 
> Clustered webservers with shared sessions are such a myth/stupid idea.
> Do it like hotmail.
> 
> 1) Request comes in to one of the front processor 
> machines selected by
> DNS server with multiple resolves for the same address.
> 
> 2) Choose a machine that that has resources to spare.
> 
> 3) Users session is on that machine. The url for that machine is
> machine123.msn.com.
> 
> 4) User logs off, the next time they come back their session is on
> some other machine.
> 
> I fail to see what the point of sharing sessions between machines is ?
> Even if the machine crashes, they just enter in the initial 
> address (ie
> hotmail.com ) and get sent to a working machine.
> 
> So my point is ... what's so bad about sessions ? 
> 
> Also if session ties you to a machine then file storage is 
> twice as bad.
> 
> --b
> 
> 
> 
> 
> 
> ***
> This e-mail and its attachments are confidential
> and are intended for the above named recipient
> only. If this has come to you in error, please 
> notify the sender immediately and delete this 
> e-mail from your system.
> You must take no action based on this, nor must 
> you copy or disclose it or any part of its contents 
> to any person or organisation.
> Statements and opinions contained in this email may 
> not necessarily represent those of Littlewoods.
> Please note that e-mail communica

Re: Using Log4j in Struts 1.1

2004-07-08 Thread Selim Hendrickson
Hi,
You have to put the log4j.jar into the lib directory. Then you construct 
the log4j.properties file and put into the classes directory.
Here is a sample log4j.properties file:

log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.logger.org.apache.struts=DEBUG
log4j.logger.projectName=DEBUG
log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:ss} 
(%F:%M:%L)%n%m%n%n

import org.apache.commons.logging.Log and 
org.apache.commons.logging.LogFactory;

Then use: private static Log log = LogFactory.getLog(nameOfAction.class);
Anywhere you want to print a log message use:
log.trace("Your Message");
That should be all...
Take a look at the structure of the log4.properties file to find out 
about patterns and log levels. (DEBUG, WARN, etc.)
Pay attention that log.trace() is a certain log level and can be 
log.debug() as well. Take a look at the API.

Hope that helps,
Selim HENDRICKSON
IZTEK Consulting Services
Software Engineer
selimhendrickson [at] iyte.edu.tr
0232 750 6557
[EMAIL PROTECTED] wrote:
Hello All,
Can anybody send me the steps to config Log4j in struts1.1. Using 
commons-logging

Regards,
Alok Garg
 



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


Re: duplicate submission

2004-07-08 Thread Bill Siggelkow
Well, it adds a parameter to the query string of the link containing the 
 token. You do need to save the token in the request in the Action 
prior to the page:

public class MyAction {
  public ActionForward execute(...) {
...
saveToken(request);
...
  }
}
Jignesh Patel wrote:
Does that set a same token which will be used to avoid duplicate
submission.
-Jignesh
On Thu, 2004-07-08 at 09:19, Bill Siggelkow wrote:
You can add the token to a link URL (html:link or html:rewrite tag) by 
setting 'transaction="true"'.

Jignesh Patel wrote:
We have specific requirement for generating token in JSP instead of
action class to avoid duplicate submission.
Can anybody tell us how to do that.

-
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: ActionForward with runtime parameter?

2004-07-08 Thread Twan Kogels
Hello,
Thanks for the replies! Yes, the parameter should be passed as a real 
parameter. I tryed the setattribute/getattribute method but that resulted 
in strange side effects. To remove the side effects more code lines we're 
needed. I guess i'll stick to my new ActionForward method.

Cheers,
Twan
At 14:32 08-7-2004, you wrote:
yeh. If you set it as an attribute and try to get it as a parameter your in
for some dissapointment ;-)
Doing it as an attribute would be ok though so long as its a non-redirecting
forward and the place you forward to knows to expect it as an attribute.
This does however mean you will also be passing along the baggage of all the
submitted request parameters for this page...
In this case I think that its definately parameters that Twan is after, so
the new ActionForward technique is the way to go.
-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Thursday, 8 July 2004 20:21
To: Struts Users Mailing List
Subject: RE: ActionForward with runtime parameter?
Just a couple of small notes here though, (added for the Struts beginner):
you will be setting and getting a "attribute" not a "parameter". Also you
will need to set/get it as an Integer not an int..
Geeta
> -Original Message-
> From: Kailash Vasani [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 8:29 AM
> To: 'Struts Users Mailing List'
> Subject: RE: ActionForward with runtime parameter?
>
>
> Hi,
>
> Set id and it's value in request object and just forward to
> mapping.findForward("success").
> In ur target page (where u r forwarding), get the value for
> parameter (id)
> from request object.
>
> that should do the trick
>
> Kailash
>
>
> -Original Message-
> From: Twan Kogels [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 08, 2004 5:50 PM
> To: [EMAIL PROTECTED]
> Subject: ActionForward with runtime parameter?
>
>
> Hello people,
>
> I've started my first project with struts. It's working fine,
> clean and
> quick. But i have a question regarding actionforwards and
> parameters to the
> path.
>
> I have a form; when the user submits the form i forward the
> user to another
> page. This page requires one parameter (?id=x) to function.
> Now i use a
> code like:
>
> return new
> ActionForward(mapping.findForward("success").getPath()+"?id="+
> glform.getGroe
> p());
>
> to forward and add a parameter. The forward "success"
> contains the url to
> the page without parameters (/page.do). I then append the
> "id=" parameter
> and create a new ActionForward.
>
> The value of the id= parameter is only known when the user
> submits the
> form. So i cannot put the id parameter in the struts-config.xml file.
>
> Is the above code the best and cleanest way to do the thing i
> want to do?
>
> Cheers,
> Twan Kogels
>
>
>
> -
> 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]


Réf. : Re: simply getting plugin properties

2004-07-08 Thread meissa . Sakho

Thank you nicolas.

there is something a little bit confusing in the struts documentation
that led me in misunderstanding.

I found the extract below in the struts documentation.






I could never imagine creating a javabean property named
"definition-config".


___
NATEXIS ASSET MANAGEMENT
Meissa SAKHO
01 58 19 45 71. . . . . . . . . . . . (84571)
[EMAIL PROTECTED]




"Nicolas De Loof" <[EMAIL PROTECTED]>
08/07/2004 15:43
Veuillez répondre à "Struts Users Mailing List"


Pour :  "Struts Users Mailing List" <[EMAIL PROTECTED]>
cc :
Objet : Re: simply getting plugin properties



Simply create a javabean property 'myProperty' in your plugin class :

private String myProperty;

public void setMyProperty(String str) ...

public String getMyProperty() ...


Nico.


>
> I'm using struts 1.1 and need to set some parameters in my plugin
> definition.
>
> here is my plugin definition:
>
> 
>  property="myProperty"
> value"/WEB-INF/myFile.xml"/>
> 
>
> I would like to read the property in my plugin init method.
> can someone tell me how to do this.
>
> thanks in advance.
> ___
> NATEXIS ASSET MANAGEMENT
> Meissa SAKHO
> 01 58 19 45 71. . . . . . . . . . . . (84571)
> [EMAIL PROTECTED]
>
> L'integrite de ce message n'etant pas assuree sur internet, Natexis
> Banques Populaires ne peut etre tenu responsable de
> son contenu. Toute utilisation ou diffusion non autorisee est
> interdite. Si vous n'etes pas destinataire de ce message, merci de le
> detruire et d'avertir l'expediteur.
>
> The integrity of this message cannot be guaranteed
> on the Internet. Natexis Banques Populaires can not therefore be
> considered responsible for the contents.Any unauthorized use or
dissemination is prohibited.
> If you are not the intended recipient of this message, then please
delete it and
> notify the sender.


Our name has changed.  Please update your address book to the following
format: "[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential
and is the property of the Capgemini Group. It is intended only for the
person to whom it is addressed. If you are not the intended recipient, you
are not authorized 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.


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





L'integrite de ce message n'etant pas assuree sur internet, Natexis
Banques Populaires ne peut etre tenu responsable de
son contenu. Toute utilisation ou diffusion non autorisee est
interdite. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur.

The integrity of this message cannot be guaranteed
on the Internet. Natexis Banques Populaires can not therefore be
considered responsible for the contents.Any unauthorized use or dissemination is 
prohibited.
If you are not the intended recipient of this message, then please delete it and
notify the sender.

Re: duplicate submission

2004-07-08 Thread Jignesh Patel
Does that set a same token which will be used to avoid duplicate
submission.

-Jignesh
On Thu, 2004-07-08 at 09:19, Bill Siggelkow wrote:
> You can add the token to a link URL (html:link or html:rewrite tag) by 
> setting 'transaction="true"'.
> 
> Jignesh Patel wrote:
> > We have specific requirement for generating token in JSP instead of
> > action class to avoid duplicate submission.
> > 
> > Can anybody tell us how to do that.
> 
> 
> -
> 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]



Using Log4j in Struts 1.1

2004-07-08 Thread alok . garg
Hello All,
Can anybody send me the steps to config Log4j in struts1.1. Using 
commons-logging

Regards,
Alok Garg


RE: some best practices questions

2004-07-08 Thread Paul McCulloch
The solution to this problem is to use a load balancer which knows about
sessions. mod_jk2 for Apache does this very well. 

With sticky sessions enabled the first request in a session goes, as you
say, to a low load box. All subsequent requests in that session will be sent
to the same box.

You don't have to make *any* changes to your application to support this.
The only downside (vs a 'real' cluster) is that in the event of a box dying
users will fail over to another box with nothing in their session.

Paul

> -Original Message-
> From: McCormack, Chris [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2004 14:09
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: some best practices questions
> 
> 
> >3) Users session is on that machine. The url for that 
> machine is machine123.msn.com.
> 
> You missed a few steps which outlines the problem with 
> clustered servers not being able to use session scope for a user :
> 
> -a user types in their login details on www.msn.com and hits "GO".
> 
> -the request hits www.msn.com and the load balancer assigns 
> the request to a low load box and rewrites 
> the url and forwards the request on ie serv1.msn.com
> 
> -the request lands at serv1.msn.com and the application on 
> serv1.msn.com services the request and pops a few things in 
> session scope for use later now it knows who the user is 
> because they just logged on, it then sends back a valid 
> response with the users page.
> 
> -the user gets his response and decides to click their 
> personalised news link www.msn.com/news
> 
> - we are then submitting a new request to www.msn.com. The 
> load balancer(front processor) may decide that serv1.msn.com 
> is under load or is not available for this request and sends 
> to serv24.msn.com. 
> 
> - The users session is not on this machine so the application 
> cannot obtain the info it needs about the user to proceed 
> with the request. The application has to :
>  a, get the user to relogin
>  b, fail horribly or with a nice smiley message :P
> 
> The ways around this have been to :
> 
>  c, use black magic to retrieve the users session
> 
> by black magic I mean cookies with a state id in/a sessionid 
> in the httpheader/session id in a url parameter/hidden form 
> field on a page that matches to a database/file/static 
> storage record containing the users session information.
> 
> The point is if you use load balanced application server 
> clustering its not straight forward to implement session 
> handling and everyone does it differently subject to their 
> applications needs.
> 
> Chris McCormack
> 
> -Original Message-
> From: Bryan Hunt [mailto:[EMAIL PROTECTED]
> Sent: 08 July 2004 13:00
> To: Struts Users Mailing List
> Subject: Re: some best practices questions
> 
> 
> The main arguments that people have against session storage 
> is the following
> 
> a) Excessive memory consumption limits scallability.
> True, just don't go crazy storing whole db's and stuff in there.
> 
>  b) Sessions can not be shared by webservers in clustered environment.
> 
> Clustered webservers with shared sessions are such a myth/stupid idea.
> Do it like hotmail.
> 
> 1) Request comes in to one of the front processor 
> machines selected by
> DNS server with multiple resolves for the same address.
> 
> 2) Choose a machine that that has resources to spare.
> 
> 3) Users session is on that machine. The url for that machine is
> machine123.msn.com.
> 
> 4) User logs off, the next time they come back their session is on
> some other machine.
> 
> I fail to see what the point of sharing sessions between machines is ?
> Even if the machine crashes, they just enter in the initial 
> address (ie
> hotmail.com ) and get sent to a working machine.
> 
> So my point is ... what's so bad about sessions ? 
> 
> Also if session ties you to a machine then file storage is 
> twice as bad.
> 
> --b
> 
> 
> 
> 
> 
> ***
> This e-mail and its attachments are confidential
> and are intended for the above named recipient
> only. If this has come to you in error, please 
> notify the sender immediately and delete this 
> e-mail from your system.
> You must take no action based on this, nor must 
> you copy or disclose it or any part of its contents 
> to any person or organisation.
> Statements and opinions contained in this email may 
> not necessarily represent those of Littlewoods.
> Please note that e-mail communications may be monitored.
> The registered office of Littlewoods Limited and its
> subsidiaries is 100 Old Hall Street, Liverpool, L70 1AB.
> Registered number of Littlewoods Limited is 262152.
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


***

Re: simply getting plugin properties

2004-07-08 Thread Nicolas De Loof

Simply create a javabean property 'myProperty' in your plugin class :

private String myProperty;

public void setMyProperty(String str) ...

public String getMyProperty() ...


Nico.


> 
> I'm using struts 1.1 and need to set some parameters in my plugin
> definition.
> 
> here is my plugin definition:
> 
> 
>  property="myProperty"
> value"/WEB-INF/myFile.xml"/>
> 
> 
> I would like to read the property in my plugin init method.
> can someone tell me how to do this.
> 
> thanks in advance.
> ___
> NATEXIS ASSET MANAGEMENT
> Meissa SAKHO 
> 01 58 19 45 71. . . . . . . . . . . . (84571)
> [EMAIL PROTECTED]
> 
> L'integrite de ce message n'etant pas assuree sur internet, Natexis
> Banques Populaires ne peut etre tenu responsable de
> son contenu. Toute utilisation ou diffusion non autorisee est
> interdite. Si vous n'etes pas destinataire de ce message, merci de le
> detruire et d'avertir l'expediteur.
> 
> The integrity of this message cannot be guaranteed
> on the Internet. Natexis Banques Populaires can not therefore be
> considered responsible for the contents.Any unauthorized use or dissemination is 
> prohibited.
> If you are not the intended recipient of this message, then please delete it and 
> notify the sender.


Our name has changed.  Please update your address book to the following format: 
"[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized 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.


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



Re: using Constants from JSTL .....

2004-07-08 Thread Rick Reumann
On Thu, 08 Jul 2004 13:49:11 +0200, Bryan Hunt <[EMAIL PROTECTED]>  
wrote:


Actually I haven't seen the 'scope' property like that, but have you tried  
(assuming ApplicationScope)...



The above should work assuming you have a Constants class that is in  
Application scope and Constants is either a Map (with a key  
EMAIL_NOTFICATIONS) or a regular bean with a getEMAIL_NOTIFICATIONS method  
in it.

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


RE: application configuration

2004-07-08 Thread Hibbs, David
I'll give you a good reason... file access inevitably risks
IOExceptions, and exceptions don't propogate well from a static block.

That is to say, when the ClassLoader invokes the static block, it is
not invoked from within your code.  The exception gets thrown and propogates
through the *ClassLoader* stack rather than your application code, resulting
in an application that simply won't start for mysterious reasons, forcing a
long and drawn out investigation.

The only reason I use static blocks any more is to initialize
constants that require more than 1 line to initialize correctly (such as
NumberFormats, where you may have additional methods to invoke once they are
corrected) or are order-dependent, so that if a field gets renamed and/or
the members are resorted the code doesn't blow up.
Even these examples are pretty scarce and serve very special purposes.

Best Practice: Don't do anything in a static block that can throw an
exception without good reason.  

If you have something you'd like to initialize in a static way,
create a static synchronized accessor and allow the accessor to throw
exceptions as needed.  i.e.
a singleton-like implementation:

private static Config configInstance = null;
public static final synchronized getConfig()
{
if(configInstance==null)
{
// create instance and read config;
// this can throw any RuntimeExceptions
// and still be compatible with the signature
}
return configInstance;
}

David Hibbs, ACS
Staff Programmer / Analyst
American National Insurance Company

> Id be wary about using static blocks for anything involving 
> file access. I
> cant give you a good reason for that, but it just seems like 
> a bad idea to
> me.

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



simply getting plugin properties

2004-07-08 Thread meissa . Sakho

I'm using struts 1.1 and need to set some parameters in my plugin
definition.

here is my plugin definition:





I would like to read the property in my plugin init method.
can someone tell me how to do this.

thanks in advance.
___
NATEXIS ASSET MANAGEMENT
Meissa SAKHO 
01 58 19 45 71. . . . . . . . . . . . (84571)
[EMAIL PROTECTED]

L'integrite de ce message n'etant pas assuree sur internet, Natexis
Banques Populaires ne peut etre tenu responsable de
son contenu. Toute utilisation ou diffusion non autorisee est
interdite. Si vous n'etes pas destinataire de ce message, merci de le
detruire et d'avertir l'expediteur.

The integrity of this message cannot be guaranteed
on the Internet. Natexis Banques Populaires can not therefore be
considered responsible for the contents.Any unauthorized use or dissemination is 
prohibited.
If you are not the intended recipient of this message, then please delete it and 
notify the sender.

Re: using Constants from JSTL .....

2004-07-08 Thread Kris Schneider
It's not so bad, really ;-). For some additional background, here are a few
older messages from struts-user and taglibs-user:

http://marc.theaimsgroup.com/?l=struts-user&m=103790677413408&w=2
http://marc.theaimsgroup.com/?l=struts-user&m=105777660215673&w=2
http://marc.theaimsgroup.com/?l=taglibs-user&m=105889207116316&w=2

Here's a slightly different approach:

package com.dotech.util;

import java.io.Serializable;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class ConstantBean implements Serializable {

private Map constants;

public ConstantBean() {
super();
}

public void setClassName(String className) throws ClassNotFoundException,
  IllegalAccessException {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = getClass().getClassLoader();
if (loader == null) {
loader = ClassLoader.getSystemClassLoader();
}
}
Class clazz = loader.loadClass(className);
Field[] allFields = clazz.getDeclaredFields();
int numFields = allFields.length;
Map propMap = new HashMap(numFields);
for (int i = 0; i < numFields; i++) {
Field f = allFields[i];
int mods = f.getModifiers();
if (Modifier.isPublic(mods) &&
Modifier.isStatic(mods) &&
Modifier.isFinal(mods)) {
String name = f.getName();
Object value = f.get(null);
propMap.put(name, value);
}
}
this.constants =  Collections.unmodifiableMap(propMap);
}

public Map getConstants() {
return this.constants;
}
}

Which can be used in a page like this:

<%@ page contentType="text/plain" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>





SC_INTERNAL_SERVER_ERROR: 

Quoting Bryan Hunt <[EMAIL PROTECTED]>:

> Uh oh, I just realised that is the exact same as mine just implimented 
> differently.
> 
> 
> 
> Will output the string value but will not be able to be used to resolve 
> the bean by that
> name.
> 
> I'm giving up on JSTL constants.  Nice idea ... but too expensive on my 
> hairline.
> 
> --b
> 
> Rick Reumann wrote:
> 
> > On Wed, 07 Jul 2004 20:12:02 +0200, Bryan Hunt 
> > <[EMAIL PROTECTED]>  wrote:
> >
> >> And it works fine, but really what I am trying to get here is the 
> >> value  of using Constants in
> >> both my Actions and my ( JSTL based ) jsp's.
> >
> >
> > You need to have all your Constants in a Map that is in application 
> > scope.  Kris Schneider posted this great piece of code to add to your 
> > Constants  file to return all your constants as a Map. At app start up 
> > I have a  servlet that does several things, one of which call the 
> > properties method  to put all the stuff in a Map and then you can just 
> > put that in scope:
> >
> >
> > //in some servlet at startup:
> > ServletContext context = contextEvent.getServletContext();
> > context.setAttribute("CONSTANTS", UIConstants.getConstantsMap());
> >
> >
> > (Below you don't need to do like I have. I had other reasons to do it 
> > this  way at the time. But just provide the getConstantFieldsAsMap() 
> > method )
> >
> > //example class: UIConstants
> >
> > private static Map constantsMap;
> > static {
> > constantsMap = getConstantFieldsAsMap(UIConstants.class);
> > }
> >
> > public static Map getConstantsMap() {
> > return constantsMap;
> > }
> >
> > //all your constants:
> > public final static String WHATEVER = "whatever";
> >
> > //this does the work.. thanks Kris
> > private static Map getConstantFieldsAsMap(Class cls) {
> > Map propMap = null;
> > try {
> > Field[] allFields = cls.getDeclaredFields();
> > int numFields = allFields.length;
> > propMap = new HashMap(numFields);
> > for(int i = 0; i < numFields; i++) {
> > Field f = allFields[i];
> > int mods = f.getModifiers();
> > if(Modifier.isPublic(mods) && Modifier.isStatic(mods) &&  
> > Modifier.isFinal(mods)) {
> > String name = f.getName();
> > Object value = f.get(null);
> > log.debug("Putting name = " + name + " and value=" + 
> > value  + " into propMap");
> > propMap.put(name, value);
> > }
> > }
> > } catch(IllegalAccessException ie) {
> > log.error("Problem loading constantFieldsAsMap " + ie);
> > }
> > return Collections.unmodifiableMap(propMap);
> > }
> >
> > //end class
> >
> >
> > Now in JSP you can just do:
> >
> > 

-- 
Kris Schneider 
D.O.Tech   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: some best practices questions

2004-07-08 Thread Ted Husted
Essentially, this is what ASP.NET does by default. The original values for the 
controls that you want to persist are encoded and serialized and written to the form 
as a single hidden variable. Then on the server side, it unmarshalls the hidden 
variable and restores the controls to their original state. Any request parameters are 
then applied so update the controls to their new values.

IMHO, it would be very useful to have a tag that serialized the ActionForm so that you 
would have a copy of its prior state. Ideally, the request processor would first 
repopulate the ActionForm from the serialized copy, and then look to the request 
parameters (a la .NET).

Or course, there is no free lunch. You save on the server, but you pay on the client, 
since all this serialized data has to be rendered by your browser. But, it would avoid 
over-using session scope.

-Ted.

On Wed, 07 Jul 2004 22:46:04 -0400, Christina Siena wrote:
> I have an idea how to persist the data that I currently place in
> session scope but I need to run it by someone.
>
>
> Recall when I said that placing data in session scope is frowned
> upon by some members of my team? Well no one said anything about
> not using Java serialization. Why couldn't I serialize the
> same data that I currently keep in session scope? I've already
> implemented a solution for streaming images so creating a temp file
> should not be a problem. Here is what I think I will need:
>
>
> In the action where the data is first retrieved:
>
>
> try {
> final String prefix = "myVehicleLineMap";
> final String suffix = null;
> File file = File.createTempFile(prefix, suffix); FileOutputStream
> fileOutputStream = new FileOutputStream(file); ObjectOutputStream
> objectOutputStream = new ObjectOutputStream(fileOutputStream);
> objectOutputStream.writeObject(myMap); objectOutputStream.flush();
> myForm.setTempFileName(file.getAbsolutePath()); } catch (Exception
> e) {
> System.out.println(this.getClass().getName() + "==>> " +
> e.toString()); }
>
> In the action where the data needs to be re-accessed to prepare the
> page for re-display:
>
>
> try {
>
>
> FileInputStream fileInputStream = new
> FileInputStream(myForm.getTempFileName()); ObjectInputStream
> objectInputStream = new ObjectInputStream(fileInputStream);
> SortedMap myMap = (SortedMap) objectInputStream.readObject(); //
> use myMap as before (when in session scope) } catch (Exception e) {
> System.out.println(this.getClass().getName() + "==>> " +
> e.toString()); }
>
> This is just an idea at this point, so I would welcome any
> feedback. I'm not sure if this will work or if its feasible, but at
> least it may generate some more ideas.
>
>
> - Original Message -
> From: Michael McGrady
> To: Struts Users Mailing List
> Sent: Tuesday, July 06, 2004 11:59 PM
> Subject: Re: some best practices questions
>
>
> Ever thought about creating a new scope managed by your own manager
> from application scope?  That is an approach I have been thinking
> of more and more as of late.
>
> At 08:35 PM 7/6/2004, you wrote:
>> I used hidden select lists to restore user selections since I
>> wasn't "allowed" to place the whole form in session scope. The
>> management/maintenance of user selections was indeed ugly (but
>> its done and works fine). My question has to do with the data
>> retrieved from the db (from which the user makes selections). For
>> example, when the form is initially displayed, I populate a list
>> of vehicle lines (i.e. Focus, Mustang, Freestar, and so on). The
>> user can copy a vehicle line from the source list to the target
>> list. The target list consists of user selections. When the page
>> needs to be re-displayed as a result of some other query, I
>> needed to re-populate the list of vehicle lines (the source
>> list). I felt that re-retrieving the same vehicle lines from the
>> db again was silly (since I got it once I simply put a map in
>> session and use it when needed). When posting the form, the list
>> of label value beans is no longer available in the action, so my
>> options were: (1) either store in hidden lists (concatenating the
>> key with the description) or (2) re-retrieve the vehicle lines
>> from the db or (3) place them in session the first they are
>> retrieved and get them from session scope. I chose the third and
>> wondered about some best practices others have used in similar
>> situations. - Original Message - From: Rick Reumann To:
>> Struts Users Mailing List Sent: Tuesday, July 06, 2004 10:58 PM
>> Subject: Re: some best practices questions
>>
>>
>> Christina Siena wrote:
>>
>>
>>> I recently developed an application with a complex UI. One of
>>> the pages required querying the database based on user
>>> selection and re-displaying the page with the retrieved data
>>> and any previous existing user selections. Four different
>>> fields can trigger a db query resulting in page re-display and
>>> validations can also result in page re-display. Each time the
>>

  1   2   >