Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Include File

Reply
Thread Tools

Include File

 
 
Sun
Guest
Posts: n/a
 
      06-21-2004
Have anyone an idea for including a file in a Java source code (not JSP)?

Thanks to all in advance!
Riccardo

 
Reply With Quote
 
 
 
 
DigiAl
Guest
Posts: n/a
 
      06-21-2004

"Sun" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> Have anyone an idea for including a file in a Java source code (not JSP)?
>
> Thanks to all in advance!
> Riccardo
>



Why would you want to do that? For server side / messy programming it is
needed but for Java (and anyother similar languages) its not really needed.

alan.


 
Reply With Quote
 
 
 
 
Harald Kirsch
Guest
Posts: n/a
 
      06-21-2004
"Sun" <(E-Mail Removed)> wrote:
> Have anyone an idea for including a file in a Java source code (not JSP)?



If you insist in making your life really miserable,
then there is nothing
to prevent you from either using cpp or m4, like
in a C program. Except you have to call cpp
yourself, because javac will not do this for you.-)

Harald.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-21-2004
On Mon, 21 Jun 2004 08:44:01 GMT, "Sun" <(E-Mail Removed)> wrote or
quoted :

>Have anyone an idea for including a file in a Java source code (not JSP)?


Write a little macro preprocessor that handles your include. Use the
C preprocessor.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      06-21-2004
On 21 Jun 2004 08:13:36 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Harald Kirsch) wrote
or quoted :

>
>If you insist in making your life really miserable,
>then there is nothing
>to prevent you from either using cpp or m4, like
>in a C program. Except you have to call cpp
>yourself, because javac will not do this for you.-)


I do some simple things like embed the name of the compiler used by
simply copying one of two variants to the official java file just
prior to compilation. You can do slightly more elaborate things with
simple file concatenation.

As a simple antipiracy measure, and as a very flexible configuration
tool, I sometimes copy a configuration file written in Java for a
customer to the official configuration then compile, to hard code in
all the constants.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
ASP Include file error <!-- #include file="" --> naveeddil ASP .Net 0 01-04-2008 12:58 PM
include file in include file PTM HTML 1 11-12-2007 10:13 AM
ASP Error 0126 include file not found, when using ".." in include file path Eric ASP General 10 01-11-2007 07:38 AM
#include "file" -vs- #include <file> Victor Bazarov C++ 4 03-06-2005 07:09 PM



Advertisments