struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Wessendorf" <maili...@matthias-wessendorf.de>
Subject RE: Validation Multiple Pages forward-Failure
Date Tue, 27 Jan 2004 19:41:47 GMT
hi

enter 
input="/myFormular.jsp"

so validate goes back to formular

there you can display
action-messages (or even errors if you use)

cheers,
matthias

-----Original Message-----
From: Robert Lehner [mailto:rlehner@iiv.de] 
Sent: Tuesday, January 27, 2004 7:13 PM
To: Struts Users Mailing List
Subject: Re: Validation Multiple Pages forward-Failure


Hallo

I'm using *.do mapping in my web.xml so I must use input="/newUser" ?
This does not work!

Ben Anderson wrote:
> You want to put validate="true" for the action you are submitting to.
> That's also where you specify the input.  The input is an application 
> relative path beginning with a "/", so if you're using /do/* mapping
in 
> your web.xml you'd want something like this
> 
> <action name="newUserFrom"
>           path=/nextPathInProcess"
>           validate="true"
>           input="/do/newUser"
>            ....
> 
> however, I think it's generally best to just forward back to the jsp:
>         input="/pages/newUser.jsp"

I could not user input="/newuser/newUser.jsp because there is no file 
like newUser.jsp .
I have the files index.jsp, address.jsp, services.jsp, status.jsp where 
I distribute the objects (name, fist name, street, city etc) from my 
NewUserFrom.
When I mistype anything i.E. in index.jsp it should redisplay the 
index.jsp with the errormsg otherwise it should display the next page 
(address.jsp) and so on. Like in my NewUserAktion snippt down. (Also 
shown in the struts-validation example of the struts-distribution but 
without JavaScript!!)
If you would see the full NewUserAction mail me and i would send it to 
you via pm.

thx

Robert Lehner



>> From: Robert Lehner <rlehner@iiv.de>
>> Reply-To: "Struts Users Mailing List" 
>> <struts-user@jakarta.apache.org>
>> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
>> Subject: Re: Validation Multiple Pages forward-Failure
>> Date: Tue, 27 Jan 2004 18:19:18 +0100
>>
>> Hello
>>
>> I saw this in the dtd, but I don't knowe what I should enter as value
>> of input. I tried newUser, newUser.do, newUserFrom nothing worked es 
>> expected.
>>
>> I would to get back the form where the validation find the failure, 
>> so
>> the User could corret his failure an procced the applikation.
>>  BTW: I used the struts-validation exmaple as pattern.
>> I changed in the pattern struts-config.xml at the action 
>> multiRegistration the validation to true and the applikation dosen't 
>> work any more. Why?
>>
>> Thx
>>
>> Robert Lehner
>>
>> Ben Anderson wrote:
>>
>>> struts validation uses the input attribute of the action tag to send
>>> you back to where you came from if validation fails.  Here's the 
>>> excerpt from the dtd:
>>>
>>>     input           Module-relative path of the action or other 
>>> resource to
>>>                     which control should be returned if a validation
>>> error is
>>>                     encountered. Valid only when "name" is
specified. 
>>> Required
>>>                     if "name" is specified and the input bean
returns
>>>                     validation errors. Optional if "name" is 
>>> specified and the
>>>                     input bean does not return validation errors
>>>
>>> you must specify this attribute if you want to use struts 
>>> validation. -Ben
>>>
>>>> From: Robert Lehner <rlehner@iiv.de>
>>>> Reply-To: Struts Users Mailing List 
>>>> <struts-user@jakarta.apache.org>
>>>> To: Struts Users Mailing List <struts-user@jakarta.apache.org>
>>>> Subject: Validation Multiple Pages forward-Failure
>>>> Date: Tue, 27 Jan 2004 14:01:16 +0100
>>>>
>>>> Hello,
>>>>
>>>> I have a MultiPageFrom with 7 seperate JSP-Pages.
>>>> I want to validate all these pages.
>>>>
>>>> When I run the application and whould test if the validation works
>>>> well, I get the following error when I hit Submit.
>>>> ---
>>>> type Status report
>>>>
>>>> message No input attribute for mapping path /newUser
>>>>
>>>> description The server encountered an internal error (No input
>>>> attribute for mapping path /newUser) that prevented it from 
>>>> fulfilling this request.
>>>> ---
>>>>
>>>> When validate is false, it works correctly, without validation. No 
>>>> validation is not a solution.
>>>>
>>>> Some more information:
>>>> NewUserAktion snippet:
>>>> ...
>>>> ActionErrors errors = newUserFrom.validate(mapping, request);
>>>>
>>>> if (errors != null && errros.isEmpty()){
>>>>  if (newUserFrom.getPage() == 1)
>>>>   return mapping.findForward("user2");
>>>> ...
>>>>  if (newUserFrom.getPage() == 7)
>>>>   return mapping.findForward("success");
>>>> } else {
>>>>  saveErrors(request, errors);
>>>>  if (newUserFrom.getPage() == 1)
>>>>   return mapping.findForward("user"+newUserFrom.getPage());
>>>>  if (newUserFrom.getPage() == 2)
>>>>   return mapping.findForward("user"+newUserForm.getPage());
>>>> ...
>>>> }
>>>>
>>>> struts-config snippet:
>>>> ...
>>>>
>>>> <action
>>>>  attribute="newUserFrom"
>>>>  name="newUserFrom"
>>>>  path=/newUser"
>>>>  scope="session"
>>>>  type=...
>>>>  validate="true">
>>>>   <forward
>>>>    name="success"
>>>>    path="/index.html"
>>>>    redirect="false"
>>>>    contextRelative="false"/>
>>>>   <forward
>>>>    name="user1"
>>>>    path="newuser/index.jsp"
>>>>    redirect="false"
>>>>    contextRealtive="false/>
>>>> ...
>>>> </action>
>>>>
>>>> newuser/index.jsp snippet:
>>>> ...
>>>> <logic:messagesPresent>
>>>>  <html:messages id="error"
>>>>   <bean:write name="error"/>
>>>>  </html:messages>
>>>> </logic:messagesPresent>
>>>> <html:form action="newUser">
>>>> <html:hidden property="action"/>
>>>> <html:hidden property="page" value="1"/>
>>>> ...
>>>> </html:form>
>>>>
>>>> I don's see any problem, wheres my failure?
>>>>
>>>> Thx
>>>>
>>>> Robert Lehner
>>>> rlehner@iiv.de
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> --
>>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail:
struts-user-help@jakarta.apache.org
>>>>
>>>
>>> _________________________________________________________________
>>> High-speed users—be more efficient online with the new MSN Premium
>>> Internet Software. 
>>> http://join.msn.com/?pgmarket=en-us&page=byoa/prem&ST=1
>>>
>>>
>>> --------------------------------------------------------------------
>>> -
>>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
> 
> _________________________________________________________________
> Check out the new MSN 9 Dial-up — fast & reliable Internet access with
> prime features!
http://join.msn.com/?pgmarket=en-us&page=dialup/home&ST=1
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 



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


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


Mime
View raw message