Form action context is default rather than the module's context

2004-12-03 Thread Daniel Massie
Using a module I go through an action to a JSP containg a form (using 
html:form). The action attribute of this form
is the same as an action defined in a module's struts config ie /Login, but 
when the page is accessed the full form action is the ${default context}/Login 
rather than ${default context}/${module}/Login thus resulting in the form being 
posted to the Login action of the default module. The action mapping does not 
specify contextRelative=true in the forwards.

Any help is much appreciated.

Thanks
Daniel

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



RE: Pre-populating a form from a database

2004-12-03 Thread Simon Matic Langford
have you got any documentation anywhere on your site? I couldn't see
any...
 

 -Original Message-
 From: Tak Yoshida [mailto:[EMAIL PROTECTED] 
 Sent: 03 December 2004 03:01
 To: Struts Users Mailing List
 Subject: Re: Pre-populating a form from a database
 
 
 Carlos Cajina wrote in [EMAIL PROTECTED]
 One of the solutions I've implemented is to create an 
 intermediate action 
 that loads data from a database, populates de ActionForm, 
 and directs the 
 user to the apropiate JSP.
 
 This could be a better option,
 which has the consistent prepare method invocation.
 Also you can completely separate the logic to proces request, 
 and the logic to prepare.
 No intermidiate action mapping is necessary. for 
 pre-population even for validatin failure.
 http://sourceforge.net/project/showfiles.php?group_id=111296p
ackage_id=120334

Tak


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



Date validation, multiple format

2004-12-03 Thread Mohd Amin
Hi,

 

I have a requirement for the date format to be depending on the user which
logs in. Showing the date formatted to the user preference is a no brainer
but validation using struts validator I think is slightly tougher, anyone
has any idea on how to get this implemented?

 

 

Thanks

Amin



i18n input

2004-12-03 Thread Simon Matic Langford
Is there a general pattern for localised input, ie being able to enter
numbers and dates formatted for Germany but getting them formatted for
Java on the server side for constructing BigDecimals etc, aside from
using utilities in the java.text package? What about for displaying back
the other way?

I saw a post about this a couple of weeks ago but there was not
response...


Thanks

Simon


The information contained in this e-mail is intended only for the person
or
entity to which it is addressed and may contain confidential and/or
privileged material. If You are not the intended recipient of this
e-mail,
the use of this information or any disclosure, copying or distribution
is
Prohibited and may be unlawful. If you received this in error, please
contact the sender and delete the material from any computer. The views
expressed in this e-mail may not necessarily be the views of The PCMS
Group
plc and should not be taken as authority to carry out any instruction
contained.
 



Re: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Mark Lowe
Have you done this in the jsp?

tiles:useAttribute name=topnav scope=page /

MArk

On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows [EMAIL PROTECTED] wrote:
 
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 12:11 PM
  To: [EMAIL PROTECTED]
  Subject: JSTL, Tiles PutList and Tomcat 5.028
 
 
  Hi All,
 
 
 
  I have a jsp page that I am trying to run on Tomcat that
  currently works in
  Weblogic. It appears the primary problem is that the forEach
  tag is not
  putting the variable menuItem into the pageContext attributes
  and or it
  thinks the menuItem is of type String. I am not sure where my actually
  problem is (tiles, tomcat etc).
 
 
 
 
 
  It appears Tomcat is generating code when compiling the JSP
  that isn't aware
  of the type of class the
  org.apache.struts.tiles.beans.SimpleMenuItem is -
  it looks like at run time it thinks it is a String.
 
 
 
 
 
  A snippet of my JSP looks like this (jstl tags - partial):
 
  core:forEach var=menuItem varStatus=status items=${topnav}
 
  core:choose
 
   core:when test=${menuItem.tooltip=='help'}
 
 I do something similar in my code, and it works.
 It does look like it's not figuring out what type the menuItem is though
 
 snip/
 
 
 
 
  When I check the pageContext attributes via a debugger I
  actually see an
  item in the collection with the key topnav and it contains
  a Vector of
  items that appear to be of type SimpleMenuItem. However I
  never see the item
  called menuItem that I thought the forEach tag would place in
  there for me.
 
 And I think the tutorial is agreeing with you:
 The forEach tag allows you to iterate over a collection of objects. You 
 specify the collection via the items attribute, and the current item is 
 available through a scope variable named by the item attribute.
 
 A large number of collection types are supported by forEach, including all 
 implementations of java.util.Collection and java.util.Map. If the items 
 attribute is of type java.util.Map, then the current item will be of type 
 java.util.Map.Entry, which has the following properties:
 
 * key - the key under which the item is stored in the underlying Map
 * value - the value that corresponds to the key
 
 Arrays of objects as well as arrays of primitive types (for example, int) are 
 also supported. For arrays of primitive types, the current item for the 
 iteration is automatically wrapped with its standard wrapper class (for 
 example, Integer for int, Float for float, and so on).
 
 Implementations of java.util.Iterator and java.util.Enumeration are supported 
 but these must be used with caution. Iterator and Enumeration objects are not 
 resettable so they should not be used within more than one iteration tag. 
 Finally, java.lang.String objects can be iterated over if the string contains 
 a list of comma separated values (for example: 
 Monday,Tuesday,Wednesday,Thursday,Friday).
 
 Here's the shopping cart iteration from the previous section with the forEach 
 tag:
 
 c:forEach var=item items=${sessionScope.cart.items}
   ...
   tr
 td align=right bgcolor=#ff
 ${item.quantity}
   /td
   ...
 /c:forEach
 
 The forTokens tag is used to iterate over a collection of tokens separated by 
 a delimiter.
 from http://java.sun.com/webservices/docs/1.3/tutorial/doc/index.html
 
 
 
 
  Thanks for any help you may be able to provide,
 
 
 
  Jerry Rodgers
 
 
 
 
 
 
 
 
 
 -
 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: Form action context is default rather than the module's context

2004-12-03 Thread Daniel Massie
It actually looks as though the correct module is being detected when the 
request is processed, and forwarding to the correct jsp, but the module context 
is being lost when the JSP is processed, thus the wrong action in the form. Is 
there any reason for the context being lost?

Daniel

-Original Message-
From: Daniel Massie 
Sent: 03 December 2004 09:08
To: [EMAIL PROTECTED]
Subject: Form action context is default rather than the module's context


Using a module I go through an action to a JSP containg a form (using 
html:form). The action attribute of this form
is the same as an action defined in a module's struts config ie /Login, but 
when the page is accessed the full form action is the ${default context}/Login 
rather than ${default context}/${module}/Login thus resulting in the form being 
posted to the Login action of the default module. The action mapping does not 
specify contextRelative=true in the forwards.

Any help is much appreciated.

Thanks
Daniel

-
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: Pre-populating a form from a database

2004-12-03 Thread Donie Kelly
Thanks, that worked. 

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: 02 December 2004 17:12
To: Struts Users Mailing List
Subject: RE: Pre-populating a form from a database

 -Original Message-
 From: Donie Kelly [mailto:[EMAIL PROTECTED]
 Sent: Thursday, December 02, 2004 9:57 AM
 To: Struts Users Mailing List
 Subject: RE: Pre-populating a form from a database
 
 
 Hi (and sorry for the noob question)

It's what we're here for :)

 
 I am using a DTO object to transfer the data from the data 
 access object. I
 copy that data from the Dto to the form in the action class 
 and it works
 when I resubmit the page (refresh) becuase the action is triggered.
 
 However, I can't get the action to trigger when I go to the 
 form initially.
 I am a bit lost on this one even though I'm trying to understand these
 tutorials.

If you're going to the form from /context/path/page.jsp, then it's because
the action is only triggered when you go to /context/path/action.do.
If you're saying that you are going to /context/path/action.do and the data
is only showing up when you refresh.. thats a different problem, probably
related to your action class, which I would need to see.


 
 Thanks
 Donie
 
 
 -Original Message-
 From: Jim Barrows [mailto:[EMAIL PROTECTED] 
 Sent: 02 December 2004 16:59
 To: Struts Users Mailing List
 Subject: RE: Pre-populating a form from a database
 
 The form bean is a not a data access object!!!
 Get the data in the action class, populate the form bean from that.
 FormBeans are for display only.
 
  -Original Message-
  From: Donie Kelly [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 9:43 AM
  To: Struts Users Mailing List
  Subject: Pre-populating a form from a database
  
  
  Hi all
  
   
  
  I've been going through the tutorials at
  http://www.coreservlets.com/Apache-Struts-Tutorial/index.html
  http://www.coreservlets.com/Apache-Struts-Tutorial/index.html
which shows
  how to pre-populate forms.
  
   
  
  However, as I'm new to this, is there a proper way to 
  access the database
  through the form bean? Sould I put code in the form 
  constructor class to
  initialise the data? Or does struts have a better way?
  
   
  
  Thanks
  
  donie
  
  
 
 -
 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: Date validation, multiple format

2004-12-03 Thread David G. Friedman
Is the date format changed because of the user's language selection or
particular country?  If so, validation supports country and language
extensions for that purpose.

Regards,
David

-Original Message-
From: Mohd Amin [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 4:23 AM
To: [EMAIL PROTECTED]
Subject: Date validation, multiple format


Hi,



I have a requirement for the date format to be depending on the user which
logs in. Showing the date formatted to the user preference is a no brainer
but validation using struts validator I think is slightly tougher, anyone
has any idea on how to get this implemented?





Thanks

Amin



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



ActionForm validate and redirect

2004-12-03 Thread Ilja Smoli
Hi
I use validate method in one of my ActionForms, after validation is fail,
method redirects browser to wahatever is set in struts-config.xml under
input attribut... I faced problem that i need this value to be dynamic. (I
want to redirect a user to same page from where form has been submitted but
with error messages. And this page has query paramters :( )
Trying to call actionMapping.setInput() gives exception...(Frozen config)
So seems to be ActionForm validating is not so flexible and cool :-)? Or
maybe application must use static pages where forms are located?
Of course I can do validation in action and achieve needed result
Opinion of experts?
Ilja.





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



Re: i18n input

2004-12-03 Thread Hubert Rabago
FormDef can help you with this.  https://formdef.dev.java.net. 
There's a locale.war sample app download which can work with different
locales.  It doesn't have support for BigDecimals, though (not yet,
anyway).
For displaying them on the screen, experiment bean:write with
format/formatKey/locale attributes.  If you use FormDef to specify
format keys, you can use the same key for form input and display.

Hubert


On Fri, 3 Dec 2004 09:49:52 -, Simon Matic Langford
[EMAIL PROTECTED] wrote:
 Is there a general pattern for localised input, ie being able to enter
 numbers and dates formatted for Germany but getting them formatted for
 Java on the server side for constructing BigDecimals etc, aside from
 using utilities in the java.text package? What about for displaying back
 the other way?
 
 I saw a post about this a couple of weeks ago but there was not
 response...
 
 Thanks
 
 Simon
 
 The information contained in this e-mail is intended only for the person
 or
 entity to which it is addressed and may contain confidential and/or
 privileged material. If You are not the intended recipient of this
 e-mail,
 the use of this information or any disclosure, copying or distribution
 is
 Prohibited and may be unlawful. If you received this in error, please
 contact the sender and delete the material from any computer. The views
 expressed in this e-mail may not necessarily be the views of The PCMS
 Group
 plc and should not be taken as authority to carry out any instruction
 contained.
 


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



Re: ActionForm validate and redirect

2004-12-03 Thread Hubert Rabago
You can't modify the actual struts instances that were configured in
struts-config.  However, you can handle the validation in your Action
object (see http://marc.theaimsgroup.com/?l=struts-userm=109302108205069w=2)
and redirect with parameters by constructing your own ActionForward
instance.

There's a patch to an open enhancement request that you can use:
http://issues.apache.org/bugzilla/attachment.cgi?id=9369

The enhancement request is
http://issues.apache.org/bugzilla/show_bug.cgi?id=866.

If you want to pass the ActionMessage objects as part of the url, you
can use a set of classes I've been using:
http://www.rabago.net/struts/redirect/

Hubert


On Fri, 3 Dec 2004 16:33:15 +0200, Ilja Smoli [EMAIL PROTECTED] wrote:
 Hi
 I use validate method in one of my ActionForms, after validation is fail,
 method redirects browser to wahatever is set in struts-config.xml under
 input attribut... I faced problem that i need this value to be dynamic. (I
 want to redirect a user to same page from where form has been submitted but
 with error messages. And this page has query paramters :( )
 Trying to call actionMapping.setInput() gives exception...(Frozen config)
 So seems to be ActionForm validating is not so flexible and cool :-)? Or
 maybe application must use static pages where forms are located?
 Of course I can do validation in action and achieve needed result
 Opinion of experts?
 Ilja.
 
 -
 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: i18n input

2004-12-03 Thread Simon Matic Langford
yeah,

I've looked at formdef, unfortunately I'm using an extension to struts
which prevents me using this, is there anything else?

simon
 

 -Original Message-
 From: Hubert Rabago [mailto:[EMAIL PROTECTED] 
 Sent: 03 December 2004 14:53
 To: Struts Users Mailing List
 Subject: Re: i18n input
 
 
 FormDef can help you with this.  https://formdef.dev.java.net. 
 There's a locale.war sample app download which can work with different
 locales.  It doesn't have support for BigDecimals, though (not yet,
 anyway).
 For displaying them on the screen, experiment bean:write with
 format/formatKey/locale attributes.  If you use FormDef to specify
 format keys, you can use the same key for form input and display.
 
 Hubert
 
 
 On Fri, 3 Dec 2004 09:49:52 -, Simon Matic Langford
 [EMAIL PROTECTED] wrote:
  Is there a general pattern for localised input, ie being 
 able to enter
  numbers and dates formatted for Germany but getting them 
 formatted for
  Java on the server side for constructing BigDecimals etc, aside from
  using utilities in the java.text package? What about for 
 displaying back
  the other way?
  
  I saw a post about this a couple of weeks ago but there was not
  response...
  
  Thanks
  
  Simon
  
  The information contained in this e-mail is intended only 
 for the person
  or
  entity to which it is addressed and may contain confidential and/or
  privileged material. If You are not the intended recipient of this
  e-mail,
  the use of this information or any disclosure, copying or 
 distribution
  is
  Prohibited and may be unlawful. If you received this in 
 error, please
  contact the sender and delete the material from any 
 computer. The views
  expressed in this e-mail may not necessarily be the views 
 of The PCMS
  Group
  plc and should not be taken as authority to carry out any 
 instruction
  contained.
  
 
 
 -
 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: ActionForm validate and redirect

2004-12-03 Thread Robert Taylor
I did this by subclassing the RequestProcessor and
modifying processValidate().

I place a value in the request which indicates the current url
and don't define an input attribute for the action mappings that
need this dynamic input functionality.

In processValidate() if mapping.getInput() == null, then I look
for my current url parameter and use that if it exists.

robert



 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Ilja Smoli
 Sent: Friday, December 03, 2004 9:33 AM
 To: [EMAIL PROTECTED]
 Subject: ActionForm validate and redirect
 
 
 Hi
 I use validate method in one of my ActionForms, after validation is fail,
 method redirects browser to wahatever is set in struts-config.xml under
 input attribut... I faced problem that i need this value to be dynamic. (I
 want to redirect a user to same page from where form has been submitted but
 with error messages. And this page has query paramters :( )
 Trying to call actionMapping.setInput() gives exception...(Frozen config)
 So seems to be ActionForm validating is not so flexible and cool :-)? Or
 maybe application must use static pages where forms are located?
 Of course I can do validation in action and achieve needed result
 Opinion of experts?
 Ilja.
 
 
 
 
 
 -
 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: i18n input

2004-12-03 Thread Jim Barrows

 -Original Message-
 From: Simon Matic Langford [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 2:50 AM
 To: [EMAIL PROTECTED]
 Subject: i18n input
 
 
 Is there a general pattern for localised input, ie being able to enter
 numbers and dates formatted for Germany but getting them formatted for
 Java on the server side for constructing BigDecimals etc, aside from
 using utilities in the java.text package? What about for 
 displaying back
 the other way?

Java comes with i18n built in.  You want the JSTL fmt:blah for output and look 
at the way message resources are handled in struts, as well as read through the 
i18n documentation on the sun site.

 
 I saw a post about this a couple of weeks ago but there was not
 response...
 
 
 Thanks
 
 Simon
 
 
 The information contained in this e-mail is intended only for 
 the person
 or
 entity to which it is addressed and may contain confidential and/or
 privileged material. If You are not the intended recipient of this
 e-mail,
 the use of this information or any disclosure, copying or distribution
 is
 Prohibited and may be unlawful. If you received this in error, please
 contact the sender and delete the material from any computer. 
 The views
 expressed in this e-mail may not necessarily be the views of The PCMS
 Group
 plc and should not be taken as authority to carry out any instruction
 contained.
  
 
 

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



RE: ActionForm validate and redirect

2004-12-03 Thread Jim Barrows
 -Original Message-
 From: news [mailto:[EMAIL PROTECTED] Behalf Of Ilja Smoli
 Sent: Friday, December 03, 2004 7:33 AM
 To: [EMAIL PROTECTED]
 Subject: ActionForm validate and redirect
 
 
 Hi
 I use validate method in one of my ActionForms, after 
 validation is fail,
 method redirects browser to wahatever is set in 
 struts-config.xml under
 input attribut... I faced problem that i need this value to 
 be dynamic. (I
 want to redirect a user to same page from where form has been 
 submitted but
 with error messages. And this page has query paramters :( )
 Trying to call actionMapping.setInput() gives 
 exception...(Frozen config)
 So seems to be ActionForm validating is not so flexible and 
 cool :-)? Or
 maybe application must use static pages where forms are located?
 Of course I can do validation in action and achieve needed result
 Opinion of experts?

This has been discussed on the list quite a bit.  Check the archives.

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



i18n and the database...

2004-12-03 Thread Michael Klaene

Hi. 

I'm investigating ways to support multiple languages in my app, without using 
the typical ResourceBundle/MessageResources approach. I was thinking that I 
would like to use a database instead. It seems to me that a large application 
trying to support multiple languages with this approach might become a real 
maintenance issue. 

What I'm interested in is three things: 

1.)Any opinions on whether this does in fact create maintenance issues (I've 
yet to write a large, i18n app). And what are the ways to mitigate some of 
these issues.

2.)Is anyone using a database-driven approach to this, storing application 
labels, etc. in tables and retrieving them. Possibly, by reimplementing 
versions of ResourceBundle/MessageResources to go against tables. You'd still 
have to update entries manually but I kind of like the idea of putting this 
info in the database.

3.)I know that some databases, Oracle, and I hear the newest version of MySQL 
support UTF-8. I've no experience in this area. Does anyone have experience 
with storing text in UTF-8 in the database? This *seems* like it could be an 
ideal approach, eliminating alot of on-going work. Obviously, the app would be 
less portable.

If anyone has suggestions/comments on any of the above, I've love to hear them.

Thanks in advance, 
Mike

 

 



-
Do you Yahoo!?
 Yahoo! Mail - 250MB free storage. Do more. Manage less.

RE: i18n input

2004-12-03 Thread Simon Matic Langford
yeah, I know I can do this, but this is a large system with around 200
jsps 80 views
and a number of controllers. doing the display is reasonably simple I
know, but extremely
tedious and prone to errors, I was hoping for a more elegant solution
which also handles
input...
 
 Java comes with i18n built in.  You want the JSTL fmt:blah 
 for output and look at the way message resources are handled 
 in struts, as well as read through the i18n documentation on 
 the sun site.


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



RE: i18n and the database...

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Michael Klaene [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 8:51 AM
 To: [EMAIL PROTECTED]
 Subject: i18n and the database...
 
 
 
 Hi. 
 
 I'm investigating ways to support multiple languages in my 
 app, without using the typical 
 ResourceBundle/MessageResources approach. I was thinking that 
 I would like to use a database instead. It seems to me that a 
 large application trying to support multiple languages with 
 this approach might become a real maintenance issue. 
 
 What I'm interested in is three things: 
 
 1.)Any opinions on whether this does in fact create 
 maintenance issues (I've yet to write a large, i18n app). And 
 what are the ways to mitigate some of these issues.

I can see 3 issues:
1)Makes it very difficult to hand a file to a translator and tell them to 
translate everything to the right of the equal.  You could howver provide a GUI 
of some sort for the xlator.

2)Peformance typically the messages are loaded into an in memory hashtable, 
and transported across the network.  This can of course, be worked around.

3)Re-inventing the wheel.

 
 2.)Is anyone using a database-driven approach to this, 
 storing application labels, etc. in tables and retrieving 
 them. Possibly, by reimplementing versions of 
 ResourceBundle/MessageResources to go against tables. You'd 
 still have to update entries manually but I kind of like the 
 idea of putting this info in the database.

