Standard Include symbolic links

2002-09-17 Thread Erick Todd

OK Now that I have resolved all of my jsp:include problems.  I would
like to use 4.1.10, however 4.1.10 will not let me include using a
symbolic link on my linux box.  4.0.4 will.  Anyone know of anything I
need to do??  I link a global inc folder across multiple sites to get
the consistent header and footer.  It will work if I copy the folder but
not if it is link symbolically.

Ideas??  Maybe this is just a bug in 4.1.10?

Erick

On Tue, 2002-09-17 at 11:40, Erick Todd wrote:
 Great!!  That was it.  There should probably be some documentation about
 that!?!?
 
 I could not thank you enough!!
 
 Erick
 
 On Tue, 2002-09-17 at 11:11, Tim Funk wrote:
  I'm not sure about the compile warning.
  
  I think it has to do with mime types needing to be decalred in web.xml.
  
  For example: I have the following pages:
  foo.jsp with the contents
  
  hello jsp:include flush='false'  page=foo1.timisastoopidhead/
  
  And the file foo1.timisastoopidhead exists. And voila - I get the wacky 
  exception.
  
  BUT if add the following to web.xml:
 mime-mapping
   extensiontimisastoopidhead/extension
   mime-typetext/plain/mime-type
 /mime-mapping
  
  And restart tomcat (not reload, restart) - all is ok.
  
  
  So the moral of the story seems - register you file extension/mime type 
  in web.xml if you want to include it as a file.
  
  
  
  
  Erick Todd wrote:
   The second one works, however it does write a warning to the logs that
   the JSPNote javac.main has been depracated.  Do you know why that is? 
   So I would say that something is wrong with jsp:include.  However I
   really don't want to rewrite every jsp:include across all of my jsp
   pages!!
   
   Any idea why the straight include won't work?  Hey I really appreciate
   all the help here!!
   
   Or should I consider getting the source, rewriting jsp:include and
   re-compile?!?
   
   Erick
   
   On Tue, 2002-09-17 at 10:51, Tim Funk wrote:
   
  I can reproduce this - strange. Can you try either of the following:
  
  
  %String  largeAd=/includes/468x60ad.txt;%
  jsp:include page=%=largeAd% flush=true/
  
  OR
  
   InputStream ps = 
  application.getResourceAsStream(/includes/468x60ad.inc);
   if (ps!=null) {
   byte[] buffer = new byte[1024];
   int read = ps.read(buffer);
   while (read0) {
   out.print(new String(buffer, 0, read));
   read = ps.read(buffer);
   }
   ps.close();
   }
  
  
  
  Erick Todd wrote:
  
  Ok here is more info.  These pages all work on tomcat 3 right now.  I
  have stripped down the page to the bare problem and still get the error.
  
  I downgraded to Tomcat 4.0.4 because 4.1.10 has a problem doing regular
  static include across a symbolic link.  But for this problem of dynamic
  including, I have to use jsp:include because the String largeAd actually
  comes from a parent page.  But even in this simple situation, nothing
  works.   What am I doing wrong, configuration, JVM??
  
  I use the jdk1.4.1.  If I change the jsp:include to a %@ include . ..
  Everything works fine, but I have to be able to pass the string into the
  include, so I have to use jsp:include.
  Again, this works in all the older tomcats.  I just now upgrade from 3.2
  to 4.0.4.
  
  Lastly, I am on redhat linux 7.0 and 7.3
  
  Here is the jsp page.  Down to only 2 lines.
  %String  largeAd=/includes/468x60ad.inc;%
  jsp:include page=%=largeAd% flush=true/
  
  The contents of /includes.468x60ad.inc are just 5 lines of
  html/javascript.
  
  That's it.  I use mod_jk, (jk1) do a JkMount for the virtual host for
  *.jsp.  The server xml for this domain is:
   Host name=cscom2.coloradosprings.com
  Context path= docBase=/www/sites/cscom/cscom debug=0
  reloadable=true 
  /Context
 /Host
  
  And finally the stack trace from the log is:
  
  2002-09-17 10:20:59 StandardWrapperValve[jsp]: Servlet.service() for
  servlet jsp threw exception
  java.lang.IllegalStateException
  at
  
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
  at
  
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1146)
  at
  org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
  
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
  at
  

Re: Standard Include symbolic links

2002-09-17 Thread Tim Funk

If you are not spanning filesystems - can you do a hard link?

