Re: Reading Date

2003-02-27 Thread Rick Reumann
On Fri, Feb 28,'03 (11:36 AM GMT+0530), varma wrote: 

> I Declared Timestamp obj in my bean to store the date, it is giving 
> IllegalArugumentException in jsp, when i'm trying to get it from jsp
> using 

It's ok if you have a business object has a Timestamp field, but your
form bean's should be all Strings for display purposes. So before you
populate startDate into your bean you should make sure you
declare startDate as a String and convert the Timstamp version to this
String startDate before you use . 


-- 
Rick

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



Results in multiple pages

2003-02-27 Thread Konstantina Stamopoulou
Hello,
I have the following problem and I'm not sure how I can solve it.
The resultset returned from a query I'm making to the database has many records. What 
I want to do is to display each time 10 of these records in my page.
How can i do this? I have searched the archive but I couldn't find anything similar. 
Any ideas or redirections to places where I could find a solution?

Thank you in advance.




Re: re:combining two form bean in one form

2003-02-27 Thread Samit Goyal
BlankI think that's not possible. you'll have to define an action for calling that 
JSP. and eah action can have only form bean associated to that. and that bean only 
will be available to your JSP. 


so only one bean can be made available to the JSP by struts!

Please correct me if i m wrong!
  - Original Message - 
  From: Richard Raquepo 
  To: Chetan Sahasrabudhe 
  Cc: Struts Users Mailing List 
  Sent: Friday, February 28, 2003 12:51 PM
  Subject: Re: re:combining two form bean in one form


  well what im trying to ask is this:

  assuming i have two form-bean definition in my struts config example namely: 
personInfoForm and contactInfoForm

  what im trying to ask if it's possible for the two to exist in
  one html form. i mean i will be entering the information
  in the two form-bean on one html. and on submit will populate the two bean.

  is that possible?


  - Original Message - 
From: Chetan Sahasrabudhe 
To: [EMAIL PROTECTED] 
Sent: Friday, February 28, 2003 1:51 PM
Subject: re:combining two form bean in one form


How do I include one file in another?

HTML itself offers no way to seamlessly incorporate the content of one file into 
another. 

True dynamic inclusion of one HTML document (even in a different "charset") into 
another is offered by the OBJECT element, but due to shortcomings of browser versions 
in current use, it seems unwise to rely on this yet for essential content. The same 
can be said for IFRAME. 

Two popular ways of including the contents of one file seamlessly into another for 
the WWW are preprocessing and server-side inclusion. A preprocessor converts its 
source into a plain HTML document that you publish on your server. In contrast, 
documents that use server-side inclusion are processed every time the document is 
retrieved from the server. 

Preprocessing techniques include the C preprocessor and other generic text 
manipulation methods, and several HTML-specific processors. There is a nice annotated 
list of HTML preprocessors at . 

Beware of making your "source code" non-portable. Also, the HTML can only be 
validated after preprocessing, so the typical cycle "Edit, Check, Upload" becomes 
"Edit, Preprocess, Check, Upload" (here, "Check" includes whatever steps you use to 
preview your pages: validation, linting, management walk-through etc.; and "upload" 
means whatever you do to finally publish your new pages to the web server). 

A much more powerful and versatile preprocessing technique is to use an SGML 
processor (such as the SP package) to generate your HTML; this can be self-validating. 

Examples of server-side inclusion are Server Side Includes (SSI, supported by 
Apache, NCSA, and other web servers), and Microsoft's Active Server Pages (ASP, 
supported by MS IIS). Processing occurs at the time the documents are actually 
retrieved. A typical inclusion looks like 



However, be sure to consult your own server's documentation, as the details vary 
somewhat between implementations. The whole directive gets replaced by the contents of 
the specified file. 

Using server-side inclusion (a potentially powerful tool) merely as a way to 
insert static files such as standard header/footers has implications for perceived 
access speed and for server load, and is better avoided on heavily loaded servers. If 
you use it in this way, consider making the result cacheable (e.g., via "XBitHack 
full" on Apache; setting properties of the "Response" object in ASP). Details are 
beyond the scope of this FAQ but you may find this useful: 
http://www.mnot.net/cache_docs/

Proper HTML validation of server-side inclusion is only possible after server-side 
processing is done (e.g. by using an on-line validator that retrieves the document 
from the server). 

Another approach is to create a database-backed site, as described in "Philip and 
Alex's Guide to Web Publishing" at . A 
simple change to the database template instantly changes the whole site. 

Finally, note that if the included file contains arbitrary plain text, then some 
provision must be made to convert the characters "&" and "<" (in the plain text file) 
to the entities "&" and "<" (in the HTML document). 

Regards
Chetan
___
|  
| The trouble with being punctual 
|  is that nobody's there to appreciate it.
| 
| 
|___




STRUTS With TORQUE

2003-02-27 Thread Dan Allen
> We are rewriting an entire swing application and we have
> chosen Struts for
> the new web version of the product.  
>  
> For the database handling part, we are planning to use
> Torque.  Does anyone
> have experience working with Struts / Torque or have
> Information especially
> on what can go wrong with this combo?  Torque seems to
> be too good and easy
> to be true!!!
>   
> Any info. would be greatly appreciated!!

There are some great examples in the book Struts Kick Start using
the torque framework.  It does seem to be pretty amazing.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"This is a test of the Emergency Broadcast System.  If this had 
been an actual emergency, do you really think we'd stick around 
to tell you?"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



deploy with ant, best practices

2003-02-27 Thread Dan Allen
I have been studying ant very thoroughly over the past two days, and
I completely understand the file from top to bottom, including how
to reload the application using the  tag imported from
org.apache.catalina.ant.ReloadTask.  However, I am stuck on an
issue.

Assuming that I follow the techniques from the book Struts Kick
Start, I create a development tree such as

${app.home}
/build
/deploy
/object
/src
/lib
/web
/WEB-INF
/META-INF

then the actual target tree (under tomcat/webapps) is the typical

${app.name}.war
${app.name}
/WEB-INF
/WEB-INF/lib
/WEB-INF/classes
/META-INF

Okay, now stay with me here.  Assume that I currently have the
application running under tomcat.  If I build the .war file from the
build/ directory and place it into ${app.home}/deploy, then copy
it to ${app.name}.war under tomcat/webapps, it isn't going to
automatically expand over the current running tree.  It just sits
there until I kick tomcat (restart it) after deleting the running
application directory.

So what I did instead was I made the build/ directory the actual
running application directory so it just copied over the "live"
files directly as they were updated by javac.  Then a simple
"reload" would cause the application to start using the updated
files.

The question on the table is as follows.  How do you get tomcat to
expand an updated .war file over a currently running application
before you reload it?  It seems wrong to have the "live" application
the target of my build process.

The goal here is to update the running application without having to
restart tomcat and without having to use the running application as
the target of the build process.  I want to be able to copy the
updated .war file into the tomcat/webapps folder and have it expand
it over the running application files.  Is this unreasonable to
expect this?  How does everyone else do it.  Surely you are not
restarting tomcat all day.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I am the GOD.the GOD...of house!" 
 -- Leeloo
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: re:combining two form bean in one form

2003-02-27 Thread Chetan Sahasrabudhe
Blankyep on submit u will have both form beans populated now the problem is action
if u have separate action classes defined for these beans then u can call both of them
u gotta define third action and use these beans in them.
by pulling them from request
  - Original Message - 
  From: Richard Raquepo 
  To: Chetan Sahasrabudhe 
  Cc: Struts Users Mailing List 
  Sent: Friday, February 28, 2003 12:51 PM
  Subject: Re: re:combining two form bean in one form


  well what im trying to ask is this:

  assuming i have two form-bean definition in my struts config example namely: 
personInfoForm and contactInfoForm

  what im trying to ask if it's possible for the two to exist in
  one html form. i mean i will be entering the information
  in the two form-bean on one html. and on submit will populate the two bean.

  is that possible?


  - Original Message - 
From: Chetan Sahasrabudhe 
To: [EMAIL PROTECTED] 
Sent: Friday, February 28, 2003 1:51 PM
Subject: re:combining two form bean in one form


How do I include one file in another?

HTML itself offers no way to seamlessly incorporate the content of one file into 
another. 

True dynamic inclusion of one HTML document (even in a different "charset") into 
another is offered by the OBJECT element, but due to shortcomings of browser versions 
in current use, it seems unwise to rely on this yet for essential content. The same 
can be said for IFRAME. 

Two popular ways of including the contents of one file seamlessly into another for 
the WWW are preprocessing and server-side inclusion. A preprocessor converts its 
source into a plain HTML document that you publish on your server. In contrast, 
documents that use server-side inclusion are processed every time the document is 
retrieved from the server. 

Preprocessing techniques include the C preprocessor and other generic text 
manipulation methods, and several HTML-specific processors. There is a nice annotated 
list of HTML preprocessors at . 

Beware of making your "source code" non-portable. Also, the HTML can only be 
validated after preprocessing, so the typical cycle "Edit, Check, Upload" becomes 
"Edit, Preprocess, Check, Upload" (here, "Check" includes whatever steps you use to 
preview your pages: validation, linting, management walk-through etc.; and "upload" 
means whatever you do to finally publish your new pages to the web server). 

A much more powerful and versatile preprocessing technique is to use an SGML 
processor (such as the SP package) to generate your HTML; this can be self-validating. 

Examples of server-side inclusion are Server Side Includes (SSI, supported by 
Apache, NCSA, and other web servers), and Microsoft's Active Server Pages (ASP, 
supported by MS IIS). Processing occurs at the time the documents are actually 
retrieved. A typical inclusion looks like 



However, be sure to consult your own server's documentation, as the details vary 
somewhat between implementations. The whole directive gets replaced by the contents of 
the specified file. 

Using server-side inclusion (a potentially powerful tool) merely as a way to 
insert static files such as standard header/footers has implications for perceived 
access speed and for server load, and is better avoided on heavily loaded servers. If 
you use it in this way, consider making the result cacheable (e.g., via "XBitHack 
full" on Apache; setting properties of the "Response" object in ASP). Details are 
beyond the scope of this FAQ but you may find this useful: 
http://www.mnot.net/cache_docs/

Proper HTML validation of server-side inclusion is only possible after server-side 
processing is done (e.g. by using an on-line validator that retrieves the document 
from the server). 

Another approach is to create a database-backed site, as described in "Philip and 
Alex's Guide to Web Publishing" at . A 
simple change to the database template instantly changes the whole site. 

Finally, note that if the included file contains arbitrary plain text, then some 
provision must be made to convert the characters "&" and "<" (in the plain text file) 
to the entities "&" and "<" (in the HTML document). 

Regards
Chetan
___
|  
| The trouble with being punctual 
|  is that nobody's there to appreciate it.
| 
| 
|___





handling array using jstl or struts

2003-02-27 Thread shashi_struts
Hi
I am working on a form in which some default value must be set over the form.

I have a bean in which a array value 
abc{"OR","AND"}; and his index value { "O","A"}
and a default value "O".

In the form i want to set this in the 
in this form

OR
AND

I tried and getting the result using scriptlets.

this is the code i am using


   
 
 
 "  selected> 
 <%=searchValue.getConditionsValue(index.intValue())%>
 
 
 "  > 
 <%=searchValue.getConditionsValue(index.intValue())%>
 
  
 

Is any way this using pure struts implementation or using jstl

regards

shashi bhushna
 






Re: re:combining two form bean in one form

2003-02-27 Thread Richard Raquepo



well what im trying to ask is this:
 
assuming i have two form-bean definition in my struts config example 
namely: personInfoForm and contactInfoForm
 
what im trying to ask if it's possible for the two to exist in
one html form. i mean i will be entering the information
in the two form-bean on one html. and on submit will populate the 
two bean.
 
is that possible?
 
 
- Original Message - 

  From: 
  Chetan Sahasrabudhe 
  To: [EMAIL PROTECTED] 
  Sent: Friday, February 28, 2003 1:51 
  PM
  Subject: re:combining two form bean in 
  one form
  
  How do I include one file in another?
   
  HTML itself offers no way to seamlessly incorporate the content of one 
  file into another. 
   
  True dynamic inclusion of one HTML document (even in a different 
  "charset") into another is offered by the OBJECT element, but due to 
  shortcomings of browser versions in current use, it seems unwise to rely on 
  this yet for essential content. The same can be said for IFRAME. 
   
  Two popular ways of including the contents of one file seamlessly into 
  another for the WWW are preprocessing and server-side inclusion. A 
  preprocessor converts its source into a plain HTML document that you publish 
  on your server. In contrast, documents that use server-side inclusion are 
  processed every time the document is retrieved from the server. 
   
  Preprocessing techniques include the C preprocessor and other generic 
  text manipulation methods, and several HTML-specific processors. There is a 
  nice annotated list of HTML preprocessors at . 
  
   
  Beware of making your "source code" non-portable. Also, the HTML can only 
  be validated after preprocessing, so the typical cycle "Edit, Check, Upload" 
  becomes "Edit, Preprocess, Check, Upload" (here, "Check" includes whatever 
  steps you use to preview your pages: validation, linting, management 
  walk-through etc.; and "upload" means whatever you do to finally publish your 
  new pages to the web server). 
   
  A much more powerful and versatile preprocessing technique is to use an 
  SGML processor (such as the SP package) to generate your HTML; this can be 
  self-validating. 
   
  Examples of server-side inclusion are Server Side Includes (SSI, 
  supported by Apache, NCSA, and other web servers), and Microsoft's Active 
  Server Pages (ASP, supported by MS IIS). Processing occurs at the time the 
  documents are actually retrieved. A typical inclusion looks like 
   
  
   
  However, be sure to consult your own server's documentation, as the 
  details vary somewhat between implementations. The whole directive gets 
  replaced by the contents of the specified file. 
   
  Using server-side inclusion (a potentially powerful tool) merely as a way 
  to insert static files such as standard header/footers has implications for 
  perceived access speed and for server load, and is better avoided on heavily 
  loaded servers. If you use it in this way, consider making the result 
  cacheable (e.g., via "XBitHack full" on Apache; setting properties of the 
  "Response" object in ASP). Details are beyond the scope of this FAQ but you 
  may find this useful: http://www.mnot.net/cache_docs/
   
  Proper HTML validation of server-side inclusion is only possible after 
  server-side processing is done (e.g. by using an on-line validator that 
  retrieves the document from the server). 
   
  Another approach is to create a database-backed site, as described in 
  "Philip and Alex's Guide to Web Publishing" at . 
  A simple change to the database template instantly changes the whole site. 
  
   
  Finally, note that if the included file contains arbitrary plain text, 
  then some provision must be made to convert the characters "&" and "<" 
  (in the plain text file) to the entities "&" and "<" (in the 
  HTML document). 
   
  RegardsChetan___|  
  | The trouble with being punctual 
  |  is that nobody's there to appreciate 
  it.| | 
  |___
   


Re: Reading Date

2003-02-27 Thread Rick Reumann
On Fri, Feb 28,'03 (11:36 AM GMT+0530), varma wrote: 

> I Declared Timestamp obj in my bean to store the date, it is giving 
> IllegalArugumentException in jsp, when i'm trying to get it from jsp
> using 

It's ok if you have a business object has a Timestamp field, but your
form bean's should be all Strings for display purposes. So before you
populate startDate into your bean you should make sure you
declare startDate as a String and convert the Timstamp version to this
String startDate before you use . 


-- 
Rick

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



RE: indexed property

2003-02-27 Thread Mohan Radhakrishnan
Hi,
 I was just trying to prevent dates being reset in a textbox.

 

   Since my form attributes were all String[] I use

public String getStartDateIndexed( int index ) {
return ( startDate_[ index ] );
}
and then I use

mailto:[EMAIL PROTECTED]
Sent: Friday, February 28, 2003 9:33 AM
To: [EMAIL PROTECTED]
Subject: RE: indexed property


I thought because Struts uses BeanUtils that it would have been able to
figure this out for you byusing




You cant do this:

 

because struts treats whatever is in the value parameter as a literal, and
does not perform a lookup.

Because the TextTag uses RequestUtils.Lookup method to lookup the "property"
which in turn, uses the very nifty BeanUtils from commons to find the value
from our array based form property.

Now, BeanUtils offers us some cool functionality:

http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils
/PropertyUtils.html

"Indexed (name[index]) - The underlying property value is assumed to be an
array, or this JavaBean is assumed to have indexed property getter and
setter methods. The appropriate (zero-relative) entry in the array is
selected. List objects are now also supported for read/write. You simply
need to define a getter that returns the List "

Now, I dont know how this works in practice ;)