Why?  what purpose does it serve?  

 
 3.)I know that some databases, Oracle, and I hear the newest 
 version of MySQL support UTF-8. I've no experience in this 
 area. Does anyone have experience with storing text in UTF-8 
 in the database? This *seems* like it could be an ideal 
 approach, eliminating alot of on-going work. Obviously, the 
 app would be less portable.

Less portable, and standard.

 
 If anyone has suggestions/comments on any of the above, I've 
 love to hear them.
 
 Thanks in advance, 
 Mike
 
  
 
  
 
 
   
 -
 Do you Yahoo!?
  Yahoo! Mail - 250MB free storage. Do more. Manage less.
 

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



RE: i18n input

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Simon Matic Langford [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 8:51 AM
 To: 'Struts Users Mailing List'
 Subject: RE: i18n input
 
 
 yeah, I know I can do this, but this is a large system with around 200
 jsps 80 views
 and a number of controllers. doing the display is reasonably simple I
 know, but extremely
 tedious and prone to errors, I was hoping for a more elegant solution
 which also handles
 input...

I believe it does handle input as well... depending on the browser, which java 
has no control over.  

  
  Java comes with i18n built in.  You want the JSTL fmt:blah 
  for output and look at the way message resources are handled 
  in struts, as well as read through the i18n documentation on 
  the sun site.
 
 
 -
 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: i18n and the database...

2004-12-03 Thread Simon Matic Langford
 
 
 Hi. 
 
 I'm investigating ways to support multiple languages in my 
 app, without using the typical 
 ResourceBundle/MessageResources approach. I was thinking that 
 I would like to use a database instead. It seems to me that a 
 large application trying to support multiple languages with 
 this approach might become a real maintenance issue. 
 
 What I'm interested in is three things: 
 
 1.)Any opinions on whether this does in fact create 
 maintenance issues (I've yet to write a large, i18n app). And 
 what are the ways to mitigate some of these issues.

I would imagine that the maintenance problems would be similar
to those of storing in a properties file, the only problem
being that you now won't have standard tools to check for missing
keys. However having said that, a database query to do the same would
be extremely simple.

 
 2.)Is anyone using a database-driven approach to this, 
 storing application labels, etc. in tables and retrieving 
 them. Possibly, by reimplementing versions of 
 ResourceBundle/MessageResources to go against tables. You'd 
 still have to update entries manually but I kind of like the 
 idea of putting this info in the database.

We would like to try this approach as we are currently writing a
large i18n application, but currently our database doesn't support
this, so it would be interesting to see how you go?

 
 3.)I know that some databases, Oracle, and I hear the newest 
 version of MySQL support UTF-8. I've no experience in this 
 area. Does anyone have experience with storing text in UTF-8 
 in the database? This *seems* like it could be an ideal 
 approach, eliminating alot of on-going work. Obviously, the 
 app would be less portable.

Also have you considered performance? Accessing the database a lot
could be quite expensive, especially for something like message
resources, so you would probably have to implement some kind of caching
strategy. How often do you expect to change values, could you
store values in a DB and generate your properties files from it on
a daily basis for instance?

 
 If anyone has suggestions/comments on any of the above, I've 
 love to hear them.
 

Hope these help

Simon


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



RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
Hi Matk, 

I have the following statement

tiles:importAttribute / 

Which I think am lead to believe it imports all the attributes into the
page scope. 

In an effort to figure out what was happening I downloaded the jstl 1.0.6
and built a debug project in eclipse so I could step into the ForEach tag
and I am not sure what I am really looking at yet in there but it appears
that indeed the item does contain a string and that the items collection on 
the tag has a somewhat string delimited representation of the collection. 

See below: This is that actual value in the string in the debugger... Is
this how it is stored then is ir reconstituted into SimpleMenuItem(s) as
the tag loops. The string looks like a collection because of the , i.e.
it looks like a string tokenizer.

[SimpleMenuItem[value=nav.adminhome,
link=/aems/session/changefiltertoken.do?btnResetFilter=true,
tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization,
link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library,
link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook,
link=/aems/communication/personsearchlist.do, ],
SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]

And give this sting in the items - the actual when call to next() within the
EnumeratonAdapter way in the ForEachSupport class actuall calls the
StringTokenizer and returns an item of:

[SimpleMenuItem[value=nav.adminhome

So it looks like it went to the first ,  and thus the subject of my email
might really be changed to: What is causing ForEach to read/load my tiles
putlist collection as a string and not as a collection of the
SimpleMenuItems they really are? Pretty darn long subject : 


On a side note - not sure if this means anything - when I compiled the
course I was required by eclipse to add two new methods to the
PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package
does it looks like perhaps the different JSP version might be an issue. i.e.
will jstl 1.0.6 work in Tomcat 5.0.28? 


/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
 */
public ExpressionEvaluator getExpressionEvaluator() {
// TODO Auto-generated method stub
return null;
}

/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getVariableResolver()
 */
public VariableResolver getVariableResolver() {
// TODO Auto-generated method stub
return null;
}


Thanks,
Jerry 




-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 2:49 AM
To: Struts Users Mailing List
Subject: Re: JSTL, Tiles PutList and Tomcat 5.028

Have you done this in the jsp?

tiles:useAttribute name=topnav scope=page /

MArk

On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows [EMAIL PROTECTED] wrote:
 
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 12:11 PM
  To: [EMAIL PROTECTED]
  Subject: JSTL, Tiles PutList and Tomcat 5.028
 
 
  Hi All,
 
 
 
  I have a jsp page that I am trying to run on Tomcat that
  currently works in
  Weblogic. It appears the primary problem is that the forEach
  tag is not
  putting the variable menuItem into the pageContext attributes
  and or it
  thinks the menuItem is of type String. I am not sure where my actually
  problem is (tiles, tomcat etc).
 
 
 
 
 
  It appears Tomcat is generating code when compiling the JSP
  that isn't aware
  of the type of class the
  org.apache.struts.tiles.beans.SimpleMenuItem is -
  it looks like at run time it thinks it is a String.
 
 
 
 
 
  A snippet of my JSP looks like this (jstl tags - partial):
 
  core:forEach var=menuItem varStatus=status items=${topnav}
 
  core:choose
 
   core:when test=${menuItem.tooltip=='help'}
 
 I do something similar in my code, and it works.
 It does look like it's not figuring out what type the menuItem is
though
 
 snip/
 
 
 
 
  When I check the pageContext attributes via a debugger I
  actually see an
  item in the collection with the key topnav and it contains
  a Vector of
  items that appear to be of type SimpleMenuItem. However I
  never see the item
  called menuItem that I thought the forEach tag would place in
  there for me.
 
 And I think the tutorial is agreeing with you:
 The forEach tag allows you to iterate over a collection of objects. You
specify the collection via the items attribute, and the current item is
available through a scope variable named by the item attribute.
 
 A large number of collection types are supported by forEach, including all
implementations of java.util.Collection and java.util.Map. If the items
attribute is of type java.util.Map, then the current item will be of type
java.util.Map.Entry, which has the following properties:
 
 * key - the key under which the item is stored in the underlying Map
 * value 

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
Hi Matk, 

I have the following statement

tiles:importAttribute / 

Which I think am lead to believe it imports all the attributes into the
page scope. 

In an effort to figure out what was happening I downloaded the jstl 1.0.6
and built a debug project in eclipse so I could step into the ForEach tag
and I am not sure what I am really looking at yet in there but it appears
that indeed the item does contain a string and that the items collection on 
the tag has a somewhat string delimited representation of the collection. 

See below: This is that actual value in the string in the debugger... Is
this how it is stored then is ir reconstituted into SimpleMenuItem(s) as
the tag loops. The string looks like a collection because of the , i.e.
it looks like a string tokenizer.

[SimpleMenuItem[value=nav.adminhome,
link=/aems/session/changefiltertoken.do?btnResetFilter=true,
tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization,
link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library,
link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook,
link=/aems/communication/personsearchlist.do, ],
SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]

And give this sting in the items - the actual when call to next() within the
EnumeratonAdapter way in the ForEachSupport class actuall calls the
StringTokenizer and returns an item of:

[SimpleMenuItem[value=nav.adminhome

So it looks like it went to the first ,  and thus the subject of my email
might really be changed to: What is causing ForEach to read/load my tiles
putlist collection as a string and not as a collection of the
SimpleMenuItems they really are? Pretty darn long subject : 


On a side note - not sure if this means anything - when I compiled the
course I was required by eclipse to add two new methods to the
PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package
does it looks like perhaps the different JSP version might be an issue. i.e.
will jstl 1.0.6 work in Tomcat 5.0.28? 


/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
 */
public ExpressionEvaluator getExpressionEvaluator() {
// TODO Auto-generated method stub
return null;
}

/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getVariableResolver()
 */
public VariableResolver getVariableResolver() {
// TODO Auto-generated method stub
return null;
}


Thanks,
Jerry 




-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 2:49 AM
To: Struts Users Mailing List
Subject: Re: JSTL, Tiles PutList and Tomcat 5.028

Have you done this in the jsp?

tiles:useAttribute name=topnav scope=page /

MArk

On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows [EMAIL PROTECTED] wrote:
 
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 12:11 PM
  To: [EMAIL PROTECTED]
  Subject: JSTL, Tiles PutList and Tomcat 5.028
 
 
  Hi All,
 
 
 
  I have a jsp page that I am trying to run on Tomcat that
  currently works in
  Weblogic. It appears the primary problem is that the forEach
  tag is not
  putting the variable menuItem into the pageContext attributes
  and or it
  thinks the menuItem is of type String. I am not sure where my actually
  problem is (tiles, tomcat etc).
 
 
 
 
 
  It appears Tomcat is generating code when compiling the JSP
  that isn't aware
  of the type of class the
  org.apache.struts.tiles.beans.SimpleMenuItem is -
  it looks like at run time it thinks it is a String.
 
 
 
 
 
  A snippet of my JSP looks like this (jstl tags - partial):
 
  core:forEach var=menuItem varStatus=status items=${topnav}
 
  core:choose
 
   core:when test=${menuItem.tooltip=='help'}
 
 I do something similar in my code, and it works.
 It does look like it's not figuring out what type the menuItem is
though
 
 snip/
 
 
 
 
  When I check the pageContext attributes via a debugger I
  actually see an
  item in the collection with the key topnav and it contains
  a Vector of
  items that appear to be of type SimpleMenuItem. However I
  never see the item
  called menuItem that I thought the forEach tag would place in
  there for me.
 
 And I think the tutorial is agreeing with you:
 The forEach tag allows you to iterate over a collection of objects. You
specify the collection via the items attribute, and the current item is
available through a scope variable named by the item attribute.
 
 A large number of collection types are supported by forEach, including all
implementations of java.util.Collection and java.util.Map. If the items
attribute is of type java.util.Map, then the current item will be of type
java.util.Map.Entry, which has the following properties:
 
 * key - the key under which the item is stored in the underlying Map
 * value 

Re: i18n and the database...

2004-12-03 Thread Hubert Rabago
On Fri, 3 Dec 2004 07:50:31 -0800 (PST), Michael Klaene
[EMAIL PROTECTED] wrote:
snip/ 
 2.)Is anyone using a database-driven approach to this, storing application 
 labels, etc. in tables and retrieving them. Possibly, by reimplementing 
 versions of ResourceBundle/MessageResources to go against tables. You'd still 
 have to update entries manually but I kind of like the idea of putting this 
 info in the database.
 
snip/ 

There's this:
http://sourceforge.net/project/showfiles.php?group_id=49385package_id=76369

If you check the archives, there has been some (a lot?) of discussion
about this in the past.
http://marc.theaimsgroup.com/?l=struts-userr=1w=2

Hubert

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



RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
One other thing to add : there is a key in the pageContext attributes
called topnav and that DOES contain an actual collection of SimpleMenuItems.
The plot thickens - how does the ForEach get the collection?

-Jerry 

-Original Message-
From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 8:02 AM
To: 'Struts Users Mailing List'; 'Mark Lowe'
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028

Hi Matk, 

I have the following statement

tiles:importAttribute / 

Which I think am lead to believe it imports all the attributes into the
page scope. 

In an effort to figure out what was happening I downloaded the jstl 1.0.6
and built a debug project in eclipse so I could step into the ForEach tag
and I am not sure what I am really looking at yet in there but it appears
that indeed the item does contain a string and that the items collection on 
the tag has a somewhat string delimited representation of the collection. 

See below: This is that actual value in the string in the debugger... Is
this how it is stored then is ir reconstituted into SimpleMenuItem(s) as
the tag loops. The string looks like a collection because of the , i.e.
it looks like a string tokenizer.

[SimpleMenuItem[value=nav.adminhome,
link=/aems/session/changefiltertoken.do?btnResetFilter=true,
tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization,
link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library,
link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook,
link=/aems/communication/personsearchlist.do, ],
SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]

And give this sting in the items - the actual when call to next() within the
EnumeratonAdapter way in the ForEachSupport class actuall calls the
StringTokenizer and returns an item of:

[SimpleMenuItem[value=nav.adminhome

So it looks like it went to the first ,  and thus the subject of my email
might really be changed to: What is causing ForEach to read/load my tiles
putlist collection as a string and not as a collection of the
SimpleMenuItems they really are? Pretty darn long subject : 


On a side note - not sure if this means anything - when I compiled the
course I was required by eclipse to add two new methods to the
PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package
does it looks like perhaps the different JSP version might be an issue. i.e.
will jstl 1.0.6 work in Tomcat 5.0.28? 


/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
 */
public ExpressionEvaluator getExpressionEvaluator() {
// TODO Auto-generated method stub
return null;
}

/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getVariableResolver()
 */
public VariableResolver getVariableResolver() {
// TODO Auto-generated method stub
return null;
}


Thanks,
Jerry 




-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 2:49 AM
To: Struts Users Mailing List
Subject: Re: JSTL, Tiles PutList and Tomcat 5.028

Have you done this in the jsp?

tiles:useAttribute name=topnav scope=page /

MArk

On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows [EMAIL PROTECTED] wrote:
 
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 12:11 PM
  To: [EMAIL PROTECTED]
  Subject: JSTL, Tiles PutList and Tomcat 5.028
 
 
  Hi All,
 
 
 
  I have a jsp page that I am trying to run on Tomcat that
  currently works in
  Weblogic. It appears the primary problem is that the forEach
  tag is not
  putting the variable menuItem into the pageContext attributes
  and or it
  thinks the menuItem is of type String. I am not sure where my actually
  problem is (tiles, tomcat etc).
 
 
 
 
 
  It appears Tomcat is generating code when compiling the JSP
  that isn't aware
  of the type of class the
  org.apache.struts.tiles.beans.SimpleMenuItem is -
  it looks like at run time it thinks it is a String.
 
 
 
 
 
  A snippet of my JSP looks like this (jstl tags - partial):
 
  core:forEach var=menuItem varStatus=status items=${topnav}
 
  core:choose
 
   core:when test=${menuItem.tooltip=='help'}
 
 I do something similar in my code, and it works.
 It does look like it's not figuring out what type the menuItem is
though
 
 snip/
 
 
 
 
  When I check the pageContext attributes via a debugger I
  actually see an
  item in the collection with the key topnav and it contains
  a Vector of
  items that appear to be of type SimpleMenuItem. However I
  never see the item
  called menuItem that I thought the forEach tag would place in
  there for me.
 
 And I think the tutorial is agreeing with you:
 The forEach tag allows you to iterate over a collection of objects. You
specify the collection via the items attribute, and the current item is

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
One other thing to add : there is a key in the pageContext attributes
called topnav and that DOES contain an actual collection of SimpleMenuItems.
The plot thickens - how does the ForEach get the collection?

-Jerry 

-Original Message-
From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 8:02 AM
To: 'Struts Users Mailing List'; 'Mark Lowe'
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028

Hi Matk, 

I have the following statement

tiles:importAttribute / 

Which I think am lead to believe it imports all the attributes into the
page scope. 

In an effort to figure out what was happening I downloaded the jstl 1.0.6
and built a debug project in eclipse so I could step into the ForEach tag
and I am not sure what I am really looking at yet in there but it appears
that indeed the item does contain a string and that the items collection on 
the tag has a somewhat string delimited representation of the collection. 

See below: This is that actual value in the string in the debugger... Is
this how it is stored then is ir reconstituted into SimpleMenuItem(s) as
the tag loops. The string looks like a collection because of the , i.e.
it looks like a string tokenizer.

[SimpleMenuItem[value=nav.adminhome,
link=/aems/session/changefiltertoken.do?btnResetFilter=true,
tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization,
link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library,
link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook,
link=/aems/communication/personsearchlist.do, ],
SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]

And give this sting in the items - the actual when call to next() within the
EnumeratonAdapter way in the ForEachSupport class actuall calls the
StringTokenizer and returns an item of:

[SimpleMenuItem[value=nav.adminhome

So it looks like it went to the first ,  and thus the subject of my email
might really be changed to: What is causing ForEach to read/load my tiles
putlist collection as a string and not as a collection of the
SimpleMenuItems they really are? Pretty darn long subject : 


On a side note - not sure if this means anything - when I compiled the
course I was required by eclipse to add two new methods to the
PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package
does it looks like perhaps the different JSP version might be an issue. i.e.
will jstl 1.0.6 work in Tomcat 5.0.28? 


/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
 */
public ExpressionEvaluator getExpressionEvaluator() {
// TODO Auto-generated method stub
return null;
}

/* (non-Javadoc)
 * @see javax.servlet.jsp.JspContext#getVariableResolver()
 */
public VariableResolver getVariableResolver() {
// TODO Auto-generated method stub
return null;
}


Thanks,
Jerry 




-Original Message-
From: Mark Lowe [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 2:49 AM
To: Struts Users Mailing List
Subject: Re: JSTL, Tiles PutList and Tomcat 5.028

Have you done this in the jsp?

tiles:useAttribute name=topnav scope=page /

MArk

On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows [EMAIL PROTECTED] wrote:
 
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Thursday, December 02, 2004 12:11 PM
  To: [EMAIL PROTECTED]
  Subject: JSTL, Tiles PutList and Tomcat 5.028
 
 
  Hi All,
 
 
 
  I have a jsp page that I am trying to run on Tomcat that
  currently works in
  Weblogic. It appears the primary problem is that the forEach
  tag is not
  putting the variable menuItem into the pageContext attributes
  and or it
  thinks the menuItem is of type String. I am not sure where my actually
  problem is (tiles, tomcat etc).
 
 
 
 
 
  It appears Tomcat is generating code when compiling the JSP
  that isn't aware
  of the type of class the
  org.apache.struts.tiles.beans.SimpleMenuItem is -
  it looks like at run time it thinks it is a String.
 
 
 
 
 
  A snippet of my JSP looks like this (jstl tags - partial):
 
  core:forEach var=menuItem varStatus=status items=${topnav}
 
  core:choose
 
   core:when test=${menuItem.tooltip=='help'}
 
 I do something similar in my code, and it works.
 It does look like it's not figuring out what type the menuItem is
though
 
 snip/
 
 
 
 
  When I check the pageContext attributes via a debugger I
  actually see an
  item in the collection with the key topnav and it contains
  a Vector of
  items that appear to be of type SimpleMenuItem. However I
  never see the item
  called menuItem that I thought the forEach tag would place in
  there for me.
 
 And I think the tutorial is agreeing with you:
 The forEach tag allows you to iterate over a collection of objects. You
specify the collection via the items attribute, and the current item is

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:20 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 One other thing to add : there is a key in the pageContext 
 attributes
 called topnav and that DOES contain an actual collection of 
 SimpleMenuItems.
 The plot thickens - how does the ForEach get the collection?

I think it looks up the scope chain  request, session, application

 
 -Jerry 
 
 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:02 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 Hi Matk, 
 
 I have the following statement
 
 tiles:importAttribute / 
 
 Which I think am lead to believe it imports all the 
 attributes into the
 page scope. 
 
 In an effort to figure out what was happening I downloaded 
 the jstl 1.0.6
 and built a debug project in eclipse so I could step into the 
 ForEach tag
 and I am not sure what I am really looking at yet in there 
 but it appears
 that indeed the item does contain a string and that the items 
 collection on 
 the tag has a somewhat string delimited representation of 
 the collection. 
 
 See below: This is that actual value in the string in the 
 debugger... Is
 this how it is stored then is ir reconstituted into 
 SimpleMenuItem(s) as
 the tag loops. The string looks like a collection because 
 of the , i.e.
 it looks like a string tokenizer.
 
 [SimpleMenuItem[value=nav.adminhome,
 link=/aems/session/changefiltertoken.do?btnResetFilter=true,
 tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
 link=/aems/party/persondetail.do, ], 
 SimpleMenuItem[value=nav.organization,
 link=/aems/party/organizationdetail.do, ], 
 SimpleMenuItem[value=nav.library,
 link=/aems/file/filelibrarylist.do, ], 
 SimpleMenuItem[value=nav.addressbook,
 link=/aems/communication/personsearchlist.do, ],
 SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
 SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
 
 And give this sting in the items - the actual when call to 
 next() within the
 EnumeratonAdapter way in the ForEachSupport class actuall calls the
 StringTokenizer and returns an item of:
 
 [SimpleMenuItem[value=nav.adminhome
 
 So it looks like it went to the first ,  and thus the 
 subject of my email
 might really be changed to: What is causing ForEach to 
 read/load my tiles
 putlist collection as a string and not as a collection of the
 SimpleMenuItems they really are? Pretty darn long subject : 
 
 
 On a side note - not sure if this means anything - when I compiled the
 course I was required by eclipse to add two new methods to the
 PageContextImpl in the 
 org.apache.taglibs.standard.lang.jstl.test package
 does it looks like perhaps the different JSP version might be 
 an issue. i.e.
 will jstl 1.0.6 work in Tomcat 5.0.28? 
 
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
  */
 public ExpressionEvaluator getExpressionEvaluator() {
   // TODO Auto-generated method stub
   return null;
 }
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getVariableResolver()
  */
 public VariableResolver getVariableResolver() {
   // TODO Auto-generated method stub
   return null;
 }
 
 
 Thanks,
 Jerry 
 
 
 
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 2:49 AM
 To: Struts Users Mailing List
 Subject: Re: JSTL, Tiles PutList and Tomcat 5.028
 
 Have you done this in the jsp?
 
 tiles:useAttribute name=topnav scope=page /
 
 MArk
 
 On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows 
 [EMAIL PROTECTED] wrote:
  
  
  
  
   -Original Message-
   From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
   Sent: Thursday, December 02, 2004 12:11 PM
   To: [EMAIL PROTECTED]
   Subject: JSTL, Tiles PutList and Tomcat 5.028
  
  
   Hi All,
  
  
  
   I have a jsp page that I am trying to run on Tomcat that
   currently works in
   Weblogic. It appears the primary problem is that the forEach
   tag is not
   putting the variable menuItem into the pageContext attributes
   and or it
   thinks the menuItem is of type String. I am not sure 
 where my actually
   problem is (tiles, tomcat etc).
  
  
  
  
  
   It appears Tomcat is generating code when compiling the JSP
   that isn't aware
   of the type of class the
   org.apache.struts.tiles.beans.SimpleMenuItem is -
   it looks like at run time it thinks it is a String.
  
  
  
  
  
   A snippet of my JSP looks like this (jstl tags - partial):
  
   core:forEach var=menuItem varStatus=status items=${topnav}
  
   core:choose
  
core:when test=${menuItem.tooltip=='help'}
  
  I do something similar in my code, and it works.
  It does look like it's not figuring out what type the menuItem is
 though
  
  snip/
  
  
  
  
   When I check the pageContext 

Exception when app goes to form which extends ValidatorForm

2004-12-03 Thread Donie Kelly
Hi all

 

I'm getting this error when accessign a form which extends ValidatorForm and
I'm having trouble figuring out what;s wrong. Anybody know why this might
happen. I'm following the tutorial at
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html 

 

Thanks

Donie

 

 

java.lang.IllegalArgumentException: Resources cannot be null.
at org.apache.commons.validator.Validator.(Validator.java:188)
at
org.apache.struts.validator.Resources.initValidator(Resources.java:299)
at
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:106)
at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:921)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:206)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:684)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:432)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:356)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
56)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:388)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
.java:493)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1040)
at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1151
)
at java.lang.Thread.run(Thread.java:536)

 



RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
Thanks James, 

It looks like if I put a break point in the setItems() method of the forEach
I am passed a string - that string appears to be the .toString() of the
SimpleMenuItem(s) collection. 

I check the .toString() of SimpleMenuItem and it has the format of the long
string below from my previous message - i.e. the 5 or so items in the
collection. 

How does / or should the ForEach turn that string back into a collection of
items. 

When looking at the parameter on the method signature I had expected that I
would get the EXPRESSION that needed to be evaluated by jstl within the
tag instead it appears the expression has been run prior to the call of the
method an then the .toString() has been called. 

Thanks for everyone's help and input on this - I have now spent two/three
very late nights tracking this down.

-Jerry




-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 8:45 AM
To: Struts Users Mailing List
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028



 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:20 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 One other thing to add : there is a key in the pageContext 
 attributes
 called topnav and that DOES contain an actual collection of 
 SimpleMenuItems.
 The plot thickens - how does the ForEach get the collection?