Erick Todd wrote:
 OK Now that I have resolved all of my jsp:include problems.  I would
 like to use 4.1.10, however 4.1.10 will not let me include using a
 symbolic link on my linux box.  4.0.4 will.  Anyone know of anything I
 need to do??  I link a global inc folder across multiple sites to get
 the consistent header and footer.  It will work if I copy the folder but
 not if it is link symbolically.
 
 Ideas??  Maybe this is just a bug in 4.1.10?
 
 Erick
 
 On Tue, 2002-09-17 at 11:40, Erick Todd wrote:
 
Great!!  That was it.  There should probably be some documentation about
that!?!?

I could not thank you enough!!

Erick

On Tue, 2002-09-17 at 11:11, Tim Funk wrote:

I'm not sure about the compile warning.

I think it has to do with mime types needing to be decalred in web.xml.

For example: I have the following pages:
foo.jsp with the contents

hello jsp:include flush='false'  page=foo1.timisastoopidhead/

And the file foo1.timisastoopidhead exists. And voila - I get the wacky 
exception.

BUT if add the following to web.xml:
   mime-mapping
 extensiontimisastoopidhead/extension
 mime-typetext/plain/mime-type
   /mime-mapping

And restart tomcat (not reload, restart) - all is ok.


So the moral of the story seems - register you file extension/mime type 
in web.xml if you want to include it as a file.




Erick Todd wrote:

The second one works, however it does write a warning to the logs that
the JSPNote javac.main has been depracated.  Do you know why that is? 
So I would say that something is wrong with jsp:include.  However I
really don't want to rewrite every jsp:include across all of my jsp
pages!!

Any idea why the straight include won't work?  Hey I really appreciate
all the help here!!

Or should I consider getting the source, rewriting jsp:include and
re-compile?!?

Erick

On Tue, 2002-09-17 at 10:51, Tim Funk wrote:


I can reproduce this - strange. Can you try either of the following:


%String  largeAd=/includes/468x60ad.txt;%
jsp:include page=%=largeAd% flush=true/

OR

InputStream ps = 
application.getResourceAsStream(/includes/468x60ad.inc);
if (ps!=null) {
byte[] buffer = new byte[1024];
int read = ps.read(buffer);
while (read0) {
out.print(new String(buffer, 0, read));
read = ps.read(buffer);
}
ps.close();
}



Erick Todd wrote:


Ok here is more info.  These pages all work on tomcat 3 right now.  I
have stripped down the page to the bare problem and still get the error.

I downgraded to Tomcat 4.0.4 because 4.1.10 has a problem doing regular
static include across a symbolic link.  But for this problem of dynamic
including, I have to use jsp:include because the String largeAd actually
comes from a parent page.  But even in this simple situation, nothing
works.   What am I doing wrong, configuration, JVM??

I use the jdk1.4.1.  If I change the jsp:include to a %@ include . ..
Everything works fine, but I have to be able to pass the string into the
include, so I have to use jsp:include.
Again, this works in all the older tomcats.  I just now upgrade from 3.2
to 4.0.4.

Lastly, I am on redhat linux 7.0 and 7.3

Here is the jsp page.  Down to only 2 lines.
%String  largeAd=/includes/468x60ad.inc;%
jsp:include page=%=largeAd% flush=true/

The contents of /includes.468x60ad.inc are just 5 lines of
html/javascript.

That's it.  I use mod_jk, (jk1) do a JkMount for the virtual host for
*.jsp.  The server xml for this domain is:
  Host name=cscom2.coloradosprings.com
   Context path= docBase=/www/sites/cscom/cscom debug=0
reloadable=true 
   /Context
  /Host

And finally the stack trace from the log is:

2002-09-17 10:20:59 StandardWrapperValve[jsp]: Servlet.service() for
servlet jsp threw exception
java.lang.IllegalStateException
   at
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
   at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1146)
   at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:519)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:683)
   at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
   at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:497)
 

Re: Standard Include symbolic links

2002-09-17 Thread Erick Todd

How do I hard link a directory??  The contents of the directory can be
changed.

Currently I soft link the directory but the files are not linked.

Can I hard link a directory in linux??  If I can its news to me.  Seems
like it must be glitch.  Works in 4.04.  Or maybe there is some setting
I don't know about for 4.1.10.

Ideas??
-E

