struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Puneet Babbar 2 <pbabb...@sapient.com>
Subject RE: jsp/properties file/validation interaction question
Date Wed, 07 Mar 2012 03:45:24 GMT
I had faced the same issue, now from my limited experience this problem can be tackled in the
following ways - 

1) Replicate the key/value pairs in B.properties as from what I found struts framework always
looks for the value of the key in the "Action.properties" file first. Here Action is B since
B is sending the result to A.jsp after validation.
2) Refer to the link below to read about the order in which struts looks for a key's value
in its various Resource Bundles and you choose to add your key/value pairs in a different
resource bundle.

http://struts.apache.org/2.3.1/docs/localization.html

Regards

Puneet

-----Original Message-----
From: John W. Himpel [mailto:john@jlhimpel.net] 
Sent: Wednesday, March 07, 2012 4:48 AM
To: user@struts.apache.org
Subject: jsp/properties file/validation interaction question

Good evening,

1) ActionClass A gathers some lists used in drop-down boxes and
check-boxes in A.jsp.  ActionClass A forwards to A.jsp.
2) The user makes selections and inputs additional data into A.jsp.  The
form in A.jsp forwards to ActionClass B.  A.jsp uses the property file
A.properties to provide titles, button labels, etc.
3)  ActionClass B validates the inputs from A.jsp and discovers a
validation error.  It populates the same lists referenced in #1 above.
ActionClass B then forwards to "input" which is configured to A.jsp.
3a) If ActionClass B successfully validates it's input from A.jsp, it
then performs some business logic and proceeds to forward to "success"
which is configured to B.jsp.
4)  A.jsp renders.  The drop-down boxes, check-boxes and input fields
are correctly populated.  But the jsp renderer tries to obtain a value
for <s:text value="getText('title')" /> from B.jsp.  Of course this
fails.

Either I'm missing something in A.jsp or I need to re-architect my
workflow.  I read where "chain" forwarding is highly discouraged.  Any
suggestions would be greatly appreciated.

Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

Mime
View raw message