Please unsubscribe me

2006-11-07 Thread Pillay, Kiren KN
I've tried many times to unsubscribe myself from this list but its not
working. I've asked for help but to no avail.
 

__

Standard Bank Disclaimer and Confidentiality Note

This e-mail, its attachments and any rights attaching hereto are, unless the 
context clearly indicates otherwise, the property of Standard Bank Group Limited
and/or its subsidiaries (the Group). It is confidential, private and intended 
for the addressee only. Should you not be the addressee and receive this e-mail 
by
mistake, kindly notify the sender, and delete this e-mail, immediately and do 
not disclose or use same in any manner whatsoever. Views and opinions
expressed in this e-mail are those of the sender unless clearly stated as those 
of the Group. The Group accepts no liability whatsoever for any loss or
damages whatsoever and howsoever incurred, or suffered, resulting, or arising, 
from the use of this email or its attachments. The Group does not warrant the 
integrity
of this e-mail nor that it is free of errors, viruses, interception or 
interference. Licensed divisions of the Standard Bank Group are authorised 
financial services providers
in terms of the Financial Advisory and Intermediary Services Act, No 37 of 2002 
(FAIS).
For information about the Standard Bank Group Limited visit our website 
http://www.standardbank.co.za
___


Re: Please unsubscribe me

2006-11-07 Thread Craig McClanahan

On 11/7/06, Pillay, Kiren KN [EMAIL PROTECTED] wrote:


I've tried many times to unsubscribe myself from this list but its not
working. I've asked for help but to no avail.



Done.

Craig


Using ActionMessage in Struts

2006-11-07 Thread Barun Kumar Yadav


Hi,

Can anyone give a small example of how to us ActionMessage in struts to display 
errors.

It would be great if I can get the samples for following 

 - Saving errors in ActionMessage
 - How to represent it on the jsp


Thanks
Barun Kumar Yadav
¬Sapient  Bangalore
Work 91.804.104.7490
Mobile  91.988.628.5028
YIM   meet_you_23






[s2] Error setting 'dojo.transport'

2006-11-07 Thread Oleg Galkin

When I use the div ajax tag the exception
Error setting expr 'dojo.transport' with value '...'
ognl.OgnlException: target is null for setProperty(null, transport, ...)
is thrown. The showcase example application throws the same exception. 
Anyway, the tag works. The resulting query string for the div href action 
indeed includes 'dojo.transport=xmlhttp' parameter.
Does dojo toolkit add it? If so is it possible to ignore it in Parameters 
interceptor?

Thanks,
Oleg

_
FREE pop-up blocking with the new MSN Toolbar - get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/



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



Re: Using ActionMessage in Struts

2006-11-07 Thread Niall Pemberton

On 11/7/06, Barun Kumar Yadav [EMAIL PROTECTED] wrote:


Hi,

Can anyone give a small example of how to us ActionMessage in struts to display 
errors.


http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html


It would be great if I can get the samples for following

 - Saving errors in ActionMessage
 - How to represent it on the jsp


Thanks
Barun Kumar Yadav


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



RE: Using ActionMessage in Struts

2006-11-07 Thread RoseIndia.net Help
Hi Barun,

Visit http://www.roseindia.net/struts/address_struts_validator.shtml





-Original Message-
From: Barun Kumar Yadav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 07, 2006 2:39 PM
To: Struts Users Mailing List
Subject: Using ActionMessage in Struts




Hi,

Can anyone give a small example of how to us ActionMessage in struts to
display errors.

It would be great if I can get the samples for following

 - Saving errors in ActionMessage
 - How to represent it on the jsp


Thanks
Barun Kumar Yadav
¬Sapient  Bangalore
Work 91.804.104.7490
Mobile  91.988.628.5028
YIM   meet_you_23






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



Re: how recover a map of a bean in a select list of the jsp and to post the data ?

2006-11-07 Thread nalimoussa
Hi everybody,   
Here is my code, the result isn't posted inside the select list, but
outwards, why?

s:select label=Entite de gestion
  name=mySelection
  listKey=PK_AMC
  listValue=nomAMC
s:property value=map /

/s:select

 Regards,

Nabil.


Le lundi 06 novembre 2006 à 11:05 -0500, Ed Griebel a écrit :
 You need to use either logic:iterate or c:forEach to iterate over your
 beans.
 
 This deals with arrays but is useful for how to use the iterator and how to
 populate a select list: http://husted.com/struts/tips/006.html
 
 HTH,
 -ed
 
 On 11/6/06, nalimoussa [EMAIL PROTECTED] wrote:
 
  Hi everybody,
 
  I have to create a map in a bean which recovers the data of a table, I
  would like post(integrate) these data in a select list of a JSP?
 
  Regards,
 
  Nabil.
 
 
  -
  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]



SiteMesh

2006-11-07 Thread Juan Espinosa
Hi to all, im using sitemesh and i have a little problems with excludes
I have an action that load some data from a db and then goes to a jsp page.
 
   action name=LoadSomeDataAndGoToJSP class=test.TestAction
result/private/someJSP.jsp/result
/action
 
i put in the exclude section of the decorators.xml this page
/private/someJSP.jsp
but sitemesh decores it. 
 
excludes
pattern/private/someJSP.jsp/pattern
/excludes
 
then i put this, and it works, sitemesh doesnt decorate it. the problem is
that i dont want to put
the action. I want to put only the JSP page.
 
excludes
pattern/LoadSomeDataAndGoToJSP!input.action/pattern
/excludes
 
Well, help welcome.
 
Regards,
 
Juan.
 
PD: i must tell that sitemesh is fantastic, no more putting in my pages
jsp:include...its amazing
 
 
 
 
 

 


[OT] Re: SiteMesh

2006-11-07 Thread Antonio Petrelli

Juan Espinosa ha scritto:

Hi to all, im using sitemesh...



I think writing to the Sitemesh mailing list should be better...

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



Re: SiteMesh

2006-11-07 Thread Tom Ziemer
Hi Juan,

did you add something like:
excludes file=/WEB-INF/excludes.xml /
to your sitemesh.xml

I am using SiteMesh with Struts and it's working just great (excludes as
well).

HTH,
Tom

Juan Espinosa wrote:
 Hi to all, im using sitemesh and i have a little problems with excludes
 I have an action that load some data from a db and then goes to a jsp page.
  
action name=LoadSomeDataAndGoToJSP class=test.TestAction
 result/private/someJSP.jsp/result
 /action
  
 i put in the exclude section of the decorators.xml this page
 /private/someJSP.jsp
 but sitemesh decores it. 
  
 excludes
 pattern/private/someJSP.jsp/pattern
 /excludes
  
 then i put this, and it works, sitemesh doesnt decorate it. the problem is
 that i dont want to put
 the action. I want to put only the JSP page.
  
 excludes
 pattern/LoadSomeDataAndGoToJSP!input.action/pattern
 /excludes
  
 Well, help welcome.
  
 Regards,
  
 Juan.
  
 PD: i must tell that sitemesh is fantastic, no more putting in my pages
 jsp:include...its amazing
  
  
  
  
  
 
  
 


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



RE: SiteMesh

2006-11-07 Thread Juan Espinosa
i dont have an excludes files, the excludes are in the decorators.xml
file, maybe its that

the line you wrote is located in the file sitemesh.xml isnt it ??

in the doc of sitemesh i saw this line in the file sitemesh.xml, but the doc
says that this file(sitemesh.xml) is not mandatory

i will try with your solution...
thanks for your answer 

Juan

-Mensaje original-
De: Tom Ziemer [mailto:[EMAIL PROTECTED] 
Enviado el: Martes, 07 de Noviembre de 2006 09:38 a.m.
Para: Struts Users Mailing List
Asunto: Re: SiteMesh

Hi Juan,

did you add something like:
excludes file=/WEB-INF/excludes.xml / to your sitemesh.xml

I am using SiteMesh with Struts and it's working just great (excludes as
well).

HTH,
Tom

Juan Espinosa wrote:
 Hi to all, im using sitemesh and i have a little problems with 
 excludes I have an action that load some data from a db and then goes to a
jsp page.
  
action name=LoadSomeDataAndGoToJSP class=test.TestAction
 result/private/someJSP.jsp/result
 /action
  
 i put in the exclude section of the decorators.xml this page 
 /private/someJSP.jsp but sitemesh decores it.
  
 excludes
 pattern/private/someJSP.jsp/pattern
 /excludes
  
 then i put this, and it works, sitemesh doesnt decorate it. the 
 problem is that i dont want to put the action. I want to put only the 
 JSP page.
  
 excludes
 pattern/LoadSomeDataAndGoToJSP!input.action/pattern
 /excludes
  
 Well, help welcome.
  
 Regards,
  
 Juan.
  
 PD: i must tell that sitemesh is fantastic, no more putting in my 
 pages jsp:include...its amazing
  
  
  
  
  
 
  
 


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



--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.13.31/522 - Release Date: 07/11/2006



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



Re: struts tiles and validator framework

2006-11-07 Thread Madhav Bhargava

Let me elaborate my problem and the reason i have posted this to this list:

I am using tiles with JSF. So i have just one layout.jsp. This file has the
form tag and other JSP's just get inserted into the respective place
holders.

All of this works just fine. The problem comes when i am trying to use
Struts client side validator framework along with the combination of tiles +
JSF. In the validator framework  - validation.xml file will require a form
name and then all the fields and their respective validations.

Will this mean that if there are 40 different forms that use the same layout
tile will need to have fields uniquely named? I thought this was a big ask
and therefore wanted to know how tiles and struts validator framework work
together.

Thanks for the reply.

~madhav

On 11/7/06, Antonio Petrelli [EMAIL PROTECTED] wrote:


Madhav Bhargava ha scritto:
 Since i am using struts tiles there is always going to be one form.
 How can
 i then use these 2 together?

Wait a moment, what's the connection between Tiles and the use of only
one form? That's not true.
Probably you wanted to say that you have one form and the fields of that
form is spread across different JSP pages, right?
In this case probably you have to create a big big ActionForm that
contains all fields, or create one ActionForm for each resulting page.
Anyway I don't know Validator very well, so maybe someone else can help
you more than me.

Ciao
Antonio

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





--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do


[Struts 2] execute() method not firing in Action

2006-11-07 Thread Wesley Wannemacher
Hello,

I've been racking my brain for a bit and hoping that someone will point
out my (probably obvious) mistake. 

[background]
This is my first Struts project. I downloaded the Struts 2.0.1 build and
started with struts-blank. I am basing my first action on the bootstrap
example. I have an input form with validation. When I go to the input
page the form is displayed without the validation errors. I reach it by
hitting registration!input.action. I've tested and the validation
appears to run correctly. If I fill out the form properly and attempt to
submit it, I don't get any errors, I am simply presented with the input
form again (with the values still intact). The form attempts to submit
to registration.action. I have the s:actionerror / tag in the input
JSP, but nothing is generated. Trying to figure out what is going on, I
launched Tomcat in debug mode and set a breakpoint in the execute
method. As you can see the execute method is very small. The breakpoint
I set in the execute method was never reached. However, other
breakpoints (such as ones I set in the setters and getters) are reached.
[/background]

[question]
Below, I have copy/pasted the Source for the Action as well as my
struts.xml file (actually another file that is included from the
struts.xml file). Are there any glaring errors that I am simply missing?
[/question]


 Register.java
/**
 * 
 */
package com.writingcollab.Actions;

import java.util.Date;

import com.writingcollab.bl.user.User;

import com.writingcollab.persistence.user.PersistentUser;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author wesw
 *
 */
public class Register extends ActionSupport {
static final long serialVersionUID = 20061105;

private String userLogin;
private String userPassword;
private String realName;
private String userEmail;

public String execute() throws Exception {

Date now = new Date();
User newUser = new User();
newUser.setCriticScore(0.0f);
newUser.setDateCreated(now);
newUser.setLastChangeDate(now );
newUser.setLastLogin(now);
newUser.setProfileID(0);
newUser.setRealName(realName);
newUser.setUserEmail(userEmail);
newUser.setUserLogin(userLogin);
newUser.setUserPassword(userPassword);

PersistentUser newUserP = new PersistentUser(newUser);
newUserP.insert();

return SUCCESS;

}

/**
 * @return the realName
 */
public String getRealName() {
return realName;
}

/**
 * @param realName the realName to set
 */
public void setRealName(String realName) {
this.realName = realName;
}

/**
 * @return the userEmail
 */
public String getUserEmail() {
return userEmail;
}

/**
 * @param userEmail the userEmail to set
 */
public void setUserEmail(String userEmail) {
this.userEmail = userEmail;
}

/**
 * @return the userLogin
 */
public String getUserLogin() {
return userLogin;
}

/**
 * @param userLogin the userLogin to set
 */
public void setUserLogin(String userLogin) {
this.userLogin = userLogin;
}

/**
 * @return the userPassword
 */
public String getUserPassword() {
return userPassword;
}

/**
 * @param userPassword the userPassword to set
 */
public void setUserPassword(String userPassword) {
this.userPassword = userPassword;
}
}


 wc.xml
