%@ include % files and Jasper/Ant

2004-07-08 Thread Robert Hunt
I'm trying to use Ant (in stand-alone fashion) to build a set of JSPs.  The
JSPs compile, execute and serve up HTML fine when compiled under Tomcat
5.0.25; only the root JSPs generate .java files.  Eg. FileA.jsp contains a
%@ include=FileB.jsp % directive.  When requested through the Tomcat web
server, only FileA_jsp.java and FileA_jsp.class are created.

However, when I run Ant (or JspC) from the command line (using the sample
from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web
Application Compilation for build.xml), it creates both FileA_jsp.java and
FileB_jsp.java. The build then fails because FileB_jsp.java's compilation,
by itself fails
without having the context of being code included in FileA.

How do Jasper/Ant running behind the scenes under the Tomcat webserver know
not to emit and compile the dependent files?  And why would Jasper/Ant
running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution)
NOT produce same output?


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



Re: %@ include % files and Jasper/Ant

2004-07-08 Thread Filip Hanik - Dev
This is an ant script I wrote to precompile JSPs for tomcat,
the benefit of this script, vs the regular precompile, is that is compiles files into 
the tomcat work folder, so there are no
additions needed in web.xml and you can reload JSP files, and at the same time have 
the benefit of precompiled performance.

http://cvs.apache.org/~fhanik/precompile.html
we have tons of include statements and they work fine. Not that this answers your 
question, but it may give you a better alternative

Filip

- Original Message -
From: Robert Hunt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 2:27 PM
Subject: %@ include % files and Jasper/Ant


 I'm trying to use Ant (in stand-alone fashion) to build a set of JSPs.  The
 JSPs compile, execute and serve up HTML fine when compiled under Tomcat
 5.0.25; only the root JSPs generate .java files.  Eg. FileA.jsp contains a
 %@ include=FileB.jsp % directive.  When requested through the Tomcat web
 server, only FileA_jsp.java and FileA_jsp.class are created.

 However, when I run Ant (or JspC) from the command line (using the sample
 from http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web
 Application Compilation for build.xml), it creates both FileA_jsp.java and
 FileB_jsp.java. The build then fails because FileB_jsp.java's compilation,
 by itself fails
 without having the context of being code included in FileA.

 How do Jasper/Ant running behind the scenes under the Tomcat webserver know
 not to emit and compile the dependent files?  And why would Jasper/Ant
 running standalone (I'm using Ant 1.6.1 as-is from the .ZIP distribution)
 NOT produce same output?


 -
 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]



Re: %@ include % files and Jasper/Ant

2004-07-08 Thread Robert Hunt
Thanks for the reply Filip, but no, that doesn't answer the question nor
does it solve the issue; the emitted dependent files still trigger
compilation problems.

However, I *do* like how your tomcat-precompile-jsp.xml handily precompiles
JSPs as Tomcat would.  Very nice.


So, the question remains:

How do Jasper/Ant running behind the scenes under the Tomcat webserver know
*NOT* to emit (and thus compile) the dependent files?  And why would
Jasper/Ant running standalone (I'm using Ant 1.6.1 as-is from the .ZIP
distribution) NOT produce same output?


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



RE: %@ include % files and Jasper/Ant

2004-07-08 Thread Berry, Layton
Tomcat compiles pages as needed.  So if someone hits
File.jsp, the FileA_jsp.java file is created and compiled.

If you were to hit FileB.jsp, Tomcat would try to compile
it and get the compile errors.

Your ant job is no doubt trying to compile all the .jsp files,
causing your compile errors.  Try giving FileB.jsp a different
extension.

Layton

-Original Message-
From: Robert Hunt [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 08, 2004 11:28 AM
To: [EMAIL PROTECTED]
Subject: %@ include % files and Jasper/Ant
Importance: High


I'm trying to use Ant (in stand-alone fashion) to build a set 
of JSPs.  The
JSPs compile, execute and serve up HTML fine when compiled under Tomcat
5.0.25; only the root JSPs generate .java files.  Eg. 
FileA.jsp contains a
%@ include=FileB.jsp % directive.  When requested through 
the Tomcat web
server, only FileA_jsp.java and FileA_jsp.class are created.

However, when I run Ant (or JspC) from the command line (using 
the sample
from 
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html#Web
Application Compilation for build.xml), it creates both 
FileA_jsp.java and
FileB_jsp.java. The build then fails because FileB_jsp.java's 
compilation,
by itself fails
without having the context of being code included in FileA.

How do Jasper/Ant running behind the scenes under the Tomcat 
webserver know
not to emit and compile the dependent files?  And why would Jasper/Ant
running standalone (I'm using Ant 1.6.1 as-is from the .ZIP 
distribution)
NOT produce same output?


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



Re: %@ include % files and Jasper/Ant

2004-07-08 Thread Robert Hunt
Thanks Layton.  Makes sense.

Looking back now, when I read the Jasper How-to page
(http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html) the
implication (at least, how I comprehended it) was that Jasper would produce
the same output including the seemingly prescient ability of compiling
only what's needed.

I'll change the extensions or place them in a subdir (adding the appropriate
exclusions to the build xml).



Now, if only someone would pay attention to Classloader behavior in 5.0.25
 5.0.16 (104699)

-- RH



From: Berry, Layton

Tomcat compiles pages as needed.  So if someone hits
File.jsp, the FileA_jsp.java file is created and compiled.

If you were to hit FileB.jsp, Tomcat would try to compile
it and get the compile errors.

Your ant job is no doubt trying to compile all the .jsp files,
causing your compile errors.  Try giving FileB.jsp a different
extension.

Layton


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



Re: %@ include % files and Jasper/Ant

2004-07-08 Thread simon colston

Filip Hanik - Dev wrote:
This is an ant script I wrote to precompile JSPs for tomcat,
http://cvs.apache.org/~fhanik/precompile.html
I have an ant script very similar to this but it does not report JSP 
errors in the same way as when compiled under tomcat.  Is there any way 
to get jasper to report errors when used in standalone mode?

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


can iframe include files in web-inf folder?

2004-04-09 Thread bjyang_dream
1.in my jsp page information.jsp I do this:
 iframe width=100% height=400 frameborder=1 scrolling=Auto 
src=/web-inf/test.jsp
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  c:import url=${HTMLUrl}/
  %jsp:include page=information.jsp % 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at the 
 same time.
   I use c:out value=${HTMLUrl}/,i can see this also changed.

  Hoping someone to help me,Thank you very much!


dream_and_yang
[EMAIL PROTECTED]
2004-04-09


bjyang_dream
[EMAIL PROTECTED]
2004-04-09


Re: can iframe include files in web-inf folder?

2004-04-09 Thread Matt Woodings
Do you run this through apache or other http server?

The reason that I ask is that the jsp file could have restricted access from
the outside world because it is in the WEB-INF folder.

As a pointer, I wouldn't put you want to be seen by the outside world under
the WEB-INF folder.  You need to keep this for config files, java files/jars
etc etc, because in the future you would want to block any http traffic from
seeing this.