I think it looks up the scope chain  request, session, application

 
 -Jerry 
 
 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:02 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 Hi Matk, 
 
 I have the following statement
 
 tiles:importAttribute / 
 
 Which I think am lead to believe it imports all the 
 attributes into the
 page scope. 
 
 In an effort to figure out what was happening I downloaded 
 the jstl 1.0.6
 and built a debug project in eclipse so I could step into the 
 ForEach tag
 and I am not sure what I am really looking at yet in there 
 but it appears
 that indeed the item does contain a string and that the items 
 collection on 
 the tag has a somewhat string delimited representation of 
 the collection. 
 
 See below: This is that actual value in the string in the 
 debugger... Is
 this how it is stored then is ir reconstituted into 
 SimpleMenuItem(s) as
 the tag loops. The string looks like a collection because 
 of the , i.e.
 it looks like a string tokenizer.
 
 [SimpleMenuItem[value=nav.adminhome,
 link=/aems/session/changefiltertoken.do?btnResetFilter=true,
 tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
 link=/aems/party/persondetail.do, ], 
 SimpleMenuItem[value=nav.organization,
 link=/aems/party/organizationdetail.do, ], 
 SimpleMenuItem[value=nav.library,
 link=/aems/file/filelibrarylist.do, ], 
 SimpleMenuItem[value=nav.addressbook,
 link=/aems/communication/personsearchlist.do, ],
 SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
 SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
 
 And give this sting in the items - the actual when call to 
 next() within the
 EnumeratonAdapter way in the ForEachSupport class actuall calls the
 StringTokenizer and returns an item of:
 
 [SimpleMenuItem[value=nav.adminhome
 
 So it looks like it went to the first ,  and thus the 
 subject of my email
 might really be changed to: What is causing ForEach to 
 read/load my tiles
 putlist collection as a string and not as a collection of the
 SimpleMenuItems they really are? Pretty darn long subject : 
 
 
 On a side note - not sure if this means anything - when I compiled the
 course I was required by eclipse to add two new methods to the
 PageContextImpl in the 
 org.apache.taglibs.standard.lang.jstl.test package
 does it looks like perhaps the different JSP version might be 
 an issue. i.e.
 will jstl 1.0.6 work in Tomcat 5.0.28? 
 
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
  */
 public ExpressionEvaluator getExpressionEvaluator() {
   // TODO Auto-generated method stub
   return null;
 }
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getVariableResolver()
  */
 public VariableResolver getVariableResolver() {
   // TODO Auto-generated method stub
   return null;
 }
 
 
 Thanks,
 Jerry 
 
 
 
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 2:49 AM
 To: Struts Users Mailing List
 Subject: Re: JSTL, Tiles PutList and Tomcat 5.028
 
 Have you done this in the jsp?
 
 tiles:useAttribute name=topnav scope=page /
 
 MArk
 
 On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows 
 [EMAIL PROTECTED] wrote:
  
  
  
  
   -Original Message-
   From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
   Sent: Thursday, December 02, 2004 12:11 PM
   To: [EMAIL PROTECTED]
   Subject: JSTL, Tiles 

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
Thanks James, 

It looks like if I put a break point in the setItems() method of the forEach
I am passed a string - that string appears to be the .toString() of the
SimpleMenuItem(s) collection. 

I check the .toString() of SimpleMenuItem and it has the format of the long
string below from my previous message - i.e. the 5 or so items in the
collection. 

How does / or should the ForEach turn that string back into a collection of
items. 

When looking at the parameter on the method signature I had expected that I
would get the EXPRESSION that needed to be evaluated by jstl within the
tag instead it appears the expression has been run prior to the call of the
method an then the .toString() has been called. 

Thanks for everyone's help and input on this - I have now spent two/three
very late nights tracking this down.

-Jerry




-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 8:45 AM
To: Struts Users Mailing List
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028



 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:20 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 One other thing to add : there is a key in the pageContext 
 attributes
 called topnav and that DOES contain an actual collection of 
 SimpleMenuItems.
 The plot thickens - how does the ForEach get the collection?

I think it looks up the scope chain  request, session, application

 
 -Jerry 
 
 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:02 AM
 To: 'Struts Users Mailing List'; 'Mark Lowe'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 Hi Matk, 
 
 I have the following statement
 
 tiles:importAttribute / 
 
 Which I think am lead to believe it imports all the 
 attributes into the
 page scope. 
 
 In an effort to figure out what was happening I downloaded 
 the jstl 1.0.6
 and built a debug project in eclipse so I could step into the 
 ForEach tag
 and I am not sure what I am really looking at yet in there 
 but it appears
 that indeed the item does contain a string and that the items 
 collection on 
 the tag has a somewhat string delimited representation of 
 the collection. 
 
 See below: This is that actual value in the string in the 
 debugger... Is
 this how it is stored then is ir reconstituted into 
 SimpleMenuItem(s) as
 the tag loops. The string looks like a collection because 
 of the , i.e.
 it looks like a string tokenizer.
 
 [SimpleMenuItem[value=nav.adminhome,
 link=/aems/session/changefiltertoken.do?btnResetFilter=true,
 tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
 link=/aems/party/persondetail.do, ], 
 SimpleMenuItem[value=nav.organization,
 link=/aems/party/organizationdetail.do, ], 
 SimpleMenuItem[value=nav.library,
 link=/aems/file/filelibrarylist.do, ], 
 SimpleMenuItem[value=nav.addressbook,
 link=/aems/communication/personsearchlist.do, ],
 SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
 SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
 
 And give this sting in the items - the actual when call to 
 next() within the
 EnumeratonAdapter way in the ForEachSupport class actuall calls the
 StringTokenizer and returns an item of:
 
 [SimpleMenuItem[value=nav.adminhome
 
 So it looks like it went to the first ,  and thus the 
 subject of my email
 might really be changed to: What is causing ForEach to 
 read/load my tiles
 putlist collection as a string and not as a collection of the
 SimpleMenuItems they really are? Pretty darn long subject : 
 
 
 On a side note - not sure if this means anything - when I compiled the
 course I was required by eclipse to add two new methods to the
 PageContextImpl in the 
 org.apache.taglibs.standard.lang.jstl.test package
 does it looks like perhaps the different JSP version might be 
 an issue. i.e.
 will jstl 1.0.6 work in Tomcat 5.0.28? 
 
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
  */
 public ExpressionEvaluator getExpressionEvaluator() {
   // TODO Auto-generated method stub
   return null;
 }
 
 /* (non-Javadoc)
  * @see javax.servlet.jsp.JspContext#getVariableResolver()
  */
 public VariableResolver getVariableResolver() {
   // TODO Auto-generated method stub
   return null;
 }
 
 
 Thanks,
 Jerry 
 
 
 
 
 -Original Message-
 From: Mark Lowe [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 2:49 AM
 To: Struts Users Mailing List
 Subject: Re: JSTL, Tiles PutList and Tomcat 5.028
 
 Have you done this in the jsp?
 
 tiles:useAttribute name=topnav scope=page /
 
 MArk
 
 On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows 
 [EMAIL PROTECTED] wrote:
  
  
  
  
   -Original Message-
   From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
   Sent: Thursday, December 02, 2004 12:11 PM
   To: [EMAIL PROTECTED]
   Subject: JSTL, Tiles 

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:55 AM
 To: 'Struts Users Mailing List'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 Thanks James, 
 
 It looks like if I put a break point in the setItems() method 
 of the forEach
 I am passed a string - that string appears to be the 
 .toString() of the
 SimpleMenuItem(s) collection. 
 
 I check the .toString() of SimpleMenuItem and it has the 
 format of the long
 string below from my previous message - i.e. the 5 or so items in the
 collection. 
 
 How does / or should the ForEach turn that string back into a 
 collection of
 items. 

If I understand what you're saying You have something like:
Collection foo;
Collection bar;
bar.add(foo);
then something like foo[i][j] MIGHT work.
On the other hand ifyou have just a collletion fo foo.. you want foo[i].

 
 When looking at the parameter on the method signature I had 
 expected that I
 would get the EXPRESSION that needed to be evaluated by 
 jstl within the
 tag instead it appears the expression has been run prior to 
 the call of the
 method an then the .toString() has been called. 
 
 Thanks for everyone's help and input on this - I have now 
 spent two/three
 very late nights tracking this down.
 
 -Jerry
 
 
 
 
 -Original Message-
 From: Jim Barrows [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:45 AM
 To: Struts Users Mailing List
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Friday, December 03, 2004 9:20 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  
  One other thing to add : there is a key in the pageContext 
  attributes
  called topnav and that DOES contain an actual collection of 
  SimpleMenuItems.
  The plot thickens - how does the ForEach get the collection?
 
 I think it looks up the scope chain  request, session, application
 
  
  -Jerry 
  
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 8:02 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  Hi Matk, 
  
  I have the following statement
  
  tiles:importAttribute / 
  
  Which I think am lead to believe it imports all the 
  attributes into the
  page scope. 
  
  In an effort to figure out what was happening I downloaded 
  the jstl 1.0.6
  and built a debug project in eclipse so I could step into the 
  ForEach tag
  and I am not sure what I am really looking at yet in there 
  but it appears
  that indeed the item does contain a string and that the items 
  collection on 
  the tag has a somewhat string delimited representation of 
  the collection. 
  
  See below: This is that actual value in the string in the 
  debugger... Is
  this how it is stored then is ir reconstituted into 
  SimpleMenuItem(s) as
  the tag loops. The string looks like a collection because 
  of the , i.e.
  it looks like a string tokenizer.
  
  [SimpleMenuItem[value=nav.adminhome,
  link=/aems/session/changefiltertoken.do?btnResetFilter=true,
  tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
  link=/aems/party/persondetail.do, ], 
  SimpleMenuItem[value=nav.organization,
  link=/aems/party/organizationdetail.do, ], 
  SimpleMenuItem[value=nav.library,
  link=/aems/file/filelibrarylist.do, ], 
  SimpleMenuItem[value=nav.addressbook,
  link=/aems/communication/personsearchlist.do, ],
  SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
  SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
  
  And give this sting in the items - the actual when call to 
  next() within the
  EnumeratonAdapter way in the ForEachSupport class actuall calls the
  StringTokenizer and returns an item of:
  
  [SimpleMenuItem[value=nav.adminhome
  
  So it looks like it went to the first ,  and thus the 
  subject of my email
  might really be changed to: What is causing ForEach to 
  read/load my tiles
  putlist collection as a string and not as a collection of the
  SimpleMenuItems they really are? Pretty darn long subject : 
  
  
  On a side note - not sure if this means anything - when I 
 compiled the
  course I was required by eclipse to add two new methods to the
  PageContextImpl in the 
  org.apache.taglibs.standard.lang.jstl.test package
  does it looks like perhaps the different JSP version might be 
  an issue. i.e.
  will jstl 1.0.6 work in Tomcat 5.0.28? 
  
  
  /* (non-Javadoc)
   * @see javax.servlet.jsp.JspContext#getExpressionEvaluator()
   */
  public ExpressionEvaluator getExpressionEvaluator() {
  // TODO Auto-generated method stub
  return null;
  }
  
  /* (non-Javadoc)
   * @see javax.servlet.jsp.JspContext#getVariableResolver()
   */
  public VariableResolver getVariableResolver() {
  // TODO Auto-generated method stub
  return null;
  

Re: Exception when app goes to form which extends ValidatorForm

2004-12-03 Thread Hubert Rabago
Do you have your resource file specified in your struts-config?


On Fri, 3 Dec 2004 16:42:09 -, Donie Kelly [EMAIL PROTECTED] wrote:
 Hi all
 
 I'm getting this error when accessign a form which extends ValidatorForm and
 I'm having trouble figuring out what;s wrong. Anybody know why this might
 happen. I'm following the tutorial at
 http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
 http://www.oracle.com/technology/oramag/oracle/04-jan/o14dev_struts.html
 
 Thanks
 
 Donie
 
 java.lang.IllegalArgumentException: Resources cannot be null.
 at org.apache.commons.validator.Validator.(Validator.java:188)
 at
 org.apache.struts.validator.Resources.initValidator(Resources.java:299)
 at
 org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:106)
 at
 org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
 ava:921)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:206)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
 at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
 java:684)
 at
 org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
 er.java:432)
 at
 org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
 .java:356)
 at
 org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
 56)
 at
 org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
 sor.java:388)
 at
 org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
 at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
 at
 org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:247)
 at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
 at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:260)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
 va:191)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at
 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase
 .java:493)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
 org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
 at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
 )
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at
 org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
 java:170)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
 )
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:509)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:641)
 at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
 :174)
 at
 org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at
 org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at
 org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
 

Re: i18n and the database...

2004-12-03 Thread Guillaume Cottenceau
Michael Klaene mklaene 'at' yahoo.com writes:

 3.)I know that some databases, Oracle, and I hear the newest version
 of MySQL support UTF-8. I've no experience in this area. Does anyone
 have experience with storing text in UTF-8 in the database? This
 *seems* like it could be an ideal approach, eliminating alot of
 on-going work. Obviously, the app would be less portable.

If you want to go with full i18n, even if you don't store
localized messages in database, you will hit the wall sooner or
later if the database is not able to store any string
representing text in any language, because you will want sooner
or later that your users be able to enter localized data in forms
that will end up in the database (their first/last name, etc).

Because of that reason, you need that the database be able to
store and retrieve localized text; a good approach can be to
specify that data is stored in a unicode character encoding;
UTF-8 is typically a good candidate when you have a lot of
latin-based text.

And this is really an issue at the database end. In java, the
Strings can correctly and transparently handle any language. You
just have to make sure that the database driver will correctly
store and retrieve data.

In the application at my company, the (postgres) database is
using UTF-8 and there is really nothing to say here: it works,
there is no problem.

In my opinion, the only issue is really the communication between
the end-user (browser) and your application. Sending data to the
end-user should be ok by using UTF-8 in your webpages, if your
users are not using netscape 2.0 or something. Retrieving data
should be ok by using UTF-8 in your webpages and possibly
specifying accept-charset=UTF-8 in your forms, and filtering
the input to force the CharacterEncoding to UTF-8 (because
browsers usually don't say that the data they send is UTF-8
encoded - there are been many discussions on that topic on this
list).


Please keep us updated about your project; I would be curious to
know about the performance, if you really go to using the
database for localized messages.

-- 
Guillaume Cottenceau

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



RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
If I understand your question - do I have a collection of collections no I
don't - I have a collection of SimpleMenuItem(s) the SimpleMenuItem is not a
collection it is just an object with four properties. It is a
org.apache.struts.tiles.beans.SimpleMenuItem


Back to the original jsp code - it appears to be pretty vanilla. The tiles
tag adds the topnav collection to the pagecontext. 

tiles:importAttribute /
core:forEach var=menuItem varStatus=status items=${topnav}
html:message name=menuItem property=value/ 
/core:forEach


-Jerry


-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 9:08 AM
To: Struts Users Mailing List
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028



 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:55 AM
 To: 'Struts Users Mailing List'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 Thanks James, 
 
 It looks like if I put a break point in the setItems() method 
 of the forEach
 I am passed a string - that string appears to be the 
 .toString() of the
 SimpleMenuItem(s) collection. 
 
 I check the .toString() of SimpleMenuItem and it has the 
 format of the long
 string below from my previous message - i.e. the 5 or so items in the
 collection. 
 
 How does / or should the ForEach turn that string back into a 
 collection of
 items. 