Good luck,
Mark


Hi,
   
  Answering my own question :-\

 
 mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 12:02 PM
To: 'Struts Users Mailing List'
Subject: indexed property


Hi,
  Can 

RE: Is struts-config too verbose?

2003-02-27 Thread Jacob Hookom
Mark Wrote:
The problem i see here is, this contact form will always be processed by
the same action servlet, and forwarded to the same forward.  What If I
had several different scenarios that needed to edit/view the contact
data, maybe even Different contact data such as User Contact, Customer
Contact, etc.  So that means that the "save" functionality might be
different, and the next page, the "results" might be different.

Jacob Writes:
You might want to look at WSDL to handle business logic.  Struts acts as
a presentation controller, the things you are describing can be retained
in your business logic layer.  That's not to say that you can't chain
Actions or even look at DispatchActions to complete your specified
tasks.

For me, when handling business logic like this, I go with extremely fine
granularity (no dispatch actions, I think they are bad news and you can
use abstraction and the template method pattern to essentially
accomplish the same thing).

"For every action, there is an equal reaction-- or a few of them in a
chain using the visitor pattern" or something like that.

Going back to your requirements of handling different types of Contacts:

Let's say we have a ContactActionForm object.  I'm assuming the Contact
information will change for each type of Contact.  Then create an
ActionForm for each type that extends ContactActionForm.  For each form,
bind them to a name in your struts-config.  Another possibility is to do
a single "Concrete" or "Flat" ActionForm that has all possible
attributes for every Contact.  Then you can bind that single ActionForm
type under multiple names.  The reason you want to have multiple
bindings, even though they are the same ActionForm is so you can
leverage the Validator libraries which act on a bind name basis (same
ActionForm, different rules for each bind).

For your Actions, lets say you are wanting to save these Contacts.
Again, just like you did for the ActionForm, create something that is
extensible and leverage the template method pattern so you can outline a
path of logic and have each Contact be handled differently.  Again, bind
each SaveAction to a different name.

I think Struts is extremely flexible, just don't depend on it to handle
your business logic, but only as a presentation/transport layer for your
REAL business objects/services.

-Jacob

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 9:59 PM
To: [EMAIL PROTECTED]
Subject: Is struts-config too verbose?

Looking at struts-config i see an inflexible application skeleton that
makes it hard for me to do somethings, or maybe I dont know how the
Struts way is...Can someone enlighten me please?

I have a Contact form.  I want to be able to reuse this contact form,
which has standard information such as name, address, etc, in several
places in my application.

Looking at how action mappings work and all, the form's action field is
constant.. Therefore, if i have this:





in my jsp:




THen inside my action class I have the code to process the form, and
forward to the "success" forward.

The problem i see here is, this contact form will always be processed by
the same action servlet, and forwarded to the same forward.  What If I
had several different scenarios that needed to edit/view the contact
data, maybe even Different contact data such as User Contact, Customer
Contact, etc.  So that means that the "save" functionality might be
different, and the next page, the "results" might be different.

Im befuddled how to handle this elegantly.  I want to reuse my views.
That should be simple shouldnt it?  I think im missing something.


Thanks in advance.


Regards,
Mark



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


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



Re: Is struts-config too verbose?

2003-02-27 Thread Mark
Ah! Answer a question with a question, I like that ;)

I believe its just a matter of setting up additional forwards.  I'll play around a bit 
with it.

Thanks for the tips,

Mark


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



Re: Reading Date

2003-02-27 Thread Chetan Sahasrabudhe
Varma:

two this, what timestamp r u using ?
if itz java.sql.timestamp please mention this property in ur formbean
declaration in struts-config.xml

  



 


if u do this, jsp parsing will know what type of data is stored and what
class to use to typecase it to and appy toString on the object to get
respective data on the jsp form.

Regards
Chetan
- Original Message -
From: "varma dvk" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 11:36 AM
Subject: Re: Reading Date


>
> I Declared Timestamp obj in my bean to store the date, it is giving
> IllegalArugumentException in jsp, when i'm trying to get it from jsp using
> 
>
> Cheers
> Varma
>
>
>
>
>
>
> >From: Rick Reumann <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Re: Reading Date
> >Date: Thu, 27 Feb 2003 22:55:27 -0500
> >
> >On Fri, Feb 28,'03 (09:20 AM GMT+0530), varma wrote:
> >
> > > Hi All
> > >How can i read a date from the jsp using struts, i defined date
> > >variable
> > > of type timestamp. it is throwing exception...
> >
> >What do you mean "read a date from the jsp" and what exception is it
> >throwing? Are you getting an error just trying to declare your date in
> >the page?
> >
> >
> >--
> >Rick
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> _
> Hutch MSN Cricketer- ball by ball action - Download Now!
> http://server1.msn.co.in/msnspecials/cricketdownload/contest.asp
>
>
> -
> 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: one more prepopulate question

2003-02-27 Thread Rick Reumann
On Wed, Feb 26,'03 (06:51 PM GMT-0600), Dan wrote: 

> I know that the prepopulate question has been beaten into the ground
> around here and the answer on the FAQ page is complete in answering
> most questions I have about the concept.  But I just want to run
> something by this list, see if I am going about it in the right way.
> 
> When you are designing an application, and the index page has
> several mini-forms (such as a limited search, a login and maybe a
> site index) the first page has to be a *.do page.  So I figured,
> make an index.jsp page with
> 
> 
> 
> Then my /index action would prepare the forms and display /home.jsp.
> The FAQ talks about putting the form population in the Action class
> for the /index action, which works great...
> 
> ...except, how would you populate more than one form?  Seems like in
> the cast you limit yourself to the form defined in the action
> mapping.  Would it be necessary to just set up an action chain?

I'm curious how you would accomplish this as well.

-- 
Rick

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



Re: Reading Date

2003-02-27 Thread varma dvk
   I Declared Timestamp obj in my bean to store the date, it is giving 
IllegalArugumentException in jsp, when i'm trying to get it from jsp using 


Cheers
Varma





From: Rick Reumann <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Re: Reading Date
Date: Thu, 27 Feb 2003 22:55:27 -0500
On Fri, Feb 28,'03 (09:20 AM GMT+0530), varma wrote:

> Hi All
>How can i read a date from the jsp using struts, i defined date
>variable
> of type timestamp. it is throwing exception...
What do you mean "read a date from the jsp" and what exception is it
throwing? Are you getting an error just trying to declare your date in
the page?
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Hutch MSN Cricketer- ball by ball action - Download Now! 
http://server1.msn.co.in/msnspecials/cricketdownload/contest.asp

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


1.1rc1 Error: Path index.jsp does not start with a "/" character

2003-02-27 Thread Affan Qureshi
I have been using Struts 1.1b2 and tiles in my application and have defined
forwards like:



where forward paths were JSP pages,  whithout the starting "/" for paths and
it worked ok. But this does not work when I installed Strut 1.1rc1 coz it
gave the exception:

java.lang.IllegalArgumentException: Path index.jsp?selected=1 does not start
with a "/" character

Have I been doing it wrong until now? Is this a TilesRequestProcessor issue?
I had done so, so that I can deploy my app under any context/module etc. and
have no dependency on root path.


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



[update] nested tags...

2003-02-27 Thread Arron Bates
Peoples,

Important changes just committed into CVS for the nested tags.

1) Copyright date in the header license is updated to include 2003!
2) The internal changes to get them dancing with Tomcat 4.1.18 & more.

For those too lazy to get the entire distrib of the next nightly, you can get
just the nested tags from...

http://www.keyboardmonkey.com/downloads/km-nested-v2.03.jar

   ...the ony diff between this and the last jar I posted, is it's more
reliable in using more than one root tag on the same page, using different
root tags within the nesting itself (docco on this to come), and a bug fix for
the two tags which like to play differently (nested:options & nested:link).

If people were just about to raise bugs on my last jar of these tags which
have anything to do with what's just mentioned (multiple root tags, link and
options tags), can you have another run with this jar to see if they go away.

Docco on the additional stuff this rejig of the tags can do is in the works.

For those who care, enjoy.
For those who don't, as you were.

Thanks again.


Arron.


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



changing ApplicationResources.properties runtime

2003-02-27 Thread Arunachalam Jaisankar
Hi All,

I've a column  "lastJDBCError.value" in ApplicationResources.Properties
file.
And I want to change the value of that column in run time, i mean whenever I
get an SQL Exception I want to fill "lastJDBCError.value" with that
Exception.

Is it possible to change run time? If yes, kindly let me know how to do
that.

regards
Jai


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



combining two form bean in one form

2003-02-27 Thread Richard Raquepo
is this possible? to have the inputs of the two beans in one html?

> orig
can i combine two formbean?

i mean i have a PersonalInfoForm bean and ContactInfoForm bean.

can i combine them to in one html? 

how?

thanks in advance...


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



RE: Is struts-config too verbose?

2003-02-27 Thread John Espey
It seems to me that it is less verbose than a non-Struts alternative (and
certainly not as verbose as the original email ;-)

seriously though, action mappings don't really define the usage of a form,
they define the usage of an Action class.  The way you act on that data is
what changes from action mapping to action mapping. You only define the form
once.  so I'm not sure what the complaint is For your "several different
actions" question, take a look at DispatchAction and RelayAction, they
should simplify your Actions for you somewhat.

also, your html:form tag doesn't need to specify the name of the form
either, it will find it via your action specification.

> -Original Message-
> From: Mark [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 10:04 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Is struts-config too verbose?
>
>
> Well, I left out a piece
>
> What I had a problem with was the verbosity of struts-config.xml
>
>
> For every instance of the form, i have to have a seperate, and
> almost otherwise duplicate  mapping.  To me, this is redundant...
>
> *** REPLY SEPARATOR  ***
>
> On 02/27/2003 at 9:59 PM Mark wrote:
>
> >Looking at struts-config i see an inflexible application
> skeleton that makes it hard for me to do somethings, or maybe I
> dont know how the Struts way is...Can someone enlighten me please?
> >
> >I have a Contact form.  I want to be able to reuse this contact
> form, which has standard information such as name, address, etc,
> in several places in my application.
> >
> >Looking at how action mappings work and all, the form's action
> field is constant.. Therefore, if i have this:
> >
> >
> >
> >
> >
> >in my jsp:
> >
> >
> >
> >
> >THen inside my action class I have the code to process the form,
> and forward to the "success" forward.
> >
> >The problem i see here is, this contact form will always be
> processed by the same action servlet, and forwarded to the same
> forward.  What If I had several different scenarios that needed
> to edit/view the contact data, maybe even Different contact data
> such as User Contact, Customer Contact, etc.  So that means that
> the "save" functionality might be different, and the next page,
> the "results" might be different.
> >
> >Im befuddled how to handle this elegantly.  I want to reuse my
> views.  That should be simple shouldnt it?  I think im missing something.
> >
> >
> >Thanks in advance.
> >
> >
> >Regards,
> >Mark
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: combining two form bean in one form

2003-02-27 Thread Richard Raquepo
i'll be having the inputs of the tow formbean in one html?
that's what i need...

- Original Message - 
From: "Chetan Sahasrabudhe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 1:19 PM
Subject: Re: combining two form bean in one form


> write two different jsps for both form bean
> later write third one and include the previous two in that :)
> 
> - Original Message - 
> From: "Richard Raquepo" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, February 28, 2003 10:49 AM
> Subject: combining two form bean in one form
> 
> 
> can i combine two formbean?
> 
> i mean i have a PersonalInfoForm bean and ContactInfoForm bean.
> 
> can i combine them to in one html? 
> 
> how?
> 
> thanks in advance...
> 
> 
> -
> 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: combining two form bean in one form

2003-02-27 Thread Chetan Sahasrabudhe
write two different jsps for both form bean
later write third one and include the previous two in that :)

- Original Message - 
From: "Richard Raquepo" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 10:49 AM
Subject: combining two form bean in one form


can i combine two formbean?

i mean i have a PersonalInfoForm bean and ContactInfoForm bean.

can i combine them to in one html? 

how?

thanks in advance...


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



combining two form bean in one form

2003-02-27 Thread Richard Raquepo
can i combine two formbean?

i mean i have a PersonalInfoForm bean and ContactInfoForm bean.

can i combine them to in one html? 

how?

thanks in advance... 

Re: logic:iterate examples plz.

2003-02-27 Thread shashi_struts
Hi James

You r doing same i has been done in my program.
But the problem if i go for display it will show the one 
---
Pahwa
shashi bhushan
Dua
sunil kumar
--
and it skip the value
'vijay kumar'  from the index 0 of hashtable and index 1 of arraylist

i think u carry my point

plz help me




- Original Message - 
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 9:08 PM
Subject: RE: logic:iterate examples plz.