!DOCTYPE struts PUBLIC
-//Apache Software Foundation//DTD Struts Configuration
2.0//EN
http://struts.apache.org/dtds/struts-2.0.dtd;

struts

!-- Add packages here --
package name=wc extends=struts-default
action name=index class=com.writingcollab.Actions.index
result/index.jsp/result
/action

action name=register!*
class=com.writingcollab.Actions.Register method={1}
result name=input/register/index.jsp/result
result name=success/register/complete.jsp/result
/action

action name=portal/index
result/portal/index.jsp/result
/action

action name=StyleSheetAction!*
result/css/{1}.css/result
/action

action name=*
result/{1}.jsp/result
/action
/package

/struts


--
Wes Wannemacher
Director of Operations
Double A Trailer Sales, Inc.
[EMAIL PROTECTED]

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



Re: struts tiles and validator framework

2006-11-07 Thread Antonio Petrelli

Madhav Bhargava ha scritto:
Let me elaborate my problem and the reason i have posted this to this 
list:


I am using tiles with JSF. So i have just one layout.jsp. This file 
has the

form tag and other JSP's just get inserted into the respective place
holders.

All of this works just fine. The problem comes when i am trying to use
Struts client side validator framework along with the combination of 
tiles +
JSF. In the validator framework  - validation.xml file will require a 
form

name and then all the fields and their respective validations.

Will this mean that if there are 40 different forms that use the same 
layout
tile will need to have fields uniquely named? I thought this was a big 
ask
and therefore wanted to know how tiles and struts validator framework 
work

together.


The problem is that the validator framework and Tiles do not work 
together! You should see the validator framework as it works on the 
composed page, and not on each tile.
Anyway, even if you don't use validator, each field in an html form 
should be uniquely named.


Does it answer your question?

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



Starting validation

2006-11-07 Thread Thom Burnett

What are common simple mistakes that would prevent validation from occuring?
I've got a simple struts application that runs correctly except that
validation doesn't occur. The form info is accepted as correct when required
information is missing.

I'm trying to figure out what's missing from my setup or understanding.

The ValidatorForm (my extension) class has appropriate get and set functions
for all fields.
(The fields are spread over 3 jsp pages, if that matters.)
I've added the validator plugin to the struts-config, the action mapping has
validate=true and a valid input path,  added the validation-rules and
validation.xml file, added the resource properties file with the standard
errors (taken from the struts file).

If I write my own validate method in the form bean that validation works
properly. It's my understanding that if I'm using the validation framework,
I should not have a validate() method in the form.

Am I misunderstanding something? Any ideas what might be setup wrong or
missing.


Re: [Struts 2] execute() method not firing in Action

2006-11-07 Thread Mark Menard
On 11/7/06 9:07 AM, Wesley Wannemacher [EMAIL PROTECTED] wrote:

 [question]
 Below, I have copy/pasted the Source for the Action as well as my
 struts.xml file (actually another file that is included from the
 struts.xml file). Are there any glaring errors that I am simply missing?
 [/question]

Hi Wesley,

I'm by no means a Struts 2 expert, but here's my guess. I've never used the
! notation for actions. Take a look at this page:
http://cwiki.apache.org/WW/action-configuration.html and be sure that you
have it properly configured. I think the s2 path going forward is to remove
support for the ! notation.

Take care,

Mark

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



Re: [Struts 2] execute() method not firing in Action

2006-11-07 Thread Romu

it might be in your jsp , in the tag  html:form action=/XXX

with XXX is the name of your action

if struts controller dont find the action an error will pop up .





2006/11/7, Mark Menard [EMAIL PROTECTED]:


On 11/7/06 9:07 AM, Wesley Wannemacher [EMAIL PROTECTED] wrote:

 [question]
 Below, I have copy/pasted the Source for the Action as well as my
 struts.xml file (actually another file that is included from the
 struts.xml file). Are there any glaring errors that I am simply missing?
 [/question]

Hi Wesley,

I'm by no means a Struts 2 expert, but here's my guess. I've never used
the
! notation for actions. Take a look at this page:
http://cwiki.apache.org/WW/action-configuration.html and be sure that you
have it properly configured. I think the s2 path going forward is to
remove
support for the ! notation.

Take care,

Mark

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




Re: Starting validation

2006-11-07 Thread Romu

validations are linked to xml files:

action
   path=/XXX
   name=yourForm
   scope=session
   validate=false
type=yyyAction
   forward name=succees path=/WEB-INF/jsp/success.jsp/

   /action

with name tag, struts will look in validation.xml files to see the rules etc
, and it wil generates the javascript .

check if u got javascript validation code  in your jsp  ?





2006/11/7, Thom Burnett [EMAIL PROTECTED]:


What are common simple mistakes that would prevent validation from
occuring?
I've got a simple struts application that runs correctly except that
validation doesn't occur. The form info is accepted as correct when
required
information is missing.

I'm trying to figure out what's missing from my setup or understanding.

The ValidatorForm (my extension) class has appropriate get and set
functions
for all fields.
(The fields are spread over 3 jsp pages, if that matters.)
I've added the validator plugin to the struts-config, the action mapping
has
validate=true and a valid input path,  added the validation-rules and
validation.xml file, added the resource properties file with the standard
errors (taken from the struts file).

If I write my own validate method in the form bean that validation works
properly. It's my understanding that if I'm using the validation
framework,
I should not have a validate() method in the form.

Am I misunderstanding something? Any ideas what might be setup wrong or
missing.




RE: [Struts 2] execute() method not firing in Action

2006-11-07 Thread Wesley Wannemacher
The form tag is as follows in the JSP: s:form action=register...

There are only a few fields, and using either register!* or register_*
gives me the same in the debugger. Each of the setters/getters is called
(for setting values, then re-displaying the values), but the execute
method is never called. It is as if, my execute method signature is
wrong because it is not invoked, it appears that another method is
invoked that returns input. The s:actionerror / never generates any
output, and validation appears to pass.

-Wes 

 -Original Message-
 From: Romu [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, November 07, 2006 10:51 AM
 To: Struts Users Mailing List
 Subject: Re: [Struts 2] execute() method not firing in Action
 
 it might be in your jsp , in the tag  html:form action=/XXX
 
 with XXX is the name of your action
 
 if struts controller dont find the action an error will pop up .
 
 
 
 
 
 2006/11/7, Mark Menard [EMAIL PROTECTED]:
 
  On 11/7/06 9:07 AM, Wesley Wannemacher 
 [EMAIL PROTECTED] wrote:
 
   [question]
   Below, I have copy/pasted the Source for the Action as well as my
   struts.xml file (actually another file that is included from the
   struts.xml file). Are there any glaring errors that I am 
 simply missing?
   [/question]
 
  Hi Wesley,
 
  I'm by no means a Struts 2 expert, but here's my guess. 
 I've never used
  the
  ! notation for actions. Take a look at this page:
  http://cwiki.apache.org/WW/action-configuration.html and be 
 sure that you
  have it properly configured. I think the s2 path going forward is to
  remove
  support for the ! notation.
 
  Take care,
 
  Mark
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



Re: return flow to calling servlet inside action

2006-11-07 Thread Sarry

oops you are right It should work.

apetrelli wrote:
 
 Sarry ha scritto:
 I have a servlet which is the interface for the third party and its
 calling
 the struts actions and jsps to do some processing, and it will go throuh
 the
 actions and the flow should come to the calling servlet.

 I am facing problems since third party is calling my flow as include
 method of servlet and it acts as a subroutine.so I can forward the flow
 to
 whichever actions I want but when it comes the time to return it expects
 action forward which is not possible in this case and even I tried
 making
 one more servlet and forward the call to that servlet and then return, it
 just doesn't work.

 if somebody has already integrated struts with servlets let me know how
 you
 do it?
   
 
 Did you try simply return null in your Action.execute method?
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/return-flow-to-calling-servlet-inside-action-tf2583789.html#a7221778
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Starting validation

2006-11-07 Thread Thom Burnett

What's now happening is that the validation correctly moves me back to the
jsp specified by input but the form becomes blank (doesn't keep the
information that was entered) and the html:errors returns nothing.

I can sort of get around this by calling validate and adding attributes to
the request but I'm pretty sure that I shouldn't need to do so. So I'm
wondering what's going wrong.

struts-config.xml:

?xml version = '1.0' encoding = 'windows-1252'?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.3.5//EN 
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;
struts-config
 form-beans
   form-bean name=donorBean type=
com.softrek.donation.AllDonationInformationFormBean3/
 /form-beans
 action-mappings
   action path=/donation3   type=com.softrek.donation.DonationAction3
   name=donorBean scope=session
   input=/donation3.jsp validate=true
 forward name=error  path=/error3.jsp/
 forward name=success  path=/thankYou3.jsp/
 forward name=firstPagepath=/donation3.jsp/
 forward name=secondPage   path=/honoree3.jsp/
 forward name=thirdPagepath=/payment3.jsp/
   /action
 /action-mappings
 message-resources parameter=/WEB-INF/ErrorMessages/
 plug-in className=org.apache.struts.validator.ValidatorPlugIn
   set-property property=pathnames
 value=/WEB-INF/validator/validator-rules.xml
,/WEB-INF/validator/validations.xml/
 /plug-in

/struts-config

public class AllDonationInformationFormBean3 extends ValidatorForm {
...
 // This is the addition I seem to need.
 public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
 ActionErrors actionErrors = super.validate(mapping, request) ;
 request.setAttribute(sessionForm, this) ; // If I don't do this the
form will be blank after an error.
 request.setAttribute(errors, actionErrors) ;
 return actionErrors ;
 }
}

My validations.xml file - working partially
?xml version='1.0' encoding='windows-1252'?
form-validation
 formset
   !-- Start of validation rules for each bean --
   form name=donorBean
 field property=firstname depends=required
arg0 key=validation.error.firstname/
  /field
 field property=zip depends=required
arg0 key=validation.error.zip/
  /field
  field property=last depends=required page=1
arg0 key=validation.error.last/
  /field
  field property=line1 depends=required page=1
arg0 key=validation.error.line1/
  /field
  field property=email depends=email page=1
arg0 key=validation.error.email/
  /field
  field property=t_amount depends=required page=1
arg0 key=validation.error.amount/
  /field
  field property=cc_number depends=required, creditCard page=1
arg0 key=validation.error.ccnumber/
  /field
!-- End of validation rules for each bean --
   /form
 /formset
/form-validation

Part of my jsp: only the getAttribute type of error shows up. the
html:errors parts are empty.
I'd like to have them work so I can dump the getAttribute(errors) part.

   form action=../donation3/donation3.do method=post
 input type=hidden name=pagename value=donationPage/
 p style=background-color:rgb(0,255,255); font-size:large;Donor
Information/p
 All errors with Java script
 %= request.getAttribute(errors) == null ? No errors :
request.getAttribute(errors) %br/
 All errors with strut tag
 html:errors/br/
 Single error report with strut tag
 html:errors property=firstname/
 p*Indicates required field/p
 p


On 11/7/06, Romu [EMAIL PROTECTED] wrote:


validations are linked to xml files:

action
path=/XXX
name=yourForm
scope=session
validate=false
 type=yyyAction
forward name=succees path=/WEB-INF/jsp/success.jsp/

/action

with name tag, struts will look in validation.xml files to see the rules
etc
, and it wil generates the javascript .

check if u got javascript validation code  in your jsp  ?





2006/11/7, Thom Burnett [EMAIL PROTECTED]:

 What are common simple mistakes that would prevent validation from
 occuring?
 I've got a simple struts application that runs correctly except that
 validation doesn't occur. The form info is accepted as correct when
 required
 information is missing.

 I'm trying to figure out what's missing from my setup or understanding.

 The ValidatorForm (my extension) class has appropriate get and set
 functions
 for all fields.
 (The fields are spread over 3 jsp pages, if that matters.)
 I've added the validator plugin to the struts-config, the action mapping
 has
 validate=true and a valid input path,  added the validation-rules and
 validation.xml file, added the resource properties file with the
standard
 errors (taken from the struts file).

 If I write my own validate method in the form bean that validation works
 properly. It's my understanding that if I'm using the validation
 

Re: Starting validation

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

 struts-config.xml:

This looks good.

  request.setAttribute(sessionForm, this) ; // If I don't do this the
 form will be blank after an error.

You really shouldn't have to do this. The form bean in the session will
be called donorBean because of the value of the name attribute in
your action mapping in struts-config.xml.

  request.setAttribute(errors, actionErrors) ;

You shouldn't have to do this, either. Struts should be putting this
ActionErrors object into the request for you. This is all you should need:

  return actionErrors ;


 My validations.xml file - working partially

When you say partially, you mean that your form is re-displayed when
validation doesn't pass, right? It's just that your errors do not show
up and the form fields are blank. I think your validation is probably
okay, but let's see.

 arg0 key=validation.error.firstname/