If I understand what you're saying You have something like:
Collection foo;
Collection bar;
bar.add(foo);
then something like foo[i][j] MIGHT work.
On the other hand ifyou have just a collletion fo foo.. you want foo[i].

 
 When looking at the parameter on the method signature I had 
 expected that I
 would get the EXPRESSION that needed to be evaluated by 
 jstl within the
 tag instead it appears the expression has been run prior to 
 the call of the
 method an then the .toString() has been called. 
 
 Thanks for everyone's help and input on this - I have now 
 spent two/three
 very late nights tracking this down.
 
 -Jerry
 
 
 
 
 -Original Message-
 From: Jim Barrows [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:45 AM
 To: Struts Users Mailing List
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Friday, December 03, 2004 9:20 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  
  One other thing to add : there is a key in the pageContext 
  attributes
  called topnav and that DOES contain an actual collection of 
  SimpleMenuItems.
  The plot thickens - how does the ForEach get the collection?
 
 I think it looks up the scope chain  request, session, application
 
  
  -Jerry 
  
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 8:02 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  Hi Matk, 
  
  I have the following statement
  
  tiles:importAttribute / 
  
  Which I think am lead to believe it imports all the 
  attributes into the
  page scope. 
  
  In an effort to figure out what was happening I downloaded 
  the jstl 1.0.6
  and built a debug project in eclipse so I could step into the 
  ForEach tag
  and I am not sure what I am really looking at yet in there 
  but it appears
  that indeed the item does contain a string and that the items 
  collection on 
  the tag has a somewhat string delimited representation of 
  the collection. 
  
  See below: This is that actual value in the string in the 
  debugger... Is
  this how it is stored then is ir reconstituted into 
  SimpleMenuItem(s) as
  the tag loops. The string looks like a collection because 
  of the , i.e.
  it looks like a string tokenizer.
  
  [SimpleMenuItem[value=nav.adminhome,
  link=/aems/session/changefiltertoken.do?btnResetFilter=true,
  tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
  link=/aems/party/persondetail.do, ], 
  SimpleMenuItem[value=nav.organization,
  link=/aems/party/organizationdetail.do, ], 
  SimpleMenuItem[value=nav.library,
  link=/aems/file/filelibrarylist.do, ], 
  SimpleMenuItem[value=nav.addressbook,
  link=/aems/communication/personsearchlist.do, ],
  SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
  SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
  
  And give this sting in the items - the actual when call to 
  next() within the
  EnumeratonAdapter way in the ForEachSupport class actuall calls the
  StringTokenizer and returns an item of:
  
  [SimpleMenuItem[value=nav.adminhome
  
  So it looks like it went to the first ,  and thus the 
  subject of my email
  might really be changed to: What is causing ForEach to 
  read/load my tiles
  putlist collection as a string and not as a collection of the
  SimpleMenuItems they really are? Pretty darn long subject : 
  
  
  On a side note 

RE: JSTL, Tiles PutList and Tomcat 5.028

2004-12-03 Thread Jerry Rodgers
If I understand your question - do I have a collection of collections no I
don't - I have a collection of SimpleMenuItem(s) the SimpleMenuItem is not a
collection it is just an object with four properties. It is a
org.apache.struts.tiles.beans.SimpleMenuItem


Back to the original jsp code - it appears to be pretty vanilla. The tiles
tag adds the topnav collection to the pagecontext. 

tiles:importAttribute /
core:forEach var=menuItem varStatus=status items=${topnav}
html:message name=menuItem property=value/ 
/core:forEach


-Jerry


-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 9:08 AM
To: Struts Users Mailing List
Subject: RE: JSTL, Tiles PutList and Tomcat 5.028



 -Original Message-
 From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 9:55 AM
 To: 'Struts Users Mailing List'
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 Thanks James, 
 
 It looks like if I put a break point in the setItems() method 
 of the forEach
 I am passed a string - that string appears to be the 
 .toString() of the
 SimpleMenuItem(s) collection. 
 
 I check the .toString() of SimpleMenuItem and it has the 
 format of the long
 string below from my previous message - i.e. the 5 or so items in the
 collection. 
 
 How does / or should the ForEach turn that string back into a 
 collection of
 items. 

If I understand what you're saying You have something like:
Collection foo;
Collection bar;
bar.add(foo);
then something like foo[i][j] MIGHT work.
On the other hand ifyou have just a collletion fo foo.. you want foo[i].

 
 When looking at the parameter on the method signature I had 
 expected that I
 would get the EXPRESSION that needed to be evaluated by 
 jstl within the
 tag instead it appears the expression has been run prior to 
 the call of the
 method an then the .toString() has been called. 
 
 Thanks for everyone's help and input on this - I have now 
 spent two/three
 very late nights tracking this down.
 
 -Jerry
 
 
 
 
 -Original Message-
 From: Jim Barrows [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 8:45 AM
 To: Struts Users Mailing List
 Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
 
 
 
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED]
  Sent: Friday, December 03, 2004 9:20 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  
  One other thing to add : there is a key in the pageContext 
  attributes
  called topnav and that DOES contain an actual collection of 
  SimpleMenuItems.
  The plot thickens - how does the ForEach get the collection?
 
 I think it looks up the scope chain  request, session, application
 
  
  -Jerry 
  
  -Original Message-
  From: Jerry Rodgers [mailto:[EMAIL PROTECTED] 
  Sent: Friday, December 03, 2004 8:02 AM
  To: 'Struts Users Mailing List'; 'Mark Lowe'
  Subject: RE: JSTL, Tiles PutList and Tomcat 5.028
  
  Hi Matk, 
  
  I have the following statement
  
  tiles:importAttribute / 
  
  Which I think am lead to believe it imports all the 
  attributes into the
  page scope. 
  
  In an effort to figure out what was happening I downloaded 
  the jstl 1.0.6
  and built a debug project in eclipse so I could step into the 
  ForEach tag
  and I am not sure what I am really looking at yet in there 
  but it appears
  that indeed the item does contain a string and that the items 
  collection on 
  the tag has a somewhat string delimited representation of 
  the collection. 
  
  See below: This is that actual value in the string in the 
  debugger... Is
  this how it is stored then is ir reconstituted into 
  SimpleMenuItem(s) as
  the tag loops. The string looks like a collection because 
  of the , i.e.
  it looks like a string tokenizer.
  
  [SimpleMenuItem[value=nav.adminhome,
  link=/aems/session/changefiltertoken.do?btnResetFilter=true,
  tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account,
  link=/aems/party/persondetail.do, ], 
  SimpleMenuItem[value=nav.organization,
  link=/aems/party/organizationdetail.do, ], 
  SimpleMenuItem[value=nav.library,
  link=/aems/file/filelibrarylist.do, ], 
  SimpleMenuItem[value=nav.addressbook,
  link=/aems/communication/personsearchlist.do, ],
  SimpleMenuItem[value=nav.help, link=#, tooltip=help, ],
  SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]]
  
  And give this sting in the items - the actual when call to 
  next() within the
  EnumeratonAdapter way in the ForEachSupport class actuall calls the
  StringTokenizer and returns an item of:
  
  [SimpleMenuItem[value=nav.adminhome
  
  So it looks like it went to the first ,  and thus the 
  subject of my email
  might really be changed to: What is causing ForEach to 
  read/load my tiles
  putlist collection as a string and not as a collection of the
  SimpleMenuItems they really are? Pretty darn long subject : 
  
  
  On a side note 

struts tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Hi there! I often find myself writing scriptlet due to struts tags or my 
misunderstanding about it.
Let's suppose I have an action that retreives information in a user bean.
My jsp has an account form-bean
and one of the properties is the userID (a hidden value)
I always end up doing this:

html:form property=userId value='%=user.getId()%'/
is there a more elegant way?
thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: struts tags and scriplet

2004-12-03 Thread Bill Siggelkow
If you specify the form in the action you don't need to use the 
scriptlet -- Struts will retrieve and display the value for you.

-Bill Siggelkow
Vinicius Caldeira Carvalho wrote:
Hi there! I often find myself writing scriptlet due to struts tags or my 
misunderstanding about it.
Let's suppose I have an action that retreives information in a user bean.
My jsp has an account form-bean
and one of the properties is the userID (a hidden value)
I always end up doing this:

html:form property=userId value='%=user.getId()%'/
is there a more elegant way?
thanks

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


Re: struts tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Bill Siggelkow wrote:
If you specify the form in the action you don't need to use the 
scriptlet -- Struts will retrieve and display the value for you.

-Bill Siggelkow
Vinicius Caldeira Carvalho wrote:
Hi there! I often find myself writing scriptlet due to struts tags or 
my misunderstanding about it.
Let's suppose I have an action that retreives information in a user 
bean.
My jsp has an account form-bean
and one of the properties is the userID (a hidden value)
I always end up doing this:

html:form property=userId value='%=user.getId()%'/
is there a more elegant way?
thanks

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

Sorry I don't think I made my self clear here.
Not possible. The form hold values that do not come from a database, I'm 
not talking about an update where we assemble the form from a dto class. 
This is an insert form, so no values filled, only this specific hidden 
field and also it comes from an outside bean, not the one I'm trying to 
persist.

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


Re: struts tags and scriplet

2004-12-03 Thread Wendy Smoak
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 Not possible.

Not likely. ;)

 The form hold values that do not come from a database, I'm
 not talking about an update where we assemble the form from a dto class.
 This is an insert form, so no values filled, only this specific hidden
 field and also it comes from an outside bean, not the one I'm trying to
 persist.

In the Action, before the form is displayed, retrieve the value from this
'outside bean' and use that value to set the value of the form property.
Then forward to the input form, and Struts will display the value.

If you are allowing direct access to the JSP, don't. If you are retrieving
the 'outside bean' in the JSP, do it in the Action.

-- 
Wendy Smoak


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



RE: Using a key as var-value in validator

2004-12-03 Thread Ram Venkataswamy
Well, I think for now using Global Constant is the only option. Unless
somebody else have a answer for this. 


 
-Original Message-
From: Kinjal Sonpal [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 01, 2004 10:20 PM
To: Struts Users Mailing List
Subject: RE: Using a key as var-value in validator

Ram,

Thanks for replying back.

 If you have defined resource bundle in struts config  are able to
 access key from jsp then no additional step/configuration
 is required to
 access them in validation file. The arg/msg lookup resource bundle
 defined for the application and then pick up value

Yeah, this is fine. But I also need to access the key in defining
var-value tag of the field tag. Right now I have to do a
workaround by using a global constant. I want to avoid multiple points
of updation.

Thanks and regards,
Kinjal Sonpal

In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error.
Mark Twain




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



circular dependencies tile def

2004-12-03 Thread Jim Riley
Any ideas on why I keep getting a circular dependencies tile def
message? Seems a lot of people have been working on this problem and no
one has any answers. 
 
James Riley
Office of State CIO
[EMAIL PROTECTED]
 
W- 803.737.9770
C-  803.309.2134


Re: struts tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Wendy Smoak wrote:
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 

Not possible.
   

Not likely. ;)
 

The form hold values that do not come from a database, I'm
not talking about an update where we assemble the form from a dto class.
This is an insert form, so no values filled, only this specific hidden
field and also it comes from an outside bean, not the one I'm trying to
persist.
   

In the Action, before the form is displayed, retrieve the value from this
'outside bean' and use that value to set the value of the form property.
Then forward to the input form, and Struts will display the value.
If you are allowing direct access to the JSP, don't. If you are retrieving
the 'outside bean' in the JSP, do it in the Action.
 

Well, I tried this approach before, but it seems that struts re-creates 
the form when parsing the jsp.

I have the caller action having the name=myform
inside it I have this code:
myform.setUserId(myBean.getId());
then I forward
on the jsp:
html:form action=saveAction
my saveAction configuration on struts config also have the myForm as the 
name attribute.

Do I need to set the form on the request?
Thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: struts tags and scriplet

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Wendy Smoak [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 10:53 AM
 To: Struts Users Mailing List
 Subject: Re: struts tags and scriplet
 
 
 From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
  Not possible.
 
 Not likely. ;)

Amen.. :)

 
  The form hold values that do not come from a database, I'm
  not talking about an update where we assemble the form from 
 a dto class.
  This is an insert form, so no values filled, only this 
 specific hidden
  field and also it comes from an outside bean, not the one 
 I'm trying to
  persist.
 
 In the Action, before the form is displayed, retrieve the 
 value from this
 'outside bean' and use that value to set the value of the 
 form property.
 Then forward to the input form, and Struts will display the value.
 
 If you are allowing direct access to the JSP, don't. If you 
 are retrieving
 the 'outside bean' in the JSP, do it in the Action.
html:form property=userId value='%=user.getId()%'/
You have 3 more choices:
1) The struts bean taglib
2) JSP bean tags
3) JSTL bean tags.
html:blah property=userId value=${user.id/
 
 -- 
 Wendy Smoak
 
 
 -
 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: i18n and the database... -thanks - 1 more question

2004-12-03 Thread Michael Klaene
Thanks for all of the feedback.  I'll think on it some more with these 
suggestions in mind.  
 
I have one additional question, *sort of* on the topic of Message Resources.  
Suppose there is a database table that holds metadata used to configure some 
screens, but not all.  This table holds the form label, among other things.  
Instead of storing the actual label text in this table, I was thinking of 
storing the label as 'my_form.favorite_color'.  This refers to the entry in the 
ResourceBundle.  
 
Would there be an ideal way to perform this transformation?  I can think of 
something like a javaScript onload: reload function with the jsp set to 
nocache. Just wondering if anyone has ever tried storing code in the db that 
needs to be translated.
 
Thanks,
Mike

Guillaume Cottenceau [EMAIL PROTECTED] wrote:
Michael Klaene writes:

 3.)I know that some databases, Oracle, and I hear the newest version
 of MySQL support UTF-8. I've no experience in this area. Does anyone
 have experience with storing text in UTF-8 in the database? This
 *seems* like it could be an ideal approach, eliminating alot of
 on-going work. Obviously, the app would be less portable.

If you want to go with full i18n, even if you don't store
localized messages in database, you will hit the wall sooner or
later if the database is not able to store any string
representing text in any language, because you will want sooner
or later that your users be able to enter localized data in forms
that will end up in the database (their first/last name, etc).

Because of that reason, you need that the database be able to
store and retrieve localized text; a good approach can be to
specify that data is stored in a unicode character encoding;
UTF-8 is typically a good candidate when you have a lot of
latin-based text.

And this is really an issue at the database end. In java, the
Strings can correctly and transparently handle any language. You
just have to make sure that the database driver will correctly
store and retrieve data.

In the application at my company, the (postgres) database is
using UTF-8 and there is really nothing to say here: it works,
there is no problem.

In my opinion, the only issue is really the communication between
the end-user (browser) and your application. Sending data to the
end-user should be ok by using UTF-8 in your webpages, if your
users are not using netscape 2.0 or something. Retrieving data
should be ok by using UTF-8 in your webpages and possibly
specifying accept-charset=UTF-8 in your forms, and filtering
the input to force the CharacterEncoding to UTF-8 (because
browsers usually don't say that the data they send is UTF-8
encoded - there are been many discussions on that topic on this
list).


Please keep us updated about your project; I would be curious to
know about the performance, if you really go to using the
database for localized messages.

-- 
Guillaume Cottenceau

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



-
Do you Yahoo!?
 Send holiday email and support a worthy cause. Do good.

Re: i18n and the database...

2004-12-03 Thread brettconnor
I'd endorse this. UTF-8 or UTF-16 (depending on what languages you're expecting
most of your data to be in) will handle anything. If you have Oracle it will
also handle anything, it had NLS support before unicode, but your database must
be set up with a suitable character set. It is completely a non-issue. But do
cache the resources. If the resource access is encapsulated then you can try
with and without caching, you'll notice a difference.

Brett

Quoting Guillaume Cottenceau [EMAIL PROTECTED]:

 Michael Klaene mklaene 'at' yahoo.com writes:

  3.)I know that some databases, Oracle, and I hear the newest version
  of MySQL support UTF-8. I've no experience in this area. Does anyone
  have experience with storing text in UTF-8 in the database? This
  *seems* like it could be an ideal approach, eliminating alot of
  on-going work. Obviously, the app would be less portable.

 If you want to go with full i18n, even if you don't store
 localized messages in database, you will hit the wall sooner or
 later if the database is not able to store any string
 representing text in any language, because you will want sooner
 or later that your users be able to enter localized data in forms
 that will end up in the database (their first/last name, etc).

 Because of that reason, you need that the database be able to
 store and retrieve localized text; a good approach can be to
 specify that data is stored in a unicode character encoding;
 UTF-8 is typically a good candidate when you have a lot of
 latin-based text.

 And this is really an issue at the database end. In java, the
 Strings can correctly and transparently handle any language. You
 just have to make sure that the database driver will correctly
 store and retrieve data.

 In the application at my company, the (postgres) database is
 using UTF-8 and there is really nothing to say here: it works,
 there is no problem.

 In my opinion, the only issue is really the communication between
 the end-user (browser) and your application. Sending data to the
 end-user should be ok by using UTF-8 in your webpages, if your
 users are not using netscape 2.0 or something. Retrieving data
 should be ok by using UTF-8 in your webpages and possibly
 specifying accept-charset=UTF-8 in your forms, and filtering
 the input to force the CharacterEncoding to UTF-8 (because
 browsers usually don't say that the data they send is UTF-8
 encoded - there are been many discussions on that topic on this
 list).


 Please keep us updated about your project; I would be curious to
 know about the performance, if you really go to using the
 database for localized messages.

 --
 Guillaume Cottenceau

 -
 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 tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Wendy Smoak wrote:
From: Jim Barrows [EMAIL PROTECTED]
 

html:form property=userId value='%=user.getId()%'/
You have 3 more choices:
1) The struts bean taglib
2) JSP bean tags
3) JSTL bean tags.
html:blah property=userId value=${user.id/
   

But... this prevents the framework from re-displaying the user's input if
the form fails validation.  (The user could have modified the value that was
originally displayed, and that change will be lost.)
 

From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
I have the caller action having the name=myform
inside it I have this code:
myform.setUserId(myBean.getId());
then I forward
on the jsp:
   

Can you post the actual code?  I wonder if you are operating on the 'form'
object that was passed into the Action.execute() method, or not?
Also post the relevant parts of struts-config.xml (for the 'caller action'
you mentioned, and saveAction.)
 

The caller :
   action path=/reservaProspeccao/solicitarReservaProspeccao
   
type=com.squadra.portalvendas.apresentacao.reservaprospeccao.action.SolicitarReservaProspeccaoAction
   name=cadastrarReservaProspeccaoForm
   forward path=cadastrar.solicitarReservaProspeccao 
name=sucesso/
   /action
The save action
   action path=/reservaProspeccao/salvarReservaProspeccao
type=com.squadra.portalvendas.apresentacao.reservaprospeccao.action.SalvarReservaProspeccaoAction
   input=cadastrar.solicitarReservaProspeccao
   name=cadastrarReservaProspeccaoForm
   forward path=/SucessoGeral.jsp name=sucesso/
   /action

code
Proponente proponente = delegate.findProponente(id);
CadastrarReservaProspeccaoForm reservaForm = 
(CadastrarReservaProspeccaoForm)form;
reservaForm.setIdProponente(proponente.getId());
/code

As you can see I'm using the form object that is passed to the action 
via action servlet. After using I dont need to save it to the request do I?

Thanks for your time and patience
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: struts tags and scriplet

2004-12-03 Thread Wendy Smoak
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 code
 Proponente proponente = delegate.findProponente(id);
 CadastrarReservaProspeccaoForm reservaForm =
 (CadastrarReservaProspeccaoForm)form;
 reservaForm.setIdProponente(proponente.getId());
 /code
 As you can see I'm using the form object that is passed to the action
 via action servlet. After using I dont need to save it to the request do
I?

Which Action did that code come from?  (I'm guessing... the first one.  I'm
not sure why you need it, if it just executes some code and forwards to the
second action.  Why not just put the code directly in the second action?)

No, you don't need to say request.setAttribute(...).  You are operating on a
reference to the form, which the framework has already placed wherever it
belongs.

I'm having trouble figuring out exactly what the problem is, because this
isn't how I do things.  (I have one Action with a bunch of methods, and my
forms are usually in session scope.)

To determine whether you're losing the request somewhere along the way,
try putting the form in session scope and see if the problem goes away.
(Add   scope=session   to the action tag in struts-config.xml.)  Or
perhaps someone else can see what the problem is.

-- 
Wendy Smoak



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



Re: struts tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Wendy Smoak wrote:
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 

code
Proponente proponente = delegate.findProponente(id);
CadastrarReservaProspeccaoForm reservaForm =
(CadastrarReservaProspeccaoForm)form;
reservaForm.setIdProponente(proponente.getId());
/code
As you can see I'm using the form object that is passed to the action
via action servlet. After using I dont need to save it to the request do
   

I?
Which Action did that code come from?  (I'm guessing... the first one.  I'm
not sure why you need it, if it just executes some code and forwards to the
second action.  Why not just put the code directly in the second action?)
No, you don't need to say request.setAttribute(...).  You are operating on a
reference to the form, which the framework has already placed wherever it
belongs.
I'm having trouble figuring out exactly what the problem is, because this
isn't how I do things.  (I have one Action with a bunch of methods, and my
forms are usually in session scope.)
To determine whether you're losing the request somewhere along the way,
try putting the form in session scope and see if the problem goes away.
(Add   scope=session   to the action tag in struts-config.xml.)  Or
perhaps someone else can see what the problem is.
 

I have two actions cuz:
The first one is triggered after the user clicks in a link from a page 
that displays a list of prospects.
so it find the prospect attributes and then sets it for the form in the 
next page. got it?
Using session here is out of discussion, we use session only to hold 
user info (name, login, etc...)

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


html:form action=... - Newbie

2004-12-03 Thread Jacques
Hi,

Here's what I want to achieve :

I have a form (call it INPUT).  Let's say the form's action is ActionA.do.

ActionA.do is mapped to com.mycompany.myclass, which can either forward to
success or failure.  In struts-config.xml, success is mapped to
ActionB.do, and I want failure to be mapped to a simple JSP error page,
call it failure.jsp.  In other words, I don't want to re-display INPUT
with errors (html:errors) : I want a completely different page, because it
doesn't make sense in my application to re-display the INPUT form when this
error occurs.

In failure.jsp, I want to display the error message, and have a button that,
when clicked, will return the user to some other page, mapped to
ActionStart.do.

So, I thought I would use the following struts tag : html:form
action=ActionStart.do in that error page.

When I try the application, and the failure condition is triggered, I get
the following error message :

2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
org.apache.jasper.JasperException: Cannot retrieve definition for form bean
null
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...


My fix for this error was to forget about the struts html:form... tag,
and just use HTML's form... instead.

Although this worked, I would love to have an explanation as to why I got
the error mentionned, and maybe some workaround that would let me use
html:form...


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004
 


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



Re: struts tags and scriplet

2004-12-03 Thread Wendy Smoak
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 I have two actions cuz:
 The first one is triggered after the user clicks in a link from a page
 that displays a list of prospects.
 so it find the prospect attributes and then sets it for the form in the
 next page. got it?

Yes, but you'll find 'Action Chaining' is generally frowned upon.  Your
first action does not have an 'input' attribute, it just goes straight to
the second action when it's done.  And if you're setting a form property in
the first action that you say is NOT there in the second action, it makes me
think that a new request [and thus a new form] is being created somewhere
along the line.

First, I'd put a debug statement in before:
 reservaForm.setIdProponente(proponente.getId());
and print out proponente.getId() to make sure it really has a value.  Maybe
you're setting the form property to the empty String without realizing it.

What does the log file say?  The RequestProcessor is *very* verbose, you
should see things like:

09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -  Looking
for Action instance for class edu.asu.vpia.struts.DevilsDenRegisterAction
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -   Creating
new Action instance
09:50:24,311 - DEBUG edu.asu.vpia.struts.DevilsDenRegisterAction -
unspecified begin
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor - Processing
a 'GET' for path '/denLogin'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Storing
ActionForm bean instance in scope 'request' under attribute key 'loginForm'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Populating
bean properties from this request

If you put a debug statement in the constructor or the 'setIdProponente'
method, you should be able to see when the form gets created and when that
property gets set.  If you then see a second form creation, well, that's
where your value went!

-- 
Wendy Smoak


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



Re: html:form action=... - Newbie

2004-12-03 Thread Bill Siggelkow
The reason is that in classical HTML; forms are expected to accept 
input. Struts stores the input data in an ActionForm; the traditional 
approach for what you are doing would be to use a link and not a button.

-Bill Siggelkow
Jacques wrote:
Hi,
Here's what I want to achieve :
I have a form (call it INPUT).  Let's say the form's action is ActionA.do.
ActionA.do is mapped to com.mycompany.myclass, which can either forward to
success or failure.  In struts-config.xml, success is mapped to
ActionB.do, and I want failure to be mapped to a simple JSP error page,
call it failure.jsp.  In other words, I don't want to re-display INPUT
with errors (html:errors) : I want a completely different page, because it
doesn't make sense in my application to re-display the INPUT form when this
error occurs.
In failure.jsp, I want to display the error message, and have a button that,
when clicked, will return the user to some other page, mapped to
ActionStart.do.
So, I thought I would use the following struts tag : html:form
action=ActionStart.do in that error page.
When I try the application, and the failure condition is triggered, I get
the following error message :
2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
org.apache.jasper.JasperException: Cannot retrieve definition for form bean
null
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2
54)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
My fix for this error was to forget about the struts html:form... tag,
and just use HTML's form... instead.
Although this worked, I would love to have an explanation as to why I got
the error mentionned, and maybe some workaround that would let me use
html:form...
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.802 / Virus Database: 545 - Release Date: 11/26/2004

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


Re: html:form action=... - Newbie

2004-12-03 Thread Wendy Smoak
From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service() for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it to
use.  You probably left out the name=formName attribute, probably in the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will probably
spot the error.

-- 
Wendy Smoak


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



Re: struts tags and scriplet

2004-12-03 Thread Vinicius Caldeira Carvalho
Wendy Smoak wrote:
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 

I have two actions cuz:
The first one is triggered after the user clicks in a link from a page
that displays a list of prospects.
so it find the prospect attributes and then sets it for the form in the
next page. got it?
   

Yes, but you'll find 'Action Chaining' is generally frowned upon.  Your
first action does not have an 'input' attribute, it just goes straight to
the second action when it's done.  And if you're setting a form property in
the first action that you say is NOT there in the second action, it makes me
think that a new request [and thus a new form] is being created somewhere
along the line.
First, I'd put a debug statement in before:
 

reservaForm.setIdProponente(proponente.getId());
   

and print out proponente.getId() to make sure it really has a value.  Maybe
you're setting the form property to the empty String without realizing it.
What does the log file say?  The RequestProcessor is *very* verbose, you
should see things like:
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -  Looking
for Action instance for class edu.asu.vpia.struts.DevilsDenRegisterAction
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -   Creating
new Action instance
09:50:24,311 - DEBUG edu.asu.vpia.struts.DevilsDenRegisterAction -
unspecified begin
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor - Processing
a 'GET' for path '/denLogin'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Storing
ActionForm bean instance in scope 'request' under attribute key 'loginForm'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Populating
bean properties from this request
If you put a debug statement in the constructor or the 'setIdProponente'
method, you should be able to see when the form gets created and when that
property gets set.  If you then see a second form creation, well, that's
where your value went!
 

Well I think I got it. I used to debug a log when the constructor of my 
form is called and guess what.

