Validation not displaying

2003-04-03 Thread Chen, Gin
The submit is returning to the input page so I'm pretty sure that validation
is working but no messages are being displayed.

---
//jsp
html:errors/

html:messages id=msg message=true
name=org.apache.struts.action.GLOBAL_MESSAGE
c:out value=${msg} escapeXml=false/
/html:messages

html:form action='/companySearch'
html:text property='companyName'/
html:submit styleClass=smButtonbean:message
key='button.search'//html:submit
/html:form

//struts-config.xml
form-bean name=selectCompanyForm
type=org.apache.struts.validator.DynaValidatorForm
 form-property name=companyName type=java.lang.String/
/form-bean

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames

value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-dyna.xml/
/plug-in

//validation-dyna.xml
form name=selectCompanyForm
field property=companyName depends=required
arg0 key=prompt.company.name/
/field
/form

//ApplicationResources.properties
prompt.company.name=A company name is required to search on

-Tim

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



RE: Validation not displaying

2003-04-03 Thread Chen, Gin
Please disregard this.
I'm tired and I set up my validation without the required messages. *sigh*
-Tim

-Original Message-
From: Chen, Gin [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 03, 2003 12:45 PM
To: 'Struts Users Mailing List'
Subject: Validation not displaying


The submit is returning to the input page so I'm pretty sure that validation
is working but no messages are being displayed.

---
//jsp
html:errors/

html:messages id=msg message=true
name=org.apache.struts.action.GLOBAL_MESSAGE
c:out value=${msg} escapeXml=false/
/html:messages

html:form action='/companySearch'
html:text property='companyName'/
html:submit styleClass=smButtonbean:message
key='button.search'//html:submit
/html:form

//struts-config.xml
form-bean name=selectCompanyForm
type=org.apache.struts.validator.DynaValidatorForm
 form-property name=companyName type=java.lang.String/
/form-bean

plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnames

value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-dyna.xml/
/plug-in

//validation-dyna.xml
form name=selectCompanyForm
field property=companyName depends=required
arg0 key=prompt.company.name/
/field
/form

//ApplicationResources.properties
prompt.company.name=A company name is required to search on

-Tim

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



struts auto validation not displaying

2003-03-17 Thread Chen, Gin
Hi all,
   I have a dynaform field that is being validated but it is not displaying
the error msg.
I matched everything up several times to make sure everything was there but
its still not showing the error messages. I know its validating though
because it will return me back to my page.
Even a view source of the post error page just shows a blank where the
html:errors should have put the error. If I manually create an error and
save it however, it will display correctly.
 (btw.. the unknown=false is because i'm using xdoclet to build the
struts-config and I have no idea why its putting that in. It doesnt seem to
harm anything though.
Can anyone see what I'm doing wrong?
Thanks.
-Tim

// application resource
# prompt text
prompt.company.name=A company name is required to search on

// jsp page
...
html:errors/
...

//struts-config
form-beans
  form-bean name=selectCompanyForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=companyName type=java.lang.String/
  /form-bean
/form-beans

...

action path=/companySearch
  type=com.mam.ui.action.CompanySearchAction
  name=selectCompanyForm
  scope=request
  input=select.company.page
  unknown=false
  validate=true


...

set-property property=pathnames

value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml,/WEB-INF/validat
ion-dyna.xml/

// validation-dyna.xml
formset
form name=selectCompanyForm
field property=companyName depends=required
arg0 key=prompt.company.name/
/field
/form
/formset

-Tim

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



Validation FW: Displaying messages passed the request

2001-08-28 Thread Matt Raible



I have a SaveAction that sets up some success 
messages using:
messages.add(new ActionMessage("timesheetManage.save.success"));
saveMessages(Constants.MESSAGE_KEY, request, 
messages);


And upon this save, the findForward("success") 
forwards to another action class with:

forward 
name="success" 
path="/do/editTimesheet?action=Edit" redirect="true" /

But on the JSP after, there are no messages 
displayed. I know the answer why, and that is because 
"redirect=true". However, this is the only way I can forward to another 
action class in iPlanet.

Anyone know of a workaround to carry these messages 
into the next page? Can I check the request in "editTimesheet" to see if 
messages exist, and if so - add them to the request again?

Thanks,

Matt





RE: Validation FW: Displaying messages passed the request

2001-08-28 Thread Paradis, André



Matt,

Doing 
a redirection causes a new request to be created, thus you 
loose
everything you put in the previous request object. You could save 
your messages in user session scope, then do your redirection. The next 
page will have access to the user session and you'll be able to read those 
messages. After messages are read, you can remove the bean from session 
scope in order preserve memory on the server.

Andre 
Paradis

  -Original Message-From: Matt Raible 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, August 28, 2001 2:01 
  PMTo: Struts UserSubject: Validation FW: Displaying 
  messages passed the request
  I have a SaveAction that sets up some success 
  messages using:
  messages.add(new ActionMessage("timesheetManage.save.success")); 

  saveMessages(Constants.MESSAGE_KEY, request, 
  messages);
  
  
  And upon this save, the findForward("success") 
  forwards to another action class with:
  
  forward 
  name="success" 
  path="/do/editTimesheet?action=Edit" redirect="true" /
  
  But on the JSP after, there are no messages 
  displayed. I know the answer why, and that is because 
  "redirect=true". However, this is the only way I can forward to another 
  action class in iPlanet.
  
  Anyone know of a workaround to carry these 
  messages into the next page? Can I check the request in "editTimesheet" 
  to see if messages exist, and if so - add them to the request 
  again?
  
  Thanks,
  
  Matt