> Here ya go (except I used LabelValueBean, its virtually the same as your
> 'A'):
> 
> 
> 
> <[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java" %>
> <[EMAIL PROTECTED] import="org.apache.struts.util.LabelValueBean"%>
> <[EMAIL PROTECTED] import="org.apache.struts.taglib.html.Constants"%>
> <[EMAIL PROTECTED] import="java.util.Hashtable"%>
> <[EMAIL PROTECTED] import="java.util.ArrayList"%>
> <[EMAIL PROTECTED] import="testing.SimpleBeanForTesting"%>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> 
> 
> 
>   My Test Page
> 
> 
> 
> <%
> Hashtable artists=new Hashtable();
> ArrayList titles=new ArrayList();
> String cast="Pahwa";
> titles.add(new LabelValueBean("shashi","bhushan"));
> titles.add(new LabelValueBean("vijay","kumar"));
> artists.put(cast,titles);
> cast="Dua";
> titles=new ArrayList();
> titles.add(new LabelValueBean("sunil","kumar"));
> artists.put(cast,titles);
> pageContext.setAttribute("artists",artists);
> %>
> 
> 
>Artist: 
>
>  
>  
>  
>
> 
> 
> 
> 
> 
> 
> --
> James Mitchell
> Web Developer/Struts Evangelist
> http://www.apache.org/struts/
> 
> 
> 
> > -Original Message-
> > From: shashi_struts [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, February 27, 2003 10:17 AM
> > To: Struts Users Mailing List
> > Subject: Re: logic:iterate examples plz.
> > 
> > 
> > hi Gamor
> > Thanks for reply.
> > 
> > This code not solve my problem
> > i am sending my code .plz help me
> > Hashtable artists=new Hashtable();
> > ArrayList titles=new ArrayList();
> > String cast="Pahwa";
> > titles.add(new A("shashi","bhushan"));
> > titles.add(new A("vijay","kumar"));
> > artists.put(cast,titles);
> > cast="Dua";
> > titles=new ArrayList();
> > titles.add(new A("sunil","kumar"));
> > artists.put(cast,titles);
> > pageContext.setAttribute("artists",artists);
> > and
> > i has been used this one for show the records
> > 
> > 
> >  Artist: 
> >
> >  
> > 
> > 
> >
> > 
> > 
> > plz. help me
> > 
> > 
> > - Original Message -
> > From: "Gemes Tibor" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 27, 2003 7:26 PM
> > Subject: Re: logic:iterate examples plz.
> > 
> > 
> > > shashi_struts wrote:
> > >
> > > >HI
> > > >I am working on the concept in which i stored string as 
> > key and arraylist
> > as value in the hashtable.The arraylist stores a class name A 
> > which have two
> > parameter name and value
> > > >
> > > >
> > > >I tried too much but not succeed to print the value in 
> > key,value  in
> > wirte manner.
> > > >
> > > >
> > > >
> > >
> > > http://jakarta.apache.org/struts/userGuide/struts-logic.html#iterate
> > >
> > > |
> > > 
> > > 
> > >
> > > ||
> > > ||
> > >
> > > Hth,
> > >
> > > Tib
> > > |
> > >
> > >
> > >
> > > 
> > -
> > > 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]



one more prepopulate question

2003-02-27 Thread Dan Allen
I know that the prepopulate question has been beaten into the ground
around here and the answer on the FAQ page is complete in answering
most questions I have about the concept.  But I just want to run
something by this list, see if I am going about it in the right way.

When you are designing an application, and the index page has
several mini-forms (such as a limited search, a login and maybe a
site index) the first page has to be a *.do page.  So I figured,
make an index.jsp page with



Then my /index action would prepare the forms and display /home.jsp.
The FAQ talks about putting the form population in the Action class
for the /index action, which works great...

...except, how would you populate more than one form?  Seems like in
the cast you limit yourself to the form defined in the action
mapping.  Would it be necessary to just set up an action chain?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Real programmers just hate to get up in the morning, and 
contrary to Ordinary People, they're in better shape as 
it gets closer to nighttime.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



STRUTS with TORQUE

2003-02-27 Thread Petrus, Christian (CORP, GEITC)
  Hello All,

Thanks for all the help in this list.   
 
We are rewriting an entire swing application and we have chosen Struts for
the new web version of the product.  
 
For the database handling part, we are planning to use Torque.  Does anyone
have experience working with Struts / Torque or have Information especially
on what can go wrong with this combo?  Torque seems to be too good and easy
to be true!!!
 
Any info. would be greatly appreciated!!
 
Thanks in advance,
Christian
 



"THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE
ADDRESSEE and may contain confidential and privileged information.
If the reader of this message is not the intended recipient,
you are notified that any dissemination, distribution or copy of this 
communication is strictly Prohibited. 
If you have received this message by error, please notify us 
immediately, return the original mail to the sender and delete the 
message from your system."



Re: Session Problems

2003-02-27 Thread ashokd
Hi,

Write another get/set method is PersonForm() which returns/sets ArrayList.
This method will return addresses ArrayList.
By using getNewMethod(), get the ArrayList and Add to this.
I think you no need to setNewMethod() once again. because it will pass by
reference.
Even though you check once.

If it is not updating setNewMethod() with modified ArrayList.

private ArrayList mMyList = new ArrayList();

 public Object[] getMyList() {
   return mMyList .toArray();
 }
 public ArrayList getNewList() {
  return mMyList ;
 }
 public void setNewList(ArrayList pCList) {
  mMyList =pCList;
 }

Thanks & Regards,
Ashok.D

- Original Message -
From: "Sri Sankaran" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 8:06 AM
Subject: RE: Session Problems


> Is the addAddress() method of your PersonForm simply a cover for the
ArrayList's add method?  In other words, is it simply doing
addresses.add(object-to-add)?
>
> Can you test the size of the list in the getter to see if data is indeed
being clobbered?
>
> Sri
>
> -Original Message-
> From: Jonathan [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 7:20 PM
> To: 'Struts Users Mailing List'
> Subject: RE: Session Problems
>
>
> The form bean is simply a standard action form, when its created It simply
does the following in the constructor
>
> public PersonForm() {
>
> addresses = new ArrayList(20);
> }
>
> To get the addresses and iterate through them I simply have:
>
> /**
>  * Get Addresses
>  */
> public Object[] getAddresses() {
> return (this.addresses.toArray());
> }
>
> When the second form is submitted the following method is called In the
AddAddressAction via the lookup dispatch action:
>
> public ActionForward addAddress(ActionMapping mapping,
>   ActionForm form,
>   HttpServletRequest request,
>HttpServletResponse response)
throws Exception {
>
>
>
> //Check that the token is valid, if it is then reset it
> if(isTokenValid(request)) {
>
> System.out.println("Token is valid, resetting
> the request");
> resetToken(request);
> }
> else {
> System.out.println("Token is invalid");
> }
>
>
> //Get the action form
> PersonForm personForm = (PersonForm)form;
>
> int addressId = (personForm.getNumberOfAddresses() + 1);
>
> System.out.println("New id is " + generatedId);
>
> //Create the question option from the buffered values
> Address address = new Address (generatedId, new String("address"));
>
>
>
>
> //Add the question option to the action form
> personForm.addAddress(address);
>
>
> //Save a token for this request to prevent automatic refreshing
> //from submitting the request again
> System.out.println("Saving the token");
> saveToken(request);
>
> //Now the address has been added return to the add person page
>
> return (mapping.findForward("addPerson"));
> }
>
> The address is added but the next time I try to add an address to old one
Is overwritten..
>
> Jon.
>
>
>
> -Original Message-
> From: Sri Sankaran [mailto:[EMAIL PROTECTED]
> Sent: 27 February 2003 18:54
> To: Struts Users Mailing List
> Subject: RE: Session Problems
>
> Can you summarize the form bean you are using for the first page?  What
are its properties?  How is the Collection maintained?  How is the bean
being created?
>
> Sri
>
> -Original Message-
> From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 12:01 PM
> To: Struts Users Mailing List
> Subject: Session Problems
>
>
> Hi,
>
> I'm curerntly having problems with sessions in Struts.
>
> I have two JSP's both of which point to the same action.
>
> In my first JSP I have a number of basic properties and a list of
addresses as shown below:
>
> *Name:  Bill Blah
> *Age:  23
>
> * Addresses (list)
> 23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
> 13 Glamorgan Street  |  ER34 6TT  | Edit | Delete
>
> The addresses are simply displayed using a logic:iterate tag.
>
> I also supply a link on this page to add an address in a seperate page,
this JSP allows a user to add an address to the list in the first page.
> When the page is submitted it is simply added to in the actionform.
>
> Once I've entered the new address using this second page I'm returned tot
he first page where the new address is shown in the list of addresses. the
problem I have is that when I add a second address it removes the first
address and only the second address is shown here as:
>
> * Addresses (list)
> 13 Glamorgan Street  |  ER34 6TT  | Edit | Delete
>
> instead of
>
> * Addresses (list)
> 23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
> 13 Glamorgan Street  |  ER34 6TT  | Edit | Delete
>
> I'm assuming this is a problem with the session, could somebody please
explain to me why this happening.  I have set the scope to session for both
JSP pages and both JSP pages use the same action form so why is 

Re: Is struts-config too verbose?

2003-02-27 Thread David Graham
How would you like it to work?

David



From: "Mark" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: Is struts-config too verbose?
Date: Thu, 27 Feb 2003 22:04:11 -0600
Well, I left out a piece

What I had a problem with was the verbosity of struts-config.xml

For every instance of the form, i have to have a seperate, and almost 
otherwise duplicate  mapping.  To me, this is redundant...

*** REPLY SEPARATOR  ***

On 02/27/2003 at 9:59 PM Mark wrote:

>Looking at struts-config i see an inflexible application skeleton that 
makes it hard for me to do somethings, or maybe I dont know how the Struts 
way is...Can someone enlighten me please?
>
>I have a Contact form.  I want to be able to reuse this contact form, 
which has standard information such as name, address, etc, in several 
places in my application.
>
>Looking at how action mappings work and all, the form's action field is 
constant.. Therefore, if i have this:
>
>
>
>
>
>in my jsp:
>
>
>
>
>THen inside my action class I have the code to process the form, and 
forward to the "success" forward.
>
>The problem i see here is, this contact form will always be processed by 
the same action servlet, and forwarded to the same forward.  What If I had 
several different scenarios that needed to edit/view the contact data, 
maybe even Different contact data such as User Contact, Customer Contact, 
etc.  So that means that the "save" functionality might be different, and 
the next page, the "results" might be different.
>
>Im befuddled how to handle this elegantly.  I want to reuse my views.  
That should be simple shouldnt it?  I think im missing something.
>
>
>Thanks in advance.
>
>
>Regards,
>Mark
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



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


_
Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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


Re: Is struts-config too verbose?

2003-02-27 Thread ashokd
Hi Mark,

What is your contact.Saved action mapping ?
In forward don't give another action, simply give some jsp page.
If we need pre processing before loading the page then only you give to
another action for forward.

Thanks & Regards,
Ashok.D

- Original Message -
From: "Mark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 9:29 AM
Subject: Is struts-config too verbose?


> Looking at struts-config i see an inflexible application skeleton that
makes it hard for me to do somethings, or maybe I dont know how the Struts
way is...Can someone enlighten me please?
>
> I have a Contact form.  I want to be able to reuse this contact form,
which has standard information such as name, address, etc, in several places
in my application.
>
> Looking at how action mappings work and all, the form's action field is
constant.. Therefore, if i have this:
>
> 
> 
> 
>
> in my jsp:
>
> 
> 
>
> THen inside my action class I have the code to process the form, and
forward to the "success" forward.
>
> The problem i see here is, this contact form will always be processed by
the same action servlet, and forwarded to the same forward.  What If I had
several different scenarios that needed to edit/view the contact data, maybe
even Different contact data such as User Contact, Customer Contact, etc.  So
that means that the "save" functionality might be different, and the next
page, the "results" might be different.
>
> Im befuddled how to handle this elegantly.  I want to reuse my views.
That should be simple shouldnt it?  I think im missing something.
>
>
> Thanks in advance.
>
>
> Regards,
> Mark
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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



Re: Is struts-config too verbose?

2003-02-27 Thread Mark
Well, I left out a piece

What I had a problem with was the verbosity of struts-config.xml


For every instance of the form, i have to have a seperate, and almost otherwise 
duplicate  mapping.  To me, this is redundant...

*** REPLY SEPARATOR  ***

On 02/27/2003 at 9:59 PM Mark wrote:

>Looking at struts-config i see an inflexible application skeleton that makes it hard 
>for me to do somethings, or maybe I dont know how the Struts way is...Can someone 
>enlighten me please?
>
>I have a Contact form.  I want to be able to reuse this contact form, which has 
>standard information such as name, address, etc, in several places in my application.
>
>Looking at how action mappings work and all, the form's action field is constant.. 
>Therefore, if i have this:
>
>
>
>
>
>in my jsp:
>
>
>
>
>THen inside my action class I have the code to process the form, and forward to the 
>"success" forward.
>
>The problem i see here is, this contact form will always be processed by the same 
>action servlet, and forwarded to the same forward.  What If I had several different 
>scenarios that needed to edit/view the contact data, maybe even Different contact 
>data such as User Contact, Customer Contact, etc.  So that means that the "save" 
>functionality might be different, and the next page, the "results" might be different.
>
>Im befuddled how to handle this elegantly.  I want to reuse my views.  That should be 
>simple shouldnt it?  I think im missing something.
>
>
>Thanks in advance.
>
>
>Regards,
>Mark
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




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



Re: Is struts-config too verbose?

2003-02-27 Thread David Graham
There's no rule that says you can only use a form bean with one action.  You 
can define many actions that use the same type of form bean.  Also, you 
don't need to provide the name attribute for the  tag because it 
generates one for you.

David



From: "Mark" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Is struts-config too verbose?
Date: Thu, 27 Feb 2003 21:59:08 -0600
Looking at struts-config i see an inflexible application skeleton that 
makes it hard for me to do somethings, or maybe I dont know how the Struts 
way is...Can someone enlighten me please?

I have a Contact form.  I want to be able to reuse this contact form, which 
has standard information such as name, address, etc, in several places in 
my application.

Looking at how action mappings work and all, the form's action field is 
constant.. Therefore, if i have this:




in my jsp:



THen inside my action class I have the code to process the form, and 
forward to the "success" forward.

The problem i see here is, this contact form will always be processed by 
the same action servlet, and forwarded to the same forward.  What If I had 
several different scenarios that needed to edit/view the contact data, 
maybe even Different contact data such as User Contact, Customer Contact, 
etc.  So that means that the "save" functionality might be different, and 
the next page, the "results" might be different.

Im befuddled how to handle this elegantly.  I want to reuse my views.  That 
should be simple shouldnt it?  I think im missing something.

Thanks in advance.

Regards,
Mark


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


_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


RE: indexed property

2003-02-27 Thread Mark
I thought because Struts uses BeanUtils that it would have been able to figure this 
out for you byusing




You cant do this:



because struts treats whatever is in the value parameter as a literal, and does not 
perform a lookup.

Because the TextTag uses RequestUtils.Lookup method to lookup the "property" which in 
turn, uses the very nifty BeanUtils from commons to find the value from our array 
based form property.

Now, BeanUtils offers us some cool functionality:

http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/PropertyUtils.html

"Indexed (name[index]) - The underlying property value is assumed to be an array, or 
this JavaBean is assumed to have indexed property getter and setter methods. The 
appropriate (zero-relative) entry in the array is selected. List objects are now also 
supported for read/write. You simply need to define a getter that returns the List "

Now, I dont know how this works in practice ;)

Good luck,
Mark


Hi,

  Answering my own question :-\

 
 mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 12:02 PM
To: 'Struts Users Mailing List'
Subject: indexed property


Hi,
  Can 

Re: More Than Form On A JSP

2003-02-27 Thread Mark
I have found that I needed to do this:


  MapActionForm myForm=(MapActionForm)actionForm;
  request.setAttribute("mapForm",myForm);

to get this to work.  I dont know why, but my form loses visibility like yours.  the 
above seemed to rectify the situation.

There is a nify Pager component in Karapan Sapi Struts Generator that works quite well 
with the iterate tag's offset parameter.  I have embedded this into my form just as 
you have done, and it worked good.

Regards,
Mark

At 02:38 PM 2/26/2003 -0800, you wrote:
>I am developing an architecture for the rest of my
>development staff to use on a new J2EE project
>starting next month.
>
>I have the following situation:
>
..

>
>All this allows my developers to reuse this HTML table
>logic on any JSP that has a similar appearance (static
>data at the top and scrollable data at the bottom).
>
>There is a problem however. After the page is
>redisplayed, the top part of the page contains no
>data. All of it has been lost because the form
>associated with it is out of scope (it was scoped to
>the request).
>
>I don't want to scope the forms to the session as they
>will accumulate as the user navigates through the
>application, plus the data in them will be stale if
>the user returns to a JSP they were at a while ago.
>
>Does anyone have any ideas how to solve this?
>



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



Is struts-config too verbose?

2003-02-27 Thread Mark
Looking at struts-config i see an inflexible application skeleton that makes it hard 
for me to do somethings, or maybe I dont know how the Struts way is...Can someone 
enlighten me please?

I have a Contact form.  I want to be able to reuse this contact form, which has 
standard information such as name, address, etc, in several places in my application.

Looking at how action mappings work and all, the form's action field is constant.. 
Therefore, if i have this:





in my jsp:




THen inside my action class I have the code to process the form, and forward to the 
"success" forward.

The problem i see here is, this contact form will always be processed by the same 
action servlet, and forwarded to the same forward.  What If I had several different 
scenarios that needed to edit/view the contact data, maybe even Different contact data 
such as User Contact, Customer Contact, etc.  So that means that the "save" 
functionality might be different, and the next page, the "results" might be different.

Im befuddled how to handle this elegantly.  I want to reuse my views.  That should be 
simple shouldnt it?  I think im missing something.


Thanks in advance.


Regards,
Mark



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



Re: Reading Date

2003-02-27 Thread Rick Reumann
On Fri, Feb 28,'03 (09:20 AM GMT+0530), varma wrote: 

> Hi All
>How can i read a date from the jsp using struts, i defined date
>variable 
> of type timestamp. it is throwing exception...

What do you mean "read a date from the jsp" and what exception is it
throwing? Are you getting an error just trying to declare your date in
the page?


-- 
Rick

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



Reading Date

2003-02-27 Thread varma dvk
Hi All
  How can i read a date from the jsp using struts, i defined date variable 
of type timestamp. it is throwing exception...

thanks
varma
_
Cricket World Cup 2003- News, Views and Match Reports. 
http://server1.msn.co.in/msnspecials/worldcup03/

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


RE: error in my html:select tag

2003-02-27 Thread James Mitchell
No, use a defined bean.


  


">



--
James Mitchell
Web Developer/Struts Evangelist
http://www.microsoft.com/struts/



> -Original Message-
> From: Richard Raquepo [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 10:18 PM
> To: Struts Users Mailing List
> Subject: error in my html:select tag
> 
> 
> i have this code in my jsp
> :53onchange="province(userAccountForm,' name="userAccountForm" property="citycode"/>')">
> 
> but i get this error:
> [ServletException in:/manager/addtm-body.jsp] 
> /manager/addtm-body.jsp:53: expected `>' at ``"'' (for tag 
> `' at line 53).  The XML tag syntax is:  attr1='value1'>'
> 
> can't i combine a bean:write in a html:select tag?
> 
> thanks
> 
> 
> 


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



Re: error in my html:select tag

2003-02-27 Thread David Graham
You can't use a custom tag as the value of another tag's attribute.

David



From: "Richard Raquepo" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: error in my html:select tag
Date: Fri, 28 Feb 2003 11:18:16 +0800
i have this code in my jsp
:53 
  onchange="province(userAccountForm,'')">

but i get this error:
[ServletException in:/manager/addtm-body.jsp] /manager/addtm-body.jsp:53: 
expected `>' at ``"'' (for tag `' at line 53).  The XML tag 
syntax is: '

can't i combine a bean:write in a html:select tag?

thanks




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

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


error in my html:select tag

2003-02-27 Thread Richard Raquepo
i have this code in my jsp
:53 ')">

but i get this error:
[ServletException in:/manager/addtm-body.jsp] /manager/addtm-body.jsp:53: expected `>' 
at ``"'' (for tag `' at line 53).  The XML tag syntax is: '

can't i combine a bean:write in a html:select tag?

thanks




RE: Session Problems

2003-02-27 Thread Sri Sankaran
Is the addAddress() method of your PersonForm simply a cover for the ArrayList's add 
method?  In other words, is it simply doing addresses.add(object-to-add)?

Can you test the size of the list in the getter to see if data is indeed being 
clobbered?

Sri

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 7:20 PM
To: 'Struts Users Mailing List'
Subject: RE: Session Problems


The form bean is simply a standard action form, when its created It simply does the 
following in the constructor

public PersonForm() {

addresses = new ArrayList(20);  
}

To get the addresses and iterate through them I simply have:

/**
 * Get Addresses
 */
public Object[] getAddresses() {
return (this.addresses.toArray()); 
}

When the second form is submitted the following method is called In the 
AddAddressAction via the lookup dispatch action:

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



//Check that the token is valid, if it is then reset it
if(isTokenValid(request)) {

System.out.println("Token is valid, resetting
the request");
resetToken(request);
}   
else {
System.out.println("Token is invalid");
}


//Get the action form
PersonForm personForm = (PersonForm)form;   

int addressId = (personForm.getNumberOfAddresses() + 1);

System.out.println("New id is " + generatedId);

//Create the question option from the buffered values
Address address = new Address (generatedId, new String("address"));




//Add the question option to the action form
personForm.addAddress(address);  


//Save a token for this request to prevent automatic refreshing
//from submitting the request again
System.out.println("Saving the token");
saveToken(request);

 //Now the address has been added return to the add person page

return (mapping.findForward("addPerson"));
}   

The address is added but the next time I try to add an address to old one Is 
overwritten..

Jon.



-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 18:54
To: Struts Users Mailing List
Subject: RE: Session Problems

Can you summarize the form bean you are using for the first page?  What are its 
properties?  How is the Collection maintained?  How is the bean being created?

Sri

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Session Problems


Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of addresses as shown 
below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page, this JSP 
allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned tot he first 
page where the new address is shown in the list of addresses. the problem I have is 
that when I add a second address it removes the first address and only the second 
address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please explain to me 
why this happening.  I have set the scope to session for both JSP pages and both JSP 
pages use the same action form so why is this happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  

RE: do to put onChange on a html:select tag

2003-02-27 Thread Karr, David
You just do it :) .  Look over the Struts User Guide, including the API
pages.  In the "select" tag, you'll see an "onchange" attribute.

> -Original Message-
> From: Richard Raquepo [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 4:54 PM
> To: Struts Users Mailing List
> Subject: do to put onChange on a html:select tag
> 
> how do i put a onChange function in a html:select tag?
> 
> help anyone?
> 
> many thanks in advance...

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



do to put onChange on a html:select tag

2003-02-27 Thread Richard Raquepo
how do i put a onChange function in a html:select tag?

help anyone?

many thanks in advance...

RE: Nested:Checkbox

2003-02-27 Thread Chen, Gin
Thanks Arron.
For whatever reason removing the name did help a bit (but only enough to get
the page to display) I dont know why that was the case since I used the name
attribute before and it worked fine (pre b3 struts). I found the cause of my
other error though. It was a scoping issue. I had the form in request scope
and apparently nested doesnt like that. While I dont like putting things in
session scope when I can help it. I guess I have to go with what works for
now.
-Tim

-Original Message-
From: Arron Bates [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 12:13 AM
To: Struts Users Mailing List
Subject: RE: Nested:Checkbox


nested tags don't like the "name" attribute, becuase they're getting the
bean
from their parent. In the example, the check is working off the product of
the
iterate tag anyway. I'm betting the following is what you're after...

  

  

...(there was also the closing slash in the checkbox tag, as well as the
closing tag, may have been the issue too). The process of making a bean with
the "id" property, and then the child using that, is more or less what the
nested tags do for free.

Hope this gets you working.
Happy nesting...

Arron.


> Nothing obvious jumps out.  However, have you tried the updated nested jar
that Arron made available a few days ago?  See
http://marc.theaimsgroup.com/?l=struts-user&m=104600916205585&w=2.
> 
> Sri
> 
> -Original Message-
> From: Chen, Gin [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 26, 2003 8:11 PM
> To: 'Struts Users Mailing List'
> Subject: Nested:Checkbox
> 
> 1.1b3 Bug?
> I have 
> 
> 
>   
> 
> 
> Where associates is the collection in my formbean with each bean in
something like: //interface only
> 
> AssociateVO
>   private boolean selected;
>   public boolean getSelected();
>   public void setSelected( boolean selected );
> 
> And I keep getting this.
> [ServletException in:/jsps/selectAssociates.jsp] No getter method for
property associates[0].selected of bean assoc' I had it as isSelected but I
thought the error was related to that so I changed it to get.
> 
> Yet when I simply do:
> 
> 
>   
> 
> 
> It works just fine.
> 
> Is something wrong with my nested setup?
> I've used the before in older versions so I don't think thats what it is
but
its getting late and I might be blind. >_<
> 
> -Tim
> 
> -
> 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: Session Problems

2003-02-27 Thread Jonathan
Umm in my constructor in the actionform I have:

public PersonForm() {

address = new Address(20);  
}

-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 18:57
To: 'Struts Users Mailing List'
Subject: RE: Session Problems

When you set your collection, do you use
mycollection.addAll(newcollection)
or collection = newcollection?

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED] 
Sent: February 27, 2003 1:54 PM
To: Struts Users Mailing List
Subject: RE: Session Problems

Can you summarize the form bean you are using for the first page?  What
are
its properties?  How is the Collection maintained?  How is the bean
being
created?

Sri

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Session Problems


Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of
addresses
as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this
JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he
first page where the new address is shown in the list of addresses. the
problem I have is that when I add a second address it removes the first
address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please
explain to me why this happening.  I have set the scope to session for
both
JSP pages and both JSP pages use the same action form so why is this
happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*

-
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: Session Problems

2003-02-27 Thread Jonathan
The form bean is simply a standard action form, when its created
It simply does the following in the constructor

public PersonForm() {

addresses = new ArrayList(20);  
}

To get the addresses and iterate through them I simply have:

/**
 * Get Addresses
 */
public Object[] getAddresses() {
return (this.addresses.toArray()); 
}

When the second form is submitted the following method is called
In the AddAddressAction via the lookup dispatch action:

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



//Check that the token is valid, if it is then reset it
if(isTokenValid(request)) {

System.out.println("Token is valid, resetting
the request");
resetToken(request);
}   
else {
System.out.println("Token is invalid");
}


//Get the action form
PersonForm personForm = (PersonForm)form;   

int addressId = (personForm.getNumberOfAddresses() + 1);

System.out.println("New id is " + generatedId);

//Create the question option from the buffered values
Address address = new Address (generatedId, new
String("address"));




//Add the question option to the action form
personForm.addAddress(address);  


//Save a token for this request to prevent automatic
refreshing
//from submitting the request again
System.out.println("Saving the token");
saveToken(request);

 //Now the address has been added return to the add person page

return (mapping.findForward("addPerson"));
}   

The address is added but the next time I try to add an address to old
one
Is overwritten..

Jon.



-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED] 
Sent: 27 February 2003 18:54
To: Struts Users Mailing List
Subject: RE: Session Problems

Can you summarize the form bean you are using for the first page?  What
are its properties?  How is the Collection maintained?  How is the bean
being created?

Sri

-Original Message-
From: JONATHAN PHILIP HOLLOWAY [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 12:01 PM
To: Struts Users Mailing List
Subject: Session Problems


Hi,

I'm curerntly having problems with sessions in Struts.

I have two JSP's both of which point to the same action.

In my first JSP I have a number of basic properties and a list of
addresses as shown below:

*Name:  Bill Blah
*Age:  23

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

The addresses are simply displayed using a logic:iterate tag.  

I also supply a link on this page to add an address in a seperate page,
this JSP allows a user to add an address to the list in the first page. 
When the page is submitted it is simply added to in the actionform.

Once I've entered the new address using this second page I'm returned
tot he first page where the new address is shown in the list of
addresses. the problem I have is that when I add a second address it
removes the first address and only the second address is shown here as:

* Addresses (list)
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

instead of 

* Addresses (list)
23 Glamorgan Street  |  ER34 5RT  | Edit | Delete
13 Glamorgan Street  |  ER34 6TT  | Edit | Delete

I'm assuming this is a problem with the session, could somebody please
explain to me why this happening.  I have set the scope to session for
both JSP pages and both JSP pages use the same action form so why is
this happening?

Many thanks,
Jon.


*-*
 Jonathan Holloway,   
 Dept. Of Computer Science,   
 Aberystwyth University, 
 Ceredigion,  
 West Wales,  
 SY23 3DV.
  
 07968 902140 
 http://users.aber.ac.uk/jph8 
*-*

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



--

Re: [Q] any ways to know which control was changed in Action class?

2003-02-27 Thread atta ur rehman
A hidden field, maybe as a form proerty, that your javascript would set to
appropriate value before the submit() call.

ATTA



- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 3:11 PM
Subject: [Q] any ways to know which control was changed in Action class?


> Hello,
>
> the JSP has several drop downs, each one has "onchange=submit()"
>
> how I can know which one was changed in my Action class?
>
> tnx
>
> Best Regards.
> Michael.
>
>
> -
> 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: [Q] any ways to know which control was changed in Action class?

2003-02-27 Thread James Mitchell
Set a hidden field that will update your form

...

...
...
">
...
...

--
James Mitchell
Web Developer/Struts Evangelist
http://www.microsoft.com/struts/



> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 6:11 PM
> To: [EMAIL PROTECTED]
> Subject: [Q] any ways to know which control was changed in 
> Action class?
> 
> 
> Hello,
> 
> the JSP has several drop downs, each one has "onchange=submit()"
> 
> how I can know which one was changed in my Action class?
> 
> tnx
> 
> Best Regards.
> Michael.
> 
> 
> -
> 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]



[Q] any ways to know which control was changed in Action class?

2003-02-27 Thread michael . korolyov
Hello,

the JSP has several drop downs, each one has "onchange=submit()"

how I can know which one was changed in my Action class?

tnx

Best Regards.
Michael.


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



Re: struts & Content Management System

2003-02-27 Thread Vic Cekvenich
http://jakarta.apache.org/struts/resources/examples.html
has a link to a portal w/CMS
.V
rajiv ahuja wrote:
Hi

Is there an open source CMS around that works well with struts? I am 
working on a intranet web application (using struts) that allows 
designers to create the content , managers to approve it and  operations 
center to push it live. Is there an open source product which I can 
integrate with struts to get this kind of workflow functionality.

Thanks
Rajiv




_
Cricket World Cup 2003- News, Views and Match Reports. 
http://server1.msn.co.in/msnspecials/worldcup03/


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


RE: A new Struts book ....

2003-02-27 Thread Emmanuel Boudrant
Impressive black suit, this the Struts MIB ;)

 --- Todd Pierce <[EMAIL PROTECTED]> a écrit : > Ya gotta love the covers on those WROX
books. What were they THINKING??
> 
> -Original Message-
> From: Emmanuel Boudrant [mailto:[EMAIL PROTECTED]
> Sent: Friday, 28 February 2003 9:31 AM
> To: [EMAIL PROTECTED]
> Subject: A new Struts book 
> 
> 
> I think you can add a new Struts book in Struts ressources page :
> 
> http://blogs.application-servers.com/blogs/page/eboudrant/20030227
> 
> -emmanuel
> 
> ___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
> Yahoo! Mail : http://fr.mail.yahoo.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]
>  

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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



Re: A new Struts book ....

2003-02-27 Thread Ivan N. Zhidov
Bravo, finally the book I wanted Struts/Velocity/ORB. Everybody is so locked
into JSP they are missing out on other great frameworks.

- Original Message -
From: "Emmanuel Boudrant" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 5:31 PM
Subject: A new Struts book 


I think you can add a new Struts book in Struts ressources page :

http://blogs.application-servers.com/blogs/page/eboudrant/20030227

-emmanuel

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.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]



RE: is Component a reserved word?

2003-02-27 Thread Damm, Gary
I had a similar problem but with a method "getItems()".  My application
is using a tag mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 27, 2003 2:24 PM
To: Struts Users Mailing List
Subject: Re: is Component a reserved word?

On the note of introspection, is there any push to make accomodations 
via Proxy to allow DynaBeans to work with JSTL?  It wouldn't be hard at 
all to add it to BeanUtils.

Object proxyObject = ProxyBeanUtils.createProxyObject(DynaBean, Class);
Collection proxyCollection = 
ProxyBeanUtils.createProxyCollection(Collection, Class);

request.setAttribute("bean", proxyObject);
request.setAttribute("collection", proxyCollection);

Craig R. McClanahan wrote:

>On Thu, 27 Feb 2003, Chen, Gin wrote:
>
>  
>
>>Bug in java's introspector??
>>No way.. java has no bugs. o.O
>>
>>
>>
>
>You *know* the answer to this one!  It's not a bug, it's a feature!
>
>Craig
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>




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


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



RE: A new Struts book ....

2003-02-27 Thread Todd Pierce
Ya gotta love the covers on those WROX books. What were they THINKING??

-Original Message-
From: Emmanuel Boudrant [mailto:[EMAIL PROTECTED]
Sent: Friday, 28 February 2003 9:31 AM
To: [EMAIL PROTECTED]
Subject: A new Struts book 


I think you can add a new Struts book in Struts ressources page :

http://blogs.application-servers.com/blogs/page/eboudrant/20030227

-emmanuel

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.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]



Re: Comparison Tags in STRUTS 1.0.2

2003-02-27 Thread David Graham
The right way to do this is to use the JSTL's empty keyword in an EL 
statement.

...

David



From: "Jana Navaneethan" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: Comparison Tags in STRUTS 1.0.2
Date: Thu, 27 Feb 2003 17:28:57 -0500
Hi,
   I am currently using STRUTS 1.0.2, In my JSP I need to check for null 
and
empty (String and Collection) before I display the values. I know there is 
a
 tag in 1.1 but what about 1.0.2? What is the work around
for this except using scriptlets in JSP? Please let me know the right way 
of
doing this.

Thanks in advance,
Jana.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

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


A new Struts book ....

2003-02-27 Thread Emmanuel Boudrant
I think you can add a new Struts book in Struts ressources page :

http://blogs.application-servers.com/blogs/page/eboudrant/20030227

-emmanuel

___
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

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



Comparison Tags in STRUTS 1.0.2

2003-02-27 Thread Jana Navaneethan
Hi,
   I am currently using STRUTS 1.0.2, In my JSP I need to check for null and
empty (String and Collection) before I display the values. I know there is a
 tag in 1.1 but what about 1.0.2? What is the work around
for this except using scriptlets in JSP? Please let me know the right way of
doing this.

Thanks in advance,
Jana.


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



Re: is Component a reserved word?

2003-02-27 Thread Jacob J. Hookom
On the note of introspection, is there any push to make accomodations 
via Proxy to allow DynaBeans to work with JSTL?  It wouldn't be hard at 
all to add it to BeanUtils.

Object proxyObject = ProxyBeanUtils.createProxyObject(DynaBean, Class);
Collection proxyCollection = 
ProxyBeanUtils.createProxyCollection(Collection, Class);

request.setAttribute("bean", proxyObject);
request.setAttribute("collection", proxyCollection);
Craig R. McClanahan wrote:

On Thu, 27 Feb 2003, Chen, Gin wrote:

 

Bug in java's introspector??
No way.. java has no bugs. o.O
   

You *know* the answer to this one!  It's not a bug, it's a feature!

Craig

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





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


RE: is Component a reserved word?

2003-02-27 Thread Craig R. McClanahan


On Thu, 27 Feb 2003, Chen, Gin wrote:

>
> Bug in java's introspector??
> No way.. java has no bugs. o.O
>

You *know* the answer to this one!  It's not a bug, it's a feature!

Craig

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



idName and

2003-02-27 Thread Jaye Bass
Vitals:
OS = XP
JDK=1.4.1
Struts = 1.1b3
Container = Resin 2.1.6 and Resin 3.0.0 beta
 
The idName attribute based method is not working properly for me. 
 
But first consider the following snippet from my jsp page.
 
 





 
This works absolutely perfectly...no problems...the rendered html looks like
this:

admin

user
 
Exactly what should happen.
 
 
Now when I change the jsp to read like this:
 



 
 
I get a partial set of radio buttons...no other code has changed. The
exception thrown is this:
 
[ServletException in:/WEB-INF/pages/user/add.jsp] No getter method available
for property role for bean under name org.apache.struts.taglib.html.BEAN'
 
Here is the relevant rendered html:
 

admin
[ServletException in:/WEB-INF/pages/user/add.jsp] No getter method available
for property role for bean under name org.apache.struts.taglib.html.BEAN'
 
It bothers me that it is croaking in mid process...I suspect either a bug in
Struts or some sort of incompatibility with Resin.
Any thoughts In the mean time I'll be using the scriptlet.
 
 
 

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

RE: Tiles - Stop from logging

2003-02-27 Thread Rieberger, Dale
Need an example of a commons-logging.properties and log4j.properties files.

-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 11:20 AM
To: 'Struts Users Mailing List'
Subject: RE: Tiles - Stop from logging


Look for a log4j file (probably in xml format)
Follow what is already in there to restrict the tiles class to whatever
output lvl that you need.

If you cant find the log4j file (there should be one) just add one into ur
WEB-INF\classes folder.
(Look at the log4j project for more information)
-Tim

-Original Message-
From: Rieberger, Dale [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:07 PM
To: Struts Users Mailing List
Subject: Tiles - Stop from logging


How can I stop Tiles from getting logged. I am using struts 1.1RC1, I would
like to supress the INFO statements for tiles and validation if possible.

example.

[INFO] TilesPlugin - -Tiles definition factory loaded for module ''.

thanks, dale

-
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: is Component a reserved word?

2003-02-27 Thread Chen, Gin
Bug in java's introspector??
No way.. java has no bugs. o.O

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 4:46 PM
To: Struts Users Mailing List
Subject: Re: is Component a reserved word?




On Thu, 27 Feb 2003, John Thorhauer wrote:

> Date: 27 Feb 2003 16:03:06 -0500
> From: John Thorhauer <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: is Component a reserved word?
>
> OK.  Thanks for the heads up.  I changed my class to Komponent and it
> works fine now.  Man that was a pain in th butt to figure out.  Oh well,
> on to more fun with struts.
>

It's not even the fact that there's a java.awt.Component class that causes
this problem -- it's caused by the way that java.beans.Introspector looks
up BeanInfo classes via the getBeanInfoSearchPath() method.  The net
effect is that using a class named Component is the one and only case
where you have this issue, at least on the Sun JDK.  Do a search for
BeanInfoSearchPath in the archives of COMMONS-DEV or COMMONS-USER for more
discussion if you're interested in the nitty gritty details.

> Thanks for the help,
> John
>

Craig

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

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



Re: is Component a reserved word?

2003-02-27 Thread Craig R. McClanahan


On Thu, 27 Feb 2003, John Thorhauer wrote:

> Date: 27 Feb 2003 16:03:06 -0500
> From: John Thorhauer <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>
> Subject: Re: is Component a reserved word?
>
> OK.  Thanks for the heads up.  I changed my class to Komponent and it
> works fine now.  Man that was a pain in th butt to figure out.  Oh well,
> on to more fun with struts.
>

It's not even the fact that there's a java.awt.Component class that causes
this problem -- it's caused by the way that java.beans.Introspector looks
up BeanInfo classes via the getBeanInfoSearchPath() method.  The net
effect is that using a class named Component is the one and only case
where you have this issue, at least on the Sun JDK.  Do a search for
BeanInfoSearchPath in the archives of COMMONS-DEV or COMMONS-USER for more
discussion if you're interested in the nitty gritty details.

> Thanks for the help,
> John
>

Craig

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



RE: [OT] DBCP Pool Closed connection problem

2003-02-27 Thread Gaurav . Goyal
Thats what i've been thinking. 
after we obtain results in a resultset and before we start iterating through
it, the original connection is somehow getting closed. it could be because
some other user has a reference to the same connection. but i'm not sure how
that can happen. all connections are local variables in action classes (i'll
double check this). i've also synchronized the getConnection method on the
pool.

-Original Message-
From: Phillip Qin [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 3:36 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] DBCP Pool Closed connection problem


Would it be a multi-threading problem, another user moves cursor to next row
of the ResultSet?

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: February 27, 2003 4:29 PM
To: [EMAIL PROTECTED]
Subject: RE: [OT] DBCP Pool Closed connection problem

Thanks for the replies.
How can turn on the validation which checks for a good connection before
returning.
I guess i need to setTestOnBorrow(true). Do I need to do any thing else?

We actually have automated JTest which checks for all closed connections. So
that's what makes me certain that connections are all closed properly.
What i did is that i made only one connection available to the pool. and
when i'm the only user, things work fine even with one available connection.


-Original Message-
From: Miller, Jason [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:57 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] DBCP Pool Closed connection problem


I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> 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] DBCP Pool Closed connection problem

2003-02-27 Thread Phillip Qin
Would it be a multi-threading problem, another user moves cursor to next row
of the ResultSet?

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: February 27, 2003 4:29 PM
To: [EMAIL PROTECTED]
Subject: RE: [OT] DBCP Pool Closed connection problem

Thanks for the replies.
How can turn on the validation which checks for a good connection before
returning.
I guess i need to setTestOnBorrow(true). Do I need to do any thing else?

We actually have automated JTest which checks for all closed connections. So
that's what makes me certain that connections are all closed properly.
What i did is that i made only one connection available to the pool. and
when i'm the only user, things work fine even with one available connection.


-Original Message-
From: Miller, Jason [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:57 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] DBCP Pool Closed connection problem


I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> 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] DBCP Pool Closed connection problem

2003-02-27 Thread Gaurav . Goyal
Thanks for the replies.
How can turn on the validation which checks for a good connection before
returning.
I guess i need to setTestOnBorrow(true). Do I need to do any thing else?

We actually have automated JTest which checks for all closed connections. So
that's what makes me certain that connections are all closed properly.
What i did is that i made only one connection available to the pool. and
when i'm the only user, things work fine even with one available connection.


-Original Message-
From: Miller, Jason [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 2:57 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] DBCP Pool Closed connection problem


I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> 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: Wanted: struts-calendar

2003-02-27 Thread Sundar Narasimhan
HI, David: I've used Lea Smart's java script totallysmartit.com
calendar hacked a bit (wrt. colors, clip rectangles and so forth) and
would recommend it.

Hope that helps.


 

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



RE: Wanted: struts-calendar

2003-02-27 Thread David Bolsover
cool

thnx

> -Original Message-
> From: Raible, Matt [mailto:[EMAIL PROTECTED]
> Sent: 27 February 2003 20:14
> To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
> Subject: RE: Wanted: struts-calendar
> 
> 
> #2 on this page is my favorite:
> 
> http://www.mattkruse.com/javascript/calendarpopup/
> 
> > -Original Message-
> > From: David Bolsover [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, February 27, 2003 1:10 PM
> > To: Struts User
> > Subject: Wanted: struts-calendar
> > 
> > 
> > Does anyone know of a good pop-up style calendar that will 
> > work with struts  > 
> > Ideally I need somthing that will support the notion of locales.
> > 
> > 
> > 
> > db 
> > 
> > -
> > 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: [Q] Form doesn't keep options list ... JSP has no list

2003-02-27 Thread Rick Reumann
On Thu, 27 Feb 2003 15:41:05 -0500
[EMAIL PROTECTED] wrote:

> Hello,
> 
> on JSP I have:
> 
> dropdown selection:
> 
>  styleClass="smallFont" >
> 
> 
> 
> and input field that I need validate in my reportForm  (on server)
> 
> the reportForm has all fields that are filled by Action class.
> and JSP display all just fine.
> 
> but, when I type "wrong" value into input field
> then reportForm validate returns errors
> and then Struts forward it to JSP
> and then I get error - so equipmentList is null - nothing filled it!!!
> 
> how I can resolve my problem?

Look down on the list to the messages just posted about this under..
Revisiting: repopulating lists after validation returns.

There are several ways to do it. Simplest is to just put your collection
into session scope.


-- 
Rick Reumann

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



Re: DynaValidatorActionForm

2003-02-27 Thread Dave Newton
Rick Reumann wrote:
> Sloan Seaman wrote:
>> For my edit page, how do I populate a bean for the edit page to use
>> to populate the fields?  From what I've been reading it seems like I
>> don't ahve to write a form class anymore because of the
>> DynaActionForm stuff, but I'm a bit confused.
> I like to first set up my page by having a mapping submit to a setUp
> Action. Then in this setUp action you could just do:
> DynaActionForm f = (DynaActionForm) form;
> f.set("firstName", "John Doe");
> then you would just forward to the jsp form.

I "solved" this problem quasi-generically (I depend on an ID field
in my beans, at least for now) by writing a CrudDispatchAction that
gets the bean class from a standardized name in the resource bundle
(i.e., the name attribute in the action configuration is the prefix
for the classname and I append a .classname to it to find the
appropriate class).

I've appended my CrudDispatchAction class below (it's very alpha and not
robust, it's a work in progress :) and I'd love to hear any comments on
it regarding style issues, robustification, struts paradigms, whether or
not this is even a good idea, you name it. I'm the only programmer here
so feedback is lacking :(

I left out the doCreate method since I haven't done the general purpose
one yet and I would expect some refactoring to happen (for instance the
Class instantiation stuff will go into a base class because I'm already
planning to subclass this for some other purposes).

Thanks,
Dave Newton

// Here it is
// [...]
public class CrudDispatchAction extends DispatchAction {

/**
 * Logger instance
 */
private Log log = LogFactory.getFactory().getInstance(this.getClass().getName());

/**
 * List collection of items. Assumes that the class name of the
 * database bean is in the resources file.
 */
public ActionForward doList(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
 throws Exception {

ActionForward resultForward = mapping.findForward("errjsp");
log.info("enter");

DBRow rows = getRowObject(mapping, request);
try {
rows.select();
request.setAttribute("rows", rows.getRows());
resultForward = mapping.findForward("listjsp");
} catch (SolarException x) {
throw new ModuleException("global.exception.db");
}

return resultForward;
}

/**
 * Delete an item based on ID
 */
public ActionForward doDelete(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
 throws Exception {
int id = StringUtil.parseInt(request.getParameter("id"));
log.info("entering to delete id=" + id);
DBRow row = getRowObject(mapping, request);
row.deleteById(id);
return mapping.findForward("listact");
}

/**
 * Edit an item based on ID
 */
public ActionForward doEdit(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
 throws Exception {

int id = StringUtil.parseInt(request.getParameter("id"));
log.info("entering to edit id=" + id);

// If GET then populate form and go to editing page
if (request.getMethod().equals("GET")) {
DBRow row = getRowObject(mapping, request);
if (row.selectById(id)) {
PropertyUtils.copyProperties(form, row);
return mapping.findForward(mapping.getInput());
} else {
return mapping.findForward("notfound");
}
}

// We've edited; validate
ActionErrors errs = form.validate(mapping, request);
if ((errs != null) && !errs.isEmpty()) {
saveErrors(request, errs);
return mapping.findForward(mapping.getInput());
}

// We've validated; update
ActionForward ret = mapping.findForward("listact"); // Assume success
try {
DBRow row = getRowObject(mapping, request);
PropertyUtils.copyProperties(row, form);
if (row.updateById(id) == 0) { // it didn't update
errs = new ActionErrors();
errs.add("systemerror", new ActionError("global.system.error")); // 
TODO system error key constant
saveErrors(request, errs);
return mapping.findForward(mapping.getInput());
}
} catch (SolarException sae) {
throw new ModuleException("global.exception.db");
} catch (ModuleException me) {
throw m

RE: [OT] DBCP Pool Closed connection problem

2003-02-27 Thread Phillip Qin
I had similar problem before. I read the first row in the ResultSet and
accidentally put a ; so I was actually at the end of the ResultSet and I was
trying to read from next row. That's exhausted!

Regards,
 
 
PQ
 
"This Guy Thinks He Knows Everything"
"This Guy Thinks He Knows What He Is Doing"

-Original Message-
From: Miller, Jason [mailto:[EMAIL PROTECTED] 
Sent: February 27, 2003 3:57 PM
To: 'Struts Users Mailing List'
Subject: RE: [OT] DBCP Pool Closed connection problem

I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


Commons Version with Struts in WSAD 5

2003-02-27 Thread Tim T. Young

Does anyone know what version of Commons is with Struts 1.1b2 in WSAD 5?
Or what version of Commons Validator was distributed with Struts 1.1b2 in
general?

I read the release notes for 1.1b2 and while they mention using commons
they do not specify versions.

Thanks,
Tim



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



struts, tomcat, and log4j

2003-02-27 Thread Kirby Vandivort
So, I'm running 1.1rc of struts, tomcat 4.1.18, and I just downloaded
log4j 1.2.8.

I have a struts webapp in development, and I currently have all of the
struts-required commons-*.jar files in WEB-INF/lib, and I dropped
log4j-1.2.8.jar there also.

After deployment, at random times, tomcat now hangs on me and won't let
me connect.  The only error of note is in catalina.out and is:

org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException:
org.apache.commons.logging.LogConfigurationException: Class
org.apache.commons.logging.impl.Log4JCategoryLog does not implement Log
  at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:555)
  at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:289)
  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:409)
  at org.apache.tomcat.util.log.CommonLogHandler.log(CommonLogHandler.java:97)
  at org.apache.tomcat.util.log.Log.log(Log.java:198)
  at org.apache.tomcat.util.log.Log.log(Log.java:192)
  at org.apache.tomcat.util.log.Log.log(Log.java:174)
  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
  at java.lang.Thread.run(Thread.java:484) 



So, from digging around, I now have a copy of commons-logging at:

${TOMCAT_HOME}/server/lib

_and_

at 
webapps/myapp/WEB-INF/lib



and, I suspect that the commons-logging stuff that tomcat is using
is seeing log4j that i wanted my struts webapp to use, and problems
are being caused.


What do I need to do to fix this?  I want to keep my struts webapp self
contained and not rely on jar files in tomcat if I can help it.  Can I
do that?

-- 

Kirby Vandivort  Theoretical and Computational Biophysics 
Email: [EMAIL PROTECTED]  3051 Beckman Institute
http://www.ks.uiuc.edu/~kvandivo/University of Illinois
Phone: (217) 244-5711405 N. Mathews Ave
Fax  : (217) 244-6078Urbana, IL  61801, USA

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



RE: STRUTS INTERNATIONALIZATION

2003-02-27 Thread James Mitchell
If I undertand you correctly, that's what PropertyMessageResources does.

For example, say you've got a server in France serving international
users
A request comes in and you code looks calls a resource "my.message"

It will look under the current users locale (say UK), it would
recursively look in:
1. ApplicationResources.properties_en_UK
2. ApplicationResources.properties_en
3. ApplicationResources.properties (Struts 'default')
And then finally the server's 'default' locale
4. ApplicationResources.properties_fr

I would say your best bet is to make #3 your base file and add locale
specific messages as you need them.


--
James Mitchell
Web Developer/Struts Evangelist
http://www.microsoft.com/struts/



> -Original Message-
> From: scarter [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 3:51 PM
> To: [EMAIL PROTECTED]
> Subject: STRUTS INTERNATIONALIZATION
> 
> 
> Is there a way in struts to maintain a default application resources
> file that can be referred to in the event that a requested resource is
> not found in another resource file.  For example, it would be 
> nice if I
> could only define specific resources in each locale specific resource
> file, instead of all of them, which consumes much more memory and more
> importantly, makes the application difficult to maintain.  
> The full set
> of default application resources could be defined in a default
> application resource file that would be called if the resource is not
> present in a locale specific one.  This is especially important where
> two locales are defined, say the US and UK, where very few resource
> differences exist.  If there are only a handful of resource 
> differences
> between these locales, I would not want to have to create an entirely
> new resource file for each one, since there would be quite a few
> redundancies.
> 
> I am aware that we can define separate resource bundles and associate
> each one with a bundle name.  However the problem with this 
> approach is
> that I have to modify all of my struts tags to use statically defined
> bundle names.  Does anyone know of another way I can resolve this
> problem?  
> 
> Thanks,
> 
> Scott Carter
> 
> 
> -
> 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 INTERNATIONALIZATION

2003-02-27 Thread James Childers
>From http://developer.java.sun.com/developer/technicalArticles/Intl/ResourceBundles/

[-- Begin quote --]
The getBundle method provides a graceful degradation algorithm that attempts to find 
the nearest matched bundle in cases where the specified bundle can't be found or 
doesn't exist. In the following search, each element of the search name is separated 
with an '_' (UNDERSCORE) character. The algorithm searches for bundle names in the 
following order: 

++
  +
++
  
+
++
  +
++
  
+


[-- End quote --]

If a key is not found in a specific resource bundle, the next one higher up in the 
hierarchy is searched. The default behavior of ResourceBundle does what you need.

-= J

> -Original Message-
> From: scarter [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 2:51 PM
> To: [EMAIL PROTECTED]
> Subject: STRUTS INTERNATIONALIZATION
> 
> 
> Is there a way in struts to maintain a default application resources
> file that can be referred to in the event that a requested resource is
> not found in another resource file.  For example, it would be 
> nice if I
> could only define specific resources in each locale specific resource
> file, instead of all of them, which consumes much more memory and more
> importantly, makes the application difficult to maintain.  
> The full set
> of default application resources could be defined in a default
> application resource file that would be called if the resource is not
> present in a locale specific one.  This is especially important where
> two locales are defined, say the US and UK, where very few resource
> differences exist.  If there are only a handful of resource 
> differences
> between these locales, I would not want to have to create an entirely
> new resource file for each one, since there would be quite a few
> redundancies.
> 
> I am aware that we can define separate resource bundles and associate
> each one with a bundle name.  However the problem with this 
> approach is
> that I have to modify all of my struts tags to use statically defined
> bundle names.  Does anyone know of another way I can resolve this
> problem?  
> 
> Thanks,
> 
> Scott Carter
> 
> 
> -
> 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: is Component a reserved word?

2003-02-27 Thread John Thorhauer
OK.  Thanks for the heads up.  I changed my class to Komponent and it
works fine now.  Man that was a pain in th butt to figure out.  Oh well,
on to more fun with struts.

Thanks for the help,
John

On Thu, 2003-02-27 at 15:55, Robert McIntosh wrote:
> I've had this same problem in the past, and I agree with your coworker. 
> I had to change a class from '...Component' to something else.
> 
> - Robert
> 
> Derek Richardson wrote:
> 
> >A coworker claims this is a bug in reflection when used to introspect any class 
> >called "Component" - it always thinks it's java.awt.Component. YMMV.
> >
> >  
> >
> >>-Original Message-
> >>From: Chen, Gin [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, February 27, 2003 3:38 PM
> >>To: 'Struts Users Mailing List'
> >>Subject: RE: is Component a reserved word?
> >>
> >>
> >>Will it is in his classpath indirectly it is not in his jsp 
> >>unless he did a
> >>import of it.
> >>So it looks like this is another issue.
> >>Unless there is a component besides java.awt.Component that I 
> >>don't know of.
> >>-Tim
> >>
> >>-Original Message-
> >>From: Andy Kriger [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, February 27, 2003 3:33 PM
> >>To: Struts Users Mailing List
> >>Subject: RE: is Component a reserved word?
> >>
> >>
> >>java.awt.Component is also in your classpath
> >>maybe c:out is trying to cast your object as that instead of
> >>x.y.z.Component?
> >>
> >>-Original Message-
> >>From: John Thorhauer [mailto:[EMAIL PROTECTED]
> >>Sent: Thursday, February 27, 2003 15:18
> >>To: Struts Users Mailing List
> >>Subject: is Component a reserved word?
> >>
> >>
> >>Hi,
> >>
> >>I am not sure if this is a struts, taglib, or jstl issue but I will
> >>start here.  I am using Struts/JSP's and am running into an 
> >>error when I
> >>try and reference my own object called Component.class with 
> >>tag.  I first load my test objects into the session in the 
> >>jsp page like
> >>this:
> >>
> >><%
> >>x.y.z.Component component = new x.y.z.Component();
> >>
> >>x.y.z.Xomponent xomponent = new x.y.z.Xomponent();
> >>
> >>session.setAttribute("comp2",component);
> >>session.setAttribute("xomp2",xomponent);
> >>
> >>%>
> >>
> >>Next I try and view the value of the name like this:
> >>
> >>
> >>
> >>Here is the error I am getting:
> >>
> >>org.apache.jasper.JasperException: An error occurred while evaluating
> >>custom action attribute "value" with value "${comp2.name}": An error
> >>occurred while getting property "name" from an instance of class
> >>x.y.z.Component (java.lang.IllegalArgumentException: object is not an
> >>instance of declaring class)
> >>
> >>I have played around with this a bit and set up a small test
> >>environment.  Here is my application list:
> >>
> >>Tomcat 4.1.18
> >>Struts 1.1 rc1
> >>Java 1.3.1_06-b01
> >>
> >>I have found that I can use the Runtime JSTL core tag like this and it
> >>works fine:
> >>
> >> >>   value="<%=((Component)session.getAttribute("comp2")).getName()%>"/>
> >>
> >>I can also use the  tag like this and it works fine:
> >>
> >>
> >>I have also found that if I take the exact same class and 
> >>simply rename
> >>it to Xomponent instead of Component and keep it in the same x.y.z
> >>package, it works.  So I can then do:
> >>
> >>
> >>Any ideas on this?  I have my very small test beans and jsp page if
> >>someone needs them.
> >>
> >>Thanks,
> >>John
> >>--
> >>
> >>** John Thorhauer
> >>** Web Developer
> >>** Phoenix Color Corp.
> >>** [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]
-- 

** John Thorhauer
** Web Developer
** Phoenix Color Corp.
** [EMAIL PROTECTED]




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



RE: [OT] DBCP Pool Closed connection problem

2003-02-27 Thread Miller, Jason
I had this problem once.  At the time, I was positive everything was closed
correctly, but it turned out at one point, where I was unwrapping the
connection, I had closed it.  This inadvertently caused the pool to be
exhausted.

This occurred before I had a quality check on my connections, so it didn't
replace the closed ones.  Still, check exhaustively before you say you are
positive all closings are correct.

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: [OT] DBCP Pool Closed connection problem
> 
> 
> Hi,
>   I'm using commons DBCP in conjuction with STRUTS.
>   When a lot of users start using  our application, we 
> start getting a
> lot of exceptions related to Connections, like "Exhausted 
> Resultset" or
> "Connection is Closed". The first one happens when we try to 
> retrieve a
> column from a resultset. The second one happens when we try to open a
> connection.
>   Neither of these errors happen in a predictable fashion.
>   Right now we have set the pool max active connections 
> to 50 and the
> number of users testing is about 5.
>   I'm absolutely positive, that all connections, resultsets and
> statements have been closed at the appropriate places by the pool. 
>   Is it a problem with the way I've configured the pool? 
> has anyone
> faced a similar problem before?
> 
> Thanks,
> Gaurav
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


RE: is Component a reserved word?

2003-02-27 Thread Andy Kriger
java.awt.Component would be looked for first (since it is part of the
bootclasspath) - you'd need a way to tell the reflection what class comp2
is. you might have to workaround this with a scriplet instead of the
${comp2.name}

-Original Message-
From: Derek Richardson [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 15:51
To: Struts Users Mailing List
Subject: RE: is Component a reserved word?


A coworker claims this is a bug in reflection when used to introspect any
class called "Component" - it always thinks it's java.awt.Component. YMMV.

> -Original Message-
> From: Chen, Gin [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:38 PM
> To: 'Struts Users Mailing List'
> Subject: RE: is Component a reserved word?
>
>
> Will it is in his classpath indirectly it is not in his jsp
> unless he did a
> import of it.
> So it looks like this is another issue.
> Unless there is a component besides java.awt.Component that I
> don't know of.
> -Tim
>
> -Original Message-
> From: Andy Kriger [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:33 PM
> To: Struts Users Mailing List
> Subject: RE: is Component a reserved word?
>
>
> java.awt.Component is also in your classpath
> maybe c:out is trying to cast your object as that instead of
> x.y.z.Component?
>
> -Original Message-
> From: John Thorhauer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 15:18
> To: Struts Users Mailing List
> Subject: is Component a reserved word?
>
>
> Hi,
>
> I am not sure if this is a struts, taglib, or jstl issue but I will
> start here.  I am using Struts/JSP's and am running into an
> error when I
> try and reference my own object called Component.class with 
> tag.  I first load my test objects into the session in the
> jsp page like
> this:
>
> <%
> x.y.z.Component component = new x.y.z.Component();
>
> x.y.z.Xomponent xomponent = new x.y.z.Xomponent();
>
> session.setAttribute("comp2",component);
> session.setAttribute("xomp2",xomponent);
>
> %>
>
> Next I try and view the value of the name like this:
>
> 
>
> Here is the error I am getting:
>
> org.apache.jasper.JasperException: An error occurred while evaluating
> custom action attribute "value" with value "${comp2.name}": An error
> occurred while getting property "name" from an instance of class
> x.y.z.Component (java.lang.IllegalArgumentException: object is not an
> instance of declaring class)
>
> I have played around with this a bit and set up a small test
> environment.  Here is my application list:
>
> Tomcat 4.1.18
> Struts 1.1 rc1
> Java 1.3.1_06-b01
>
> I have found that I can use the Runtime JSTL core tag like this and it
> works fine:
>
> value="<%=((Component)session.getAttribute("comp2")).getName()%>"/>
>
> I can also use the  tag like this and it works fine:
> 
>
> I have also found that if I take the exact same class and
> simply rename
> it to Xomponent instead of Component and keep it in the same x.y.z
> package, it works.  So I can then do:
> 
>
> Any ideas on this?  I have my very small test beans and jsp page if
> someone needs them.
>
> Thanks,
> John
> --
> 
> ** John Thorhauer
> ** Web Developer
> ** Phoenix Color Corp.
> ** [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: is Component a reserved word?

2003-02-27 Thread Robert McIntosh
I've had this same problem in the past, and I agree with your coworker. 
I had to change a class from '...Component' to something else.

- Robert

Derek Richardson wrote:

A coworker claims this is a bug in reflection when used to introspect any class called "Component" - it always thinks it's java.awt.Component. YMMV.

 

-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 3:38 PM
To: 'Struts Users Mailing List'
Subject: RE: is Component a reserved word?
Will it is in his classpath indirectly it is not in his jsp 
unless he did a
import of it.
So it looks like this is another issue.
Unless there is a component besides java.awt.Component that I 
don't know of.
-Tim

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 3:33 PM
To: Struts Users Mailing List
Subject: RE: is Component a reserved word?
java.awt.Component is also in your classpath
maybe c:out is trying to cast your object as that instead of
x.y.z.Component?
-Original Message-
From: John Thorhauer [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 15:18
To: Struts Users Mailing List
Subject: is Component a reserved word?
Hi,

I am not sure if this is a struts, taglib, or jstl issue but I will
start here.  I am using Struts/JSP's and am running into an 
error when I
try and reference my own object called Component.class with 
tag.  I first load my test objects into the session in the 
jsp page like
this:

<%
x.y.z.Component component = new x.y.z.Component();
x.y.z.Xomponent xomponent = new x.y.z.Xomponent();

session.setAttribute("comp2",component);
session.setAttribute("xomp2",xomponent);
%>

Next I try and view the value of the name like this:



Here is the error I am getting:

org.apache.jasper.JasperException: An error occurred while evaluating
custom action attribute "value" with value "${comp2.name}": An error
occurred while getting property "name" from an instance of class
x.y.z.Component (java.lang.IllegalArgumentException: object is not an
instance of declaring class)
I have played around with this a bit and set up a small test
environment.  Here is my application list:
Tomcat 4.1.18
Struts 1.1 rc1
Java 1.3.1_06-b01
I have found that I can use the Runtime JSTL core tag like this and it
works fine:
"/>
I can also use the  tag like this and it works fine:

I have also found that if I take the exact same class and 
simply rename
it to Xomponent instead of Component and keep it in the same x.y.z
package, it works.  So I can then do:


Any ideas on this?  I have my very small test beans and jsp page if
someone needs them.
Thanks,
John
--

** John Thorhauer
** Web Developer
** Phoenix Color Corp.
** [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: [Q] Revisiting: Repopulating Lists after validation returns false

2003-02-27 Thread Jeff_Mychasiw

We still keep static lists  in various scopes, but all of our pages are pre
populated with back end data so I needed a way to turn that off.

I found that this also helped me when I needed
to add stuff like  a "clear" link that would reload previously saved data.






Rick Reumann <[EMAIL PROTECTED]> on 02/27/2003 02:40:27 PM

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

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

Subject:Re: [Q] Revisiting: Repopulating Lists after validation returns
   false


On Thu, 27 Feb 2003 14:25:51 -0600
[EMAIL PROTECTED] wrote:

>
> I handle this with mulitple mappings to the same loadAction.
> The parameter is used to suppress parts of the load action.

Cool idea Jeff! Thanks. I actually thought about just even using one
mapping and then just checking for any ActionErrors (which there
shouldn't be if you are just coming from a normal set up of the form).
That might even be easier, although I haven't tried it.


--
Rick Reumann

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

2003-02-27 Thread scarter
Is there a way in struts to maintain a default application resources
file that can be referred to in the event that a requested resource is
not found in another resource file.  For example, it would be nice if I
could only define specific resources in each locale specific resource
file, instead of all of them, which consumes much more memory and more
importantly, makes the application difficult to maintain.  The full set
of default application resources could be defined in a default
application resource file that would be called if the resource is not
present in a locale specific one.  This is especially important where
two locales are defined, say the US and UK, where very few resource
differences exist.  If there are only a handful of resource differences
between these locales, I would not want to have to create an entirely
new resource file for each one, since there would be quite a few
redundancies.

I am aware that we can define separate resource bundles and associate
each one with a bundle name.  However the problem with this approach is
that I have to modify all of my struts tags to use statically defined
bundle names.  Does anyone know of another way I can resolve this
problem?  

Thanks,

Scott Carter


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



[OT] DBCP Pool Closed connection problem

2003-02-27 Thread Gaurav . Goyal
Hi,
I'm using commons DBCP in conjuction with STRUTS.
When a lot of users start using  our application, we start getting a
lot of exceptions related to Connections, like "Exhausted Resultset" or
"Connection is Closed". The first one happens when we try to retrieve a
column from a resultset. The second one happens when we try to open a
connection.
Neither of these errors happen in a predictable fashion.
Right now we have set the pool max active connections to 50 and the
number of users testing is about 5.
I'm absolutely positive, that all connections, resultsets and
statements have been closed at the appropriate places by the pool. 
Is it a problem with the way I've configured the pool? has anyone
faced a similar problem before?

Thanks,
Gaurav

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



RE: is Component a reserved word?

2003-02-27 Thread Derek Richardson
A coworker claims this is a bug in reflection when used to introspect any class called 
"Component" - it always thinks it's java.awt.Component. YMMV.

> -Original Message-
> From: Chen, Gin [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:38 PM
> To: 'Struts Users Mailing List'
> Subject: RE: is Component a reserved word?
> 
> 
> Will it is in his classpath indirectly it is not in his jsp 
> unless he did a
> import of it.
> So it looks like this is another issue.
> Unless there is a component besides java.awt.Component that I 
> don't know of.
> -Tim
> 
> -Original Message-
> From: Andy Kriger [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 3:33 PM
> To: Struts Users Mailing List
> Subject: RE: is Component a reserved word?
> 
> 
> java.awt.Component is also in your classpath
> maybe c:out is trying to cast your object as that instead of
> x.y.z.Component?
> 
> -Original Message-
> From: John Thorhauer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 15:18
> To: Struts Users Mailing List
> Subject: is Component a reserved word?
> 
> 
> Hi,
> 
> I am not sure if this is a struts, taglib, or jstl issue but I will
> start here.  I am using Struts/JSP's and am running into an 
> error when I
> try and reference my own object called Component.class with 
> tag.  I first load my test objects into the session in the 
> jsp page like
> this:
> 
> <%
> x.y.z.Component component = new x.y.z.Component();
> 
> x.y.z.Xomponent xomponent = new x.y.z.Xomponent();
> 
> session.setAttribute("comp2",component);
> session.setAttribute("xomp2",xomponent);
> 
> %>
> 
> Next I try and view the value of the name like this:
> 
> 
> 
> Here is the error I am getting:
> 
> org.apache.jasper.JasperException: An error occurred while evaluating
> custom action attribute "value" with value "${comp2.name}": An error
> occurred while getting property "name" from an instance of class
> x.y.z.Component (java.lang.IllegalArgumentException: object is not an
> instance of declaring class)
> 
> I have played around with this a bit and set up a small test
> environment.  Here is my application list:
> 
> Tomcat 4.1.18
> Struts 1.1 rc1
> Java 1.3.1_06-b01
> 
> I have found that I can use the Runtime JSTL core tag like this and it
> works fine:
> 
> value="<%=((Component)session.getAttribute("comp2")).getName()%>"/>
> 
> I can also use the  tag like this and it works fine:
> 
> 
> I have also found that if I take the exact same class and 
> simply rename
> it to Xomponent instead of Component and keep it in the same x.y.z
> package, it works.  So I can then do:
> 
> 
> Any ideas on this?  I have my very small test beans and jsp page if
> someone needs them.
> 
> Thanks,
> John
> --
> 
> ** John Thorhauer
> ** Web Developer
> ** Phoenix Color Corp.
> ** [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: passing parameter between a view and an action with

2003-02-27 Thread alexj
I solve my problem (I've forgot to add the type and name of the ActionForm
on the
edit view page)

--
Alexandre Jaquet
- Original Message -
From: "alexj" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 9:25 PM
Subject: Re: passing parameter between a view and an action with 


> I just change the to url to href="/ibmss/getstudent.do paramId="name"
> paramProperty="name"/> and
>
> I didn't get any error but I'm still having trouble when I will populate a
> form with
> the datas I get from the preceding view.
>
> In fact what I want to do is to when a user select a person in my view
page
> (where I have defined the link) is to pass all the datas to an action
named
> getstudent.
>
> In this action I create a new ActionForm and populate with the datas I
just
> pick from my action. I 've do some System.out.println just to test if my
> datas was taken. But I'm still having trouble when I want to forward
> theses datas to an editstudent view page.
>
> I define in my getstudent action an execute method who do this job :
>
> public ActionForward execute(
>  ActionMapping mapping,
>  ActionForm form,
>  HttpServletRequest request,
>  HttpServletResponse response)
>  throws Exception {
>
> try {
>   form = buildStudent(request.getParameter("name"));
>   if (form == null) {
>  System.out.println ("form nulle");
>}
>   if ("request".equals(mapping.getScope() )) {
>   System.out.println("<<>>");
>   request.setAttribute(mapping.getAttribute(), form);
>}
>   else {
>  System.out.println("<<>>");
>  HttpSession session = request.getSession();
>  session.setAttribute(mapping.getAttribute(), form);  }
> }
>   catch (Exception ex) {
>   }
>   return mapping.findForward("success");
>
> The buildStudent(request.getParameter("name"))
> method build me the a new form with the existing
> datas.
>
> But when I run my editstudent view page have blank field.
>
> My mapping is defined this way :
>
> 
> attribute="studentForm"
>
> input="/form/editstudent.jsp"
>
> name="studentForm"
>
> path="/editstudent"
>
> type="soft.ibmss.struts.action.Action">
>
> 
>
> 
>
> 
>
>
>
> 
> path="/getstudent"
>
> name="studentForm"
>
> scope="request"
>
> validate="false"
>
> type="soft.ibmss.struts.action.GetstudentAction">
>
> 
>
> 
>
> Any idea 
>
> Thank you in advance.
>
> --
> Alexandre Jaquet
>
> - Original Message -
> From: "alexj" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, February 27, 2003 8:03 PM
> Subject: passing parameter between a view and an action with 
>
>
> > Hi,
> >
> > I'm been looking how can I passe a parameter between a view to an action
> > using
> >
> > the  >
> >
> >
> >  > href="/ibmss/getstudent.do?name=" paramId="name" paramProperty="name"/>
> >
> > Thanks for your help.
> >
> > <--
> > Alexandre Jaquet
> > ->
> >
> >
> >
> > -
> > 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: [Q] Revisiting: Repopulating Lists after validation returnsfalse

2003-02-27 Thread Rick Reumann
On Thu, 27 Feb 2003 14:25:51 -0600
[EMAIL PROTECTED] wrote:

> 
> I handle this with mulitple mappings to the same loadAction.
> The parameter is used to suppress parts of the load action.

Cool idea Jeff! Thanks. I actually thought about just even using one
mapping and then just checking for any ActionErrors (which there
shouldn't be if you are just coming from a normal set up of the form).
That might even be easier, although I haven't tried it.

 
-- 
Rick Reumann

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



RE: is Component a reserved word?

2003-02-27 Thread Chen, Gin
Will it is in his classpath indirectly it is not in his jsp unless he did a
import of it.
So it looks like this is another issue.
Unless there is a component besides java.awt.Component that I don't know of.
-Tim

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 3:33 PM
To: Struts Users Mailing List
Subject: RE: is Component a reserved word?


java.awt.Component is also in your classpath
maybe c:out is trying to cast your object as that instead of
x.y.z.Component?

-Original Message-
From: John Thorhauer [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 15:18
To: Struts Users Mailing List
Subject: is Component a reserved word?


Hi,

I am not sure if this is a struts, taglib, or jstl issue but I will
start here.  I am using Struts/JSP's and am running into an error when I
try and reference my own object called Component.class with 
tag.  I first load my test objects into the session in the jsp page like
this:

<%
x.y.z.Component component = new x.y.z.Component();

x.y.z.Xomponent xomponent = new x.y.z.Xomponent();

session.setAttribute("comp2",component);
session.setAttribute("xomp2",xomponent);

%>

Next I try and view the value of the name like this:



Here is the error I am getting:

org.apache.jasper.JasperException: An error occurred while evaluating
custom action attribute "value" with value "${comp2.name}": An error
occurred while getting property "name" from an instance of class
x.y.z.Component (java.lang.IllegalArgumentException: object is not an
instance of declaring class)

I have played around with this a bit and set up a small test
environment.  Here is my application list:

Tomcat 4.1.18
Struts 1.1 rc1
Java 1.3.1_06-b01

I have found that I can use the Runtime JSTL core tag like this and it
works fine:

"/>

I can also use the  tag like this and it works fine:


I have also found that if I take the exact same class and simply rename
it to Xomponent instead of Component and keep it in the same x.y.z
package, it works.  So I can then do:


Any ideas on this?  I have my very small test beans and jsp page if
someone needs them.

Thanks,
John
--

** John Thorhauer
** Web Developer
** Phoenix Color Corp.
** [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]



[Q] Form doesn't keep options list ... JSP has no list

2003-02-27 Thread michael . korolyov
Hello,

on JSP I have:

dropdown selection:





and input field that I need validate in my reportForm  (on server)

the reportForm has all fields that are filled by Action class.
and JSP display all just fine.

but, when I type "wrong" value into input field
then reportForm validate returns errors
and then Struts forward it to JSP
and then I get error - so equipmentList is null - nothing filled it!!!

how I can resolve my problem?

tnx

Best Regards.
Michael.


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



RE: [Q] Revisiting: Repopulating Lists after validation returns false

2003-02-27 Thread Kris Schneider
I suppose you could keep the collection as a property of the form bean and
"serialize" it as a set of hidden inputs.

Quoting James Mitchell <[EMAIL PROTECTED]>:

> In most cases I've used, putting them in application scope works great.
> I know that won't work for a list setup by what role someone might have
> or other such case, in those cases I would use session scope (but I
> don't see that much with what I do).
> 
> 
> --
> James Mitchell
> Web Developer/Struts Evangelist
> http://www.apache.org/struts/
> 
> 
> 
> > -Original Message-
> > From: Rick Reumann [mailto:[EMAIL PROTECTED] 
> > Sent: Thursday, February 27, 2003 3:07 PM
> > To: Struts Users Mailing List
> > Cc: Robert Taylor
> > Subject: [Q] Revisiting: Repopulating Lists after validation 
> > returns false
> > 
> > 
> > A while back there was a good discussion going about the best practice
> > for repopulating lists that a JSP form needs after validation returns
> > false and you need to be returned to the initial JSP form.
> > 
> > The problem of course is if you have an options collection that is not
> > in session or application scope, you some how need to have this
> > collection repopulated.
> > 
> > Popular belief seems to be to not do this in the reset method of an
> > ActionForm (or any of it's sub classes). 
> > 
> > I really liked Robert Taylor's solution of setting the input attribute
> > in your config file to be that of the action that sets up 
> > your form, so
> > that if validation fails you form collections are reset.
> > 
> > The problem, though, I'm running into with that approach is 
> > that what if
> > your setUp action also is used to set fields in the 
> > ActionForm? You will
> > end up reseting anything the user submitted for those fields.
> > 
> > Is there a good work around to this problem? or other suggestions of
> > where/when to repopulate lists after validation?
> > 
> > 
> > -- 
> > Rick Reumann
> > 
> > -
> > 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]
> 


-- 
Kris Schneider 
D.O.Tech   

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



Re: [Q] Revisiting: Repopulating Lists after validation returnsfalse

2003-02-27 Thread Rick Reumann
On Thu, 27 Feb 2003 15:12:37 -0500
"James Mitchell" <[EMAIL PROTECTED]> wrote:

> In most cases I've used, putting them in application scope works
> great. I know that won't work for a list setup by what role someone
> might have or other such case, in those cases I would use session
> scope (but I don't see that much with what I do).
> 

Yes, I'm thinking now after looking at all of the alternatives that
session scope will have to do ( the List is based on role so app scope
won't work). I was trying to avoid using Session scope since the List is
really only needed on one form and I didn't feel like taking care of
removing it. But now that I think about it it would be very easy to
remove the list from the Session once they get to the appropriate
Action. I guess the simplest solution is often the best:)


-- 
Rick Reumann

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



Re: [Q] Revisiting: Repopulating Lists after validation returns false

2003-02-27 Thread Jeff_Mychasiw

I handle this with mulitple mappings to the same loadAction.
The parameter is used to suppress parts of the load action.

/crApplicationLoad.do
and
/crApplicationLoadOnError.do

ie:
Two possible load mappings:


 
  

   
 
  

Perform validation on a save
 
 
  


>From the load action:
 //** Get Invoice List **
//Do not use the list if returned on error
if(!(param.equals(PARAM_ON_ERROR))){
 // get back end data for the page.
appForm.setInvoiceWebList();
}else{
   if(log.isDebugEnabled()) log.debug("Did not load list because of validation 
error: ");
}
//**


I have not tried it but it seems as thought this type of thing might be easier with a 
DynaAction..

hope this helps.




Rick Reumann <[EMAIL PROTECTED]> on 02/27/2003 02:06:35 PM

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

To:Struts Users Mailing List <[EMAIL PROTECTED]>
cc:"Robert Taylor" <[EMAIL PROTECTED]>

Subject:[Q] Revisiting: Repopulating Lists after validation returns
   false


A while back there was a good discussion going about the best practice
for repopulating lists that a JSP form needs after validation returns
false and you need to be returned to the initial JSP form.

The problem of course is if you have an options collection that is not
in session or application scope, you some how need to have this
collection repopulated.

Popular belief seems to be to not do this in the reset method of an
ActionForm (or any of it's sub classes).

I really liked Robert Taylor's solution of setting the input attribute
in your config file to be that of the action that sets up your form, so
that if validation fails you form collections are reset.

The problem, though, I'm running into with that approach is that what if
your setUp action also is used to set fields in the ActionForm? You will
end up reseting anything the user submitted for those fields.

Is there a good work around to this problem? or other suggestions of
where/when to repopulate lists after validation?


--
Rick Reumann

-
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: is Component a reserved word?

2003-02-27 Thread Andy Kriger
java.awt.Component is also in your classpath
maybe c:out is trying to cast your object as that instead of
x.y.z.Component?

-Original Message-
From: John Thorhauer [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 27, 2003 15:18
To: Struts Users Mailing List
Subject: is Component a reserved word?


Hi,

I am not sure if this is a struts, taglib, or jstl issue but I will
start here.  I am using Struts/JSP's and am running into an error when I
try and reference my own object called Component.class with 
tag.  I first load my test objects into the session in the jsp page like
this:

<%
x.y.z.Component component = new x.y.z.Component();

x.y.z.Xomponent xomponent = new x.y.z.Xomponent();

session.setAttribute("comp2",component);
session.setAttribute("xomp2",xomponent);

%>

Next I try and view the value of the name like this:



Here is the error I am getting:

org.apache.jasper.JasperException: An error occurred while evaluating
custom action attribute "value" with value "${comp2.name}": An error
occurred while getting property "name" from an instance of class
x.y.z.Component (java.lang.IllegalArgumentException: object is not an
instance of declaring class)

I have played around with this a bit and set up a small test
environment.  Here is my application list:

Tomcat 4.1.18
Struts 1.1 rc1
Java 1.3.1_06-b01

I have found that I can use the Runtime JSTL core tag like this and it
works fine:

"/>

I can also use the  tag like this and it works fine:


I have also found that if I take the exact same class and simply rename
it to Xomponent instead of Component and keep it in the same x.y.z
package, it works.  So I can then do:


Any ideas on this?  I have my very small test beans and jsp page if
someone needs them.

Thanks,
John
--

** John Thorhauer
** Web Developer
** Phoenix Color Corp.
** [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: passing parameter between a view and an action with

2003-02-27 Thread alexj
I just change the to url to href="/ibmss/getstudent.do paramId="name"
paramProperty="name"/> and

I didn't get any error but I'm still having trouble when I will populate a
form with
the datas I get from the preceding view.

In fact what I want to do is to when a user select a person in my view page
(where I have defined the link) is to pass all the datas to an action named
getstudent.

In this action I create a new ActionForm and populate with the datas I just
pick from my action. I 've do some System.out.println just to test if my
datas was taken. But I'm still having trouble when I want to forward
theses datas to an editstudent view page.

I define in my getstudent action an execute method who do this job :

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

try {
  form = buildStudent(request.getParameter("name"));
  if (form == null) {
 System.out.println ("form nulle");
   }
  if ("request".equals(mapping.getScope() )) {
  System.out.println("<<>>");
  request.setAttribute(mapping.getAttribute(), form);
   }
  else {
 System.out.println("<<>>");
 HttpSession session = request.getSession();
 session.setAttribute(mapping.getAttribute(), form);  }
}
  catch (Exception ex) {
  }
  return mapping.findForward("success");

The buildStudent(request.getParameter("name"))
method build me the a new form with the existing
datas.

But when I run my editstudent view page have blank field.

My mapping is defined this way :

















Any idea 

Thank you in advance.

--
Alexandre Jaquet

- Original Message -
From: "alexj" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, February 27, 2003 8:03 PM
Subject: passing parameter between a view and an action with 


> Hi,
>
> I'm been looking how can I passe a parameter between a view to an action
> using
>
> the 
>
>
>  href="/ibmss/getstudent.do?name=" paramId="name" paramProperty="name"/>
>
> Thanks for your help.
>
> <--
> Alexandre Jaquet
> ->
>
>
>
> -
> 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]



is Component a reserved word?

2003-02-27 Thread John Thorhauer
Hi,

I am not sure if this is a struts, taglib, or jstl issue but I will
start here.  I am using Struts/JSP's and am running into an error when I
try and reference my own object called Component.class with 
tag.  I first load my test objects into the session in the jsp page like
this:

<%
x.y.z.Component component = new x.y.z.Component();

x.y.z.Xomponent xomponent = new x.y.z.Xomponent();

session.setAttribute("comp2",component);
session.setAttribute("xomp2",xomponent);

%>

Next I try and view the value of the name like this:



Here is the error I am getting:

org.apache.jasper.JasperException: An error occurred while evaluating
custom action attribute "value" with value "${comp2.name}": An error
occurred while getting property "name" from an instance of class
x.y.z.Component (java.lang.IllegalArgumentException: object is not an
instance of declaring class)

I have played around with this a bit and set up a small test
environment.  Here is my application list:

Tomcat 4.1.18
Struts 1.1 rc1
Java 1.3.1_06-b01

I have found that I can use the Runtime JSTL core tag like this and it
works fine:

"/>

I can also use the  tag like this and it works fine:


I have also found that if I take the exact same class and simply rename
it to Xomponent instead of Component and keep it in the same x.y.z
package, it works.  So I can then do:


Any ideas on this?  I have my very small test beans and jsp page if
someone needs them.

Thanks,
John
-- 

** John Thorhauer
** Web Developer
** Phoenix Color Corp.
** [EMAIL PROTECTED]




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



RE: Wanted: struts-calendar

2003-02-27 Thread Raible, Matt
#2 on this page is my favorite:

http://www.mattkruse.com/javascript/calendarpopup/

> -Original Message-
> From: David Bolsover [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 27, 2003 1:10 PM
> To: Struts User
> Subject: Wanted: struts-calendar
> 
> 
> Does anyone know of a good pop-up style calendar that will 
> work with struts  
> Ideally I need somthing that will support the notion of locales.
> 
> 
> 
> db 
> 
> -
> 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: [Q] Revisiting: Repopulating Lists after validation returns false

2003-02-27 Thread James Mitchell
In most cases I've used, putting them in application scope works great.
I know that won't work for a list setup by what role someone might have
or other such case, in those cases I would use session scope (but I
don't see that much with what I do).


--
James Mitchell
Web Developer/Struts Evangelist
http://www.apache.org/struts/



> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 27, 2003 3:07 PM
> To: Struts Users Mailing List
> Cc: Robert Taylor
> Subject: [Q] Revisiting: Repopulating Lists after validation 
> returns false
> 
> 
> A while back there was a good discussion going about the best practice
> for repopulating lists that a JSP form needs after validation returns
> false and you need to be returned to the initial JSP form.
> 
> The problem of course is if you have an options collection that is not
> in session or application scope, you some how need to have this
> collection repopulated.
> 
> Popular belief seems to be to not do this in the reset method of an
> ActionForm (or any of it's sub classes). 
> 
> I really liked Robert Taylor's solution of setting the input attribute
> in your config file to be that of the action that sets up 
> your form, so
> that if validation fails you form collections are reset.
> 
> The problem, though, I'm running into with that approach is 
> that what if
> your setUp action also is used to set fields in the 
> ActionForm? You will
> end up reseting anything the user submitted for those fields.
> 
> Is there a good work around to this problem? or other suggestions of
> where/when to repopulate lists after validation?
> 
> 
> -- 
> Rick Reumann
> 
> -
> 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]



Wanted: struts-calendar

2003-02-27 Thread David Bolsover
Does anyone know of a good pop-up style calendar that will work with struts 

[Q] Revisiting: Repopulating Lists after validation returns false

2003-02-27 Thread Rick Reumann
A while back there was a good discussion going about the best practice
for repopulating lists that a JSP form needs after validation returns
false and you need to be returned to the initial JSP form.

The problem of course is if you have an options collection that is not
in session or application scope, you some how need to have this
collection repopulated.

Popular belief seems to be to not do this in the reset method of an
ActionForm (or any of it's sub classes). 

I really liked Robert Taylor's solution of setting the input attribute
in your config file to be that of the action that sets up your form, so
that if validation fails you form collections are reset.

The problem, though, I'm running into with that approach is that what if
your setUp action also is used to set fields in the ActionForm? You will
end up reseting anything the user submitted for those fields.

Is there a good work around to this problem? or other suggestions of
where/when to repopulate lists after validation?


-- 
Rick Reumann

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



RE: [Q] can I use ArrayList type for property ?

2003-02-27 Thread michael . korolyov
ArrayList doesn't work for me...

when I changed it back to String[] just after that it works Ok. I changed
this type in my Form too, to be in sync with tag.

also I didn't find any doc / spec for this type.

any help are very welcome

Best Regards.
Michael.


-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 26, 2003 6:53 PM
To: Struts Users Mailing List
Subject: RE: [Q] can I use ArrayList type for  property ?


Quoting the docs

..Renders an HTML  element of type checkbox, whose "checked" status
is initialized based on whether the specified value matches one of the
elements of the underlying property's array of current values...

I'd guess it must be an Object[].  I have used it only with String[]s.

Sri

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 26, 2003 5:40 PM
To: [EMAIL PROTECTED]
Subject: [Q] can I use ArrayList type for  property ?


Hello,

what types allowed for   property ?

Best Regards.
Michael.

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



Re: DynaValidatorActionForm

2003-02-27 Thread Rick Reumann
On Thu, 27 Feb 2003 14:34:23 -0500
"Sloan Seaman" <[EMAIL PROTECTED]> wrote:
 
> 
> For my edit page, how do I populate a bean for the edit page to use to
> populate the fields?  From what I've been reading it seems like I
> don't ahve to write a form class anymore because of the DynaActionForm
> stuff, but I'm a bit confused.
 
I like to first set up my page by having a mapping submit to a setUp
Action. Then in this setUp action you could just do:

DynaActionForm f = (DynaActionForm) form;
f.set("firstName", "John Doe");
//etc.

then you would just forward to the jsp form.

-- 
Rick Reumann

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



DynaValidatorActionForm

2003-02-27 Thread Sloan Seaman
I'm getting the hang of struts (very cool) but I'm not sure how I should be
doing the following.

I have your standard add/change/delete part of an application.

For the add part I have the following form bean defined:

   
   
   
   
   
   
   
   
   
  

Here is my question:

For my edit page, how do I populate a bean for the edit page to use to
populate the fields?  From what I've been reading it seems like I don't ahve
to write a form class anymore because of the DynaActionForm stuff, but I'm a
bit confused.

So far all I ahve figured out is that to get to the edit page I will call
and action that will somehow populate something and then the jsp page will
be displayed and will be populated...

Help?

--
Sloan



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



Re: Tiles: dynamically adding definitions

2003-02-27 Thread John Nikolai
Thanks Cedric, I look forward to seeing the document.

Is this a feature which may be added to Tiles at a future date?
Or is this too specialized?
Thanks again,
 - John
On Thursday, February 27, 2003, at 10:46 AM, Cedric Dumoulin wrote:

 Hi,

 The answer is yes, but it need some coding.

 The default definition factory doesn't provide a well know API to add 
dynamically new definitions.
 What you can do is to implement your own definition factory to 
provide such functionality. You can extends the existing factory and 
add the methods you need.
 You have to know that the "extends" mechanism is resolved statically 
when the config file is loaded. After that, definitions are stored 
resolved. So, you have to resolve yourself your extend. This is 
however simple to do: get the definition referenced by "extend", 
create a new definition initialized with the previously loaded one, 
add your own attributes, store your definition in the factory.
 I have a short document describing how to write a factory. I will 
make it accessible asap.

 Cedric

John Nikolai wrote:

Is it possible to define a few base tiles definitions (loaded using 
TilesPlugin) and, during runtime, read in other definitions which 
extend these base definitions?

Here is an example use:

We have an XML file which defines a web site and used to generate the 
web site navigation. If we add a new page to the site we need to 
update this XML file to update the navigation as well. Can I add a 
tiles definition to this XML file and add that definition into tiles 
for processing?


 Events & Activities 
 Events & Activities 


...


NOTE: "master.page" is defined in the default definitions loaded at 
startup using TilesPlugin.

Doing it this way when I add a new file I only need to update a 
single XML file as opposed to several.

Thanks for your help!
 - 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]


  1   2   3   >