[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tomcat-user
Subject:    Re: Symlinks to index JSP files.
From:       gmc filter <gmcfilter123 () gmail ! com>
Date:       2016-02-26 21:48:17
Message-ID: CAD4amrMRi+g+mVddEwgam+vkW5UVz_xzTYgJuSaecjWQi97RJw () mail ! gmail ! com
[Download RAW message or body]


Thanks Mark,
Regretfully, my favorite IDE right now is IntelliJ (I use the free one) but
it seems pretty obvious that it's not the right choice for developing this
kind of application, as it doesn't have any explicit support for this kind
of development at all. I might just have to buckle down and stat using
netbeans or eclipse and convince others to as well.

I know how to write scripts and create complicated build/run actions in
IntelliJ, but things definitely take on the order of seconds when I would
prefer they were instant. I will take a look at Takari and see if it can
help me.


On Fri, Feb 26, 2016 at 3:15 PM, Mark Eggers <its_toasted@yahoo.com.invalid>
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Chris,
>
> On 2/26/2016 12:36 PM, Christopher Schultz wrote:
> > To whom it may concern,
> >
> > On 2/26/16 2:07 PM, gmc filter wrote:
> >> Chris, I am specifically trying to avoid rebuilding the project
> >> each time I make small changes in jsp/html/whatever files, if
> >> that is what you are suggesting. Now that you mention this, I
> >> doubt any maven plugin can achieve what I'm trying to do either.
> >
> > This is one of my big problems with Maven: it doesn't seem to
> > really be geared towards /development/. I'm sure it's great for
> > end-to-end builds, but for a simple "update my local deployment
> > with that 2-character change I just did" doesn't seem to be on the
> > menu.
> >
> >> That did give me an idea though. I suppose I could write a
> >> script which simply overwrites the deployed file with a copy from
> >> my workspace... I would have to run this script each time I want
> >> to review my changes, which is disappointing, but I guess it will
> >> work for now.
> >
> > For me, ant is integrated into my IDE. When I want to publish
> > changes to my locally-running dev environment, I just click a
> > button and it's done in a few ms. Tomcat reloads the resource and
> > I'm good to go.
> >
> > -chris
> >
> >> On Fri, Feb 26, 2016 at 12:38 PM, Christopher Schultz <
> >> chris@christopherschultz.net> wrote:
> >
> >>> To whom it may concern,
> >>>
> >>> On 2/26/16 11:53 AM, gmc filter wrote:
> >>>> I am currently using Maven to build my project and compile
> >>>> it into a WAR file.
> >>>>
> >>>> Does Maven have some plugin that can help me achieve what I
> >>>> am trying to
> >>> do?
> >>>
> >>> If Maven doesn't know how to copy one file from one place to
> >>> another, I'm still comfortable with my decision to completely
> >>> ignore its existence as a build tool.
> >>>
> >>> With ant, it's as simple as (paraphrasing):
> >>>
> >>> <copy toDir="${deploy.dir}"> <fileset dir="${jsp.source.dir}"
> >>> includes="**/*.jsp" /> </copy>
> >>>
> >>> -chris
> >>>
> >>>> On Fri, Feb 26, 2016 at 10:34 AM, Christopher Schultz <
> >>>> chris@christopherschultz.net> wrote:
> >>>>
> >>>>> To whom it may concern,
> >>>>>
> >>>>> On 2/25/16 4:08 PM, gmc filter wrote:
> >>>>>> Hi all, I'm having some trouble with tomcat and symbolic
> >>>>>> links. I am working
> >>> with
> >>>>>> OSX and I use a local instance of Tomcat to do some
> >>>>>> testing before deploying my site elsewhere.
> >>>>>>
> >>>>>> What I want to do: I'd like to create a small script
> >>>>>> which will stop tomcat, clear out old deployment folders,
> >>>>>> rebuild my project, copy the resulting WAR file to the
> >>>>>> webapps folder, restart tomcat, wait for deployment to
> >>>>>> finish, and finally replace a JSP file with a symbolic
> >>> link
> >>>>>> to the corresponding file that is in my workspace.
> >>>>>>
> >>>>>> Why I want to do this: I'd like to be able to quickly
> >>>>>> rebuild and
> >>>>> redeploy
> >>>>>> my WAR and also edit my JSP files and see those changes
> >>>>>> by simply refreshing the already-open page.
> >>>>>>
> >>>>>> My problem: I have all of the above steps working so
> >>>>>> far. However, as
> >>>>> soon
> >>>>>> as I swap out the real index.JSP with a link to the one
> >>>>>> in my
> >>> workspace,
> >>>>> I
> >>>>>> can no longer load the page, I get a 404 error instead.
> >>>>>>
> >>>>>> What I have tried: I have found questions like mine
> >>>>>> asked many times
> >>> and
> >>>>>> usually the solution is to hunt down a "context.xml"
> >>>>>> file and add a tag into that file, 'allowLinking="true"'.
> >>>>>> I have tried to add this tag
> >>> into
> >>>>>> "<tomcat home>/libexec/conf/context.xml", "<tomcat
> >>>>>> home>/libexec/conf/Catalina/localhost/context.xml"
> >>>>>> (created this one)
> >>> and
> >>>>>> also "<tomcat
> >>>>>> home>/libexec/webapps/appname/META-INF/context.xml".
> >>> After
> >>>>>> multiple restarts, none of those seem to change any
> >>>>>> functionality that
> >>> I
> >>>>>> can see.
> >>>>>>
> >>>>>> By trial and error, I have eventually found that if I
> >>>>>> follow these
> >>>>> steps, I
> >>>>>> can get the link to work for a little while... Deploy
> >>>>>> the WAR Load the page (It works) Move index_bs.jsp to
> >>>>>> index_bs.jsp.bak (in the webapp directory) Load the page
> >>>>>> (404, as expected) Create a symbolic link from
> >>>>>> index_bs.jsp to index_bs.jsp.bak Load the page (It
> >>>>>> works!) Edit index_bs.jsp.bak, save Load the page (404
> >>>>>> again)
> >>>>>>
> >>>>>> This seems very strange to me. Obviously I've reached a
> >>>>>> point where symbolic linking works somewhat, but as soon
> >>>>>> as I edit the original
> >>> file
> >>>>>> (my main goal here) the link stops working as expected.
> >>>>>> Does anyone
> >>> know
> >>>>>> what I'm doing wrong here? I must be missing
> >>>>>> something...
> >>>>>>
> >>>>>>
> >>>>>> Some information about my setup: OSX 10.10.5 Tomcat
> >>>>>> 8.0.28 installed with my username running brew brew to
> >>>>>> "/usr/local/Cellar/tomcat/8.0.28/"
> >>>>>>
> >>>>>
> >>> "/usr/local/Cellar/tomcat/8.0.28/libexec/webapps/hue-web-1.0-SNAPSHO
> T
> >
> >>>
> .war"
> >>>>>>
> >>>
> > deployed successfully to
> >>>>>> "/usr/local/Cellar/tomcat/8.0.28/libexec/webapps/hue-web-1.0-SNAP
> S
> >
> >>>>>>
> HOT/"
> >>>>>>
> >>>>>>
> > Target file is
> >>>>>> "/Users/uid/mygithub/hue-stuff/hue-web/src/main/webapp/index_bs.j
> s
> >
> >>>>>>
> p"
> >>>>>
> >>>>>
> >>>>>>
> > If you need an IDE-independent build process (which I highly
> > recommend),
> >>>>> consider something like Apache ant (similar to UNIX "make"
> >>>>> but way better for the Java world) or even Maven, if you
> >>>>> don't mind the
> >>> overhead.
> >>>>>
> >>>>> Using symlinks with Tomcat is sometimes problematic, though
> >>>>> I can't explain why it's actually failing for your
> >>>>> specific case... I would have expected that to work.
> >>>>>
> >>>>> -chris
> >>>>>
>
> I use Maven exclusively (migrated from Ant about 2 years ago). I've
> never had the update problem with NetBeans and a NetBeans-controlled
> Tomcat.
>
> For Eclipse, I think there used to be issues. I run Mars.1 (just to
> make sure that my pom.xml changes play nicely with Eclipe), and just
> tried a small project.
>
> Changes to index.jsp are reflected after a browser refresh.
> Changes to CSS are reflected after a browser refresh.
>
> My Eclipse setup for Tomcat uses the defaults, so if you take over a
> locally installed Tomcat (rather than running out of
> workspace/.metadata), your mileage may vary.
>
> For NetBeans, I have compile-on-save turned on. This means that when I
> save a Java file, only that file gets recompiled and added to
> target/artifactId/WEB-INF/classes. Tomcat detects this and reloads the
> web application automatically.
>
> I don't know if this happens in Eclipse or not. I suppose that I could
> test.
>
> If you need / want incremental builds with Maven, you should check out
> the Takari Maven Lifecycle plugin
> (https://github.com/takari/takari-lifecycle). I haven't yet, but there
> are lots of features that look promising (including incremental builds
> for resource changes).
>
> . . . . just my two cents
> /mde/
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQEcBAEBAgAGBQJW0MBaAAoJEEFGbsYNeTwtOQAIAIwNlMcY12Fbe6DabVkmRM1K
> j9gHKU2e12T6P8lHzsKckkVZLyIRiSXA9tn0p94bEtqyMI2rvqhy6yk5hoetDv3t
> Rk493xQ5Qqb1dd7LyZ6tjojPwkwCDQZPObBIGqOnhlX4Gfd27YvzduWgluhzUUAH
> 9TM4E1OQ2ur0irgT5FsR3ufViz/H5AC+0BTrVeKqMn1vNoe9ZAdb0jG2jF11HXY9
> 9JZAmNwVANznjOlMYRDExIGrMRm4zre622z5oLIEKAghp1wZXCkTkVeGmT7lSxzG
> xeYJWmreF/+q/WTdBlBW5jqWfiyYDTNGthVrAJAifdszUYXrVBqjh5TuOREVMzU=
> =o1ZZ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic