Re: Including jsp files that exist outside of the web application

2004-12-28 Thread Dakota Jack
I cannot understand your situation.  If you use the include directive,
then the JAVA Servlet file will include the info in the JSP file which
is included.  If you use the include element, then the included JSP
file will have its own separate JAVA Servlet file.  Accordingly, the
include element requires a JAVA Servlet file to be loaded with a class
loader.  So, you must be using JSP files that are edited outside the
web application and then inserted into the web application, where they
are then compiled and included via reference by other Servlets. 
Right?

I am not sure what the problem is with overwriting.  I am also not
sure what you mean by them existing outside the web application.  If
by being edited outside and included in a web application is what you
mean by existing outside, what is the problem?

Sorry to be dark, but this is a mysterious discussion to me.  You guys
clearly understand what you are talking about.  I don't.  Consider
this a subquestion in an attempt to be helpful.  ;-)

Jack


On Mon, 27 Dec 2004 12:22:50 -0800 (PST), [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hello,
 
 We have a web application that is overwritten each time we push a new
 version of the code into production.  However, we have jsp files that are
 included by the web application (dynamically via a jsp:include), but are
 edited outside of the web application... and should not be overwritten
 just because the core code is updated.
 
 What is the best practice for including jsp files that exist outside the
 web application?  I have seen a couple of threads of putting these
 included jsp files in a separate web application that is not
 overwritten... but I was wondering if there was a better solution.
 
 Thank you,
 -Raiden Johnson
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
--

You can lead a horse to water but you cannot make it float on its back.

~Dakota Jack~

You can't wake a person who is pretending to be asleep.

~Native Proverb~

Each man is good in His sight. It is not necessary for eagles to be crows.

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---

This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.

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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread Dakota Jack
What if you don't include the JSP file but include the related JAVA
file and use CLASSPATH?  Will that work?  You cannot, of course, make
this dynamic, since you have class loader issues.  The biggest issue
is the class loader issue.  You might create a set of interfaces and
implemenations outside your web application that allow dynamic
reloading.  I don't see, however, why your edited files are not just
popped into your web application without issues?

Jack


On Mon, 27 Dec 2004 12:22:50 -0800 (PST), [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hello,

 We have a web application that is overwritten each time we push a new
 version of the code into production.  However, we have jsp files that are
 included by the web application (dynamically via a jsp:include), but are
 edited outside of the web application... and should not be overwritten
 just because the core code is updated.
 
 What is the best practice for including jsp files that exist outside the
 web application?  I have seen a couple of threads of putting these
 included jsp files in a separate web application that is not
 overwritten... but I was wondering if there was a better solution.
 
 Thank you,
 -Raiden Johnson
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
--

You can lead a horse to water but you cannot make it float on its back.

~Dakota Jack~

You can't wake a person who is pretending to be asleep.

~Native Proverb~

Each man is good in His sight. It is not necessary for eagles to be crows.

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

---

This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation.

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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread QM
On Mon, Dec 27, 2004 at 07:11:24PM -0800, [EMAIL PROTECTED] wrote:
:  Is there any way to include jsp code dynamically besides the jsp:include
:  method?
: 
: I'm thinking of using symbolic links... with the allowLinking flag.  Then,
: I can access jsp files outside of the web app by following the symbolic
: link out.  I just have to make sure that the symbolic link is recreated
: before Tomcat starts up.  (Or actually, before any jsp's are compiled.)
This is a short-term fix, almost a hack.  It makes your app less
portable between different OSs (not all OSs support symlinks), between
containers (not all containers support allowLinking), and between
exploded-dir and WAR format webapps.

I'm not saying it won't work; I'm just saying it'll hurt in the long
run.

-QM


-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread raiden
On Tue, 28 Dec 2004, Dakota Jack wrote:

 I am not sure what the problem is with overwriting.  I am also not
 sure what you mean by them existing outside the web application.  If
 by being edited outside and included in a web application is what you
 mean by existing outside, what is the problem?

 Sorry to be dark, but this is a mysterious discussion to me.  You guys
 clearly understand what you are talking about.  I don't.  Consider
 this a subquestion in an attempt to be helpful.  ;-)


Hi Jack,

The basic idea is, we have jsp's that must be edited on the fly, through a
web page.  Those edits must survive updates of the application itself.
So, if you think of the edited jsp's as being headers or footers that are
included in other jsp files, we want to save these headers and footers
outside of the tomcat/webapps/ROOT directory, because this will get
deleted when we deploy a new ROOT.war file.

So, we were hoping on saving them in something like /var/jsp/footer.jsp
and /var/jsp/header.jsp so that when /usr/local/tomcat/webapps/ROOT gets
deleted and then redeployed with a new version of the application, we can
continue using the old footer.jsp and header.jsp files.  And
unfortunately, these special files do need jsp code, and must be more than
just html.

Thank you,
-Raiden


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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread raiden
On Tue, 28 Dec 2004, Dakota Jack wrote:

 What if you don't include the JSP file but include the related JAVA
 file and use CLASSPATH?  Will that work?  You cannot, of course, make
 this dynamic, since you have class loader issues.  The biggest issue
 is the class loader issue.  You might create a set of interfaces and
 implemenations outside your web application that allow dynamic
 reloading.  I don't see, however, why your edited files are not just
 popped into your web application without issues?


We would love to be able to pop our edited files back into the web
application, but we don't see an easy way to do that.  The files must be
dynamic, as they will be edited many times over the lifetime of the
current web application.

So far, symbolic linking out of the web application seems to be the only
way we have found to really do this.

Thank you,
-Raiden


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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread raiden

On Tue, 28 Dec 2004, QM wrote:

 On Mon, Dec 27, 2004 at 07:11:24PM -0800, [EMAIL PROTECTED] wrote:
 :  Is there any way to include jsp code dynamically besides the jsp:include
 :  method?
 :
 : I'm thinking of using symbolic links... with the allowLinking flag.  Then,
 : I can access jsp files outside of the web app by following the symbolic
 : link out.  I just have to make sure that the symbolic link is recreated
 : before Tomcat starts up.  (Or actually, before any jsp's are compiled.)
 This is a short-term fix, almost a hack.  It makes your app less
 portable between different OSs (not all OSs support symlinks), between
 containers (not all containers support allowLinking), and between
 exploded-dir and WAR format webapps.

 I'm not saying it won't work; I'm just saying it'll hurt in the long
 run.


AND, it is really a pain to have to make sure that you recreate the
symbolic link before the pages that need the link are accessed, but AFTER
the war file has been exploded.

I don't like it much, but it's the best solution we have at the moment.

Thank you,
-Raiden


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



Re: Including jsp files that exist outside of the web application

2004-12-28 Thread Frank W. Zammetti
You know, I'm not sure how often this comes up for people, but it might 
make a good custom tag... I can imagine simply a version of 
jsp:include that allows for absolute paths.  Sure, it'll tie you to an 
OS to some degree (i.e., change paths from Windows forms to Unix forms), 
but that might be something people can live with.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
[EMAIL PROTECTED] wrote:
On Tue, 28 Dec 2004, Dakota Jack wrote:

What if you don't include the JSP file but include the related JAVA
file and use CLASSPATH?  Will that work?  You cannot, of course, make
this dynamic, since you have class loader issues.  The biggest issue
is the class loader issue.  You might create a set of interfaces and
implemenations outside your web application that allow dynamic
reloading.  I don't see, however, why your edited files are not just
popped into your web application without issues?

We would love to be able to pop our edited files back into the web
application, but we don't see an easy way to do that.  The files must be
dynamic, as they will be edited many times over the lifetime of the
current web application.
So far, symbolic linking out of the web application seems to be the only
way we have found to really do this.
Thank you,
-Raiden
-
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: Including jsp files that exist outside of the web application

2004-12-27 Thread QM
On Mon, Dec 27, 2004 at 12:22:50PM -0800, [EMAIL PROTECTED] wrote:
: What is the best practice for including jsp files that exist outside the
: web application?

I don't think there really is one.  read on:


: I have seen a couple of threads of putting these
: included jsp files in a separate web application that is not
: overwritten... but I was wondering if there was a better solution.

Some would say that keeping those JSP files in another app *is* the
better solution.

Keep in mind, webapps are meant to be self-contained units.  You should
design your apps such that they can be placed in a sealed WAR file (e.g.
you don't need to touch file components at runtime).

In turn, this means anything that's going to change throughout the
lifetime of the webapp should live outside of it: filesystem (you'd have
to write your own code to stream the data), database, another webapp
(i.e. dedicating a single webapp to be the file store), etc.

Such separation provides the additional benefit of letting your app
scale to multiple machines.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: Including jsp files that exist outside of the web application

2004-12-27 Thread raiden


On Mon, 27 Dec 2004, QM wrote:

 On Mon, Dec 27, 2004 at 12:22:50PM -0800, [EMAIL PROTECTED] wrote:
 : What is the best practice for including jsp files that exist outside the
 : web application?

 I don't think there really is one.  read on:


 : I have seen a couple of threads of putting these
 : included jsp files in a separate web application that is not
 : overwritten... but I was wondering if there was a better solution.

 Some would say that keeping those JSP files in another app *is* the
 better solution.

 Keep in mind, webapps are meant to be self-contained units.  You should
 design your apps such that they can be placed in a sealed WAR file (e.g.
 you don't need to touch file components at runtime).

 In turn, this means anything that's going to change throughout the
 lifetime of the webapp should live outside of it: filesystem (you'd have
 to write your own code to stream the data), database, another webapp
 (i.e. dedicating a single webapp to be the file store), etc.

 Such separation provides the additional benefit of letting your app
 scale to multiple machines.

Hello,

Thanks for your response.  I agree wholeheartedly, and would like to be
able to have this code live outside of that, since it's goign to change
throughout the lifetime of the webapp (and must maintain its changes
before and after).

However, the tricky part here, is that the code needs to be compiled
dynamically as part of the jsp.

Maybe that's the real question.  Is there a way to include jsp code
outside of the webapp that will be compiled runtime?

Thanks,
-Raiden


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



RE: Including jsp files that exist outside of the web application

2004-12-27 Thread Brad Rhoads
 
 
 On Mon, 27 Dec 2004, QM wrote:
 
  On Mon, Dec 27, 2004 at 12:22:50PM -0800, 
 [EMAIL PROTECTED] wrote:
  : What is the best practice for including jsp files that 
 exist outside 
  the
  : web application?
 
  I don't think there really is one.  read on:
 

FWIW - We let our clients brand our app. To handle that (and the connection
string in the web.xml) I create an external directory to save the custom
files in. Then the main app just has a script that copies the custom files
back into the appropriate places in the app.




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



Re: Including jsp files that exist outside of the web application

2004-12-27 Thread QM
On Mon, Dec 27, 2004 at 01:58:53PM -0800, [EMAIL PROTECTED] wrote:
: Maybe that's the real question.  Is there a way to include jsp code
: outside of the webapp that will be compiled runtime?

What about jsp:include/?
(or is that %@ include /?  I forget which is runtime, and which is
compile-time...)

Essentially, use whichever one you're not using now and see whether that
works ;)

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


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



Re: Including jsp files that exist outside of the web application

2004-12-27 Thread raiden


On Mon, 27 Dec 2004, QM wrote:

 On Mon, Dec 27, 2004 at 01:58:53PM -0800, [EMAIL PROTECTED] wrote:
 : Maybe that's the real question.  Is there a way to include jsp code
 : outside of the webapp that will be compiled runtime?

 What about jsp:include/?
 (or is that %@ include /?  I forget which is runtime, and which is
 compile-time...)

 Essentially, use whichever one you're not using now and see whether that
 works ;)

It's the jsp:include one that is runtime... and that seems to require it
to be a jsp page in the web application... which, unfortunately, is our
problem.

Is there any way to include jsp code dynamically besides the jsp:include
method?  If there was some way to do it in the code, then we could just
load the jsp code from a file store of some sort.

Thanks,
-Raiden


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



Re: Including jsp files that exist outside of the web application

2004-12-27 Thread Liem Do
Could you do something like the following? You'll be essentially doing
something like curl to get the output from the other app and simply writing
it out in your app. This has been tested but should help you get the idea. I
did something similar to send a POST request to an external site and then
just displayed the output in my app.

%
  URL url = new URL(http://path_to_other_app/other_page.jsp;);
  HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  conn.setUseCaches(false);
  conn.setRequestMethod(GET);

  // Get the response
  BufferedReader rd = new BufferedReader(new
InputStreamReader(conn.getInputStream()));
  String line;
  while ((line = rd.readLine()) != null) {
 out.println(line);
  }
%

HTH
--LD

- Original Message - 
From: [EMAIL PROTECTED]
To: Tomcat Users List tomcat-user@jakarta.apache.org
Sent: Monday, December 27, 2004 3:10 PM
Subject: Re: Including jsp files that exist outside of the web application




 On Mon, 27 Dec 2004, QM wrote:

  On Mon, Dec 27, 2004 at 01:58:53PM -0800, [EMAIL PROTECTED] wrote:
  : Maybe that's the real question.  Is there a way to include jsp code
  : outside of the webapp that will be compiled runtime?
 
  What about jsp:include/?
  (or is that %@ include /?  I forget which is runtime, and which is
  compile-time...)
 
  Essentially, use whichever one you're not using now and see whether that
  works ;)

 It's the jsp:include one that is runtime... and that seems to require it
 to be a jsp page in the web application... which, unfortunately, is our
 problem.

 Is there any way to include jsp code dynamically besides the jsp:include
 method?  If there was some way to do it in the code, then we could just
 load the jsp code from a file store of some sort.

 Thanks,
 -Raiden


 -
 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: Including jsp files that exist outside of the web application

2004-12-27 Thread raiden

On Mon, 27 Dec 2004 [EMAIL PROTECTED] wrote:
 On Mon, 27 Dec 2004, QM wrote:

  On Mon, Dec 27, 2004 at 01:58:53PM -0800, [EMAIL PROTECTED] wrote:
  : Maybe that's the real question.  Is there a way to include jsp code
  : outside of the webapp that will be compiled runtime?
 
  What about jsp:include/?
  (or is that %@ include /?  I forget which is runtime, and which is
  compile-time...)
 
  Essentially, use whichever one you're not using now and see whether that
  works ;)

 It's the jsp:include one that is runtime... and that seems to require it
 to be a jsp page in the web application... which, unfortunately, is our
 problem.

 Is there any way to include jsp code dynamically besides the jsp:include
 method?  If there was some way to do it in the code, then we could just
 load the jsp code from a file store of some sort.


I'm thinking of using symbolic links... with the allowLinking flag.  Then,
I can access jsp files outside of the web app by following the symbolic
link out.  I just have to make sure that the symbolic link is recreated
before Tomcat starts up.  (Or actually, before any jsp's are compiled.)

-Raiden


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