RE: Struts2 Validation

2008-01-24 Thread Jeff Hill (RR)
Kevin,
You didn't mention what page has the form you're submitting, but let me call
that page0. Let's say it has two buttons: Button1 for Action1, and Button2
for Action2. I'm assuming that you entered data and hit Button2, and this
worked fine until you added the validation descriptor for Action2. 

The fact that it did stop working, and that it's trying to handle input,
says there was a vaidation failure. Trying to coerce input to take you to
page2 isn't likely to help, since on the validation failure the action
isn't invoked, so edit() is never called.

So, I have to assume that, from the data you entered, you didn't *expect*
validation to fail. I'd suggest you review the validation you added,
especially if there are any custom validators - maybe there's a combination
of validators on some field that can never evaluate to true. If there's
nothing obvious then I'd suggest adding an actionerror or some fielderror
tags to page0, and let it redisplay so you can see what field is failing
validation.

...Jeff

-Original Message-
From: djia002 [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 24, 2008 8:14 PM
To: user@struts.apache.org
Subject: Struts2 Validation


Hello , I am new to struts2. Please help me on this problem.

I have a configuration like this 
action name=Action1.* method={1} class=ActionClass1
result name=summary/page1.jsp/result
result name=detail/page2.jsp/result
/action

action name=Action2.* method={1} class=ActionClass2
result name=summary/page1.jsp/result
result name=detail/page2.jsp/result
result name=input/page2.jsp/result
/action


The flow is I submit a form from page1 to Action ActionClass2.edit method, 

public String edit() throws Exception {

// fetch some data and push into session for rendering page2.jsp ...


return detail; // This will forward to page2.jsp
}

You can see from the code that edit() method try to store some data in
session for displaying page2.jsp.

Everything works fine until i added ActionClass2-validation.xml for
validating the form on page2.jsp.

I got error says No result defined for action  and result input.
so I added result name=inputpage2.jsp/result into configuration. and
then of course it just simply try to display page2.jsp without having data
preloaded by edit() because edit() not get called at all.

How can I work around with this problem?

Thanks in advance.
Kevin
-- 
View this message in context:
http://www.nabble.com/Struts2-Validation-tp15079124p15079124.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



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



RE: Type converters: please help!!! :(

2008-01-24 Thread Jeff Hill (RR)
Ravi,
From my understanding of OGNL, it *should* use the model object's conversion
descriptor. It's probably more surprising that it called convertFromString
without it. Are you using defaultStack?

I believe providing the model object's descriptor is the correct approach,
and you indicate that it's working. So why the long face? ;-)

-Original Message-
From: ravi_eze [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 24, 2008 11:45 PM
To: user@struts.apache.org
Subject: Type converters: please help!!! :(


hi,

i badly need the solution to this problem. i had posted this issue on xwork
forums, struts fourms previously also, but hardluck: no reply :(

i am reposting the same again... atleast let me know if this idea itself is
wrong!!! or any better approach/ is there?  


ravi_eze wrote:
 
 hi,
 
 We have Action class with Employee Object with setters and getters. The
 Typeconverter was configured to be called when EmployeeObject.empId is
 called by the jsp page. We found that convertFromString of type converter
 is being called but convertToString is never called. Any idea why this is
 happening? The details are as follows:
 
 Type converter:
 public class LongConverter extends StrutsTypeConverter {
   public Object convertFromString(Map context, String[] values, Class
 toClass) {
  ... 
   }
   public String convertToString(Map context, Object o) {
 ... 
   }
 }
 
 in actionClass-conversion.properties located along with the class file in
 the same package:
 employee.empId=com.comp.util.converter.LongConverter
 
 After some debugging we found that we need to add a new file:
 Employee-conversion.properties in the same package of Employee class with
 entries: 
 empId=com.comp.util.converter.LongConverter
 
 and only then the convertToString would be called. I think we should have
 only one conversion.prop file instead of 2. Any ideas why this is
 happening this way? or am i missing any thing? please help. 
 
 cheers,
 ravi
 

-- 
View this message in context:
http://www.nabble.com/Type-converters%3A-convertToString-not-called-tp150349
25p15080943.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



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



Missing/broken links for prior releases

2008-01-23 Thread Jeff Hill (RR)
Note sure if this is the right mailing list for this, but on the download
page (http://struts.apache.org/downloads.html), there are links for prior
releases such as 2.0.9. They all take you to the same page (download.cgi),
with local references (struts#209), but those local anchors have apparently
been removed, so the only 2.x download listed there is 2.0.11 (and 1.3.8 and
1.3.9 beta??).  I found what I needed (in archives/binaries), but the links
should probably be fixed.

 

Jeff Hill

 



Where's dojo?

2008-01-23 Thread Jeff Hill (RR)
I've seen references all over the place to the struts dojo plugin, but I
can't find a jar by that name in any of the 2.x distributions I've checked
(2.09 and later). Is the jar called something else? Or is it not actually
part of the distribution as the docs say?

 

Also, I understand the Ajax tags move to struts-dojo-tags in 2.1. I
downloaded the test distribution (2.1.0), and can't find the TLD for that
either.

 

What am I missing (besides sleep)?

 

Thanks!

   Jeff