Matt

- Original Message - 
From: bjyang_dream [EMAIL PROTECTED]
To: tomcat-user [EMAIL PROTECTED]
Sent: Friday, April 09, 2004 9:20 AM
Subject: can iframe include files in web-inf folder?


 1.in my jsp page information.jsp I do this:
  iframe width=100% height=400 frameborder=1 scrolling=Auto
src=/web-inf/test.jsp
   but when the Tomcat 5.0 just tell me that such page is not available.
 2.Then i try another way.
   i created another page called import page,in this page:
   c:import url=${HTMLUrl}/
   %jsp:include page=information.jsp %
   Here HTMLUrl comes from my Struts Action,and refer the URL in want to
import in
   the iframe.
   This time,I do get it worked and have HTMLUrl page in the iframe,The
problem
  is when the HTMLUrl has changed,The page in the iframe didn't changed at
the
  same time.
I use c:out value=${HTMLUrl}/,i can see this also changed.

   Hoping someone to help me,Thank you very much!


 dream_and_yang
 [EMAIL PROTECTED]
 2004-04-09


 bjyang_dream
 [EMAIL PROTECTED]
 2004-04-09




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



RE: can iframe include files in web-inf folder?

2004-04-09 Thread Shapira, Yoav

(BHi,
(BPer the servlet spec, a servlet container is not allowed to serve content under 
(B/WEB-INF to the browser.  That's why your normal HTML links and references like 
(Bsrc="/WEB-INF/xxx" fail.  You can get around this (but you shouldn't) by streaming the 
(Bcontent yourself using your own code, or in this case your Struts code.
(B
(BYoav Shapira
(BMillennium Research Informatics
(B
(B
(B-Original Message-
(BFrom: bjyang_dream [mailto:[EMAIL PROTECTED]
(BSent: Friday, April 09, 2004 10:21 AM
(BTo: tomcat-user
(BSubject: can iframe include files in web-inf folder?
(B
(B1.in my jsp page information.jsp I do this:
(B iframe width="100%" height="400" frameborder="1" scrolling="Auto"
(Bsrc="/web-inf/test.jsp"
(B  but when the Tomcat 5.0 just tell me that such page is not available.
(B2.Then i try another way.
(B  i created another page called import page,in this page:
(B  c:import url="${HTMLUrl}"/
(B  %jsp:include page="information.jsp" %
(B  Here HTMLUrl comes from my Struts Action,and refer the URL in want to
(Bimport in
(B  the iframe.
(B  This time,I do get it worked and have HTMLUrl page in the iframe,The
(Bproblem
(B is when the HTMLUrl has changed,The page in the iframe didn't changed at
(Bthe
(B same time.
(B   I use c:out value="${HTMLUrl}"/,i can see this also changed.
(B
(B  Hoping someone to help me,Thank you very much!
(B
(B
(B$B(Jdream_and_yang
(B$B([EMAIL PROTECTED]
(B$B(J2004-04-09
(B
(B
(B$B(Jbjyang_dream
(B$B([EMAIL PROTECTED]
(B$B(J2004-04-09
(B
(B
(B
(BThis e-mail, including any attachments, is a confidential business communication, and 
(Bmay contain information that is confidential, proprietary and/or privileged.  This 
(Be-mail is intended only for the individual(s) to whom it is addressed, and may not be 
(Bsaved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
(Bintended recipient, please immediately delete this e-mail from your computer system 
(Band notify the sender.  Thank you.
(B
(B
(B-
(BTo unsubscribe, e-mail: [EMAIL PROTECTED]
(BFor additional commands, e-mail: [EMAIL PROTECTED]

Re: RE: can iframe include files in web-inf folder?

2004-04-09 Thread bjyang
streaming the content yourself using your own code, or in this case your Struts code.
Couled more detials please?


  bjyang
  [EMAIL PROTECTED]
  2004-04-10





Hi,
Per the servlet spec, a servlet container is not allowed to serve content under 
/WEB-INF to the browser.  That's why your normal HTML links and references like 
src=/WEB-INF/xxx fail.  You can get around this (but you shouldn't) by streaming 
the content yourself using your own code, or in this case your Struts code.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: bjyang_dream [mailto:[EMAIL PROTECTED]
Sent: Friday, April 09, 2004 10:21 AM
To: tomcat-user
Subject: can iframe include files in web-inf folder?

1.in my jsp page information.jsp I do this:
 iframe width=100 height=400 frameborder=1 scrolling=Auto
src=/web-inf/test.jsp
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  c:import url=${HTMLUrl}/
  jsp:include page=information.jsp 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to
import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The
problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at
the
 same time.
   I use c:out value=${HTMLUrl}/,i can see this also changed.

  Hoping someone to help me,Thank you very much!


$B(Jdream_and_yang
$B([EMAIL PROTECTED]
$B(J2004-04-09


$B(Jbjyang_dream
$B([EMAIL PROTECTED]
$B(J2004-04-09



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
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]



Re: Re: can iframe include files in web-inf folder?

2004-04-09 Thread bjyang
Thanks,Matt!
I work with Tomcat 5.0 and I do need to access files in the Web-inf folder.
Would you tell me,how can i manage to do that?
Thank you again.





Do you run this through apache or other http server?

The reason that I ask is that the jsp file could have restricted access from
the outside world because it is in the WEB-INF folder.

As a pointer, I wouldn't put you want to be seen by the outside world under
the WEB-INF folder.  You need to keep this for config files, java files/jars
etc etc, because in the future you would want to block any http traffic from
seeing this.

Matt

- Original Message -
From: bjyang_dream [EMAIL PROTECTED]
To: tomcat-user [EMAIL PROTECTED]
Sent: Friday, April 09, 2004 9:20 AM
Subject: can iframe include files in web-inf folder?


 1.in my jsp page information.jsp I do this:
  iframe width=100 height=400 frameborder=1 scrolling=Auto
src=/web-inf/test.jsp
   but when the Tomcat 5.0 just tell me that such page is not available.
 2.Then i try another way.
   i created another page called import page,in this page:
   c:import url=${HTMLUrl}/
   jsp:include page=information.jsp 
   Here HTMLUrl comes from my Struts Action,and refer the URL in want to
import in
   the iframe.
   This time,I do get it worked and have HTMLUrl page in the iframe,The
problem
  is when the HTMLUrl has changed,The page in the iframe didn't changed at
the
  same time.
I use c:out value=${HTMLUrl}/,i can see this also changed.

   Hoping someone to help me,Thank you very much!


 dream_and_yang
 [EMAIL PROTECTED]
 2004-04-09


 bjyang_dream
 [EMAIL PROTECTED]
 2004-04-09




-
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]



Re: RE: can iframe include files in web-inf folder?

2004-04-09 Thread Parsons Technical Services
bjyang,

The jvm running under Tomcat can read any file with the standard file
read/write operations provided in the Java api as long as the user that the
jvm is running as has rights to that file. So write a servlet that receives
the request reads the file from the directory and the streams it back to the
client.

As for code I have none at this point, but a little googling should turn up
something.

Doug


- Original Message - 
From: bjyang [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, April 10, 2004 12:00 AM
Subject: Re: RE: can iframe include files in web-inf folder?


streaming the content yourself using your own code, or in this case your
Struts code.
Couled more detials please?


  bjyang
  [EMAIL PROTECTED]
  2004-04-10





Hi,
Per the servlet spec, a servlet container is not allowed to serve content
under /WEB-INF to the browser.  That's why your normal HTML links and
references like src=/WEB-INF/xxx fail.  You can get around this (but you
shouldn't) by streaming the content yourself using your own code, or in this
case your Struts code.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: bjyang_dream [mailto:[EMAIL PROTECTED]
Sent: Friday, April 09, 2004 10:21 AM
To: tomcat-user
Subject: can iframe include files in web-inf folder?

1.in my jsp page information.jsp I do this:
 iframe width=100 height=400 frameborder=1 scrolling=Auto
src=/web-inf/test.jsp
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  c:import url=${HTMLUrl}/
  jsp:include page=information.jsp 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to
import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The
problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at
the
 same time.
   I use c:out value=${HTMLUrl}/,i can see this also changed.

  Hoping someone to help me,Thank you very much!


$B(Jdream_and_yang
$B([EMAIL PROTECTED]
$B(J2004-04-09


$B(Jbjyang_dream
$B([EMAIL PROTECTED]
$B(J2004-04-09



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
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]




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



RE: RE: can iframe include files in web-inf folder?

2004-04-09 Thread Shapira, Yoav

Hi,

streaming the content yourself using your own code, or in this case
your
Struts code.
Couled more detials please?

a href=WEB-INF/someFile.txtClick Here!/a would lead to a 404 if
the user clicks on it as I previously explained.

Now imagine a servlet:

public class BadServlet extends HttpServlet {
  protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String requestedFile = req.getParameter(requestedFile);
InputStream is =
getServletContext().getResourceAsStream(requestedFile);
BufferedInputStream bis = new BufferedInputStream(is);
String line = null;

res.setContentType(text/html);
PrintWriter out = res.getWriter();

while((line = bis.readLine()) != null) {
  out.println(line);
}

bis.close();
  }
}

Map this servlet in web.xml to /BadServlet, and go to
http://localhost:8080/BadServlet?requestedFile=/WEB-INF/someFile.txt to
see how it's served.  I typed the above from memory without testing, but
it should be close enough to illustrate this point, which is: what
you're doing is bad design.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


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



Re: Re: RE: can iframe include files in web-inf folder?

2004-04-09 Thread bjyang
Thanks,Doug!
Let me try,since it looks a bit trouble to write a servlet to do that.
I do get the file in web-inf folder with jsp:include,but failed to
make it flush in the iframe.
Thans again.


bjyang,

The jvm running under Tomcat can read any file with the standard file
read/write operations provided in the Java api as long as the user that the
jvm is running as has rights to that file. So write a servlet that receives
the request reads the file from the directory and the streams it back to the
client.

As for code I have none at this point, but a little googling should turn up
something.

Doug


- Original Message -
From: bjyang [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Sent: Saturday, April 10, 2004 12:00 AM
Subject: Re: RE: can iframe include files in web-inf folder?


streaming the content yourself using your own code, or in this case your
Struts code.
Couled more detials please?


  bjyang
  [EMAIL PROTECTED]
  2004-04-10





Hi,
Per the servlet spec, a servlet container is not allowed to serve content
under /WEB-INF to the browser.  That's why your normal HTML links and
references like src=/WEB-INF/xxx fail.  You can get around this (but you
shouldn't) by streaming the content yourself using your own code, or in this
case your Struts code.

Yoav Shapira
Millennium Research Informatics


-Original Message-
From: bjyang_dream [mailto:[EMAIL PROTECTED]
Sent: Friday, April 09, 2004 10:21 AM
To: tomcat-user
Subject: can iframe include files in web-inf folder?

1.in my jsp page information.jsp I do this:
 iframe width=100 height=400 frameborder=1 scrolling=Auto
src=/web-inf/test.jsp
  but when the Tomcat 5.0 just tell me that such page is not available.
2.Then i try another way.
  i created another page called import page,in this page:
  c:import url=${HTMLUrl}/
  jsp:include page=information.jsp 
  Here HTMLUrl comes from my Struts Action,and refer the URL in want to
import in
  the iframe.
  This time,I do get it worked and have HTMLUrl page in the iframe,The
problem
 is when the HTMLUrl has changed,The page in the iframe didn't changed at
the
 same time.
   I use c:out value=${HTMLUrl}/,i can see this also changed.

  Hoping someone to help me,Thank you very much!


$B(Jdream_and_yang
$B([EMAIL PROTECTED]
$B(J2004-04-09


$B(Jbjyang_dream
$B([EMAIL PROTECTED]
$B(J2004-04-09



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


-
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]




-
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]



Re: RE: RE: can iframe include files in web-inf folder?

2004-04-09 Thread bjyang
haha,May be i have to persuade my boss the point you've illustrated
enoughly



Hi,

streaming the content yourself using your own code, or in this case
your
Struts code.
Couled more detials please?

a href=WEB-INF/someFile.txtClick Here!/a would lead to a 404 if
the user clicks on it as I previously explained.

Now imagine a servlet:

public class BadServlet extends HttpServlet {
  protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws IOException, ServletException {
String requestedFile = req.getParameter(requestedFile);
InputStream is =
getServletContext().getResourceAsStream(requestedFile);
BufferedInputStream bis = new BufferedInputStream(is);
String line = null;

res.setContentType(text/html);
PrintWriter out = res.getWriter();

while((line = bis.readLine()) != null) {
  out.println(line);
}
 
bis.close();
  }
}

Map this servlet in web.xml to /BadServlet, and go to
http://localhost:8080/BadServlet?requestedFile=/WEB-INF/someFile.txt to
see how it's served.  I typed the above from memory without testing, but
it should be close enough to illustrate this point, which is: what
you're doing is bad design.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


-
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]



Re: include files

2004-02-12 Thread Ankur Shah
...and if you're a windowz fanatic, you still have hope. You can 
download a copy of touch from:

ftp://ftp.microsoft.com/Services/TechNet/samples/ps/win98/Reskit/FILE/

(TOUCH.EXE, is what you're looking for)

or you could simply install Cygwin, the greatest unix emulator on the 
face of this planet! (Sorry, couldn't resist)

Yiannis Mavroukakis wrote:

The touch command is on Unix OS'es. It hasn't got anything to do with
tomcat. What it does is it updates (among other things) the last modified
attribute
of a file, but in your case the purpose is (at least if my head is screwed
on right)
to trigger Tomcat into detecting a file change in the work directory, hence
doing a reload.
If I got the Tomcat bit wrong, shoot at the bright red target on my
forehead :)
Yiannis.

-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 14:50
To: Tomcat Users List
Subject: Re: include files
thanks.

do i delete the name of the app under tomcat, for example 
work/Standalone/localhost/Website ?  and all the $... files and the two 
directories -  Help and WEB-INF under this directory ?

what is the touch cmd ?  i cant find it in my wrox tomcat book ?

cheers

chris
 

snip

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


include files

2004-02-10 Thread Chris Daly
hi

i've tested a new version of my jsp include file (a header which is 
referenced by about 40 pages) on one jsp page, and its wokred ok.  i've 
changed the coding of the include page though none of the other jsp pages 
have picked up the new include and are still looking to teh old one ?  i've 
stopped and started tomcat but its till not changed.

does anyone have any ideas ?  i've included a couple of new tag libraries 
but they are working ok and i cant see why it would be anything other than 
tomcat ?

cheers

chris

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


Re: include files

2004-02-10 Thread De Toffoli Garry
Chris Daly ha scritto:

hi

i've tested a new version of my jsp include file (a header which is 
referenced by about 40 pages) on one jsp page, and its wokred ok.  
i've changed the coding of the include page though none of the other 
jsp pages have picked up the new include and are still looking to teh 
old one ?  i've stopped and started tomcat but its till not changed.

does anyone have any ideas ?  i've included a couple of new tag 
libraries but they are working ok and i cant see why it would be 
anything other than tomcat ?

cheers

chris

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

Have you tried to use the touch cmd on all the file that include you .jsp?



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


RE: include files

2004-02-10 Thread Yiannis Mavroukakis
If you think everything else is working ok, stop tomcat delete everything
under the work directory and start again.

-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 09:19
To: [EMAIL PROTECTED]
Subject: include files


hi

i've tested a new version of my jsp include file (a header which is 
referenced by about 40 pages) on one jsp page, and its wokred ok.  i've 
changed the coding of the include page though none of the other jsp pages 
have picked up the new include and are still looking to teh old one ?  i've 
stopped and started tomcat but its till not changed.

does anyone have any ideas ?  i've included a couple of new tag libraries 
but they are working ok and i cant see why it would be anything other than 
tomcat ?

cheers

chris


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



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.


Note:__
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.

RE: include files

2004-02-10 Thread Chris Daly
everyhting under the work directory, all the directories

work/Standalone/localhost  etc etc ?  wont this delete the standlone server ?



At 10:09 10.02.2004 +, you wrote:
If you think everything else is working ok, stop tomcat delete everything
under the work directory and start again.
-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 09:19
To: [EMAIL PROTECTED]
Subject: include files
hi

i've tested a new version of my jsp include file (a header which is
referenced by about 40 pages) on one jsp page, and its wokred ok.  i've
changed the coding of the include page though none of the other jsp pages
have picked up the new include and are still looking to teh old one ?  i've
stopped and started tomcat but its till not changed.
does anyone have any ideas ?  i've included a couple of new tag libraries
but they are working ok and i cant see why it would be anything other than
tomcat ?
cheers

chris

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

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.
Note:__
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.


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


Re: include files

2004-02-10 Thread De Toffoli Garry
Chris Daly ha scritto:

everyhting under the work directory, all the directories

work/Standalone/localhost  etc etc ?  wont this delete the standlone 
server ?



At 10:09 10.02.2004 +, you wrote:

If you think everything else is working ok, stop tomcat delete 
everything
under the work directory and start again.

-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 09:19
To: [EMAIL PROTECTED]
Subject: include files
hi

i've tested a new version of my jsp include file (a header which is
referenced by about 40 pages) on one jsp page, and its wokred ok.  i've
changed the coding of the include page though none of the other jsp 
pages
have picked up the new include and are still looking to teh old one 
?  i've
stopped and started tomcat but its till not changed.

does anyone have any ideas ?  i've included a couple of new tag 
libraries
but they are working ok and i cant see why it would be anything other 
than
tomcat ?

cheers

chris

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

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.
Note:__
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.


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

You would delete only the directory relative of your site, under the 
work directory of tomcat;

for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;

probably the name may be different from release;

after delete it, you must restart tomcat;

But have you tried to use the touch cmd on all .jsp file that include 
your include.jsp? I use this mode, and all is OK, and I doesn't delete 
the work directory;

Best regards.



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


Re: include files

2004-02-10 Thread Chris Daly
thanks.

do i delete the name of the app under tomcat, for example 
work/Standalone/localhost/Website ?  and all the $... files and the two 
directories -  Help and WEB-INF under this directory ?

what is the touch cmd ?  i cant find it in my wrox tomcat book ?

cheers

chris

You would delete only the directory relative of your site, under the work 
directory of tomcat;
for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;
probably the name may be different from release;
after delete it, you must restart tomcat;
But have you tried to use the touch cmd on all .jsp file that include your 
include.jsp? I use this mode, and all is OK, and I doesn't delete the work 
directory;

At 11:25 10.02.2004 +0100, you wrote:
You would delete only the directory relative of your site, under the work 
directory of tomcat;

for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;

probably the name may be different from release;

after delete it, you must restart tomcat;

But have you tried to use the touch cmd on all .jsp file that include your 
include.jsp? I use this mode, and all is OK, and I doesn't delete the work 
directory;


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


Re: include files

2004-02-10 Thread Milt Epstein
On Tue, 10 Feb 2004, Chris Daly wrote:

 hi

 i've tested a new version of my jsp include file (a header which is
 referenced by about 40 pages) on one jsp page, and its wokred ok.
 i've changed the coding of the include page though none of the other
 jsp pages have picked up the new include and are still looking to
 teh old one ?  i've stopped and started tomcat but its till not
 changed.

 does anyone have any ideas ?  i've included a couple of new tag
 libraries but they are working ok and i cant see why it would be
 anything other than tomcat ?

The problem is that the timestamps on the jsps in question have not
changed, so Tomcat has no reason to recompile them (which is what is
necessary for it to find the new included file).  People have come up
with two suggestions to help:

1. touch the jsps -- touch is a Unix command which updates the
   timestamp on a file.  If you're not using Unix, perhaps your system
   has a similar command.

2. delete everything under Tomcat's work subdirectory -- that's where
   jsps are compiled (first into java source files and then into class
   files).  These files are used as the baseline for the timestamp
   comparison, so if they don't exist, any jsp will be deemed new.

Either of these should do the trick.  The latter one may be the better
way to go though.  Many people routinely delete everything under the
work directory as part of the Tomcat restart process.  I believe these
files are all automatically generated so it shouldn't hurt to delete
them.

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

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



Re: include files

2004-02-10 Thread De Toffoli Garry
You would delete only the  file under the work directory; WEB-INF exist 
on the directory of your web site, and not under work;
if you have installed tomcat in /usr/tomcat, the work directory is: 
/usr/tomcat/work;
with your example: /usr/tomcat/Standalone/localhost/Website

the touch cmd is a unix cmd;
example: touch mytest.jsp;
touch change the date/time of the file mytest.jsp to the current date/time;
under Windows, you can open and save the file, without modify;
so, touching you jsp file where you include, tomcat can detect that 
the page mytest.jsp is changed, so recompile it;

Best regards.



Chris Daly ha scritto:

thanks.

do i delete the name of the app under tomcat, for example 
work/Standalone/localhost/Website ?  and all the $... files and the 
two directories -  Help and WEB-INF under this directory ?

what is the touch cmd ?  i cant find it in my wrox tomcat book ?

cheers

chris

You would delete only the directory relative of your site, under the 
work directory of tomcat;
for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;
probably the name may be different from release;
after delete it, you must restart tomcat;
But have you tried to use the touch cmd on all .jsp file that include 
your include.jsp? I use this mode, and all is OK, and I doesn't delete 
the work directory;

At 11:25 10.02.2004 +0100, you wrote:

You would delete only the directory relative of your site, under the 
work directory of tomcat;

for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;

probably the name may be different from release;

after delete it, you must restart tomcat;

But have you tried to use the touch cmd on all .jsp file that include 
your include.jsp? I use this mode, and all is OK, and I doesn't 
delete the work directory;


-
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]


RE: include files

2004-02-10 Thread Yiannis Mavroukakis
The touch command is on Unix OS'es. It hasn't got anything to do with
tomcat. What it does is it updates (among other things) the last modified
attribute
of a file, but in your case the purpose is (at least if my head is screwed
on right)
to trigger Tomcat into detecting a file change in the work directory, hence
doing a reload.
If I got the Tomcat bit wrong, shoot at the bright red target on my
forehead :)

Yiannis.

-Original Message-
From: Chris Daly [mailto:[EMAIL PROTECTED]
Sent: 10 February 2004 14:50
To: Tomcat Users List
Subject: Re: include files


thanks.

do i delete the name of the app under tomcat, for example 
work/Standalone/localhost/Website ?  and all the $... files and the two 
directories -  Help and WEB-INF under this directory ?

what is the touch cmd ?  i cant find it in my wrox tomcat book ?

cheers

chris

You would delete only the directory relative of your site, under the work 
directory of tomcat;
for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;
probably the name may be different from release;
after delete it, you must restart tomcat;
But have you tried to use the touch cmd on all .jsp file that include your 
include.jsp? I use this mode, and all is OK, and I doesn't delete the work 
directory;


At 11:25 10.02.2004 +0100, you wrote:
You would delete only the directory relative of your site, under the work 
directory of tomcat;

for example, if you site is called www.test.org, you must delete the 
directory under tomcat work/www.test.org_8080;

probably the name may be different from release;

after delete it, you must restart tomcat;

But have you tried to use the touch cmd on all .jsp file that include your 
include.jsp? I use this mode, and all is OK, and I doesn't delete the work 
directory;


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



This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.


Note:__
This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender. You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. Jaguar Freight Services and any of its subsidiaries
each reserve the right to monitor all e-mail communications through its
networks.
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity.

This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs.

Re: include files

2004-02-10 Thread Milt Epstein
On Tue, 10 Feb 2004, Chris Daly wrote:

 thanks.

 do i delete the name of the app under tomcat, for example
 work/Standalone/localhost/Website ?  and all the $... files and the two
 directories -  Help and WEB-INF under this directory ?

I don't think there should be a WEB-INF under there.  Are you sure
you're looking in the right place?


 what is the touch cmd ?  i cant find it in my wrox tomcat book ?

touch is a Unix command.  What OS are you using?  If Windows, I don't
know whether it has a similar command.  (Basically touch file
updates the timestamp on file -- it will also create it, as an empty
file, if it doesn't exist.)


 You would delete only the directory relative of your site, under the work
 directory of tomcat;
 for example, if you site is called www.test.org, you must delete the
 directory under tomcat work/www.test.org_8080;
 probably the name may be different from release;
 after delete it, you must restart tomcat;
 But have you tried to use the touch cmd on all .jsp file that include your
 include.jsp? I use this mode, and all is OK, and I doesn't delete the work
 directory;


 At 11:25 10.02.2004 +0100, you wrote:
 You would delete only the directory relative of your site, under the work
 directory of tomcat;
 
 for example, if you site is called www.test.org, you must delete the
 directory under tomcat work/www.test.org_8080;
 
 probably the name may be different from release;
 
 after delete it, you must restart tomcat;
 
 But have you tried to use the touch cmd on all .jsp file that include your
 include.jsp? I use this mode, and all is OK, and I doesn't delete the work
 directory;


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


Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

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



Re: include files

2004-02-10 Thread Chris Daly
thanks to all.

At 09:06 10.02.2004 -0600, you wrote:
On Tue, 10 Feb 2004, Chris Daly wrote:

 thanks.

 do i delete the name of the app under tomcat, for example
 work/Standalone/localhost/Website ?  and all the $... files and the two
 directories -  Help and WEB-INF under this directory ?
I don't think there should be a WEB-INF under there.  Are you sure
you're looking in the right place?
 what is the touch cmd ?  i cant find it in my wrox tomcat book ?

touch is a Unix command.  What OS are you using?  If Windows, I don't
know whether it has a similar command.  (Basically touch file
updates the timestamp on file -- it will also create it, as an empty
file, if it doesn't exist.)
 You would delete only the directory relative of your site, under the work
 directory of tomcat;
 for example, if you site is called www.test.org, you must delete the
 directory under tomcat work/www.test.org_8080;
 probably the name may be different from release;
 after delete it, you must restart tomcat;
 But have you tried to use the touch cmd on all .jsp file that include your
 include.jsp? I use this mode, and all is OK, and I doesn't delete the work
 directory;


 At 11:25 10.02.2004 +0100, you wrote:
 You would delete only the directory relative of your site, under the work
 directory of tomcat;
 
 for example, if you site is called www.test.org, you must delete the
 directory under tomcat work/www.test.org_8080;
 
 probably the name may be different from release;
 
 after delete it, you must restart tomcat;
 
 But have you tried to use the touch cmd on all .jsp file that include your
 include.jsp? I use this mode, and all is OK, and I doesn't delete the work
 directory;


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

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
-
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]


Include Files

2003-12-03 Thread Duncan
When using Tomcat 4.0, I was able to include files in a directory above
my public web directory, but with tomcat 4.1, when I try to run the same
jsp, I get the error:

org.apache.jasper.JasperException: /main.jsp(3,0) File
../Private/NormalTemplate.inc not found

All casing etc is correct.

Is this a security fix, or should this still be possible?

Many thanks
Duncan Smith
Decker Telecom Ltd




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



Re: Include Files

2003-12-03 Thread Tim Funk
I would think this is a security fix. (Or a bug fix) I am surprised this was 
allowed in 4.0.

-Tim

Duncan wrote:

When using Tomcat 4.0, I was able to include files in a directory above
my public web directory, but with tomcat 4.1, when I try to run the same
jsp, I get the error:
org.apache.jasper.JasperException: /main.jsp(3,0) File
../Private/NormalTemplate.inc not found
All casing etc is correct.

Is this a security fix, or should this still be possible?
 


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


Re: Include Files

2003-12-03 Thread Duncan
So how does one get around this issue

ie, how do you have an include file that is not accessable by a user, do people
set up a secure folder for these?

Any suggestions?
- Duncan

Tim Funk wrote:

 I would think this is a security fix. (Or a bug fix) I am surprised this was
 allowed in 4.0.

 -Tim

 Duncan wrote:

  When using Tomcat 4.0, I was able to include files in a directory above
  my public web directory, but with tomcat 4.1, when I try to run the same
  jsp, I get the error:
 
  org.apache.jasper.JasperException: /main.jsp(3,0) File
  ../Private/NormalTemplate.inc not found
 
  All casing etc is correct.
 
  Is this a security fix, or should this still be possible?
 

 -
 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]



Re: Include Files

2003-12-03 Thread Tim Funk
Place it in WEB-INF (or a subdirectory in WEB-INF)

-Tim

Duncan wrote:

So how does one get around this issue

ie, how do you have an include file that is not accessable by a user, do people
set up a secure folder for these?
Any suggestions?
- Duncan
Tim Funk wrote:


I would think this is a security fix. (Or a bug fix) I am surprised this was
allowed in 4.0.
-Tim

Duncan wrote:


When using Tomcat 4.0, I was able to include files in a directory above
my public web directory, but with tomcat 4.1, when I try to run the same
jsp, I get the error:
org.apache.jasper.JasperException: /main.jsp(3,0) File
../Private/NormalTemplate.inc not found
All casing etc is correct.

Is this a security fix, or should this still be possible?

-
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]



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


Re: Include Files

2003-12-03 Thread Duncan
Good plan.

Thanks Tim, didn't think of that one.

Tim Funk wrote:

 Place it in WEB-INF (or a subdirectory in WEB-INF)

 -Tim

 Duncan wrote:

  So how does one get around this issue
 
  ie, how do you have an include file that is not accessable by a user, do people
  set up a secure folder for these?
 
  Any suggestions?
  - Duncan
 
  Tim Funk wrote:
 
 
 I would think this is a security fix. (Or a bug fix) I am surprised this was
 allowed in 4.0.
 
 -Tim
 
 Duncan wrote:
 
 
 When using Tomcat 4.0, I was able to include files in a directory above
 my public web directory, but with tomcat 4.1, when I try to run the same
 jsp, I get the error:
 
 org.apache.jasper.JasperException: /main.jsp(3,0) File
 ../Private/NormalTemplate.inc not found
 
 All casing etc is correct.
 
 Is this a security fix, or should this still be possible?
 
 
 -
 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]
 
 

 -
 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]



Re: include files in server.xml?

2003-01-08 Thread paul miller
Can some one post an example on how to do this.
I would love it if my app's web.xml could include another xml file

This is what I have tried with no luck

  !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
  http://java.sun.com/dtd/web-app_2_3.dtd;
  [
   !ENTITY section1 SYSTEM /WEB-INF/section1.xml
  ]

  section1;

various paths to section1.xml did not change the error message:

2003-01-08 12:24:39 ContextConfig[] Parse error in application web.xml
java.io.FileNotFoundException
at org.apache.naming.resources.DirContextURLConnection.getInputStream(Unknown
Source)


thanks

--- Bill Barker [EMAIL PROTECTED] wrote:
 You can use XML Entities to do it.  There isn't a specific tag to include a
 file.
 
 Matthew Boeckman [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm wondering if tomcat-4.1.12 supports include files, similair to
  apache in the server.xml file?
 
  I have to support dozens of virtual hosts, and wanted to break each's
  config out into their own include.
  --
  Matthew Boeckman (816) 777-2160
  Manager - Systems Integration Saepio Technologies
 
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: include files in server.xml?

2003-01-08 Thread Turner, John

Not sure about web.xml, but check today's thread server.xml DTD? for a
discussion and working example of how to do this in server.xml.

John


 -Original Message-
 From: paul miller [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 08, 2003 12:27 PM
 To: Tomcat Users List
 Subject: Re: include files in server.xml?
 
 
 Can some one post an example on how to do this.
 I would love it if my app's web.xml could include another xml file
 
 This is what I have tried with no luck
 
   !DOCTYPE web-app
   PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
   http://java.sun.com/dtd/web-app_2_3.dtd;
   [
!ENTITY section1 SYSTEM /WEB-INF/section1.xml
   ]
 
   section1;
 
 various paths to section1.xml did not change the error message:
 
 2003-01-08 12:24:39 ContextConfig[] Parse error in application web.xml
 java.io.FileNotFoundException
   at 
 org.apache.naming.resources.DirContextURLConnection.getInputSt
 ream(Unknown
 Source)
 
 
 thanks
 
 --- Bill Barker [EMAIL PROTECTED] wrote:
  You can use XML Entities to do it.  There isn't a specific 
 tag to include a
  file.
  
  Matthew Boeckman [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I'm wondering if tomcat-4.1.12 supports include files, similair to
   apache in the server.xml file?
  
   I have to support dozens of virtual hosts, and wanted to 
 break each's
   config out into their own include.
   --
   Matthew Boeckman (816) 777-2160
   Manager - Systems Integration Saepio Technologies
  
  
  
  
  --
  To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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

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




RE: include files in server.xml?

2003-01-08 Thread Turner, John

That thread should be DTD for server.xml??

John

 -Original Message-
 From: Turner, John [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 08, 2003 12:29 PM
 To: 'Tomcat Users List'
 Subject: RE: include files in server.xml?
 
 
 
 Not sure about web.xml, but check today's thread server.xml 
 DTD? for a
 discussion and working example of how to do this in server.xml.
 
 John
 
 
  -Original Message-
  From: paul miller [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 08, 2003 12:27 PM
  To: Tomcat Users List
  Subject: Re: include files in server.xml?
  
  
  Can some one post an example on how to do this.
  I would love it if my app's web.xml could include another xml file
  
  This is what I have tried with no luck
  
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web 
 Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
[
 !ENTITY section1 SYSTEM /WEB-INF/section1.xml
]
  
section1;
  
  various paths to section1.xml did not change the error message:
  
  2003-01-08 12:24:39 ContextConfig[] Parse error in 
 application web.xml
  java.io.FileNotFoundException
  at 
  org.apache.naming.resources.DirContextURLConnection.getInputSt
  ream(Unknown
  Source)
  
  
  thanks
  
  --- Bill Barker [EMAIL PROTECTED] wrote:
   You can use XML Entities to do it.  There isn't a specific 
  tag to include a
   file.
   
   Matthew Boeckman [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'm wondering if tomcat-4.1.12 supports include files, 
 similair to
apache in the server.xml file?
   
I have to support dozens of virtual hosts, and wanted to 
  break each's
config out into their own include.
--
Matthew Boeckman (816) 777-2160
Manager - Systems Integration Saepio Technologies
   
   
   
   
   --
   To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
  
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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




include files in server.xml?

2003-01-07 Thread Matthew Boeckman
I'm wondering if tomcat-4.1.12 supports include files, similair to 
apache in the server.xml file?

I have to support dozens of virtual hosts, and wanted to break each's 
config out into their own include.
--
Matthew Boeckman			(816) 777-2160
Manager - Systems Integration		Saepio Technologies


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



Re: include files in server.xml?

2003-01-07 Thread Bill Barker
You can use XML Entities to do it.  There isn't a specific tag to include a
file.

Matthew Boeckman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm wondering if tomcat-4.1.12 supports include files, similair to
 apache in the server.xml file?

 I have to support dozens of virtual hosts, and wanted to break each's
 config out into their own include.
 --
 Matthew Boeckman (816) 777-2160
 Manager - Systems Integration Saepio Technologies




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




JspC/Jasper won't ignore include files?

2002-10-08 Thread Simpson, Mike W



I'm having problems with my pre-compilation script.  Basically, we have lots
of jsp files that are only used as included files inside others jsps.  I
have them all named .jspi instead of .jsp.  Jasper wants to compile them
when they're found, but they can't be compiled alone because they don't have
imports defined (and variables in some cases).  Maybe I'm missing something,
but is there any way to force some files to not be compiled?  Creating a
script to individually compile each of my 1000+ files isn't an attractive
option.

My script:
c:\catalina\bin\jspc.bat -uriroot c:\project\code\web -d c:\tmp\catalina_out
-l -s --compile -webapp c:\project\code\web


thanks!
Mike


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




Include files in Tomcat

2001-07-12 Thread Gadde, Padma

Hi 
i am working with XML and I have my JSPs in the tomcat (version 3.2.2) . I
am trying to import org.apache.xpath and import javax.sql and i get the
following errors. 
Can any one help me?


Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0
002ejspssMenu_jsp_0.java:16: Package javax.sql not found in import.
import javax.sql.*;
   ^
C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0002
ejspssMenu_jsp_0.java:20: Package org.apache.xalan.serialize not found in
import.
import org.apache.xalan.serialize.*;
   ^
C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0002
ejspssMenu_jsp_0.java:21: Package org.apache.xpath not found in import.
import org.apache.xpath.*;
   ^
3 errors

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:258)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:268)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:484)

Thanks in advance
Padma



Re: Include files in Tomcat

2001-07-12 Thread Dmitri Colebatch

where are the jars containing those packages?  they should be in 
$TOMCAT_HOME/lib or $WEB-INF/lib.

cheers
dim

On Fri, 13 Jul 2001 03:03, Gadde, Padma wrote:
 Hi
 i am working with XML and I have my JSPs in the tomcat (version 3.2.2) . I
 am trying to import org.apache.xpath and import javax.sql and i get the
 following errors.
 Can any one help me?


 Internal Servlet Error:

 org.apache.jasper.JasperException: Unable to compile class for
 JSPC:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_
0 002ejspssMenu_jsp_0.java:16: Package javax.sql not found in import. import
 javax.sql.*;
^
 C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_000
2 ejspssMenu_jsp_0.java:20: Package org.apache.xalan.serialize not found in
 import.
 import org.apache.xalan.serialize.*;
^
 C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_000
2 ejspssMenu_jsp_0.java:21: Package org.apache.xpath not found in import.
 import org.apache.xpath.*;
^
 3 errors

   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
   at
 org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
   at
 org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
   at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
   at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspS
e rvlet.java:258)
   at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j
a va:268)
   at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
   at org.apache.tomcat.core.Handler.service(Handler.java:287)
   at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
   at
 org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:7
9 7)
   at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
   at
 org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Http
C onnectionHandler.java:213)
   at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
   at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
   at java.lang.Thread.run(Thread.java:484)

 Thanks in advance
 Padma



Re: Include files in Tomcat

2001-07-12 Thread Boris Niyazov

The error indicates that tomcat doesn't know where the packages are located. 
Make sure you have JAVA_HOME is set and all jars needed are in $TOMCAT_HOME/lib.

  - Boris




Hi 
i am working with XML and I have my JSPs in the tomcat (version 3.2.2) . I
am trying to import org.apache.xpath and import javax.sql and i get the
following errors. 
Can any one help me?


Internal Servlet Error:

org.apache.jasper.JasperException: Unable to compile class for
JSPC:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0
002ejspssMenu_jsp_0.java:16: Package javax.sql not found in import.
import javax.sql.*;
   ^
C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0002
ejspssMenu_jsp_0.java:20: Package org.apache.xalan.serialize not found in
import.
import org.apache.xalan.serialize.*;
   ^
C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_0002
ejspssMenu_jsp_0.java:21: Package org.apache.xpath not found in import.
import org.apache.xpath.*;
   ^
3 errors

   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
   at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
   at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
   at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
   at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:258)
   at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:268)
   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
   at org.apache.tomcat.core.Handler.service(Handler.java:287)
   at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
   at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
   at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
   at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:213)
   at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
   at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
   at java.lang.Thread.run(Thread.java:484)

Thanks in advance
Padma




Re: Include files in Tomcat

2001-07-12 Thread Ravishankar.S

hi padma,
chek if in the lib dir u have
servlet.jar,webserver.jar.jaxp.jar jasper.jar.of course java_home should be
C:\jdk1.3(assuming that is where u have it).edit the bat file startup.bat
and insert some echo statements and when u start, see the tomcat window and
see if the echo stats appear,this way u can chek if it senses the jar files
also(pl start the tomcat frm cmd prompt)

 
 
 Hi
 i am working with XML and I have my JSPs in the tomcat (version 3.2.2) .
I
 am trying to import org.apache.xpath and import javax.sql and i get the
 following errors.
 Can any one help me?
 
 
 Internal Servlet Error:
 
 org.apache.jasper.JasperException: Unable to compile class for

JSPC:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_
0
 002ejspssMenu_jsp_0.java:16: Package javax.sql not found in import.
 import javax.sql.*;
^

C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_000
2
 ejspssMenu_jsp_0.java:20: Package org.apache.xalan.serialize not found in
 import.
 import org.apache.xalan.serialize.*;
^

C:\tomcat\jakarta-tomcat-3.2.2\work\localhost_8080%2Fpadma\_0002fssMenu_000
2
 ejspssMenu_jsp_0.java:21: Package org.apache.xpath not found in import.
 import org.apache.xpath.*;
^
 3 errors
 
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
  at
 org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612)
  at
 org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
  at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:542)
  at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspS
e
 rvlet.java:258)
  at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.j
a
 va:268)
  at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
  at org.apache.tomcat.core.Handler.service(Handler.java:287)
  at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
  at

org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:7
9
 7)
  at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
  at

org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(Http
C
 onnectionHandler.java:213)
  at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
  at

org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
  at java.lang.Thread.run(Thread.java:484)
 
 Thanks in advance
 Padma




RE: altering include files

2001-06-26 Thread Jann VanOver

No, not really.  You CAN delete all the tomcat\work files for that context,
or touch the file that does the include.  Either of these things will
force the page to be recompiled.

I've been trying to replace my includes with:
  %
request.getRequestDispatcher(nextPieceOfWork.jsp).forward(request,response
); %
and with tag libraries in order to avoid the problem you are having.  In the
long run, these techniques make for better (more reusable) code as well --
imho.

-Original Message-
From: teh j [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 25, 2001 10:07 PM
To: [EMAIL PROTECTED]
Subject: altering include files


Hi there

I am currently using Tomcat v3.2.1 and am using
include files in my .jsp files a fair bit

Im finding though that if I make a change to my
include file, it does not appear in the JSP that is
using the include file UNLESS I delete the include
file, reload the hosting JSP, put back the include
file and then reload the page again!

Is there a way around this? It is very frustrating and
takes away quite a bit of the idea of the include
file!

thanks
Jason


_
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!



altering include files

2001-06-25 Thread teh j

Hi there

I am currently using Tomcat v3.2.1 and am using
include files in my .jsp files a fair bit

Im finding though that if I make a change to my
include file, it does not appear in the JSP that is
using the include file UNLESS I delete the include
file, reload the hosting JSP, put back the include
file and then reload the page again!

Is there a way around this? It is very frustrating and
takes away quite a bit of the idea of the include
file!

thanks
Jason

_
http://messenger.yahoo.com.au - Yahoo! Messenger
- Voice chat, mail alerts, stock quotes and favourite news and lots more!



RE: Include files in Tomcat and Apache

2001-03-09 Thread Rodriguez Victor A.

Abdullah,

 I  have apache  1.3.14 ( with Jserv) and Tomcat  3.2.1 
 running in the same machne
 on linux.
 All the html and images are in apache,
 All the Jsp and Servlets  are in tomcat
 Here i have one problem .
 I have a jsp  called login.jsp which has an include statement  like
 
 %@ include file="http://127.0.0.1/static/msFoot1.html" %
  or
 %@ include file="http://abdullah/static/msFoot1.html" %
 
 when i call this login.jsp , i am getting the following exception
 
 Internal Servlet Error:
 
 org.apache.jasper.compiler.CompileException:
 /usr/local/jakarta-tomcat-3.2.1/webapps/Oilgrains/jsp/ 
 login.jsp(9,0) Bad file
 argument to include

You only can include files trough the local filesystem :

%@ include file="/usr/local/html_files/static/msFoot1.html" %

If you need to include files via a URL, you can use the next code snippet :

  %
//
// URL inclusion
//

String url = "http://server/path/to/file/here");  // Can be any URL
(ftp, http, etc)


try {
URL urlConn = new URL ( url ); // Creates an
object,
URLConnection connURL = urlConn.openConnection();  // then opens the
connection
InputStream inURL = connURL.getInputStream();  // and converts
it to
   // an InptuStream
while ( (x = inURL.read()) != -1 ) {
 out.print( (char) x );
};
 
inURL.close();

} catch (MalformedURLException e) {
out.println("B" + e + "/B" );
} catch (IOException e) {
out.println("B" + e + "/B" );
}
}
  %

Perhaps is not the better code, but take as a starting point (BTW, if anyone
has a better one I'll be happy to hear from it !!)

Cheers.
-- 
Vctor A. Rodrguez ( http://www.bit-man.com.ar) 
Telefnica de Argentina - http://www.Telefonica.com.ar 
Tel. (54-11) 4333-7305 - Fax: (54-11) 4303-5586 int. 1680 

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




RE: Include files in Tomcat and Apache

2001-03-09 Thread Marc Saegesser

Read the JSP spec.  The include directive requires a relativeURLspec.  You
can only include files from the current webapp so there is no need to fully
qualify the URL.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Abdullah
 Sent: Wednesday, March 07, 2001 3:41 AM
 To: [EMAIL PROTECTED]
 Subject: Include files in Tomcat and Apache
 Importance: High


  hi  ,

 I  have apache  1.3.14 ( with Jserv) and Tomcat  3.2.1 running in
 the same machne
 on linux.
 All the html and images are in apache,
 All the Jsp and Servlets  are in tomcat
 Here i have one problem .
 I have a jsp  called login.jsp which has an include statement  like

 %@ include file="http://127.0.0.1/static/msFoot1.html" %
  or
 %@ include file="http://abdullah/static/msFoot1.html" %

 when i call this login.jsp , i am getting the following exception

 Internal Servlet Error:

 org.apache.jasper.compiler.CompileException:
 /usr/local/jakarta-tomcat-3.2.1/webapps/Oilgrains/jsp/
 login.jsp(9,0) Bad file
 argument to include
 at java.lang.Throwable.(Throwable.java:96)
 at java.lang.Exception.(Exception.java:44)
 at javax.servlet.ServletException.(ServletException.java:107)
 at org.apache.jasper.JasperException.(JasperException.java:73)
 at
 org.apache.jasper.compiler.CompileException.(CompileException.java:73)

 at
 org.apache.jasper.compiler.JspParseEventListener.handleDirective(J
spParseEventListener.java:730)

 at
 org.apache.jasper.compiler.DelegatingListener.handleDirective(Dele
gatingListener.java:116)

 at
 org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
 at
 org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
 at
 org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
 at
 org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNeces
 sary(JspServlet.java:152)

 at
 org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp
Servlet.java:164)

 at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
 org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at
 org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

 at
 org.apache.tomcat.core.ContextManager.internalService(ContextManag
 er.java:797)
 at
 org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

 at
 org.apache.tomcat.service.connector.Ajp12ConnectionHandler.process
 Connection(Ajp12ConnectionHandler.java:166)

 at
 org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
 org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:498)

 please ,anyone can help me?
 Thanks
 Abdullah




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


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




Include files in Tomcat and Apache

2001-03-07 Thread Abdullah

 hi  ,

I  have apache  1.3.14 ( with Jserv) and Tomcat  3.2.1 running in the same machne
on linux.
All the html and images are in apache,
All the Jsp and Servlets  are in tomcat
Here i have one problem .
I have a jsp  called login.jsp which has an include statement  like

%@ include file="http://127.0.0.1/static/msFoot1.html" %
 or
%@ include file="http://abdullah/static/msFoot1.html" %

when i call this login.jsp , i am getting the following exception

Internal Servlet Error:

org.apache.jasper.compiler.CompileException:
/usr/local/jakarta-tomcat-3.2.1/webapps/Oilgrains/jsp/ login.jsp(9,0) Bad file
argument to include
at java.lang.Throwable.(Throwable.java:96)
at java.lang.Exception.(Exception.java:44)
at javax.servlet.ServletException.(ServletException.java:107)
at org.apache.jasper.JasperException.(JasperException.java:73)
at org.apache.jasper.compiler.CompileException.(CompileException.java:73)

at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:730)

at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116)

at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:215)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1077)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)

at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)

at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:166)

at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:498)

please ,anyone can help me?
Thanks
Abdullah




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