Back in the good old struts in action (struts sequence diagram page)
The action servlet looks for an action (first action) finds a form 
associated (great!!! let's instantiate it for you). The value is set. 
Now,  forward to the jsp, oops, it has a form element with an action 
associated, (wow! now lets look for its formbean and instantiate it.) 
oops, now I have a new instance with empty fields 
well...
webwork??? jsf??? maybe...

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


RE: [BULK] - Re: html:form action=... - Newbie

2004-12-03 Thread Harrison Tsang


-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 11:31 AM
To: Struts Users Mailing List
Subject: [BULK] - Re: html:form action=... - Newbie

From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I
get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service()
for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real
names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it
to
use.  You probably left out the name=formName attribute, probably in
the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will
probably
spot the error.

-- 
Wendy Smoak


-
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 tags and scriplet

2004-12-03 Thread Bill Siggelkow
Are you specifying the name of the form bean as an attribute of the 
html:form tag on the target JSP? If so, then remove it ... it causes 
Struts to create a new action form ... (the name attribute on the 
html:form tag has been removed in Struts 1.2.x).

As far as your frustration; my advice is to
(1) take a few deep breaths
(2) look over the examples included with Struts.
The Struts community is very helpful; if you don't lose your patience; 
then they won't either.

-Bill Siggelkow
Vinicius Caldeira Carvalho wrote:
Wendy Smoak wrote:
From: Vinicius Caldeira Carvalho [EMAIL PROTECTED]
 

I have two actions cuz:
The first one is triggered after the user clicks in a link from a page
that displays a list of prospects.
so it find the prospect attributes and then sets it for the form in the
next page. got it?
  

Yes, but you'll find 'Action Chaining' is generally frowned upon.  Your
first action does not have an 'input' attribute, it just goes straight to
the second action when it's done.  And if you're setting a form 
property in
the first action that you say is NOT there in the second action, it 
makes me
think that a new request [and thus a new form] is being created somewhere
along the line.

First, I'd put a debug statement in before:
 

reservaForm.setIdProponente(proponente.getId());
  
and print out proponente.getId() to make sure it really has a value.  
Maybe
you're setting the form property to the empty String without realizing 
it.

What does the log file say?  The RequestProcessor is *very* verbose, you
should see things like:
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -  Looking
for Action instance for class edu.asu.vpia.struts.DevilsDenRegisterAction
09:50:24,202 - DEBUG org.apache.struts.action.RequestProcessor -   
Creating
new Action instance
09:50:24,311 - DEBUG edu.asu.vpia.struts.DevilsDenRegisterAction -
unspecified begin
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor - 
Processing
a 'GET' for path '/denLogin'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  Storing
ActionForm bean instance in scope 'request' under attribute key 
'loginForm'
09:51:08,155 - DEBUG org.apache.struts.action.RequestProcessor -  
Populating
bean properties from this request

If you put a debug statement in the constructor or the 'setIdProponente'
method, you should be able to see when the form gets created and when 
that
property gets set.  If you then see a second form creation, well, that's
where your value went!

 

Well I think I got it. I used to debug a log when the constructor of my 
form is called and guess what.

Back in the good old struts in action (struts sequence diagram page)
The action servlet looks for an action (first action) finds a form 
associated (great!!! let's instantiate it for you). The value is set. 
Now,  forward to the jsp, oops, it has a form element with an action 
associated, (wow! now lets look for its formbean and instantiate it.) 
oops, now I have a new instance with empty fields 
well...
webwork??? jsf??? maybe...

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


Off topic : IBM Portlet

2004-12-03 Thread Mathew, Manoj

Sorry for the off topic.
Any of you guys know what are the things I need to install in my machine to set 
up a portal and start working on portal.
I have WSAD in my system.

thanks 
Manoj Mathew

-Original Message-
From: Harrison Tsang [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 2:03 PM
To: Struts Users Mailing List
Subject: RE: [BULK] - Re: html:form action=... - Newbie




-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 11:31 AM
To: Struts Users Mailing List
Subject: [BULK] - Re: html:form action=... - Newbie

From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I
get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service()
for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real
names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it
to
use.  You probably left out the name=formName attribute, probably in
the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will
probably
spot the error.

-- 
Wendy Smoak


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



-Message Disclaimer-

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [EMAIL PROTECTED] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act (E-Sign)
unless a specific statement to the contrary is included in this message.

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



Re: MVC initialization

2004-12-03 Thread Ken Pelletier
A bit late to the party, but...
Firstly, I'd second what Joe said about PlugIns vs 
ServletContextListener: in more than one instance I've found that using 
ServletContextListener that does service/model initialization paid off 
when I later wanted to use the same service layer in a non-Struts web 
app;  unless it needs to be tied to Struts, a servlet context listener 
has the mvc framework-neutrality benefit.

I'd also add that you might find the Spring IoC (or another IoC 
container such as Pico) features are worth going a step further toward 
making your services webapp-independent as well.

Using Spring, I configure a model layer that consists of a rich domain, 
orm mapper (hibernate/jdo) and, if needed, a service layer that creates 
a facade for app-specific behavior and to handle transaction 
demarcation.  This setup works equally well in a Struts webapp (or any 
other webapp) as it does in fat clients, unit tests and scripts 
(scripting a Spring-configured rich domain model in grovvy is a real 
kick!).  It's surprisingly simple to do as well.

In that way, the configuration and bootstrapping of your service and 
model layers are flexible and reusable outside the webapp.

- Ken
On Nov 30, 2004, at 9:00 PM, [EMAIL PROTECTED] wrote:
Thank you both much!!!   I guess I will try using the 
ServletContextListener because I am using Servlet 2.3 as found in 
Tomcat 4.1.  I have tried hard on staying away from having a common 
initilization, but the scope of the service platform I created 
requires the ability now...so that each product can have its own 
specific interface callbacks as need be.   Guess this is the only way 
to achieve a generic platform and have specific service interfaces 
that sit on top.

Thank you for the help.   Now I just have to figure how to implement 
it.


- Original Message -
From: Joe Germuska [EMAIL PROTECTED]
Date: Tuesday, November 30, 2004 6:10 pm
Subject: RE: MVC initialization
At 6:02 PM -0500 11/30/04, Robert Taylor wrote:
A standardized approach would be to implement a
ServletContextListener and define it
in your web.xml for the web app. It will be invoked before the
web
app accepts any requests
and when the web app is shutdown.
A more Struts approach would be to use a PlugIn and define it
in
your struts-config.xml file.
Note that the only compelling reason to use a PlugIn would be if
you
were still only on Servlet 2.2 (when it hadn't yet been
introduced)
or if you needed your PlugIn to have a reference to the
ModuleConfig
object corresponding to the Module in which the PlugIn was defined.
Just wanted to point out that just because it's a more 'Struts'
approach, it's not necessarily better.
Then again, I keep writing PlugIns myself, just out of habit.
They work.
Joe
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
Narrow minds are weapons made for mass destruction  -The Ex

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

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


Re: Using a key as var-value in validator

2004-12-03 Thread Niall Pemberton
Would be a good idea IMO to add key/bundle to the var element in Commons
Validator. I've create a bugzilla ticket for this so it doesn't get
forgotten.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32522


If its something your interested in, patches are always welcome :-)


Niall

- Original Message - 
From: Ram Venkataswamy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, December 03, 2004 6:09 PM
Subject: RE: Using a key as var-value in validator


Well, I think for now using Global Constant is the only option. Unless
somebody else have a answer for this.



-Original Message-
From: Kinjal Sonpal [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 10:20 PM
To: Struts Users Mailing List
Subject: RE: Using a key as var-value in validator

Ram,

Thanks for replying back.

 If you have defined resource bundle in struts config  are able to
 access key from jsp then no additional step/configuration
 is required to
 access them in validation file. The arg/msg lookup resource bundle
 defined for the application and then pick up value

Yeah, this is fine. But I also need to access the key in defining
var-value tag of the field tag. Right now I have to do a
workaround by using a global constant. I want to avoid multiple points
of updation.

Thanks and regards,
Kinjal Sonpal

In the real world, the right thing never happens in the right place
at the right time. It is the task of journalists and historians to
rectify this error.
Mark Twain




-
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: Off topic : IBM Portlet

2004-12-03 Thread bmf5




I did a little work w/ this about 6 mos ago then the project was cancelled.
Depending on your WSAD version you'll probably need a plug-in for portlet
development.  We also installed the portal server for testing.  Here's a
link to the portal zone.  Somewhere in there are charts that give all the
requirements re. WSAD version, portlet version, etc that you need.

http://www-106.ibm.com/developerworks/websphere/zones/portal/





   
 Mathew, Manoj   
 [EMAIL PROTECTED] 
 ncipal.comTo 
   Struts Users Mailing List 
 12/03/2004 03:23  [EMAIL PROTECTED]
 PM cc 
   
   Subject 
 Please respond to Off topic : IBM Portlet 
   Struts Users   
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   





Sorry for the off topic.
Any of you guys know what are the things I need to install in my machine to
set up a portal and start working on portal.
I have WSAD in my system.

thanks
Manoj Mathew

-Original Message-
From: Harrison Tsang [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 2:03 PM
To: Struts Users Mailing List
Subject: RE: [BULK] - Re: html:form action=... - Newbie




-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 11:31 AM
To: Struts Users Mailing List
Subject: [BULK] - Re: html:form action=... - Newbie

From: Jacques [EMAIL PROTECTED]
 When I try the application, and the failure condition is triggered, I
get
 the following error message :

 2004-12-03 13:27:20 StandardWrapperValve[action]: Servlet.service()
for
 servlet action threw exception
 org.apache.jasper.JasperException: Cannot retrieve definition for form
bean
 null

Rather than make up names, it's a lot easier if you just use the real
names
of the forms and classes you're working on.

That error means that Struts can't figure out what form bean you want it
to
use.  You probably left out the name=formName attribute, probably in
the
action tag in struts-config.xml.  Post your actual config information
[just the action tag] and some of your JSP code, and someone will
probably
spot the error.

--
Wendy Smoak


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



-Message Disclaimer-

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [EMAIL PROTECTED] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act (E-Sign)
unless a specific statement to the contrary is included in this message.

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




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



Re: Where to store and how to retrieve Images for web app

2004-12-03 Thread Ken Pelletier
My experience with this has been a blend of some of what's been said so 
far, with a bit of sugar on top.

I agree with those who say that the filesystem and a stock webserver 
(apache) are the way to server images - and all static content, imho. 
(ymmv)   Particularly since your image data is dynamic (not part of 
your app but user data that is uploaded), this makes webapp deployment 
easier and even allows deployment of an unpacked war.

I use apache to serve all images, and an image manager object in the 
service layer of my app (as I believe Joe suggested as wel ).  The 
image manager handles storing uploaded images to the a configured 
filesystem location as well as associating the related metadata with 
the business data.

The bit of sugar you might consider is a tag that uses a configured 
http prefix to generate the URL's for img tags.

In one application, I have a simple tag that composes product catalog 
image URL's, given a product instance, for example:

img src=i:catalogImageURI product=${product}'/
That tag just uses attributes of the Product domain object to compose 
the URL, given the currently-configured http server that's handling 
images.

You can then tweak your webapp configuration to allow for your web 
container to serve the images out of your context root during 
development for example, but have apache serve the images in 
production.

- Ken
On Dec 1, 2004, at 12:12 PM, Woodchuck wrote:
hihi,
yea i also keep images on the fileserver.  it's nice and simple.  as
many others have said already, all that needs to go to the database is
any meta info about the image you require and any other info needed to
construct the image link for display.
no need for any servlet image--blob business.  when you need to
deploy or redeploy, just zip up the the images folder or just war the
whole thing and away you go.  can't get simpler than that.
i have also found websphere to be slower than tomcat.  it's not as
zippity as tomcat.  i'm willing to bet that it's because websphere has
a lot of @[EMAIL PROTECTED]@$@% code in it.
woodchuck
--- Jim Barrows [EMAIL PROTECTED] wrote:

-Original Message-
From: Brady Hegberg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 01, 2004 10:40 AM
To: Struts Users Mailing List
Subject: RE: Where to store and how to retrieve Images for web app
snip/
Does anyone know if there are advantages in particular app-servers
to
keeping your graphics on the filesystem versus in the database?
Well...let's see... local to server file system, no data xfer across
network. Store image in DB and you have to pull image across net,
then shove it out to user.
Depending on image size and network latency, the container won't make
any difference at all to performance.
If you're doing a lot of images, then you probably want to put Apache
in front.  I have told apache to redirect certain requests to the
images directory, while letting my web app write their.  Beats ths
stuffin out of writing a pass through servlet.  If apache and
app-server can't reside on same box, share drives or use something
like rsync to keep both boxes up to date.
As for app-server speed... I've found Websphere to be somewhat slower
the Tomcat then again.. it could be the @[EMAIL PROTECTED]@$@% legacy code
I'm dealing with too.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



__
Do you Yahoo!?
All your favorites on one personal page – Try My Yahoo!
http://my.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: Using a key as var-value in validator

2004-12-03 Thread Niall Pemberton
Actually I hate patches - but thats the party line! Changing the code's
usually easy and straight forward - its the testing that ends up taking
most of the time and is a pain, with a patch you just get to do the testing
part :-(

Now answering questions thats good - I don't have to test them :-)

Niall

- Original Message - 
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, December 03, 2004 10:37 PM
Subject: RE: Using a key as var-value in validator


  If its something your interested in, patches are
  always welcome :-)

 Patches?  Patches?  You think I have time for patches?  Just because I
pick
 up some of the tougher questions and try to find a solution for them to
 satisfy my own curiosity doesn't mean I want to TRULY know how the Struts
or
 Commons Validator internals work on a low level. :)

 We'll see what I get around to  Just don't ask me to make another
 taglib.  My last one for the Validator wasn't requested by even one
 listmember.
 *Add a melodramatic sigh here for effect*

 Regards,
 David

 -Original Message-
 From: Niall Pemberton [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 4:00 PM
 To: Struts Users Mailing List
 Subject: Re: Using a key as var-value in validator


 Would be a good idea IMO to add key/bundle to the var element in Commons
 Validator. I've create a bugzilla ticket for this so it doesn't get
 forgotten.

 http://issues.apache.org/bugzilla/show_bug.cgi?id=32522

 If its something your interested in, patches are always welcome :-)

 Niall

 - Original Message -
 From: Ram Venkataswamy [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 6:09 PM
 Subject: RE: Using a key as var-value in validator


 Well, I think for now using Global Constant is the only option. Unless
 somebody else have a answer for this.



 -Original Message-
 From: Kinjal Sonpal [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 01, 2004 10:20 PM
 To: Struts Users Mailing List
 Subject: RE: Using a key as var-value in validator

 Ram,

 Thanks for replying back.

  If you have defined resource bundle in struts config  are able to
  access key from jsp then no additional step/configuration
  is required to
  access them in validation file. The arg/msg lookup resource bundle
  defined for the application and then pick up value

 Yeah, this is fine. But I also need to access the key in defining
 var-value tag of the field tag. Right now I have to do a
 workaround by using a global constant. I want to avoid multiple points
 of updation.

 Thanks and regards,
 Kinjal Sonpal
 
 In the real world, the right thing never happens in the right place
 at the right time. It is the task of journalists and historians to
 rectify this error.
 Mark Twain




 -
 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: i18n input

2004-12-03 Thread Huw Richards
The one problem I had with i18n input was with European locales where , is
used as the decimal separator. The number would be formatted with , as the
decimal separator but as the input boxes are just text, the numeric keypad
which produces , in excel when . is pressed just produces . in the
number box. I had to rely on an adapted javascript to mask the numbers on
field entry  exit.

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 03, 2004 11:00 AM
To: Struts Users Mailing List
Subject: RE: i18n input



___

*** WARNING ***

This email has been received from the internet. 
Check any attachments for viruses before opening them. 
___




 -Original Message-
 From: Simon Matic Langford [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 8:51 AM
 To: 'Struts Users Mailing List'
 Subject: RE: i18n input
 
 
 yeah, I know I can do this, but this is a large system with around 200
 jsps 80 views
 and a number of controllers. doing the display is reasonably simple I
 know, but extremely
 tedious and prone to errors, I was hoping for a more elegant solution
 which also handles
 input...

I believe it does handle input as well... depending on the browser, which
java has no control over.  

  
  Java comes with i18n built in.  You want the JSTL fmt:blah 
  for output and look at the way message resources are handled 
  in struts, as well as read through the i18n documentation on 
  the sun site.
 
 
 -
 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]


___ 

CONFIDENTIALITY NOTE 

This message may contain confidential and privileged information. 
If you think, for any reason, that this message may have been 
addressed to you in error, you must not disseminate, copy or 
take any action in reliance on it and we would ask you to notify us 
immediately by return email to [EMAIL PROTECTED]. 

http://www.oprig.com 


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



RE: i18n input

2004-12-03 Thread Jim Barrows


 -Original Message-
 From: Huw Richards [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 4:05 PM
 To: Struts Users Mailing List
 Subject: RE: i18n input
 
 
 The one problem I had with i18n input was with European 
 locales where , is
 used as the decimal separator. The number would be formatted 
 with , as the
 decimal separator but as the input boxes are just text, the 
 numeric keypad
 which produces , in excel when . is pressed just produces 
 . in the
 number box. I had to rely on an adapted javascript to mask 
 the numbers on
 field entry  exit.

Browser issue I believe which is not all that surprising I suppose.  
Normally Swing/AWT handle I18N quite well, the problem with web apps (any 
language) is the browser and what it thinks it should be doing.

 
 -Original Message-
 From: Jim Barrows [mailto:[EMAIL PROTECTED] 
 Sent: Friday, December 03, 2004 11:00 AM
 To: Struts Users Mailing List
 Subject: RE: i18n input
 
 
 
 ___
 
 *** WARNING ***
 
 This email has been received from the internet. 
 Check any attachments for viruses before opening them. 
 ___
 
 
 
 
  -Original Message-
  From: Simon Matic Langford [mailto:[EMAIL PROTECTED]
  Sent: Friday, December 03, 2004 8:51 AM
  To: 'Struts Users Mailing List'
  Subject: RE: i18n input
  
  
  yeah, I know I can do this, but this is a large system with 
 around 200
  jsps 80 views
  and a number of controllers. doing the display is 
 reasonably simple I
  know, but extremely
  tedious and prone to errors, I was hoping for a more 
 elegant solution
  which also handles
  input...
 
 I believe it does handle input as well... depending on the 
 browser, which
 java has no control over.  
 
   
   Java comes with i18n built in.  You want the JSTL fmt:blah 
   for output and look at the way message resources are handled 
   in struts, as well as read through the i18n documentation on 
   the sun site.
  
  
  
 -
  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]
 
 
 ___ 
 
 CONFIDENTIALITY NOTE 
 
 This message may contain confidential and privileged information. 
 If you think, for any reason, that this message may have been 
 addressed to you in error, you must not disseminate, copy or 
 take any action in reliance on it and we would ask you to notify us 
 immediately by return email to [EMAIL PROTECTED]. 
 
 http://www.oprig.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]



Access to a database with a configuration file

2004-12-03 Thread Philippe PONSONNET
Hello,

 

I would like to use a database with struts without using the default
datasource.

I also would like to configure all acces of this database with a xml file
named database.xml.

The goal of this is to have a really independant model.

 

So I have developped a special class named Database which uses the
database.xml file for its connection.

All my classes which map a table use this class. Like that, it is not
nessecary to add some code in my action classes to connect the database.

 

But I have a problem when I want to load the database.xml file : I can't get
its path when my webapp is loaded.

The instruction getClass().getResource(.).getFile() always return null.

 

How could I do ?

 

Thanks in advance and sorry for my poor english.

 

Philippe



Access to a database with a configuration file

2004-12-03 Thread Philippe PONSONNET
Hello,

 

I would like to use a database with struts without using the default
datasource.

I also would like to configure all acces of this database with a xml file
named database.xml.

The goal of this is to have a really independant model.

 

So I have developped a special class named Database which uses the
database.xml file for its connection.

All my classes which map a table use this class. Like that, it is not
nessecary to add some code in my action classes to connect the database.

 

But I have a problem when I want to load the database.xml file : I can't get
its path when my webapp is loaded.

The instruction getClass().getResource(.).getFile() always return null.

 

How could I do ?

 

Thanks in advance and sorry for my poor english.

 

Philippe



Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5

2004-12-03 Thread Eddie Bush
FWIW ... seems like having my Tomcat installation burried under Program 
Files etc was the culprit.  I reinstalled to C:\Tomcat\5.0 and then deleted 
my Tomcat config and created a new one and everything seems to be working 
alright now.

It's really cool.  I can totally debug anything right in Eclipse!
- Original Message - 
From: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 6:34 AM
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


WTP = Web Tools Platform
I've seen the Sysdedo plugin, but I was trying to keep my environment here 
congruent with what's at work.  The WTP seems to be what's running inside 
of WSAD.

I don't see anything inside the Windows - Preferences section.  I do see 
a top-level node for Solar Eclipse  I can't recall if this was something 
I installed because I heard I should or the WTP needed it.  I don't see 
a tabbed pane or node or anything indicative of WTP.

Good stuff, Peter :-)  Thanks.  I'm actually going to try out the memory 
ideas on WSAD at work and see if that helps boost performance.  I've got a 
gig of RAM and it's ... still a beast to fire off :-)

Eddie
- Original Message - 
From: Pilgrim, Peter [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 6:20 AM
Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5



-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]
====

Has anyone successfully setup IBM WTP with Tomcat 5 under
Eclipse 3.01?
Every time I go to fire the server off it fails and says
there was a problem in thread main.  I can launch Tomcat just
fine from the command prompt or as a service :-|
My guess is that it's doing something wrong in trying to
launch Tomcat (duh!), but I can't find a confuration
parameter that's incorrect and I can't find any other handle
by which to control things or even tell which end it thinks is up.
Anyone experienced / solved this?
====

0) Look under Eclipse menu Windows-Preferences , see if you
can fine the tabbed pane for the plug-in that launching
the application / web server.
1) What does WTP stand for?
2) Have you looked at the Sysdeo Eclipse Plug-in?
This can launch Tomcat 3,4,5 fine.
3) Eclipse and Big Project are notorious for out of memory errors.
Under windows XP you need configure the Shortcut for
``C:\opt\eclipse\Eclipse.exe'' and add something like
`` --vmargs -Xss32m -Xmx256m '. Keep the stack size low
for lots of threads, and increase the heap space as proportional
to 1/3 to 1/2 of RAM on your PC (for big projects 2000 classes or more)
The same advice might apply to another Java programs you
launch under the control of Eclipse, ie Debugging or Running apps,
JUnit tests, or launching web / app servers if they do not add
configuration for their own memory requirements.
--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston,
10 South Colonnade, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497
==
This message is for the sole use of the intended recipient. If you 
received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until 
they
are confirmed by us. Message transmission is not guaranteed to be secure.
==

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

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0448-1, 11/26/2004
Tested on: 11/29/2004 6:34:13 AM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com

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


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0449-1, 12/02/2004
Tested on: 12/3/2004 9:05:29 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com

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


RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5

2004-12-03 Thread David G. Friedman
Eddie,

Since you put it that way, the culprit was probably
spaces in the path such as in the directory
C:\Program Files.  I had that happen to me in Windows
XP with Tomcat 5.X.XX until I used the short dir /x
names.  For Program files it was c:\progra~1

Regards,
David

-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 10:05 PM
To: Struts Users Mailing List
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


FWIW ... seems like having my Tomcat installation burried under Program
Files etc was the culprit.  I reinstalled to C:\Tomcat\5.0 and then deleted
my Tomcat config and created a new one and everything seems to be working
alright now.

It's really cool.  I can totally debug anything right in Eclipse!

- Original Message -
From: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 6:34 AM
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


 WTP = Web Tools Platform

 I've seen the Sysdedo plugin, but I was trying to keep my environment here
 congruent with what's at work.  The WTP seems to be what's running inside
 of WSAD.

 I don't see anything inside the Windows - Preferences section.  I do see
 a top-level node for Solar Eclipse  I can't recall if this was something
 I installed because I heard I should or the WTP needed it.  I don't see
 a tabbed pane or node or anything indicative of WTP.

 Good stuff, Peter :-)  Thanks.  I'm actually going to try out the memory
 ideas on WSAD at work and see if that helps boost performance.  I've got a
 gig of RAM and it's ... still a beast to fire off :-)

 Eddie

 - Original Message -
 From: Pilgrim, Peter [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Monday, November 29, 2004 6:20 AM
 Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5



 -Original Message-
 From: Eddie Bush [mailto:[EMAIL PROTECTED]
 ====


 Has anyone successfully setup IBM WTP with Tomcat 5 under
 Eclipse 3.01?
 Every time I go to fire the server off it fails and says
 there was a problem in thread main.  I can launch Tomcat just
 fine from the command prompt or as a service :-|
 My guess is that it's doing something wrong in trying to
 launch Tomcat (duh!), but I can't find a confuration
 parameter that's incorrect and I can't find any other handle
 by which to control things or even tell which end it thinks is up.
 Anyone experienced / solved this?

 ====


 0) Look under Eclipse menu Windows-Preferences , see if you
 can fine the tabbed pane for the plug-in that launching
 the application / web server.

 1) What does WTP stand for?

 2) Have you looked at the Sysdeo Eclipse Plug-in?
 This can launch Tomcat 3,4,5 fine.

 3) Eclipse and Big Project are notorious for out of memory errors.
 Under windows XP you need configure the Shortcut for
 ``C:\opt\eclipse\Eclipse.exe'' and add something like
 `` --vmargs -Xss32m -Xmx256m '. Keep the stack size low
 for lots of threads, and increase the heap space as proportional
 to 1/3 to 1/2 of RAM on your PC (for big projects 2000 classes or more)

 The same advice might apply to another Java programs you
 launch under the control of Eclipse, ie Debugging or Running apps,
 JUnit tests, or launching web / app servers if they do not add
 configuration for their own memory requirements.

 --
 Peter Pilgrim
 Operations/IT - Credit Suisse First Boston,
 10 South Colonnade, London E14 4QJ, United Kingdom
 Tel: +44-(0)207-883-4497