Do all of these properties actually exist in this file:

/WEB-INF/ErrorMessages.properties (this is where you indicated your
message resources were).

I'm not sure what is the standard way to do this, but I have my
message resources in my WEB-INF/classes directory, and I specify it like
this:

message-resources parameter=ApplicationMessages null=false /

You might try adding 'null=false' to see if you start getting messages
like '???en_US.validation.error.firstname???' in your pages. If you get
these messages, it means that struts can't find your error messages, but
they are being properly generated and saved into the request.

  html:errors/

This ought to print /something/. My guess is a properties file loading
problem (see above).

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUMCr9CaO5/Lv0PARAg8pAJ0ToTTuxR2wC09xbRLXrGTNKfwa7ACfUhBI
41L+o5dayknOJDxN2PrQOl8=
=T+ly
-END PGP SIGNATURE-

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



Struts app with web service, Axis and Eclipse

2006-11-07 Thread Dave Kennedy

Hi,
http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/index.html
I've implemented these tutorials and would now like to add web services to a 
Struts application.
Any tutorials/suggestions/examples using Axis, Struts, Eclipse would be 
greatly appreciated.

Thanks in advance

_
Say hello to the next generation of Search. Live Search – try it now. 
http://www.live.com/?mkt=en-ca



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



Re: Starting validation

2006-11-07 Thread Thom Burnett

Chris,

Following your advice, I've now found the proper settings for my resource
file.
With that fixed I can take out the sub class' validate() method and still
get a set of errors.
However, getting errors still depopulate's the form's fields. Again, I can
fix that by overriding the validate method (calling super) and that's not a
horrible solution - since it doesn't cost much work. But I don't think it
should be necessary and am wondering what's not set up right that would
cause that problem.

As near as I can see the form is being named and associated correctly but I
must be missing something.

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

 struts-config.xml:

This looks good.

  request.setAttribute(sessionForm, this) ; // If I don't do this
the
 form will be blank after an error.

You really shouldn't have to do this. The form bean in the session will
be called donorBean because of the value of the name attribute in
your action mapping in struts-config.xml.

  request.setAttribute(errors, actionErrors) ;

You shouldn't have to do this, either. Struts should be putting this
ActionErrors object into the request for you. This is all you should need:

  return actionErrors ;


 My validations.xml file - working partially

When you say partially, you mean that your form is re-displayed when
validation doesn't pass, right? It's just that your errors do not show
up and the form fields are blank. I think your validation is probably
okay, but let's see.

 arg0 key=validation.error.firstname/

Do all of these properties actually exist in this file:

/WEB-INF/ErrorMessages.properties (this is where you indicated your
message resources were).

I'm not sure what is the standard way to do this, but I have my
message resources in my WEB-INF/classes directory, and I specify it like
this:

message-resources parameter=ApplicationMessages null=false /

You might try adding 'null=false' to see if you start getting messages
like '???en_US.validation.error.firstname???' in your pages. If you get
these messages, it means that struts can't find your error messages, but
they are being properly generated and saved into the request.

  html:errors/

This ought to print /something/. My guess is a properties file loading
problem (see above).

Hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUMCr9CaO5/Lv0PARAg8pAJ0ToTTuxR2wC09xbRLXrGTNKfwa7ACfUhBI
41L+o5dayknOJDxN2PrQOl8=
=T+ly
-END PGP SIGNATURE-

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




Re: Starting validation

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

Thom Burnett wrote:
 With that fixed I can take out the sub class' validate() method and still
 get a set of errors.

That's good, I guess. What do you mean, the subclass's validate method?
I didn't realize that you had multiple levels of validation being performed.

 However, getting errors still depopulate's the form's fields.

That shouldn't happen. Lemmie look at your JSP source again...

Ah. You didn't provide any of the HTML code that contains the input
elements. Could you post a representative sample?

 Again, I can
 fix that by overriding the validate method (calling super) and that's not a
 horrible solution

Yeah... don't do that. You should be able to work directly with the bean
that you already have. No need to go through any acrobatics like this.

Just so I know, what is the superclass for this bean and what does its
super.validate method do that you aren't doing in the subclass?

Come to think of it, why are you overriding the superclass's validate
method in the first place? And... if you are overriding it, why aren't
you calling that superclass method first thing in your overidden method
implementation?

If you have a base form bean that contains some utility methods, you
should not have to call super.validate(). On the other hand, if you have
a super class bean that needs its validation done /too/, then you should
do this:

public ActionErrors validate(...)
{
   ActionErrors errors = super.validate(...);

   // Now perform your own validation.

   return errors;
}

 As near as I can see the form is being named and associated correctly but I
 must be missing something.

It looks like validate() is being called, otherwise you wouldn't be
getting error messages. Since your action mapping names the bean /and/
the input attribute is associated with the mapping (i.e. there's no
redirect), that bean (including its invalid input) ought to be available
in the session (as per your 'scope' preference).

Post your JSP code around your input elements and let me have a look.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUM8a9CaO5/Lv0PARAsyxAJ9YtgRv+A4MQgUi5n4zppJVkTcFIQCfeM3n
yrmuTXI0ttkeoceXAFyr/aQ=
=wyhj
-END PGP SIGNATURE-

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



RE: request.getParameterMap

2006-11-07 Thread Nitin M. Mandolkar
Cast it to String object. 

Nitin 

