You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Dmitry Beransky <db...@dembel.org> on 2001/11/16 20:54:58 UTC

namespaces and virtual contexts

Hi,

I'll try to rephrase me previous question.  (I'm working with the 
integrated Tomcat-Slide server from the binary dist)

The docs say that a separate context is created for every 
namespace.  'Slide' is a namespace configured in web.xml.  So,  a virtual 
context will be created for it, right?

My question is, how do I add libraries and taglib definitions to such a 
virtual context?

Thanks
Dmitry


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: namespaces and virtual contexts

Posted by Dmitry Beransky <db...@ucsd.edu>.
At 05:48 PM 11/16/2001, Remy Maucherat wrote:
>Similarly, you can upload a webapp deployment descriptor to
>'/files/WEB-INF/web.xml' (note that you'll have to create the 'WEB-INF'
>collection), and it will be read once you stop and start the context (either
>through the Tomcat manager webapp, or just by restarting the server).


Ingenious!  And worked like a charm.  Thanks, Remy.

Cheers
Dmitry

PS Another question's coming up


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


getting content's mime

Posted by Dmitry Beransky <db...@ucsd.edu>.
Hi,

Now that I got my index page to work, I've modified it to display 
thumbnails of jpegs that happen to reside in that directory.  Is this the 
correct way of getting to the mime info of a node:

                org.apache.slide.taglib.bean.NodeBean servletNodeBean = 
ns.getNode("/files"+request.getServletPath(),true);
                org.apache.slide.taglib.bean.NodeBean currentDir = 
servletNodeBean.getParent();
                java.util.Vector children = currentDir.getChildren();

                for( int i=0; i<children.size(); i++ )
                {
                   org.apache.slide.taglib.bean.NodeBean node = 
(org.apache.slide.taglib.bean.NodeBean)children.elementAt(i);
                   String uri = 
request.getContextPath()+node.getUri().substring(6);
                   String mime = 
node.getLatestRevision().getProperty("getcontenttype",null).getValue();

                   if( !mime.equals("image/jpeg") )
                      continue;
                %>
                   <a href="<%=uri%>"><img src="<%=uri%>" width="100"></a>
                <%
                }


Thanks
Dmitry


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: namespaces and virtual contexts

Posted by Remy Maucherat <re...@apache.org>.
> Hi,
>
> I'll try to rephrase me previous question.  (I'm working with the
> integrated Tomcat-Slide server from the binary dist)
>
> The docs say that a separate context is created for every
> namespace.  'Slide' is a namespace configured in web.xml.  So,  a virtual
> context will be created for it, right?

No, it's not done that way.

You can add contexts by editing the conf/slide.xml file, and a Slide
namespace will be associated to a webapp.

> My question is, how do I add libraries and taglib definitions to such a
> virtual context?

In the default configuration, the path '/files' in the Slide namespace
corresponds to the root of the Tomcat context.
So if you upload a simple jsp, like snoop.jsp to /files/snoop.jsp using the
WebDAV host on port 8080, you'll be able to run it normally by accessing
http://127.0.0.1:8080/slide/snoop.jsp
Similarly, you can upload a webapp deployment descriptor to
'/files/WEB-INF/web.xml' (note that you'll have to create the 'WEB-INF'
collection), and it will be read once you stop and start the context (either
through the Tomcat manager webapp, or just by restarting the server). Web
applications which do direct filesystem access to the webapp resources won't
work, but those written according to Sun's recommendations (using
ServletContext.getResource to access files, or only manipulating files
directly when they are inside the work directory) should.

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>