You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ron McNulty <rm...@xtra.co.nz> on 2004/08/23 12:53:39 UTC

DTD not found

I have today migrated my JBoss 3.2.5/Struts 1.1 application to our QA server, which does not have Internet access.

I am getting an error from the Digester, when looking for tiles-config1_1.dtd. It seems it is trying to read it from http://..... Sure enough, turning off Internet access on my development box produces the same error. This DTD is in struts.jar, and I have tried dropping copies in all sorts of places to no avail.

Some digging about on Google confirmed this is a problem, but was fixed in a nightly build in July 2002!.

About the only slightl non-standard config of my app is to put all taglibs in WEBINF/taglib. web.xml has been updated to suit.

Can anyone throw some light o this?

Ron McNulty

RE: ActionForm.validate() Help

Posted by Matthias Wessendorf <ma...@matthias-wessendorf.de>.
hi, I use this in ActionForms:

<snip>
public ActionErrors validate(ActionMapping mapping, 
                         HttpServletRequest request) { 
		ActionErrors errors = new ActionErrors(); 
          
		if( (this.nachname==null) || (this.nachname.length()<1)
) 
		 errors.add( "nachname", new
ActionMessage("nachname.fehler")); 
          
		if( (this.vorname==null) || (this.vorname.length()<1) ) 
		 errors.add("vorname", new
ActionMessage("vorname.fehler")); 
          
		return errors; 
	} 
</snip>

and this in JSPs:

<snip>:
<html:form action="/ausfuehren"> 

    Vorname <html:text property="vorname"/> 
            <html:messages id="error" property="vorname"> 
      <bean:write name="error"/> 
    </html:messages> <br/> 


     Nachname <html:text property="nachname"/> 
    <html:messages id="error" property="nachname"> 
      <bean:write name="error"/> 
    </html:messages><br/>  



    <html:submit/>  
</html:form> 

</snip>

Hope it helps you!
Regards,
Matthias


> -----Original Message-----
> From: Matthew J. Vincent [mailto:vincent@cs.usm.maine.edu] 
> Sent: Wednesday, September 01, 2004 6:36 PM
> To: Struts Users Mailing List
> Subject: ActionForm.validate() Help
> 
> 
> Hello all,
> 
> I just downloaded the latest stable build of Struts 1.2.  What is a 
> "best practice" approach of handling validation in the ActionForm's 
> validate method since ActionError was deprecated? 
> Also, how should one display the messages in the JSP?  
> Currently I use:
> 
> <logic:messagesPresent message="true">
>     <html:messages id="message" message="true">
>         ${message}<br>
>     </html:messages>
> </logic:messagesPresent>
> 
> Howver this does not display anything when I use the 
> following code in 
> my ActionForm because errors is obviously not populated with any data:
> 
>     public ActionErrors validate(ActionMapping mapping,
>                                  HttpServletRequest request) {
> 
>         ActionErrors errors = new ActionErrors();
>        
>         if (/*some error occurs*/){
>             ActionMessages messages = new ActionMessages();
>             ActionMessage message = new 
> ActionMessage("errors.valueRequired");
>             messages.add(ActionMessages.GLOBAL_MESSAGE, message);
>             request.setAttribute("warnings", messages);
>         }
>         return errors;
>     }
> 
> 
> However in an Action the following code will work correctly 
> and display 
> in the HTML rendered by the JSP code from above:
> 
>             ActionMessages messages = new ActionMessages();
>             ActionMessage message = new 
> ActionMessage("errors.notfound");
>             messages.add(ActionMessages.GLOBAL_MESSAGE, message);
>             saveMessages(request, messages);
> 
> 
> Do I have to check for the existence of both messages and 
> errors in the JSP?
> 
> Thanks!
> 
> Matt
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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


ActionForm.validate() Help

Posted by "Matthew J. Vincent" <vi...@cs.usm.maine.edu>.
Hello all,

I just downloaded the latest stable build of Struts 1.2.  What is a 
"best practice" approach of handling validation in the ActionForm's 
validate method since ActionError was deprecated? 
Also, how should one display the messages in the JSP?  Currently I use:

<logic:messagesPresent message="true">
    <html:messages id="message" message="true">
        ${message}<br>
    </html:messages>
</logic:messagesPresent>

Howver this does not display anything when I use the following code in 
my ActionForm because errors is obviously not populated with any data:

    public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {

        ActionErrors errors = new ActionErrors();
       
        if (/*some error occurs*/){
            ActionMessages messages = new ActionMessages();
            ActionMessage message = new 
ActionMessage("errors.valueRequired");
            messages.add(ActionMessages.GLOBAL_MESSAGE, message);
            request.setAttribute("warnings", messages);
        }
        return errors;
    }


However in an Action the following code will work correctly and display 
in the HTML rendered by the JSP code from above:

            ActionMessages messages = new ActionMessages();
            ActionMessage message = new ActionMessage("errors.notfound");
            messages.add(ActionMessages.GLOBAL_MESSAGE, message);
            saveMessages(request, messages);


Do I have to check for the existence of both messages and errors in the JSP?

Thanks!

Matt

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


Re: DTD not found

Posted by Ron McNulty <rm...@xtra.co.nz>.
Thanks Erik

Not the best solution maybe, but it works a treat and gets our first build
up and running.

Thanks again

Ron
----- Original Message ----- 
From: "Erik Weber" <er...@mindspring.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, August 24, 2004 5:58 AM
Subject: Re: DTD not found


> I solved this problem once and for all in my web apps by including the
> DTDs directly in the XML files. Now, if it can't be found *there*, it
> just wasn't meant to be.
>
> :)
>
> Erik
>
> Ron McNulty wrote:
>
> >I have today migrated my JBoss 3.2.5/Struts 1.1 application to our QA
server, which does not have Internet access.
> >
> >I am getting an error from the Digester, when looking for
tiles-config1_1.dtd. It seems it is trying to read it from http://..... Sure
enough, turning off Internet access on my development box produces the same
error. This DTD is in struts.jar, and I have tried dropping copies in all
sorts of places to no avail.
> >
> >Some digging about on Google confirmed this is a problem, but was fixed
in a nightly build in July 2002!.
> >
> >About the only slightl non-standard config of my app is to put all
taglibs in WEBINF/taglib. web.xml has been updated to suit.
> >
> >Can anyone throw some light o this?
> >
> >Ron McNulty
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


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


Re: DTD not found

Posted by Erik Weber <er...@mindspring.com>.
I solved this problem once and for all in my web apps by including the 
DTDs directly in the XML files. Now, if it can't be found *there*, it 
just wasn't meant to be.

:)

Erik

Ron McNulty wrote:

>I have today migrated my JBoss 3.2.5/Struts 1.1 application to our QA server, which does not have Internet access.
>
>I am getting an error from the Digester, when looking for tiles-config1_1.dtd. It seems it is trying to read it from http://..... Sure enough, turning off Internet access on my development box produces the same error. This DTD is in struts.jar, and I have tried dropping copies in all sorts of places to no avail.
>
>Some digging about on Google confirmed this is a problem, but was fixed in a nightly build in July 2002!.
>
>About the only slightl non-standard config of my app is to put all taglibs in WEBINF/taglib. web.xml has been updated to suit.
>
>Can anyone throw some light o this?
>
>Ron McNulty
>  
>

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