-Original Message-
From: temp temp [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 8:04 AM
To: user@struts.apache.org
Subject: request.getParameterMap 

I want all  the parameters in ServletRequest object for this I am
using the method request.getParameterMap().  It returns java.util.Map
which contains  request parameter name and its value.When I print out
the Map I can read the  key but I cannot read the value .
   
  Here is the  print of the Map
   
   
  06/11/03  10:58:57  request paramskey score1  ,
value  [Ljava.lang.String;@13f348b
  06/11/03  10:58:57  request paramskey progname  ,
value  [Ljava.lang.String;@92997e
  06/11/03  10:58:57  request paramskey submit  ,
value  [Ljava.lang.String;@9b601d
  06/11/03  10:58:57  request paramskey
numberPerPage  , value  [Ljava.lang.String;@c3362f
  06/11/03  10:58:57  request paramskey appNum  ,
value  [Ljava.lang.String;@1a5770
  06/11/03  10:58:57  request paramskey sortBy  ,
value  [Ljava.lang.String;@1628b8d
  06/11/03  10:58:57  request paramskey amount2  ,
value  [Ljava.lang.String;@b80f1c
  06/11/03  10:58:57  request paramskey hasAward  ,
value  [Ljava.lang.String;@1e80f3a
  06/11/03  10:58:57  request paramskey score2  ,
value  [Ljava.lang.String;@3fc47c
  06/11/03  10:58:57  request paramskey orgState  ,
value  [Ljava.lang.String;@7cb44d
  06/11/03  10:58:57  request paramskey amount1  ,
value  [Ljava.lang.String;@1214626
  06/11/03  10:58:57  request paramskey orgName  ,
value  [Ljava.lang.String;@1849daf 
   
  How can I translatevalue [Ljava.lang.String;@1849daf to
readable String?
Thanks  Regards
  Miro
  
 
-
We have the perfect Group for you. Check out the handy changes to Yahoo!
Groups.


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



RE: How do I configure this Interceptor for every action in struts.xml

2006-11-07 Thread Nitin M. Mandolkar
Extend the struts action class and provide your own action class. Which
can be extended by every action in your application. 

May I know the role of your Interceptor? 

Nitin 
-Original Message-
From: Asish Kr. Samanta [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 03, 2006 2:13 AM
To: 'Struts Users Mailing List'
Subject: How do I configure this Interceptor for every action in
struts.xml

Hi everybody, 

I have written an Interceptor. How do I configure this Interceptor for
every
action in struts.xml? 

Regards, 

Asish


-
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: ActionServlet and RequestProcessor

2006-11-07 Thread Nitin M. Mandolkar
Is any body other knows about his. 

Nitin 

-Original Message-
From: Nitin M. Mandolkar [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 01, 2006 10:26 AM
To: Struts Users Mailing List
Subject: Re: ActionServlet and RequestProcessor

Hay Chris

Good Logical reply.

Is RequestProcessor also help for mutiple modules under single web
application. Say i have a Web Application, Online Shoppe. This web
application is divded in to modules like

1. Billing Module
2. Order Placement Module
3. Order Processing Module
4. Admin Module

If yes, please tell me how.

ni3

On 11/1/06, Christopher Schultz [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Nitin,

 Nitin M. Mandolkar wrote:
  The Actionservlet delegates the handling of a request to a
  RequestProcessor object  Previously this is job is done by
  ActionServlet itself. Now it is pass on to RequestProcessor.
 
  I am not getting how it is going to help for web application
development.

 If you wanted to override any of the functionality of the
 RequestProcessor, you can now just subclass the RequestProcessor and
do
 whatever you want, instead of doing the same with the ActionServlet.

 Perhaps it is no more or less convenient than it was in the past, but
 the logical separation of duties (RequestProcessor is a better
 abstraction than the ActionServlet) makes better sense, at least to
me.

 Also, if you change servlets (say, from ActionServlet to
 MyOverriddenActionServlet), then you have to configure your servlet in
 web.xml. I think you use struts-config.xml to configure the
 RequestProcessor to use. Not that it makes much of a difference.

 If you never messed with ActionServlet in the past, then you probably
 aren't going to mess with RequestProcessor right now.

 Just trust that the Struts team thought it was the right move to make,
 and the change can be safely ignored if the change doesn't affect you.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.5 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFSOMJ9CaO5/Lv0PARAsu5AKCd+aP7J1kHfTY+P5ePJK6Z8fI25ACeItJ0
 2rOeadqOW7NPLgTLdZki0pY=
 =4FCH
 -END PGP SIGNATURE-

 -
 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: Starting validation

2006-11-07 Thread Thom Burnett

Here's a snippet of one of the jsp files.

I'd almost forgotten myself that I added the getAttribute(sessionForm)
some time ago.
I'm working on an application that uses several jsp pages to gather one set
of information before it really does anything with it. Ideally, the first
form gets validated before the user can get to the second form and that must
be validated before the third  And of course all of this must work if
the user hits the browser's navigation buttons.

Before I added any validation at all, I found that when I filled out one
page and went on to the next page, I'd lose whatever was added in the first
page unless I put the sessionForm as an attribute. Simply specifying that
the form was in session scope didn't keep the information around. In my
research, this was something that some people did and others didn't. I
wasn't clear on when or why.

So maybe the use of the Javascript to fill input values is killing something
that struts is trying to do. I just know that without this, I didn't keep
information between requests.

The reason for overriding the validate method was to set the sessionForm
attribute. I was also just starting to try to use the ValidateForm.setPage().
As I understand it, that field (page) should enable me to have validation
done only on parts of the form. I haven't seen any examples and am just
trying it out as we speak.

 % AllDonationInformationFormBean3 sessionForm =
(AllDonationInformationFormBean3)request.getAttribute(sessionForm) ;
if(sessionForm == null) sessionForm = new
AllDonationInformationFormBean3() ; %
 body
   center
 h1New Account Registration/h1
   /center
   form action=../donation3/donation3.do method=post
 input type=hidden name=pagename value=donationPage/
 p style=background-color:rgb(0,255,255); font-size:large;Donor
Information/p
 html:errors/br/
 p*Indicates required field/p
 p
   Title
   select name=salutation/
  option value=Mr.Mr/option
  option value=Ms.Ms/option
   /select
 /p
 P
   font color=red*First Name: /font
   input type=text name=firstname value=%=
sessionForm.getFirstname() % /br/

   font color=red*Last Name:/font
   input type=text name=last  value=%= sessionForm.getLast()
% /br/



On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

Thom Burnett wrote:
 With that fixed I can take out the sub class' validate() method and
still
 get a set of errors.

That's good, I guess. What do you mean, the subclass's validate method?
I didn't realize that you had multiple levels of validation being
performed.

 However, getting errors still depopulate's the form's fields.

That shouldn't happen. Lemmie look at your JSP source again...

Ah. You didn't provide any of the HTML code that contains the input
elements. Could you post a representative sample?

 Again, I can
 fix that by overriding the validate method (calling super) and that's
not a
 horrible solution

Yeah... don't do that. You should be able to work directly with the bean
that you already have. No need to go through any acrobatics like this.

Just so I know, what is the superclass for this bean and what does its
super.validate method do that you aren't doing in the subclass?

Come to think of it, why are you overriding the superclass's validate
method in the first place? And... if you are overriding it, why aren't
you calling that superclass method first thing in your overidden method
implementation?

If you have a base form bean that contains some utility methods, you
should not have to call super.validate(). On the other hand, if you have
a super class bean that needs its validation done /too/, then you should
do this:

public ActionErrors validate(...)
{
   ActionErrors errors = super.validate(...);

   // Now perform your own validation.

   return errors;
}

 As near as I can see the form is being named and associated correctly
but I
 must be missing something.

It looks like validate() is being called, otherwise you wouldn't be
getting error messages. Since your action mapping names the bean /and/
the input attribute is associated with the mapping (i.e. there's no
redirect), that bean (including its invalid input) ought to be available
in the session (as per your 'scope' preference).

Post your JSP code around your input elements and let me have a look.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUM8a9CaO5/Lv0PARAsyxAJ9YtgRv+A4MQgUi5n4zppJVkTcFIQCfeM3n
yrmuTXI0ttkeoceXAFyr/aQ=
=wyhj
-END PGP SIGNATURE-

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




Re: request.getParameterMap

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Nitin,

 From: temp temp [mailto:[EMAIL PROTECTED]
   How can I translatevalue [Ljava.lang.String;@1849daf to
 readable String?

Nitin M. Mandolkar wrote:
 Cast it to String object. 

This won't work. Casting String[] to a String will result in a
ClassCastException, which does not yield the desired result.

The shortest code you can use to produce nice output for a string array
is this:

System.out.println(java.util.Arrays.asList(stringArrayObject));

In order to get all of your request params to print like this, you might
try something like this:

for(Enumeration e=request.getParameterNames(); e.hasMoreElements(); )
{
   String paramName = (String)e.nextElement();

   String[] values = request.getParameterValues(paramName);

   System.out.print( request params key= + paramName
+ , value=);

   if(null == values || 0 == values.length)
   System.out.println(NULL);
   else
   System.out.println(java.util.Arrays.asList(values));
}

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUNWX9CaO5/Lv0PARAhZdAJ9y49zX4qFU04yXJ6inwFjNEcavTgCfToMN
F/7EPPW4eMIPqn/cGyHZo98=
=Sh4W
-END PGP SIGNATURE-

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



RE: ActionServlet and RequestProcessor

2006-11-07 Thread Nitin M. Mandolkar

Hi C

Did you find any thing about this? 

Nitin 
-Original Message-
From: Nitin M. Mandolkar [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, November 01, 2006 10:26 AM
To: Struts Users Mailing List
Subject: Re: ActionServlet and RequestProcessor

Hay Chris

Good Logical reply.

Is RequestProcessor also help for mutiple modules under single web
application. Say i have a Web Application, Online Shoppe. This web
application is divded in to modules like

1. Billing Module
2. Order Placement Module
3. Order Processing Module
4. Admin Module

If yes, please tell me how.

ni3

On 11/1/06, Christopher Schultz [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Nitin,

 Nitin M. Mandolkar wrote:
  The Actionservlet delegates the handling of a request to a
  RequestProcessor object  Previously this is job is done by
  ActionServlet itself. Now it is pass on to RequestProcessor.
 
  I am not getting how it is going to help for web application
development.

 If you wanted to override any of the functionality of the
 RequestProcessor, you can now just subclass the RequestProcessor and
do
 whatever you want, instead of doing the same with the ActionServlet.

 Perhaps it is no more or less convenient than it was in the past, but
 the logical separation of duties (RequestProcessor is a better
 abstraction than the ActionServlet) makes better sense, at least to
me.

 Also, if you change servlets (say, from ActionServlet to
 MyOverriddenActionServlet), then you have to configure your servlet in
 web.xml. I think you use struts-config.xml to configure the
 RequestProcessor to use. Not that it makes much of a difference.

 If you never messed with ActionServlet in the past, then you probably
 aren't going to mess with RequestProcessor right now.

 Just trust that the Struts team thought it was the right move to make,
 and the change can be safely ignored if the change doesn't affect you.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.5 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFSOMJ9CaO5/Lv0PARAsu5AKCd+aP7J1kHfTY+P5ePJK6Z8fI25ACeItJ0
 2rOeadqOW7NPLgTLdZki0pY=
 =4FCH
 -END PGP SIGNATURE-

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



Losing Locale after Sesion.invalidate()

2006-11-07 Thread Chris Pratt

I am having a strange problem with JSTL locale's after Session.invalidate.
I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
systems in sync, I have a servlet filter that executes this code:

 protected void doFilter (HttpServletRequest req,HttpServletResponse
res,FilterChain chain) throws IOException, ServletException {
   Locale locale;
   HttpSession ses = req.getSession();
   String locstr = req.getParameter(locale);
   if(locstr == null) {
 if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null) {
   locale = req.getLocale();
 }
   } else {
 locale = new Locale(locstr);
   }
   if(locale != null) {
 ses.setAttribute(Globals.LOCALE_KEY,locale);
 Config.set(ses,Config.FMT_LOCALE,locale);
   }
   chain.doFilter(req,res);
 } //doFilter

This works great except when, after the LogoutAction calls
Session.invalidate(), I redirect to a Logout Success page.  For some
reason that page picks up the French text from the application_fr.properties
resource file for the JSTL tags, but not for the Struts tags.

I have put lots of debugging in the stream and from what I can see, the
Locale is getting set in the filter, but by the time the JSP page is
processed, Config.FMT_LOCALE is null.

Any insights would be greatly appreciated.
 (*Chris*)


Re: Starting validation

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thom,

Thom Burnett wrote:
 I'm working on an application that uses several jsp pages to gather
 one set of information before it really does anything with it.
 Ideally, the first form gets validated before the user can get to the
 second form and that must be validated before the third  And of
 course all of this must work if the user hits the browser's
 navigation buttons.

This is a pretty standard multi-page form flow. I assume that you are
using a single form with each page separated-out in the validation one
way or another. If not, consider doing that. I switched from
hand-written form beans to dynamic form beans over the past year or so
and haven't looked back. They support this paging concept, and work very
well with the commons-validator plug-in, so you can write your
validations in a declarative way instead of hand-coding everything.

At any rate, let's move on.

 Before I added any validation at all, I found that when I filled out one
 page and went on to the next page, I'd lose whatever was added in the first
 page unless I put the sessionForm as an attribute.

I think what you want to do is one of the following:

1. Name each form something different, and set them all to
   scope=session. Collect all of the forms from the session in your
   final do it action.
2. Write an action to save the validated data from each page of your
   multi-page form somewhere (like the session) in either a custom data
   bean or something like that. Then, pull that data out in your
   final do it action.
3. Merge all your separate forms into a single form and validate based
   upon the current page. You can stop validation at any point when
   you hit the end of the page in your validation by simply returning
   from the validation method somewhere in the middle. Just add a
   page property to your bean and submit the current page as a hidden
   form element. Then, use that value to determine where to stop
   validation. This is how the dynamic, multi-page form beans do things.

 Simply specifying that
 the form was in session scope didn't keep the information around.

That shouldn't be the case. Are you sure you were using the correct
session attribute key? That key should match the name attribute of the
action mapping.

 So maybe the use of the Javascript to fill input values is killing 
 something that struts is trying to do. I just know that without this,
 I didn't keep information between requests.

Aah, the plot thickens: you are using Javascript to re-populate your
form fields? Yuck. Don't do that. Struts is perfectly capable of doing
that for you. Turn off all that javascript weirdness until you get this
issue solved, then re-add any javascript you think you still need.

 The reason for overriding the validate method was to set the sessionForm
 attribute. I was also just starting to try to use the
 ValidateForm.setPage().
 As I understand it, that field (page) should enable me to have validation
 done only on parts of the form. I haven't seen any examples and am just
 trying it out as we speak.

Yup. This is really the way to go.

  % AllDonationInformationFormBean3 sessionForm =
 (AllDonationInformationFormBean3)request.getAttribute(sessionForm) ;
 if(sessionForm == null) sessionForm = new
 AllDonationInformationFormBean3() ; %

Okay, the sessionForm should actually be called donorBean. You
should also be getting it from the session (duh -- was that a typo?). Do
it like this:

%
AllDonationInformationFormBean3 donorBean =
  (AllDonationInformationFormBean3)
  session.getAttribute(donorBean);
if(null == donorBean)
  donorBean = new ...();
%

select name=salutation/
   option value=Mr.Mr/option
   option value=Ms.Ms/option
/select

You aren't pre-selecting this field based upon what is in the bean. Did
you mean to do that?

input type=text name=firstname value=%=
 sessionForm.getFirstname() % /br/

Okay, this /is/ what you should be doing, except using my example, I
used donorBean instead of sessionForm. If you add javascript on top
of this, you are just going to confuse the hell out of yourself.

font color=red*Last Name:/font
input type=text name=last  value=%= sessionForm.getLast()

Just a matter of style... why do you have firstname versus last? I
would recommend lastname in this case since it's pretty much the same
thing as the firstname. Again, that's just a matter of style, really.
Although, if your form is expecting firstname and lastname, then
this is a bug.

Although it /is/ just a matter of style, I think it's good to be
consistent because it reduces the chances of an accidental bug popping up.

Hope this helps,
- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUNoh9CaO5/Lv0PARArkFAJ4sGAG7GttGAE+l/3/NrGIO/1vD6gCaAjaU
ZfVQBTr/eJefPw6d707U22w=
=poVi
-END PGP 

Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 I am having a strange problem with JSTL locale's after Session.invalidate.
 I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
 systems in sync, I have a servlet filter that executes this code:

[snip]

if(locstr == null) {
  if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null) {
locale = req.getLocale();
  }
} else {
  locale = new Locale(locstr);
}

An I reading this right? You have an optional request parameter called
locale that you can use to set the locale to something specific. If
that parameter is not found, then you check the session for Struts's
locale. (Note that the session has just been invalidated, so this is
likely to return null in this). If struts doesn't have one, then you use
the locale of the request (presumably from the client's provided headers).

if(locale != null) {
  ses.setAttribute(Globals.LOCALE_KEY,locale);
  Config.set(ses,Config.FMT_LOCALE,locale);
}
chain.doFilter(req,res);

It looks like that ought to do it. Are you sure you aren't ending up
with a NULL locale object in this code?

 This works great except when, after the LogoutAction calls
 Session.invalidate(), I redirect to a Logout Success page.  For some
 reason that page picks up the French text from the
 application_fr.properties
 resource file for the JSTL tags, but not for the Struts tags.

That suggests that Globals.LOCALE_KEY isn't set properly. Can you dump
out the contents of the session in various places? For instance, what
does the session contain both before and after this call:

chain.doFilter(req, res);

I haven't used the JSTL before... I assume Config.set(ses, foo, bar)
basically does ses.setAttribute(foo, bar), eh?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUN129CaO5/Lv0PARAnwfAKCVnQ0fabblJ5jrSjYAeiqS9v8x5gCfd2M9
p9uCdcUZiP1W47nIhMVuvJ4=
=LPOU
-END PGP SIGNATURE-

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



Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Chris Pratt

Thanks for the reply, and you read it correctly, if there's a locale
parameter, use that if not check the session, otherwise go with the browser
setting.  And yes, I've confirmed that the locale is not null.  Here is the
information I'm getting in my logs from all the debugging statements:

[10:08:43.179] I18NFilter.doFilter: Processing Request for
/canada/logout.jsp
[10:08:43.179] I18NFilter.doFilter: Using Locale from Request - en_US
[10:08:43.179] I18NFilter.doFilter: Session (abcWr_wP-sVd1_Us3Md7q) is new
and is valid
[10:08:43.179] I18NFilter.doFilter: javax.servlet.jsp.jstl.fmt.locale=en_US
[10:08:43.616] ShowConfigSettingsTag.doStartTag: JSTL Configuration Settings
(abcWr_wP-sVd1_Us3Md7q)
[10:08:43.616] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.locale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.fallbackLocale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.localizationContext
com.vsp.canada.resources.application
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.timeZone null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.dataSource null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.maxRows null
[10:08:43.632] ShowConfigSettingsTag.doStartTag: Struts Configuration
Settings
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
org.apache.struts.action.LOCALE en_US

As you can see in the I18NFilter output that it has decided to use the
locale from the request (i.e. the user's browser setting) and that it has a
new valid session.  Then I added a Custom Tag that just dumps a bunch of
information to the logs (the ShowConfigSettingsTag) and all the JSTL
settings are null, but the Struts locale seems fine???  Weird.
 (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 I am having a strange problem with JSTL locale's after
Session.invalidate.
 I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
 systems in sync, I have a servlet filter that executes this code:

[snip]

if(locstr == null) {
  if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null)
{
locale = req.getLocale();
  }
} else {
  locale = new Locale(locstr);
}

An I reading this right? You have an optional request parameter called
locale that you can use to set the locale to something specific. If
that parameter is not found, then you check the session for Struts's
locale. (Note that the session has just been invalidated, so this is
likely to return null in this). If struts doesn't have one, then you use
the locale of the request (presumably from the client's provided headers).

if(locale != null) {
  ses.setAttribute(Globals.LOCALE_KEY,locale);
  Config.set(ses,Config.FMT_LOCALE,locale);
}
chain.doFilter(req,res);

It looks like that ought to do it. Are you sure you aren't ending up
with a NULL locale object in this code?

 This works great except when, after the LogoutAction calls
 Session.invalidate(), I redirect to a Logout Success page.  For some
 reason that page picks up the French text from the
 application_fr.properties
 resource file for the JSTL tags, but not for the Struts tags.

That suggests that Globals.LOCALE_KEY isn't set properly. Can you dump
out the contents of the session in various places? For instance, what
does the session contain both before and after this call:

chain.doFilter(req, res);

I haven't used the JSTL before... I assume Config.set(ses, foo, bar)
basically does ses.setAttribute(foo, bar), eh?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUN129CaO5/Lv0PARAnwfAKCVnQ0fabblJ5jrSjYAeiqS9v8x5gCfd2M9
p9uCdcUZiP1W47nIhMVuvJ4=
=LPOU
-END PGP SIGNATURE-

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




RE: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Jiang, Peiyun
I use the following code in JSPs to debug:

context is PageContext: 
Enumeration eSession = context.getAttributeNamesInScope(context.SESSION_SCOPE);
if (eSession != null) {
while (eSession.hasMoreElements()) {
 String sessionName = (String) eSession.nextElement();
 Object sessionValue = context.getAttribute(sessionName, 
context.SESSION_SCOPE);
 if (sessionValue != null) {
if (SystemConfig.loggingEnabled()  logger.isDebugEnabled()) {
logger.debug(sessionName +  =  + sessionValue + ( + 
sessionValue.getClass().getName() + ));
}
 } else {
if (SystemConfig.loggingEnabled()  logger.isDebugEnabled()) {
logger.debug(sessionName +  is null);
}
}
   }
}
Print out all attributes before and after session is invalidated. Probably you 
will see if locale is set properly.

Peiyun

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: November 7, 2006 2:25 PM
To: Struts Users Mailing List
Subject: Re: Losing Locale after Sesion.invalidate()


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 I am having a strange problem with JSTL locale's after Session.invalidate.
 I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
 systems in sync, I have a servlet filter that executes this code:

[snip]

if(locstr == null) {
  if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null) {
locale = req.getLocale();
  }
} else {
  locale = new Locale(locstr);
}

An I reading this right? You have an optional request parameter called
locale that you can use to set the locale to something specific. If
that parameter is not found, then you check the session for Struts's
locale. (Note that the session has just been invalidated, so this is
likely to return null in this). If struts doesn't have one, then you use
the locale of the request (presumably from the client's provided headers).

if(locale != null) {
  ses.setAttribute(Globals.LOCALE_KEY,locale);
  Config.set(ses,Config.FMT_LOCALE,locale);
}
chain.doFilter(req,res);

It looks like that ought to do it. Are you sure you aren't ending up
with a NULL locale object in this code?

 This works great except when, after the LogoutAction calls
 Session.invalidate(), I redirect to a Logout Success page.  For some
 reason that page picks up the French text from the
 application_fr.properties
 resource file for the JSTL tags, but not for the Struts tags.

That suggests that Globals.LOCALE_KEY isn't set properly. Can you dump
out the contents of the session in various places? For instance, what
does the session contain both before and after this call:

chain.doFilter(req, res);

I haven't used the JSTL before... I assume Config.set(ses, foo, bar)
basically does ses.setAttribute(foo, bar), eh?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUN129CaO5/Lv0PARAnwfAKCVnQ0fabblJ5jrSjYAeiqS9v8x5gCfd2M9
p9uCdcUZiP1W47nIhMVuvJ4=
=LPOU
-END PGP SIGNATURE-

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



Radio buttons and iterate

2006-11-07 Thread Perry Minchew
Hi all,

 

I asked this question earlier, but did not see a response, so I'll try
again. Here's my jsp

table

logic:iterate id=admins name=requestList

trtd bean:write name=admins property=dn/ /td

tdbean:write name=admins property=givenname//td

tdbean:write name=admins property=sn//td

tdbean:write name=admins property=telephonenumber//td

tdbean:write name=admins property=mail//td

tdbean:write name=admins property=portal//td

tdbean:write name=admins property=requestedApp//td

tdhtml:radio property=reqStatus value=PENDING
name=adminsN/C/html:radio

html:radio property=reqStatus value=APPROVED
name=adminsApprove/html:radio

html:radio property=reqStatus value=DENIED
name=adminsDeny/html:radio/td

/tr

/logic:iterate

/table

 

So I'm iterating over the array list (requestList) and displaying
information from our oracle database. I get solid output for the 4 in my
test list. However, all of the radio buttons are linked. At the admin
screen, I see 12 radio buttons, and only one of them is marked (the last
one). Clicking a radio button on a row above makes the global radio
change. How do I make each row have it's on radio set with the iterate
feature?

 

Thanks

 

Perry Minchew

Systems Integrator

SPAWAR Systems Charleston

Office : (843) 218.7031

Cell : (843) 822.1555

 



RE: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Jiang, Peiyun
Can you invalidate the session and create a new session immediately and set the 
locale according to the old session?

Peiyun

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED]
Sent: November 7, 2006 2:33 PM
To: Struts Users Mailing List
Subject: Re: Losing Locale after Sesion.invalidate()


Thanks for the reply, and you read it correctly, if there's a locale
parameter, use that if not check the session, otherwise go with the browser
setting.  And yes, I've confirmed that the locale is not null.  Here is the
information I'm getting in my logs from all the debugging statements:

[10:08:43.179] I18NFilter.doFilter: Processing Request for
/canada/logout.jsp
[10:08:43.179] I18NFilter.doFilter: Using Locale from Request - en_US
[10:08:43.179] I18NFilter.doFilter: Session (abcWr_wP-sVd1_Us3Md7q) is new
and is valid
[10:08:43.179] I18NFilter.doFilter: javax.servlet.jsp.jstl.fmt.locale=en_US
[10:08:43.616] ShowConfigSettingsTag.doStartTag: JSTL Configuration Settings
(abcWr_wP-sVd1_Us3Md7q)
[10:08:43.616] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.locale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.fallbackLocale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.localizationContext
com.vsp.canada.resources.application
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.timeZone null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.dataSource null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.maxRows null
[10:08:43.632] ShowConfigSettingsTag.doStartTag: Struts Configuration
Settings
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
org.apache.struts.action.LOCALE en_US

As you can see in the I18NFilter output that it has decided to use the
locale from the request (i.e. the user's browser setting) and that it has a
new valid session.  Then I added a Custom Tag that just dumps a bunch of
information to the logs (the ShowConfigSettingsTag) and all the JSTL
settings are null, but the Struts locale seems fine???  Weird.
  (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Chris,

 Chris Pratt wrote:
  I am having a strange problem with JSTL locale's after
 Session.invalidate.
  I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
  systems in sync, I have a servlet filter that executes this code:

 [snip]

 if(locstr == null) {
   if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null)
 {
 locale = req.getLocale();
   }
 } else {
   locale = new Locale(locstr);
 }

 An I reading this right? You have an optional request parameter called
 locale that you can use to set the locale to something specific. If
 that parameter is not found, then you check the session for Struts's
 locale. (Note that the session has just been invalidated, so this is
 likely to return null in this). If struts doesn't have one, then you use
 the locale of the request (presumably from the client's provided headers).

 if(locale != null) {
   ses.setAttribute(Globals.LOCALE_KEY,locale);
   Config.set(ses,Config.FMT_LOCALE,locale);
 }
 chain.doFilter(req,res);

 It looks like that ought to do it. Are you sure you aren't ending up
 with a NULL locale object in this code?

  This works great except when, after the LogoutAction calls
  Session.invalidate(), I redirect to a Logout Success page.  For some
  reason that page picks up the French text from the
  application_fr.properties
  resource file for the JSTL tags, but not for the Struts tags.

 That suggests that Globals.LOCALE_KEY isn't set properly. Can you dump
 out the contents of the session in various places? For instance, what
 does the session contain both before and after this call:

 chain.doFilter(req, res);

 I haven't used the JSTL before... I assume Config.set(ses, foo, bar)
 basically does ses.setAttribute(foo, bar), eh?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.5 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFUN129CaO5/Lv0PARAnwfAKCVnQ0fabblJ5jrSjYAeiqS9v8x5gCfd2M9
 p9uCdcUZiP1W47nIhMVuvJ4=
 =LPOU
 -END PGP SIGNATURE-

 -
 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: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Jiang, Peiyun
Just wonder if after a session is invalidated, STRUTS, not the SERVLET 
container, creates a new session even before the request is forwarded to the 
JSP. If this is true, the browser setting is not involved. Of course, many 
settings would be null. Just a guess.

Peiyun

-Original Message-
From: Chris Pratt [mailto:[EMAIL PROTECTED]
Sent: November 7, 2006 2:33 PM
To: Struts Users Mailing List
Subject: Re: Losing Locale after Sesion.invalidate()


Thanks for the reply, and you read it correctly, if there's a locale
parameter, use that if not check the session, otherwise go with the browser
setting.  And yes, I've confirmed that the locale is not null.  Here is the
information I'm getting in my logs from all the debugging statements:

[10:08:43.179] I18NFilter.doFilter: Processing Request for
/canada/logout.jsp
[10:08:43.179] I18NFilter.doFilter: Using Locale from Request - en_US
[10:08:43.179] I18NFilter.doFilter: Session (abcWr_wP-sVd1_Us3Md7q) is new
and is valid
[10:08:43.179] I18NFilter.doFilter: javax.servlet.jsp.jstl.fmt.locale=en_US
[10:08:43.616] ShowConfigSettingsTag.doStartTag: JSTL Configuration Settings
(abcWr_wP-sVd1_Us3Md7q)
[10:08:43.616] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.locale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.fallbackLocale null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.localizationContext
com.vsp.canada.resources.application
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.fmt.timeZone null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.dataSource null
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
javax.servlet.jsp.jstl.sql.maxRows null
[10:08:43.632] ShowConfigSettingsTag.doStartTag: Struts Configuration
Settings
[10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
org.apache.struts.action.LOCALE en_US

As you can see in the I18NFilter output that it has decided to use the
locale from the request (i.e. the user's browser setting) and that it has a
new valid session.  Then I added a Custom Tag that just dumps a bunch of
information to the logs (the ShowConfigSettingsTag) and all the JSTL
settings are null, but the Struts locale seems fine???  Weird.
  (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Chris,

 Chris Pratt wrote:
  I am having a strange problem with JSTL locale's after
 Session.invalidate.
  I am using JSTL as the main TagLib with Struts 1.2.9.  So to keep both
  systems in sync, I have a servlet filter that executes this code:

 [snip]

 if(locstr == null) {
   if((locale = (Locale)ses.getAttribute(Globals.LOCALE_KEY)) == null)
 {
 locale = req.getLocale();
   }
 } else {
   locale = new Locale(locstr);
 }

 An I reading this right? You have an optional request parameter called
 locale that you can use to set the locale to something specific. If
 that parameter is not found, then you check the session for Struts's
 locale. (Note that the session has just been invalidated, so this is
 likely to return null in this). If struts doesn't have one, then you use
 the locale of the request (presumably from the client's provided headers).

 if(locale != null) {
   ses.setAttribute(Globals.LOCALE_KEY,locale);
   Config.set(ses,Config.FMT_LOCALE,locale);
 }
 chain.doFilter(req,res);

 It looks like that ought to do it. Are you sure you aren't ending up
 with a NULL locale object in this code?

  This works great except when, after the LogoutAction calls
  Session.invalidate(), I redirect to a Logout Success page.  For some
  reason that page picks up the French text from the
  application_fr.properties
  resource file for the JSTL tags, but not for the Struts tags.

 That suggests that Globals.LOCALE_KEY isn't set properly. Can you dump
 out the contents of the session in various places? For instance, what
 does the session contain both before and after this call:

 chain.doFilter(req, res);

 I haven't used the JSTL before... I assume Config.set(ses, foo, bar)
 basically does ses.setAttribute(foo, bar), eh?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.5 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFFUN129CaO5/Lv0PARAnwfAKCVnQ0fabblJ5jrSjYAeiqS9v8x5gCfd2M9
 p9uCdcUZiP1W47nIhMVuvJ4=
 =LPOU
 -END PGP SIGNATURE-

 -
 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: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 Thanks for the reply, and you read it correctly [snip]. Here is the 
 information I'm getting in my logs from all the debugging statements:
 
 [10:08:43.179] I18NFilter.doFilter: Processing Request for
 /canada/logout.jsp
 [10:08:43.179] I18NFilter.doFilter: Using Locale from Request - en_US
 [10:08:43.179] I18NFilter.doFilter: Session (abcWr_wP-sVd1_Us3Md7q) is new
 and is valid
 [10:08:43.179] I18NFilter.doFilter: javax.servlet.jsp.jstl.fmt.locale=en_US

Okay, I don't see anything about the struts globals key. Is this because
you aren't printing it, or because it isn't in the session?


 [10:08:43.616] ShowConfigSettingsTag.doStartTag: JSTL Configuration
 Settings
 (abcWr_wP-sVd1_Us3Md7q)
 [10:08:43.616] ShowConfigSettingsTag.doStartTag:   *
 javax.servlet.jsp.jstl.fmt.locale null

That doesn't look right... didn't you set the locale in your filter? If
so, then why is this null?

 [10:08:43.632] ShowConfigSettingsTag.doStartTag: Struts Configuration
 Settings
 [10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
 org.apache.struts.action.LOCALE en_US

That's very odd that the session apparently now contains the locale
under the struts key, and the JSTL ones is null. What's going on? I
thought you said that the JSTL stuff was working, but the struts was
not. This session information seems to disagree.

Your first set of output (from the I18NFilter) agrees with your report
that struts doesn't work and JSTL does, but the output from the
ShowConfigSettingsTag is the exact opposite.

Are you sure they are the same session (not sure why they wouldn't be,
but that could explain something).

 Weird.

Agreed.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUO0X9CaO5/Lv0PARAuj2AKColl8RxT73qqw6cc3EhHMqj3oM6gCgpcaI
M9glFqOB6UES817fccQERdw=
=cSrP
-END PGP SIGNATURE-

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



HTML:FILE

2006-11-07 Thread Van Nguyen








Im trying to create a jsp page that can upload a
file. Everything works, but I cannot apply my style to the Browse
button:



html:file property=theFile
size=40 styleClass=browse_button /



That displays the regular button I apply the same styleClass
to the submit button and that works out fine:



html:submit styleClass=submit_button /



Any ideas on why it my style wont apply to the Browse
button??








United Rentals
Consider it done.™
800-UR-RENTS
unitedrentals.com

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

Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Chris Pratt

No the original problem statement was that the JSTL fmt tags were picking up
the French text even though the locale was set to English, the Struts tags
are working correctly.  The only thing that I can think of is that the
Config class isn't working properly in this situation.  With Struts I set
the Session Attribute directly, with JSTL, I used the Config.set() method.
 (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 Thanks for the reply, and you read it correctly [snip]. Here is the
 information I'm getting in my logs from all the debugging statements:

 [10:08:43.179] I18NFilter.doFilter: Processing Request for
 /canada/logout.jsp
 [10:08:43.179] I18NFilter.doFilter: Using Locale from Request - en_US
 [10:08:43.179] I18NFilter.doFilter: Session (abcWr_wP-sVd1_Us3Md7q) is
new
 and is valid
 [10:08:43.179] I18NFilter.doFilter:
javax.servlet.jsp.jstl.fmt.locale=en_US

Okay, I don't see anything about the struts globals key. Is this because
you aren't printing it, or because it isn't in the session?


 [10:08:43.616] ShowConfigSettingsTag.doStartTag: JSTL Configuration
 Settings
 (abcWr_wP-sVd1_Us3Md7q)
 [10:08:43.616] ShowConfigSettingsTag.doStartTag:   *
 javax.servlet.jsp.jstl.fmt.locale null

That doesn't look right... didn't you set the locale in your filter? If
so, then why is this null?

 [10:08:43.632] ShowConfigSettingsTag.doStartTag: Struts Configuration
 Settings
 [10:08:43.632] ShowConfigSettingsTag.doStartTag:   *
 org.apache.struts.action.LOCALE en_US

That's very odd that the session apparently now contains the locale
under the struts key, and the JSTL ones is null. What's going on? I
thought you said that the JSTL stuff was working, but the struts was
not. This session information seems to disagree.

Your first set of output (from the I18NFilter) agrees with your report
that struts doesn't work and JSTL does, but the output from the
ShowConfigSettingsTag is the exact opposite.

Are you sure they are the same session (not sure why they wouldn't be,
but that could explain something).

 Weird.

Agreed.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFUO0X9CaO5/Lv0PARAuj2AKColl8RxT73qqw6cc3EhHMqj3oM6gCgpcaI
M9glFqOB6UES817fccQERdw=
=cSrP
-END PGP SIGNATURE-

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




Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 No the original problem statement was that the JSTL fmt tags were
 picking up
 the French text even though the locale was set to English

Strange. Where is that French locale coming from? Default JDK locale?
Locale of the web browser's headers? Stray alpha particle?

 the Struts tags are working correctly.

Okay, that makes sooo much more sense.

 The only thing that I can think of is that the
 Config class isn't working properly in this situation.  With Struts I set
 the Session Attribute directly, with JSTL, I used the Config.set() method.

Is this happening in a request that is distinct from the one in which
you did the invalidate? Or, might you be invalidating the request, and
then doing a server-side forward to the code that re-sets this locale?

I'm just wondering if it's possible that Config.set grabs the /old/
session identifier instead of the new one. Is Config.set the recommended
way to set up data for the JSTL? As I said, I've never used it. Is there
an alternate way? Say... poking a value directly into the session?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFURP89CaO5/Lv0PARAvGSAKCVIzPWw9HxIMEntWrl8y383UvOqQCgvfKz
jki/ZLBndeuNBs+2d5hdnRg=
=LaG0
-END PGP SIGNATURE-

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



Re: HTML:FILE

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Van,

 I’m trying to create a jsp page that can upload a file.  Everything
 works, but I cannot apply my style to the “Browse” button:

Most browsers don't let you style the browse button for file input types
specifically.

 That displays the regular button… I apply the same styleClass to the
 submit button and that works out fine:

Yup: that's because it's a button instead of a file input type. I
think you might just be out of luck.

Also remember that Safari won't let you style buttons at all.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFURSP9CaO5/Lv0PARAq86AKCbxpnO0NWrpJiufghYc1DgaurMRwCfVuWd
Xdh0v8SjllxjHA4VgaZKOzM=
=bXWD
-END PGP SIGNATURE-

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



Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Chris Pratt

I believe stray alpha particle is the most likely answer.  I'm on a US PC,
with an English version of Windows XP.  Everything on this machine screams
English, but for some reason it's picking the application_fr.properties.

The forward for my logout action includes the attribute forward=true to
make sure that the request gets run through the filter, and I can see in the
logs that it is.

As far as I can tell Config is the correct way to set JSTL values and since
I passed the same HttpSession instance into the Config.set that I used to
set the Struts Global value, I can't see how it would have gotten the old
session.

I really don't want to have to try and debug into the black box that is
Struts, but that's looking more and more likely (so much for saving time on
this project by using a tried-and-true technology instead of rolling my own
like I've always done in the past).
 (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 No the original problem statement was that the JSTL fmt tags were
 picking up
 the French text even though the locale was set to English

Strange. Where is that French locale coming from? Default JDK locale?
Locale of the web browser's headers? Stray alpha particle?

 the Struts tags are working correctly.

Okay, that makes sooo much more sense.

 The only thing that I can think of is that the
 Config class isn't working properly in this situation.  With Struts I
set
 the Session Attribute directly, with JSTL, I used the Config.set()
method.

Is this happening in a request that is distinct from the one in which
you did the invalidate? Or, might you be invalidating the request, and
then doing a server-side forward to the code that re-sets this locale?

I'm just wondering if it's possible that Config.set grabs the /old/
session identifier instead of the new one. Is Config.set the recommended
way to set up data for the JSTL? As I said, I've never used it. Is there
an alternate way? Say... poking a value directly into the session?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFURP89CaO5/Lv0PARAvGSAKCVIzPWw9HxIMEntWrl8y383UvOqQCgvfKz
jki/ZLBndeuNBs+2d5hdnRg=
=LaG0
-END PGP SIGNATURE-

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




RE: Radio buttons and iterate

2006-11-07 Thread Strachan, Paul
If you view the html source you would notice the 'name' attribute is the
same for each radio field; this field is what groups the radios
together.

With struts, typically you would apply indexProperties feature e.g.

logic:iterate id=requestList name=MyForm property=requestList

... tdhtml:radio indexed=true name=requestList
property=reqStatus value=PENDINGN/C/html:radio

html:radio indexed=true name=requestList property=reqStatus
value=APPROVEDApprove/html:radio

html:radio indexed=true name=requestList property=reqStatus
value=DENIEDDeny/html:radio/td
...

And your formdef may look like

form-bean name=MyForm type=...DynaValidatorForm
form-property name=requestList type=java.util.ArrayList/

Each bean in the collection of requestList has a property reqStatus

Also view the struts documentation on indexed properties:

http://struts.apache.org/1.2.x/faqs/indexedprops.html


HTH
Paul


-Original Message-
From: Perry Minchew [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 8 November 2006 6:45 AM
To: 'Struts Users Mailing List'
Subject: Radio buttons and iterate

Hi all,

 

I asked this question earlier, but did not see a response, so I'll try
again. Here's my jsp

table

logic:iterate id=admins name=requestList

trtd bean:write name=admins property=dn/ /td

tdbean:write name=admins property=givenname//td

tdbean:write name=admins property=sn//td

tdbean:write name=admins property=telephonenumber//td

tdbean:write name=admins property=mail//td

tdbean:write name=admins property=portal//td

tdbean:write name=admins property=requestedApp//td

tdhtml:radio property=reqStatus value=PENDING
name=adminsN/C/html:radio

html:radio property=reqStatus value=APPROVED
name=adminsApprove/html:radio

html:radio property=reqStatus value=DENIED
name=adminsDeny/html:radio/td

/tr

/logic:iterate

/table

 

So I'm iterating over the array list (requestList) and displaying
information from our oracle database. I get solid output for the 4 in my
test list. However, all of the radio buttons are linked. At the admin
screen, I see 12 radio buttons, and only one of them is marked (the last
one). Clicking a radio button on a row above makes the global radio
change. How do I make each row have it's on radio set with the iterate
feature?

 

Thanks

 

Perry Minchew

Systems Integrator

SPAWAR Systems Charleston

Office : (843) 218.7031

Cell : (843) 822.1555

 

**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

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



s:component question

2006-11-07 Thread Mark Menard
Is it possible to access the body of an s:component tag, like so?

s:component template=mytemplateMy Body/s:component

I'd like to be able to get at the My Body string in the tag. Is this
possible? How would I refer to it?

Alternatively could I do something like this:

s:components:url value=my.action //s:component

And then access the results of the s:url tag inside my component template?

Thanks,

Mark

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



Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 I believe stray alpha particle is the most likely answer.  I'm on a
 US PC, with an English version of Windows XP.  Everything on this 
 machine screams English, but for some reason it's picking the 
 application_fr.properties.

Totally weird.

 As far as I can tell Config is the correct way to set JSTL values and
 since I passed the same HttpSession instance into the Config.set that
 I used to set the Struts Global value, I can't see how it would have
 gotten the old session.

Oh, duh. Yeah, you *do* pass-in that parameter. Are you sure that's what
you're supposed to do when setting the JSTL locale? It looks about
right... just making sure.

 I really don't want to have to try and debug into the black box that
 is Struts, but that's looking more and more likely

I thought struts was working properly, though. Oughtn't you be digging
through JSTL instead?

 (so much for saving time on this project by using a tried-and-true
 technology instead of rolling my own like I've always done in the
 past).

Don't write-off struts just yet. It's the best app framework I've ever
used, though I've only ever used two: one was home-grown and was
completely worthless. The other was Turbine which didn't match up with
the way I see application frameworks as being useful. I actually
converted a Turbine project to struts (ugh) and I've never looked back.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFURnL9CaO5/Lv0PARAomFAJ4+1eK+AUMrI8LKrpGYl1UGiyCvAACgwNif
/F/JuuC8/M4mgVqluYOTMIM=
=zqql
-END PGP SIGNATURE-

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



Re: Losing Locale after Sesion.invalidate()

2006-11-07 Thread Chris Pratt

True, this definitely seems more like a JSTL bug/problem than a Struts.
 (*Chris*)

On 11/7/06, Christopher Schultz [EMAIL PROTECTED] wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

Chris Pratt wrote:
 I believe stray alpha particle is the most likely answer.  I'm on a
 US PC, with an English version of Windows XP.  Everything on this
 machine screams English, but for some reason it's picking the
 application_fr.properties.

Totally weird.

 As far as I can tell Config is the correct way to set JSTL values and
 since I passed the same HttpSession instance into the Config.set that
 I used to set the Struts Global value, I can't see how it would have
 gotten the old session.

Oh, duh. Yeah, you *do* pass-in that parameter. Are you sure that's what
you're supposed to do when setting the JSTL locale? It looks about
right... just making sure.

 I really don't want to have to try and debug into the black box that
 is Struts, but that's looking more and more likely

I thought struts was working properly, though. Oughtn't you be digging
through JSTL instead?

 (so much for saving time on this project by using a tried-and-true
 technology instead of rolling my own like I've always done in the
 past).

Don't write-off struts just yet. It's the best app framework I've ever
used, though I've only ever used two: one was home-grown and was
completely worthless. The other was Turbine which didn't match up with
the way I see application frameworks as being useful. I actually
converted a Turbine project to struts (ugh) and I've never looked back.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFURnL9CaO5/Lv0PARAomFAJ4+1eK+AUMrI8LKrpGYl1UGiyCvAACgwNif
/F/JuuC8/M4mgVqluYOTMIM=
=zqql
-END PGP SIGNATURE-

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




Re: [s2] Accessing HttpServletRequest from an Interceptor

2006-11-07 Thread Ted Husted

Yes, that's fine. The role of the ServletActionContext is to make it
easy to snag the request from an Action or Interceptor.

The ActionContext itself is a thread-local container of the objects
being processed with the request. The core framework objects, like
Locale, are defined in the XWork ActionContext. The
ServletActionContext is the Struts 2 extension that hosts web-specific
objects.


From an Interceptor, another way to snag the request is from the

invocation that is passed in by the framework.

HttpServletRequest request = (HttpServletRequest)
invocation.getInvocationContext().get(HTTP_REQUEST);

But, this idiom only works in an Interceptor. The ServletActionContext
approach works in an Action too.

-- HTH, Ted.
* http://www.husted.com/struts/

On 11/6/06, Mark Menard [EMAIL PROTECTED] wrote:

I need to access the HttpServletRequest from an Interceptor. I'm using:

HttpServletRequest request = ServletActionContext.getRequest ();

Is that the correct way to get it? It works, but I'm not sure that's how I
should be doing it.

Thanks,


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



Re: [Struts 2] execute() method not firing in Action

2006-11-07 Thread Ted Husted

On 11/7/06, Wesley Wannemacher [EMAIL PROTECTED] wrote:

The form tag is as follows in the JSP: s:form action=register...

There are only a few fields, and using either register!* or register_*
gives me the same in the debugger. Each of the setters/getters is called
(for setting values, then re-displaying the values), but the execute
method is never called. It is as if, my execute method signature is
wrong because it is not invoked, it appears that another method is
invoked that returns input. The s:actionerror / never generates any
output, and validation appears to pass.


Valiation isn't passing. That's why input is being returned, and why
the Action class is never invoked. If the messages are not displaying,
the most likely cause is that a property is being validated that is
not present on the page (so there is no where to display the message).
If the validator is being attached to the Action class, note that a
subclass will inherit the validations of its superclass.

You might want to try the new debugging mode to see if there are any
orphan field validation errors.

* http://cwiki.apache.org/WW/debugging.html

One note about the wildcards and the exclamation point. If you use the
exclamation point as a wildcard separator, in struts.properties be
sure to set

* struts.enable.DynamicMethodInvocation = false

Better yet, stick with the underscore. I find it to be an
easier-to-read separator.

-Ted.

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



Struts v2.0.1 BETA Release

2006-11-07 Thread Ted Husted

The Apache Struts project is pleased to announce the availability of
the Struts 2.0.1 BETA release
[http://struts.apache.org/download.cgi#struts201].

Apache Struts 2 is an elegant, extensible framework, well suited for
enterprise-ready Java web applications. The framework is designed to
streamline the full development cycle, from building, to deploying, to
maintaining applications over time.

Apache Struts 2 was originally known as WebWork 2. After working
independently for several years, the WebWork and Struts communities
joined forces to create Struts2. This new version of Struts is simpler
to use and closer to how Struts was always meant to be.

* Build!
 o Easy startup - A Maven archetype, template application, and
bootstrap tutorial help jumpstart new projects.
 o Improved Design - All framework classes are based on interfaces.
Core interfaces are HTTP independent.
 o Enhanced Results - Unlike ActionForwards, Struts2 Results can
actually help prepare the response.
 o Enhanced Tags - Struts2 tags don't just output data, but provide
stylesheet-driven markup, so that we can create consistent pages with
less code.
 o Stateful Checkboxes - Struts2 checkboxes do not require special
handling for false values.
 o Easy cancel handling - The Struts2 Cancel button can go directly
to a different action.
 o POJO forms - No more ActionForms! We can use any JavaBean we like
or put properties directly on our Action classes. No need to use all
String properties!
 o POJO Actions - Any class can be used as an Action class. Even the
interface is optional!
 o Easy Spring integration - Struts2 Actions are Spring-aware. Just
add Spring beans!
 o First-class AJAX support - The AJAX theme gives interactive
applications a boost.

* Deploy!
 o QuickStart - Configuration files are reloadable so many changes
can be made on the fly without restarting a web container.
 o Easy plugins - Framework extensions can be added by dropping in a
JAR. No manual configuration required! Bundled plugins add support for
JavaServer Faces, JasperReports, JFreeChart, Tiles, and more ...
 o Easy portlets - Automatic portlet support allows portal and
servlet deployments with no code changes.

* Maintain!
 o Easy-to-test Actions - Struts2 Actions are HTTP independent and
can be tested without resorting to mock objects.
 o Intelligent Defaults - Most framework configuration elements have
a default value that we can set and forget.
 o Easy-to-customize controller - Struts 1 lets us customize the
request processor per module, Struts2 lets us customize the request
handling per action, if desired.
 o Easy-to-tweak tags - Struts2 tag markup can be altered by changing
an underlying stylesheet. Individual tag markup can be changed by
editing a FreeMarker template. No need to grok the taglib API! JSP,
FreeMarker, and Velocity tags are fully supported.
 o Integrating Debugging - Built-in debugging tools supporting
profiling, problem reports, and interactive object model queries.

For more, visit the Apache Struts 2 website [http://struts.apache.org/2.x/].



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



How to pass Java parameter to javascript

2006-11-07 Thread Pankaj Gupta
Hi All,

I am unable to pass a java parameter to a javascript method. Can you 
please tell whats going wrong. Here is my code:
html:submit property=submitType onclick=setFile('%= 
((FileInstance)nmeFile).getFileName() %', this.form); 

regards,
Pankaj

Re: Issue: using logic:iterate to display rows and html:button to distinguish one of them

2006-11-07 Thread Pankaj Gupta

I am facing the same problem. I am trying to use the onclick approach but
not able to make it work. The parameter I pass to the javascript method does
not work. The problem is that the java parameter is not resolved to a value
here.

html:submit property=submitType
onclick=setFile('%=((FileInstance)nmeFile).getFileName()
%', this.form); 

regards,

Pankaj

On 10/26/06, Chris Pratt [EMAIL PROTECTED] wrote:


Another option would be using JavaScript and an onclick handler on the
delete button to update a single contactID hidden field before form
submission.
(*Chris*)

On 10/26/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED]
wrote:

 Hi,

 I've discovered the answer, although it may not be the most
 elegant.


 Rather than having one form, have one form per row. This is
 achieved
 by placing the html:form tags inside the logic:iterate ones, then
the
 html:hidden tag will contain the correct value when the button is
 pressed.

 Thanks



  Regards,

  Jim


 -Original Message-
 From: Marcello Savino [mailto:[EMAIL PROTECTED]
 Sent: 26 October 2006 11:32
 To: Struts Users Mailing List
 Subject: R: Issue: using logic:iterate to display rows and html:button
to
 distinguish one of them

 *** WARNING : This message originates from the Internet ***

 Give to the hyperlink a button appereance , don't know other way to do
 this


 Marcello Savino
 ALDEBRA S.p.A.
 tel.  0461302441

 -Messaggio originale-
 Da: Gallagher, Jim (RBoS ITDS Dublin) [mailto:[EMAIL PROTECTED]
 Inviato: giovedì 26 ottobre 2006 12.27
 A: 'Struts Users Mailing List'
 Oggetto: RE: Issue: using logic:iterate to display rows and html:button
to
 distinguish one of them

 Thanks for this - unfortunately I'm required to use a button, not a
 hyperlink. Is it possible?



  Regards,

  Jim


 -Original Message-
 From: Marcello Savino [mailto:[EMAIL PROTECTED]
 Sent: 26 October 2006 11:21
 To: Struts Users Mailing List
 Subject: R: Issue: using logic:iterate to display rows and html:button
to
 distinguish one of them

 *** WARNING : This message originates from the Internet ***

 Sorry i forgot something in my code

 c:url value=/delete.do var=urldel
 c:param name=idToDeletebean:write name=index
property=id
 //c:param
 c:param name=page value=thisPage.do?method=Open/c:param
 /c:url
 a href=c:out value=${urldel}/Delete/a

 HIH
 Ciao, marcello



 -Messaggio originale-
 Da: Gallagher, Jim (RBoS ITDS Dublin) [mailto:[EMAIL PROTECTED]
 Inviato: giovedì 26 ottobre 2006 12.02
 A: 'user@struts.apache.org'
 Oggetto: Issue: using logic:iterate to display rows and html:button to
 distinguish one of them

 Hi
 Apologies if this is a simple issue, but it's driving me insane.

 In my web app (using Struts 1.1 on Java 1.4  Websphere) I have a jsp
that
 is using logic:iterate to display a sequence of records.

 On each row I have a Delete button, which should cause the object that
 row
 represents to be deleted. I have a form defined and the Delete button
 submits the form, currently with a html:hidden tag providing the key of
 the
 row to be deleted (contactID).

 The full jsp code is:

 html:form action=scDeleteOrder
 logic:iterate id=outstandinglist name=outstandingList
indexId=index
 property=arrayList type=temptest.OrderDetail bean:write
 name=outstandinglist property=contactID / bean:write
 name=outstandinglist property=contactFirstName / lt;bean:write
 name=outstandinglist property=contactLastName / bean:write
 name=outstandinglist property=organisationName / bean:write
 name=outstandinglist property=dateOrderSent / bean:write
 name=outstandinglist property=orderStatus / bean:write
 name=outstandinglist property=errorCode / bean:write
 name=outstandinglist property=serviceUserNo / bean:write
 name=outstandinglist property=billingSortCode / bean:write
 name=outstandinglist property=billingAccountNo / html:hidden
 name=outstandinglist property=contactID /html:submit
value=Delete
 /
 /logic:iterate /html:form

 My problem is that the contactID returned is always the first one
 displayed,
 not the one of the row selected. I changed the hidden tag to a text one
to
 see the value being written and it was the correct contactID, but on
 pressing the button the contactID retrieved in the Action is always the
 first row displayed.

 Could anybody suggest a) a solution to the above issue and/or b) a more
 elegant way to achieve what I'm trying to do?

 Thanks in advance

  Regards,

  Jim

 Jim Gallagher



 The Royal Bank of Scotland plc, Registered in Scotland No. 90312.
 Registered
 Office: 36 St Andrew Square, Edinburgh EH2 2YB

 Authorised and regulated by the Financial Services Authority.

 This e-mail message is confidential and for use by the addressee only.
If
 the message 

Re: Issue: using logic:iterate to display rows and html:button to distinguish one of them

2006-11-07 Thread Chris Pratt

What do you get when you try it?
 (*Chris*)

On 11/7/06, Pankaj Gupta [EMAIL PROTECTED] wrote:


I am facing the same problem. I am trying to use the onclick approach but
not able to make it work. The parameter I pass to the javascript method
does
not work. The problem is that the java parameter is not resolved to a
value
here.

html:submit property=submitType
onclick=setFile('%=((FileInstance)nmeFile).getFileName()
%', this.form); 

regards,

Pankaj

On 10/26/06, Chris Pratt [EMAIL PROTECTED] wrote:

 Another option would be using JavaScript and an onclick handler on the
 delete button to update a single contactID hidden field before form
 submission.
 (*Chris*)

 On 10/26/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED]

 wrote:
 
  Hi,
 
  I've discovered the answer, although it may not be the most
  elegant.
 
 
  Rather than having one form, have one form per row. This is
  achieved
  by placing the html:form tags inside the logic:iterate ones, then
 the
  html:hidden tag will contain the correct value when the button is
  pressed.
 
  Thanks
 
 
 
   Regards,
 
   Jim
 
 
  -Original Message-
  From: Marcello Savino [mailto:[EMAIL PROTECTED]
  Sent: 26 October 2006 11:32
  To: Struts Users Mailing List
  Subject: R: Issue: using logic:iterate to display rows and html:button
 to
  distinguish one of them
 
  *** WARNING : This message originates from the Internet ***
 
  Give to the hyperlink a button appereance , don't know other way to do
  this
 
 
  Marcello Savino
  ALDEBRA S.p.A.
  tel.  0461302441
 
  -Messaggio originale-
  Da: Gallagher, Jim (RBoS ITDS Dublin) [mailto:[EMAIL PROTECTED]
]
  Inviato: giovedì 26 ottobre 2006 12.27
  A: 'Struts Users Mailing List'
  Oggetto: RE: Issue: using logic:iterate to display rows and
html:button
 to
  distinguish one of them
 
  Thanks for this - unfortunately I'm required to use a button, not a
  hyperlink. Is it possible?
 
 
 
   Regards,
 
   Jim
 
 
  -Original Message-
  From: Marcello Savino [mailto:[EMAIL PROTECTED]
  Sent: 26 October 2006 11:21
  To: Struts Users Mailing List
  Subject: R: Issue: using logic:iterate to display rows and html:button
 to
  distinguish one of them
 
  *** WARNING : This message originates from the Internet ***
 
  Sorry i forgot something in my code
 
  c:url value=/delete.do var=urldel
  c:param name=idToDeletebean:write name=index
 property=id
  //c:param
  c:param name=page value=thisPage.do
?method=Open/c:param
  /c:url
  a href=c:out value=${urldel}/Delete/a
 
  HIH
  Ciao, marcello
 
 
 
  -Messaggio originale-
  Da: Gallagher, Jim (RBoS ITDS Dublin) [mailto:[EMAIL PROTECTED]
]
  Inviato: giovedì 26 ottobre 2006 12.02
  A: 'user@struts.apache.org'
  Oggetto: Issue: using logic:iterate to display rows and html:button to
  distinguish one of them
 
  Hi
  Apologies if this is a simple issue, but it's driving me insane.
 
  In my web app (using Struts 1.1 on Java 1.4  Websphere) I have a jsp
 that
  is using logic:iterate to display a sequence of records.
 
  On each row I have a Delete button, which should cause the object
that
  row
  represents to be deleted. I have a form defined and the Delete button
  submits the form, currently with a html:hidden tag providing the key
of
  the
  row to be deleted (contactID).
 
  The full jsp code is:
 
  html:form action=scDeleteOrder
  logic:iterate id=outstandinglist name=outstandingList
 indexId=index
  property=arrayList type=temptest.OrderDetail bean:write
  name=outstandinglist property=contactID / bean:write
  name=outstandinglist property=contactFirstName / lt;bean:write
  name=outstandinglist property=contactLastName / bean:write
  name=outstandinglist property=organisationName / bean:write
  name=outstandinglist property=dateOrderSent / bean:write
  name=outstandinglist property=orderStatus / bean:write
  name=outstandinglist property=errorCode / bean:write
  name=outstandinglist property=serviceUserNo / bean:write
  name=outstandinglist property=billingSortCode / bean:write
  name=outstandinglist property=billingAccountNo / html:hidden
  name=outstandinglist property=contactID /html:submit
 value=Delete
  /
  /logic:iterate /html:form
 
  My problem is that the contactID returned is always the first one
  displayed,
  not the one of the row selected. I changed the hidden tag to a text
one
 to
  see the value being written and it was the correct contactID, but on
  pressing the button the contactID retrieved in the Action is always
the
  first row displayed.
 
  Could anybody suggest a) a solution to the above issue and/or b) a
more
  elegant way to achieve what I'm trying to do?
 
  Thanks in advance
 
   Regards,
 
   Jim
 
  Jim Gallagher
 
 
 
  The Royal Bank of 

Re: Issue: using logic:iterate to display rows and html:button to distinguish one of them

2006-11-07 Thread Pankaj Gupta
Thanks Chris for the response. I have fixed the bug. It works now the new 
code looks like this:
html:submit property=submitType onclick=%= return setFile(' + 
((FileInstance)nmeFile).getFileName() +')% 





Chris Pratt [EMAIL PROTECTED] 
11/08/2006 11:48 AM
Please respond to
Struts Users Mailing List user@struts.apache.org


To
Struts Users Mailing List user@struts.apache.org
cc

Subject
Re: Issue: using logic:iterate to display rows and html:button to 
distinguish one of them






What do you get when you try it?
  (*Chris*)

On 11/7/06, Pankaj Gupta [EMAIL PROTECTED] wrote:

 I am facing the same problem. I am trying to use the onclick approach 
but
 not able to make it work. The parameter I pass to the javascript method
 does
 not work. The problem is that the java parameter is not resolved to a
 value
 here.

 html:submit property=submitType
 onclick=setFile('%=((FileInstance)nmeFile).getFileName()
 %', this.form); 

 regards,

 Pankaj

 On 10/26/06, Chris Pratt [EMAIL PROTECTED] wrote:

  Another option would be using JavaScript and an onclick handler on the
  delete button to update a single contactID hidden field before form
  submission.
  (*Chris*)
 
  On 10/26/06, Gallagher, Jim (RBoS ITDS Dublin) 
[EMAIL PROTECTED]
 
  wrote:
  
   Hi,
  
   I've discovered the answer, although it may not be the most
   elegant.
  
  
   Rather than having one form, have one form per row. This is
   achieved
   by placing the html:form tags inside the logic:iterate ones, 
then
  the
   html:hidden tag will contain the correct value when the button is
   pressed.
  
   Thanks
  
  
  
Regards,
  
Jim
  
  
   -Original Message-
   From: Marcello Savino [mailto:[EMAIL PROTECTED]
   Sent: 26 October 2006 11:32
   To: Struts Users Mailing List
   Subject: R: Issue: using logic:iterate to display rows and 
html:button
  to
   distinguish one of them
  
   *** WARNING : This message originates from the Internet ***
  
   Give to the hyperlink a button appereance , don't know other way to 
do
   this
  
  
   Marcello Savino
   ALDEBRA S.p.A.
   tel.  0461302441
  
   -Messaggio originale-
   Da: Gallagher, Jim (RBoS ITDS Dublin) 
[mailto:[EMAIL PROTECTED]
 ]
   Inviato: giovedì 26 ottobre 2006 12.27
   A: 'Struts Users Mailing List'
   Oggetto: RE: Issue: using logic:iterate to display rows and
 html:button
  to
   distinguish one of them
  
   Thanks for this - unfortunately I'm required to use a button, not a
   hyperlink. Is it possible?
  
  
  
Regards,
  
Jim
  
  
   -Original Message-
   From: Marcello Savino [mailto:[EMAIL PROTECTED]
   Sent: 26 October 2006 11:21
   To: Struts Users Mailing List
   Subject: R: Issue: using logic:iterate to display rows and 
html:button
  to
   distinguish one of them
  
   *** WARNING : This message originates from the Internet ***
  
   Sorry i forgot something in my code
  
   c:url value=/delete.do var=urldel
   c:param name=idToDeletebean:write name=index
  property=id
   //c:param
   c:param name=page value=thisPage.do
 ?method=Open/c:param
   /c:url
   a href=c:out value=${urldel}/Delete/a
  
   HIH
   Ciao, marcello
  
  
  
   -Messaggio originale-
   Da: Gallagher, Jim (RBoS ITDS Dublin) 
[mailto:[EMAIL PROTECTED]
 ]
   Inviato: giovedì 26 ottobre 2006 12.02
   A: 'user@struts.apache.org'
   Oggetto: Issue: using logic:iterate to display rows and html:button 
to
   distinguish one of them
  
   Hi
   Apologies if this is a simple issue, but it's driving me insane.
  
   In my web app (using Struts 1.1 on Java 1.4  Websphere) I have a 
jsp
  that
   is using logic:iterate to display a sequence of records.
  
   On each row I have a Delete button, which should cause the object
 that
   row
   represents to be deleted. I have a form defined and the Delete 
button
   submits the form, currently with a html:hidden tag providing the key
 of
   the
   row to be deleted (contactID).
  
   The full jsp code is:
  
   html:form action=scDeleteOrder
   logic:iterate id=outstandinglist name=outstandingList
  indexId=index
   property=arrayList type=temptest.OrderDetail bean:write
   name=outstandinglist property=contactID / bean:write
   name=outstandinglist property=contactFirstName / lt;bean:write
   name=outstandinglist property=contactLastName / bean:write
   name=outstandinglist property=organisationName / bean:write
   name=outstandinglist property=dateOrderSent / bean:write
   name=outstandinglist property=orderStatus / bean:write
   name=outstandinglist property=errorCode / bean:write
   name=outstandinglist property=serviceUserNo / bean:write
   name=outstandinglist property=billingSortCode / bean:write
   name=outstandinglist property=billingAccountNo / html:hidden
   name=outstandinglist property=contactID /html:submit
  value=Delete
  

Re: How to pass Java parameter to javascript

2006-11-07 Thread WongTseng

when you insert jsp scriptlet into  the  tag  as a value of an attribute,
the scriptlet should be bracketed by the quotation marks without anything
else inside.

2006/11/8, Pankaj Gupta [EMAIL PROTECTED]:


Hi All,

I am unable to pass a java parameter to a javascript method. Can you
please tell whats going wrong. Here is my code:
html:submit property=submitType onclick=setFile('%=
((FileInstance)nmeFile).getFileName() %', this.form); 

regards,
Pankaj





--
Wong Tseng
王曾


Re: Issue: using logic:iterate to display rows and html:button to dis tinguish one of them

2006-11-07 Thread WongTseng

It's bacause you have more than one hidden elements with the same name,so
whichever
row you choose to delete, your action will recive an array of parameter
values with the same  parameter name. That's the reason why you always get
the id of the first row. I suggest you to use a radio boxs to replace the
hidden elements,and only one delete button is enough.
2006/10/26, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED]:


Hi
Apologies if this is a simple issue, but it's driving me insane.

In my web app (using Struts 1.1 on Java 1.4  Websphere) I have a jsp that
is using logic:iterate to display a sequence of records.

On each row I have a Delete button, which should cause the object that
row
represents to be deleted. I have a form defined and the Delete button
submits the form, currently with a html:hidden tag providing the key of
the
row to be deleted (contactID).

The full jsp code is:

html:form action=scDeleteOrder
logic:iterate id=outstandinglist name=outstandingList indexId=index
property=arrayList type=temptest.OrderDetail
bean:write name=outstandinglist property=contactID /
bean:write name=outstandinglist property=contactFirstName /
lt;bean:write name=outstandinglist property=contactLastName /
bean:write name=outstandinglist property=organisationName /
bean:write name=outstandinglist property=dateOrderSent /
bean:write name=outstandinglist property=orderStatus /
bean:write name=outstandinglist property=errorCode /
bean:write name=outstandinglist property=serviceUserNo /
bean:write name=outstandinglist property=billingSortCode /
bean:write name=outstandinglist property=billingAccountNo /
html:hidden name=outstandinglist property=contactID /html:submit
value=Delete /
/logic:iterate
/html:form

My problem is that the contactID returned is always the first one
displayed,
not the one of the row selected. I changed the hidden tag to a text one to
see the value being written and it was the correct contactID, but on
pressing the button the contactID retrieved in the Action is always the
first row displayed.

Could anybody suggest a) a solution to the above issue and/or b) a more
elegant way to achieve what I'm trying to do?

Thanks in advance

 Regards,

 Jim

Jim Gallagher



The Royal Bank of Scotland plc, Registered in Scotland No. 90312.
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB

Authorised and regulated by the Financial Services Authority.

This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message from
your computer. Internet e-mails are not necessarily secure. The Royal Bank
of Scotland plc does not accept responsibility for changes made to this
message after it was sent.

Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the onward
transmission, opening or use of this message and any attachments will not
adversely affect its systems or data. No responsibility is accepted by The
Royal Bank of Scotland plc in this regard and the recipient should carry out
such virus and other checks as it considers appropriate.


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





--
Wong Tseng
王曾


Struts problem, random properties after every restart of server

2006-11-07 Thread Philippe Schober

Hi,

I am using Struts on Orion 2.0.5 and have some languages (de, sv, en, tr 
and so on). en is the default language (ApplicationResources.properties).


The problem I have only occurs on the clients online system. It is not 
reproducable on our test systems, his test systems or locally.


After each restart of the server some texts are in english, some in 
german. It just mixes up. Those texts are always the same until the next 
restart. So changing the locale, reloading the page or whatever doesn't 
change the result. Only restarting the server does. So it seems to be a 
caching problem.


I am aware of bug STR-2925 but think that I have avoided that problem.

The strange thing is that it always seems to be german that mixes up with 
other languages and none of the others. We mirrored the server and tried 
to reproduce it but the problem just didn't show up.


Does anyone have any ideas? Our client is very upset and we are forced to 
act. The last resort would be to replace Struts but that would be 
something we all want to avoid at all costs.


Cheers,
 Philippe Schober

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



Struts2 question on action with properties

2006-11-07 Thread Ing. Andrea Vettori

Hi,

I've used struts1 a lot and now I'm using struts2 version 2.0.1 for a  
new medium-sized project (it's an e-commerce site).


I'm facing this problem and since the documentation is poor (or at  
least it seems poor, maybe I'm looking on the wrong places), I need  
an advice from you experts.


In the home page, that is a jsp page loaded with the Home action, I  
have a couple of forms. In one of them I need to use a select tag to  
give the user some options. I've put the List getInfos() method on  
the Action specified on the form that contains the select tag since I  
thought that an Action would be instanciated and used to call the  
method. This gives me an error saying that the list param of the  
select tag is not found as a collection/array/. etc.


Putting the getInfos() method on the Home action, that is the action  
that call the jsp page where the form is, works.


Now I think it would be cleaner if the getInfos() method belonged  
to the Action that is associated to the form. Is this possible to  
do ? Am I missing something ?


Thank you

P.S.
Hope you understand my Italian-English :)

--
Ing. Andrea Vettori
Consulente per l'Information Technology