FW: Relative Link Question

2006-04-14 Thread Arshad Mahmood
Hi,

Hmm. What are you trying to do? Surely your images are not actually in a
directory called "/webapp/images/...". Your images are probably at the top
level of your docBase. The "webapp" is surely just a context that is being
mapping to a webapp under tomcat, and you probably want Apache to serve the
images anyway (since you're fronting it with Apache).

Are the images really not being displayed? What have you set the
DocumentRoot to in the apache httpd.conf.

Regards.

-Original Message-
From: Steven Huey [mailto:[EMAIL PROTECTED] 
Sent: 14 April 2006 23:49
To: users@tomcat.apache.org
Subject: Relative Link Question

Hello,

I've got a setup with Apache 2.2, Mod_Jk 1.2.15, and Tomcat 5.5.16  
and things are working pretty well except for relative links in my  
webapp.

When accessing my webapp at http://myserver.com/mywebapp/index.jsp  
any relative links within subdirectories of the mywebapp directory  
don't include /mywebapp/ in the URL. For example I have a mywebapp/ 
includes/ directory and some of the files use links such as:



Instead of linking to http://myserver.com/mywebapp/images/pic.jpg the  
link is http://myserver.com/images/pic.jpg.

I've read that if I remove the leading "/" from the links it will  
work, but I already have a lot of links in this format and am  
wondering if there is a configuration change or something else I can  
do to resolve this.

Thanks,
Steve Huey



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



FW: Tomcat 5.5.16 configuration problem--THIRD RESEND

2006-04-14 Thread Arshad Mahmood
Hi,

Do you really need that resource-ref in the web.xml. Your resource is
defined under Context so you shouldn't need one. Other than that
Your code looks fine and I can't see any problems with it.

Regards.

On 4/14/06, Filip Hanik - Dev Lists <[EMAIL PROTECTED]> wrote:
>
> check your log files upon startup, your myapp.xml doesn't have a docBase
> attribute to associate it with the app itself.
>  path="/myapp">.
>
> Scott Smith wrote:
> > Sorry, I sent this so many times.  Hopefully, I have all of the typos
> > out of it this time...
> >
> >
> >
> > I have specified the following as myapp.xml in the
> > conf\Catalina\locahost directory:
> >
> >
> >
> > 
> >
> >
> >
> >  >
> > type="javax.sql.DataSource"
> >
> > username="user" password="pswd"
> >
> >
> > driverClassName="net.sourceforge.jtds.jdbc.Driver"
> >
> >
> > url="jdbc:jtds:sqlserver://127.0.0.1:1433;DatabaseName=MyDB;SelectMethod
> > =cursor"
> >
> > maxActive="30" maxIdle="20" minIdle="10"
> > maxWait="2" />
> >
> >  > debug="99"
> >
> > dataSourceName="jdbc/MyDB"
> >
> > userTable="zUsers" userNameCol="zUserName"
> > userCredCol="zPassword"
> >
> > userRoleTable="wsViewRoles" roleNameCol="zRole"
> > />
> >
> > 
> >
> >
> >
> > In my web.xml file I have:
> >
> >
> >
> >   
> >
> > jdbc/MyDB
> >
> > javax.sql.DataSource
> >
> > Container
> >
> >   
> >
> >
> >
> > But, when I execute the code
> >
> >
> >
> > DataSource ds = null;
> >
> > try
> >
> > {
> >
> > Context initCtx = new InitialContext();
> >
> > Context envCtx = (Context)
> > initCtx.lookup("java:comp/env");
> >
> >ds = (DataSource) envCtx.lookup("jdbc/MyDB");
> >
> > }
> >
> > catch (NamingException e)
> >
> > {
> >
> > _log.error("Unable to retrieve MyDB DataSource",
> > e);
> >
> > ds = null;
> >
> > }
> >
> >
> >
> > The exception is caught and I get an error message which says
> > "javax.naming.NamingException: Name is not bound to a Context".  I
> > verified that the name in the ,   and the
> > context lookup are the same.
> >
> >
> >
> > I suspect I understand the message.  I just don't know what I've done
> > wrong.  Any suggestions?
> >
> >
> >
> > Scott
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
> -
> 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]



FW: Tomcat 5.5.16 configuration problem--THIRD RESEND

2006-04-15 Thread Arshad Mahmood

Hi,

Do you really need that resource-ref in the web.xml. Your resource is
defined under Context so you shouldn't need one. Other than that
Your code looks fine and I can't see any problems with it.

Regards.

Hi,

Why have you got servlet-api.jar under your WEB-INF/lib. You should
Be using the servlet implementation that comes with tomcat (under
common/lib).

I don't know enough about tomcat to know what it would mean if you have the
jar under WEB-INF/lib, but I am sure it won't be very happy with it.


Regards.

>OK, I removed the unnecessary Contexts (at least they are unnecessary
>for the time being) and did notice the following messages.
>
>WARNING: A docBase c:\webapps\myapp inside the host appBase has been
>specified, and will be ignored
>Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader
>validateJarFile
>INFO:
>validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv
>let-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
>Offending class: javax/servlet/Servlet.class
>Apr 15, 2006 2:09:41 AM org.apache.catalina.loader.WebappClassLoader
>validateJarFile
>INFO:
>validateJarFile(D:\MSD\Prog0\NewsBrowser\webapps\medias\WEB-INF\lib\serv
>let.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2.
>Offending class: javax/servlet/Servlet.class




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