You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Ke...@ttpartners.com on 2001/06/14 18:34:21 UTC
DTD Location
Currently, the XML indicates that the DTD is located over the web using a
public qualifier. Does it really check over the web for the DTD to
validate against? I would rather not do this for performance reasons. If
it does, can I change the reference to a SYSTEM ref instead. What is the
recommended approach for a production implementation?
Thanks in Advance,
Ken Hoying
Practice Partner
TITAN Technology Partners
Pager: 216-275-7284
Re: DTD Location
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Thu, 14 Jun 2001, William Shulman wrote:
>
>
> Another way is to implement your own EntityResolver to maintain a
> local cache. This is explained in the javadoc for the EntryResolver
> class (somewhere in javax.xml...)
>
It's already there, and already used! See the sources for ActionServlet,
in particular the calls to digester.register(). The code in the digester
then implements an appropriate EntityHandler.
Craig
> -will
>
> KenHoying@ttpartners.com writes:
> > Currently, the XML indicates that the DTD is located over the web using a
> > public qualifier. Does it really check over the web for the DTD to
> > validate against? I would rather not do this for performance reasons. If
> > it does, can I change the reference to a SYSTEM ref instead. What is the
> > recommended approach for a production implementation?
> >
> > Thanks in Advance,
> > Ken Hoying
> > Practice Partner
> > TITAN Technology Partners
> > Pager: 216-275-7284
> >
>
Re: DTD Location
Posted by William Shulman <wi...@metaconsortium.com>.
Another way is to implement your own EntityResolver to maintain a
local cache. This is explained in the javadoc for the EntryResolver
class (somewhere in javax.xml...)
-will
KenHoying@ttpartners.com writes:
> Currently, the XML indicates that the DTD is located over the web using a
> public qualifier. Does it really check over the web for the DTD to
> validate against? I would rather not do this for performance reasons. If
> it does, can I change the reference to a SYSTEM ref instead. What is the
> recommended approach for a production implementation?
>
> Thanks in Advance,
> Ken Hoying
> Practice Partner
> TITAN Technology Partners
> Pager: 216-275-7284
>
getServletInfo
Posted by Matt Raible <ma...@yahoo.com>.
I am trying to change background colors of table cells (and whether a link
exists or not) in my menu based on when the user is in a particular page.
Does anyone know how to do the following with logic:equals tags?
<%
if (getServletInfo().equals("myServletName")) {
%>
<td width="85%" class="secondaryNavigationSelected">Link to Page</td>
<td width="10%" class="secondaryNavigationSelected"
align="right"> </td>
<%
}
else
{
%>
<td width="85%">
<html:link forward="myNextPage" styleClass="secondaryNavigation">Link to
Page</html:link>
</td>
<td width="10%" align="right"> </td>
<%
}
%>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
RE: DTD Location
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Thu, 21 Jun 2001, Chad Johnston wrote:
> Craig,
>
> I took my project home to work on it last night. I have a small LAN at home
> that connects to the 'Net through a dialup on a file server. I was unable to
> get my Struts 1.0 application working without being dialed in to my ISP.
> Whenever I started up Tomcat without being connected to the 'Net, I would
> get the message that
> "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd" could not be
> located, and struts-config.xml would never be parsed. When I was connected,
> everything worked fine. The strange thing was, when I was connected to the
> 'Net, the messages would say that Struts was using the local copy of the
> DTD, but the check was still made.
>
Boy, that is strange. I was running Struts on my laptop (totally
disconnected from the net) during my JavaOne session that demo'd
Struts, and it worked fine.
> I don't know if I'm making much sense here. Basically, I had to be connected
> to the 'Net in order for Struts to start up properly. This seems to be at
> odds with what you said below. Am I missing a config parameter somewhere, or
> is there something else that I should check?
>
What does the top of your struts-config.xml file look like? In
particular, the <!DOCTYPE> declaration must exactly match the one that's
in all of the Struts examples:
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
In particular, it is the public identifier (the first string) that Struts
tries to match on.
A second question -- what XML parser and version are you using?
> Thanks,
> Chad Johnston
> Sunset Group Limited
> (719) 535-6284
> cjohnston@sunsetgroup.com
> c-Chad.Johnston@wcom.com
>
Craig McClanahan
RE: DTD Location
Posted by Chad Johnston <c-...@wcom.com>.
Craig,
I took my project home to work on it last night. I have a small LAN at home
that connects to the 'Net through a dialup on a file server. I was unable to
get my Struts 1.0 application working without being dialed in to my ISP.
Whenever I started up Tomcat without being connected to the 'Net, I would
get the message that
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd" could not be
located, and struts-config.xml would never be parsed. When I was connected,
everything worked fine. The strange thing was, when I was connected to the
'Net, the messages would say that Struts was using the local copy of the
DTD, but the check was still made.
I don't know if I'm making much sense here. Basically, I had to be connected
to the 'Net in order for Struts to start up properly. This seems to be at
odds with what you said below. Am I missing a config parameter somewhere, or
is there something else that I should check?
Thanks,
Chad Johnston
Sunset Group Limited
(719) 535-6284
cjohnston@sunsetgroup.com
c-Chad.Johnston@wcom.com
-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Thursday, June 14, 2001 10:48 AM
To: struts-dev@jakarta.apache.org
Subject: Re: DTD Location
On Thu, 14 Jun 2001 KenHoying@ttpartners.com wrote:
> Currently, the XML indicates that the DTD is located over the web using a
> public qualifier. Does it really check over the web for the DTD to
> validate against? I would rather not do this for performance reasons. If
> it does, can I change the reference to a SYSTEM ref instead. What is the
> recommended approach for a production implementation?
>
If you look inside the controller servlet, you'll see that it registers a
local copy of the struts-config DTD, as well as the web.xml DTDs, with the
XML parser (the digester.register() calls). This tells the parser to use
the local copy when a request for the specified public identifier is made.
Among other things, that means you can run Struts-based apps even when you
are not connected to the internet. As long as your struts-config.xml file
has the correct public identifier, Struts does *not* go across the net to
perform the validation.
> Thanks in Advance,
> Ken Hoying
> Practice Partner
> TITAN Technology Partners
> Pager: 216-275-7284
>
>
Craig McClanahan
Re: DTD Location
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Thu, 14 Jun 2001 KenHoying@ttpartners.com wrote:
> Currently, the XML indicates that the DTD is located over the web using a
> public qualifier. Does it really check over the web for the DTD to
> validate against? I would rather not do this for performance reasons. If
> it does, can I change the reference to a SYSTEM ref instead. What is the
> recommended approach for a production implementation?
>
If you look inside the controller servlet, you'll see that it registers a
local copy of the struts-config DTD, as well as the web.xml DTDs, with the
XML parser (the digester.register() calls). This tells the parser to use
the local copy when a request for the specified public identifier is made.
Among other things, that means you can run Struts-based apps even when you
are not connected to the internet. As long as your struts-config.xml file
has the correct public identifier, Struts does *not* go across the net to
perform the validation.
> Thanks in Advance,
> Ken Hoying
> Practice Partner
> TITAN Technology Partners
> Pager: 216-275-7284
>
>
Craig McClanahan