==
 This message is for the sole use of the intended recipient. If you
 received
 this message in error please delete it and notify us. If this message was
 misdirected, CSFB does not waive any confidentiality or privilege. CSFB
 retains and monitors electronic communications sent through its network.
 Instructions transmitted over this system are not binding on CSFB until
 they
 are confirmed by us. Message transmission is not guaranteed to be secure.


==


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




 ---
 avast! Antivirus: Outbound message clean.
 Virus Database (VPS): 0448-1, 11/26/2004
 Tested on: 11/29/2004 6:34:13 AM
 avast! - copyright (c) 2000-2004 ALWIL Software.
 http://www.avast.com




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





---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0449-1, 12/02/2004
Tested on: 12/3/2004 9:05:29 PM
avast! - copyright (c) 2000-2004 ALWIL Software.
http://www.avast.com




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

Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5

2004-12-03 Thread Eddie Bush
Yes.  That's my thought as well.  Eclipse likes to control things though.  I 
first tried putting quotes around the path and when that didn't work I 
reinstalled to a new, shorter, spaceless location.  I didn't try using short 
names, but I have to wonder if Eclipse would like that.  It seemed pretty 
picky!

Still, it's food for thought if there's anyone else out there setting up the 
WTP :-)

Later / Thanks!
Eddie
- Original Message - 
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, December 03, 2004 9:16 PM
Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


Eddie,
Since you put it that way, the culprit was probably
spaces in the path such as in the directory
C:\Program Files.  I had that happen to me in Windows
XP with Tomcat 5.X.XX until I used the short dir /x
names.  For Program files it was c:\progra~1
Regards,
David
-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 10:05 PM
To: Struts Users Mailing List
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5
FWIW ... seems like having my Tomcat installation burried under Program
Files etc was the culprit.  I reinstalled to C:\Tomcat\5.0 and then 
deleted
my Tomcat config and created a new one and everything seems to be working
alright now.

It's really cool.  I can totally debug anything right in Eclipse!
- Original Message -
From: Eddie Bush [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 6:34 AM
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5

WTP = Web Tools Platform
I've seen the Sysdedo plugin, but I was trying to keep my environment 
here
congruent with what's at work.  The WTP seems to be what's running inside
of WSAD.

I don't see anything inside the Windows - Preferences section.  I do see
a top-level node for Solar Eclipse  I can't recall if this was 
something
I installed because I heard I should or the WTP needed it.  I don't see
a tabbed pane or node or anything indicative of WTP.

Good stuff, Peter :-)  Thanks.  I'm actually going to try out the memory
ideas on WSAD at work and see if that helps boost performance.  I've got 
a
gig of RAM and it's ... still a beast to fire off :-)

Eddie
- Original Message -
From: Pilgrim, Peter [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, November 29, 2004 6:20 AM
Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]
====

Has anyone successfully setup IBM WTP with Tomcat 5 under
Eclipse 3.01?
Every time I go to fire the server off it fails and says
there was a problem in thread main.  I can launch Tomcat just
fine from the command prompt or as a service :-|
My guess is that it's doing something wrong in trying to
launch Tomcat (duh!), but I can't find a confuration
parameter that's incorrect and I can't find any other handle
by which to control things or even tell which end it thinks is up.
Anyone experienced / solved this?
====

0) Look under Eclipse menu Windows-Preferences , see if you
can fine the tabbed pane for the plug-in that launching
the application / web server.
1) What does WTP stand for?
2) Have you looked at the Sysdeo Eclipse Plug-in?
This can launch Tomcat 3,4,5 fine.
3) Eclipse and Big Project are notorious for out of memory errors.
Under windows XP you need configure the Shortcut for
``C:\opt\eclipse\Eclipse.exe'' and add something like
`` --vmargs -Xss32m -Xmx256m '. Keep the stack size low
for lots of threads, and increase the heap space as proportional
to 1/3 to 1/2 of RAM on your PC (for big projects 2000 classes or more)
The same advice might apply to another Java programs you
launch under the control of Eclipse, ie Debugging or Running apps,
JUnit tests, or launching web / app servers if they do not add
configuration for their own memory requirements.
--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston,
10 South Colonnade, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497


==
This message is for the sole use of the intended recipient. If you
received
this message in error please delete it and notify us. If this message 
was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until
they
are confirmed by us. Message transmission is not guaranteed to be 
secure.


==

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

---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0448-1, 11/26/2004
Tested on: 11/29/2004 6:34:13 AM
avast! - copyright (c) 

Re: circular dependencies tile def

2004-12-03 Thread James Mitchell
This can happen for any one of many reasons.
Unless you provide more details on what you are doing, we can only guess.
(a) XyzAction - tile-def - jsps
(one of the jsp does a redirect or forward to XyzAction
(b) XyzAction - tile-def - action-forward - XyzAction
(c) XyzAction - tile-def - jsps (a page does a tiles:include for tile-def)


--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx
- Original Message - 
From: Jim Riley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, December 03, 2004 12:59 PM
Subject: circular dependencies tile def


Any ideas on why I keep getting a circular dependencies tile def
message? Seems a lot of people have been working on this problem and no
one has any answers.
James Riley
Office of State CIO
[EMAIL PROTECTED]
W- 803.737.9770
C-  803.309.2134

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


RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5

2004-12-03 Thread David G. Friedman
Eddit,

The problem I had was with both the JAVA_HOME and CATALINA_HOME
environmental variables.  Once both of those environmental variables were
changed, Eclipse and Ant worked as expected.

Regards,
David

-Original Message-
From: Eddie Bush [mailto:[EMAIL PROTECTED]
Sent: Friday, December 03, 2004 10:24 PM
To: Struts Users Mailing List
Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


Yes.  That's my thought as well.  Eclipse likes to control things though.  I
first tried putting quotes around the path and when that didn't work I
reinstalled to a new, shorter, spaceless location.  I didn't try using short
names, but I have to wonder if Eclipse would like that.  It seemed pretty
picky!

Still, it's food for thought if there's anyone else out there setting up the
WTP :-)

Later / Thanks!

Eddie

- Original Message -
From: David G. Friedman [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, December 03, 2004 9:16 PM
Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


 Eddie,

 Since you put it that way, the culprit was probably
 spaces in the path such as in the directory
 C:\Program Files.  I had that happen to me in Windows
 XP with Tomcat 5.X.XX until I used the short dir /x
 names.  For Program files it was c:\progra~1

 Regards,
 David

 -Original Message-
 From: Eddie Bush [mailto:[EMAIL PROTECTED]
 Sent: Friday, December 03, 2004 10:05 PM
 To: Struts Users Mailing List
 Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


 FWIW ... seems like having my Tomcat installation burried under Program
 Files etc was the culprit.  I reinstalled to C:\Tomcat\5.0 and then
 deleted
 my Tomcat config and created a new one and everything seems to be working
 alright now.

 It's really cool.  I can totally debug anything right in Eclipse!

 - Original Message -
 From: Eddie Bush [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Monday, November 29, 2004 6:34 AM
 Subject: Re: [OT] Eclips 3.01 + IBM WTP + Tomcat 5


 WTP = Web Tools Platform

 I've seen the Sysdedo plugin, but I was trying to keep my environment
 here
 congruent with what's at work.  The WTP seems to be what's running inside
 of WSAD.

 I don't see anything inside the Windows - Preferences section.  I do see
 a top-level node for Solar Eclipse  I can't recall if this was
 something
 I installed because I heard I should or the WTP needed it.  I don't see
 a tabbed pane or node or anything indicative of WTP.

 Good stuff, Peter :-)  Thanks.  I'm actually going to try out the memory
 ideas on WSAD at work and see if that helps boost performance.  I've got
 a
 gig of RAM and it's ... still a beast to fire off :-)

 Eddie

 - Original Message -
 From: Pilgrim, Peter [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Monday, November 29, 2004 6:20 AM
 Subject: RE: [OT] Eclips 3.01 + IBM WTP + Tomcat 5



 -Original Message-
 From: Eddie Bush [mailto:[EMAIL PROTECTED]
 ====


 Has anyone successfully setup IBM WTP with Tomcat 5 under
 Eclipse 3.01?
 Every time I go to fire the server off it fails and says
 there was a problem in thread main.  I can launch Tomcat just
 fine from the command prompt or as a service :-|
 My guess is that it's doing something wrong in trying to
 launch Tomcat (duh!), but I can't find a confuration
 parameter that's incorrect and I can't find any other handle
 by which to control things or even tell which end it thinks is up.
 Anyone experienced / solved this?

 ====


 0) Look under Eclipse menu Windows-Preferences , see if you
 can fine the tabbed pane for the plug-in that launching
 the application / web server.

 1) What does WTP stand for?

 2) Have you looked at the Sysdeo Eclipse Plug-in?
 This can launch Tomcat 3,4,5 fine.

 3) Eclipse and Big Project are notorious for out of memory errors.
 Under windows XP you need configure the Shortcut for
 ``C:\opt\eclipse\Eclipse.exe'' and add something like
 `` --vmargs -Xss32m -Xmx256m '. Keep the stack size low
 for lots of threads, and increase the heap space as proportional
 to 1/3 to 1/2 of RAM on your PC (for big projects 2000 classes or more)

 The same advice might apply to another Java programs you
 launch under the control of Eclipse, ie Debugging or Running apps,
 JUnit tests, or launching web / app servers if they do not add
 configuration for their own memory requirements.

 --
 Peter Pilgrim
 Operations/IT - Credit Suisse First Boston,
 10 South Colonnade, London E14 4QJ, United Kingdom
 Tel: +44-(0)207-883-4497





 ==
 This message is for the sole use of the intended recipient. If you
 received
 this message in error please delete it and notify us. If this message
 was
 misdirected, CSFB does not waive any confidentiality or privilege. CSFB
 retains and monitors electronic communications sent through its network.
 Instructions transmitted over this