On Tue, 2002-09-17 at 12:00, Tim Funk wrote:
 If you are not spanning filesystems - can you do a hard link?
 
 Erick Todd wrote:
  OK Now that I have resolved all of my jsp:include problems.  I would
  like to use 4.1.10, however 4.1.10 will not let me include using a
  symbolic link on my linux box.  4.0.4 will.  Anyone know of anything I
  need to do??  I link a global inc folder across multiple sites to get
  the consistent header and footer.  It will work if I copy the folder but
  not if it is link symbolically.
  
  Ideas??  Maybe this is just a bug in 4.1.10?
  
  Erick
  
  On Tue, 2002-09-17 at 11:40, Erick Todd wrote:
  
 Great!!  That was it.  There should probably be some documentation about
 that!?!?
 
 I could not thank you enough!!
 
 Erick
 
 On Tue, 2002-09-17 at 11:11, Tim Funk wrote:
 
 I'm not sure about the compile warning.
 
 I think it has to do with mime types needing to be decalred in web.xml.
 
 For example: I have the following pages:
 foo.jsp with the contents
 
 hello jsp:include flush='false'  page=foo1.timisastoopidhead/
 
 And the file foo1.timisastoopidhead exists. And voila - I get the wacky 
 exception.
 
 BUT if add the following to web.xml:
mime-mapping
  extensiontimisastoopidhead/extension
  mime-typetext/plain/mime-type
/mime-mapping
 
 And restart tomcat (not reload, restart) - all is ok.
 
 
 So the moral of the story seems - register you file extension/mime type 
 in web.xml if you want to include it as a file.
 
 
 
 
 Erick Todd wrote:
 
 The second one works, however it does write a warning to the logs that
 the JSPNote javac.main has been depracated.  Do you know why that is? 
 So I would say that something is wrong with jsp:include.  However I
 really don't want to rewrite every jsp:include across all of my jsp
 pages!!
 
 Any idea why the straight include won't work?  Hey I really appreciate
 all the help here!!
 
 Or should I consider getting the source, rewriting jsp:include and
 re-compile?!?
 
 Erick
 
 On Tue, 2002-09-17 at 10:51, Tim Funk wrote:
 
 
 I can reproduce this - strange. Can you try either of the following:
 
 
 %String  largeAd=/includes/468x60ad.txt;%
 jsp:include page=%=largeAd% flush=true/
 
 OR
 
 InputStream ps = 
 application.getResourceAsStream(/includes/468x60ad.inc);
 if (ps!=null) {
 byte[] buffer = new byte[1024];
 int read = ps.read(buffer);
 while (read0) {
 out.print(new String(buffer, 0, read));
 read = ps.read(buffer);
 }
 ps.close();
 }
 
 
 
 Erick Todd wrote:
 
 
 Ok here is more info.  These pages all work on tomcat 3 right now.  I
 have stripped down the page to the bare problem and still get the error.
 
 I downgraded to Tomcat 4.0.4 because 4.1.10 has a problem doing regular
 static include across a symbolic link.  But for this problem of dynamic
 including, I have to use jsp:include because the String largeAd actually
 comes from a parent page.  But even in this simple situation, nothing
 works.   What am I doing wrong, configuration, JVM??
 
 I use the jdk1.4.1.  If I change the jsp:include to a %@ include . ..
 Everything works fine, but I have to be able to pass the string into the
 include, so I have to use jsp:include.
 Again, this works in all the older tomcats.  I just now upgrade from 3.2
 to 4.0.4.
 
 Lastly, I am on redhat linux 7.0 and 7.3
 
 Here is the jsp page.  Down to only 2 lines.
 %String  largeAd=/includes/468x60ad.inc;%
 jsp:include page=%=largeAd% flush=true/
 
 The contents of /includes.468x60ad.inc are just 5 lines of
 html/javascript.
 
 That's it.  I use mod_jk, (jk1) do a JkMount for the virtual host for
 *.jsp.  The server xml for this domain is:
 Host name=cscom2.coloradosprings.com
Context path= docBase=/www/sites/cscom/cscom debug=0
 reloadable=true 
/Context
   /Host
 
 And finally the stack trace from the log is:
 
 2002-09-17 10:20:59 StandardWrapperValve[jsp]: Servlet.service() for
 servlet jsp threw exception
 java.lang.IllegalStateException
at
 
org.apache.jasper.runtime.ServletResponseWrapperInclude.getOutputStream(ServletResponseWrapperInclude.java:109)
at