"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
To answer #1, I would suggest the following.
To answer #1, I would suggest the following: Spend some time learning maven to build your . War without eclipse. It's not that hard with the proper archetype.
See here for more details: URL1 Maven can generate eclipse projects either through mvn eclipse:eclipse or by using the m2 plugin For deployment to your local machine and to production, use the maven cargo plugin. cargo.codehaus.org/Maven2+plugin and blank.jasonwhaley.com/2010/03/automated-... To answer question #2, there's nothing wrong with modifying your /etc/hosts file to mimic production. Just have a quick script that lets you add/remove those entries and flushes your dns cache.
I do exactly that all of the time. (be sure to make your browser clear its cache frequently also through its relevant setting). To answer question #3) yes this is how you should be doing things.
Each build should result in a single deployable artifact that you can deploy to any of your environments in one step. You need to make sure you can do this without your IDE and use the IDE only as a tool to help you during the development phase.
Thanks Whaley. So I'm clear - are you confirming that even if I want to, say, put a quick alert in a line of javascript, or correct a typo in some text in an html file, I'll need to wait for the war to rebuild and then get deployed (even if automatically) to my development servlet container, and only then I can see the result of my change? If so, that feels very stilted compared to the efficiency of just having something pointed right at the project files.
Have I understood correctly, or am I missing something? – Jeremy May 13 '10 at 1:42 That's precisely what I'm suggesting. If your production deployment consists of .
War drops, that is what your development deployment should look like too. Java webapps are meant to be bundled and deployed as war's - I find life is always much easier when you don't try to work around that convention. – whaley May 13 '10 at 2:13 Using the webtools/EE edition of Eclipse you can "link" your project with a local tomcat (or other container) installation, so you could preview small changes without waiting for the war generation/deployment.
– agnul Mar 8 '11 at 16:24.
1) I think you're relying too much on your IDE. Usually I have an Ant build. Xml that has a couple of tasks: one is "build war" the other is "update jsps.
" Building the war compiles all the code, packages it, deploys it to Tomcat and restarts everything. Updating the jsps doesn't restart the server, it's just a straight copy from my local files to Tomcat's deployed instance.No restart necessary since they're JSPs. Takes about half a second.
Where you have many subdomains, say one for static files and one for dynamic, you have to write out the full path, surely?2) No way, Jose. So you mean any time the server name changes, you have to recompile your code? If you need to support dynamic URLs you might just want to bite the bullet and take a look at a framework to do the heavy lifting for you.
I'm partial to Stripes (which supports dynamic URL rewriting out-of-the-box)... there are others.
Sorry, I wasn't very explicit about the subdomain urls point. What I mean is that if you only have relative urls in your code like href=file. Html, then those work equally on dev and prod.
But if you have a file f. Html located at foo.com" rel="nofollow">foo.com, whose html references a file f2. Html located at STATIC.foo.com, eg href=STATIC.foo.com/f2.
Html , then you can make those urls still work OK in dev and prod by putting entries in your /etc/hosts file like so: 127.0.0.1 foo.com" rel="nofollow">foo.com STATIC.foo.com Now in dev, those urls all resolve to your local machine, which is what you want, WITHOUT changing code. – Jeremy May 13 '10 at 2:11 If you absolutely must specify the full URL, I think your current method is probably best. I would definitely take whaley's advice re:automating that part of the process.
– Matt Brock May 13 '10 at 2:34.
. Also, while I use an IDE (or two), I refuse to have one as part of my build process, EVER. Somebody needs to be able to understand and tune your build.
Disclaimer: I would break the "no IDE build" for a toy / throwaway project. But not for something released into a production work environment. – Roboprog May 19 '10 at 1:23.
Others have already answered you, I'll just comment on this (this too long for a comment btw so I make it an answer): Every time I want to change anything in development, like one line in an html file, I have to rebuild the entire project and then wait for tomcat to load the war before I can see if it's what I wanted. If you change one line in an html file, there's no need to rebuild the entire project. Note that I always rebuild the full .
War and redeploy my . War but this takes less than two seconds (less than one second to rezip the . War that's really what a .
War is, a zipped file and less than one second to redeploy it) because: you don't need to recompile your entire project when you simply change one line in an html file Same when you change one . Java file: you can simply recompile that one file and re-war. I wrote my own Ant build file from scratch (no Maven here) and I've got several targets.
I can force a "clean build", that shall re-compile everything but typically I'm simply repackaging and redeploying the . War You can check it for yourself: build a . War, unzip it in, say, directory dir1, then modify one .
Html (or one . Java/. Class file) and build a new .
War and unzip that new . War in, say, dir2. Then compare dir1 and dir2: now fix your build process so that you can create that second .
War without needing to recompile everything. Changing one . Html, .
Java, . Jsp, . Css, .
Js / whatever file and redeploying a new . War should be a matter of seconds (less than two seconds if you didn't throw the kitchen sink in your Webapp). Note that on the very same project, another developer here prefers to "hot deploy" / replace the files directly in the exploded webapp (I prefer to redeploy a .
War everytime and because my complete repackage/redeploy takes less than two seconds I'm fine with it that way).
Oops, forgot to precise: I've got a really fast Linux workstation with a sh! Tload of memory so things tend to be faster then on my co-worker systems (who're on OS X MacBook Pro, fine machines, but nowhere near as fast as my system) :) But still, everything should be a matter of a few seconds. Btw I've got a MBP too for when I'm on the run: this is not a cheap shot at Apple – SyntaxT3rr0r May 13 '10 at 6:00.
You don't need to reconstruct war file if your project is an Dynamic Web App in Eclipse and configured Tomcat server properly. Follow the below instructions: 1) Check out the below of how to configure tomcat server with eclipse: greatwebguy.com/programming/eclipse/make... 2) Use relative paths for your application but not absolute paths. 3) If you follow the above 2 steps properly then you have a best environment for development.
During development, you should configure eclipse and tomcat so that no rebuild/redeloy is required. Just modify html/css/jsp etc, save, and refresh browser to see the result. But before deploying to production site, you should do a clean full build and test it carefully.
Domains: they should be in a config file; dev and prod should have different config files.
For a "simple webapplication" this high level approach looks fine in general. However, if you want more critical feedback, you'd need to give more details about the low-level approach. It may for example happen that it isn't memory efficient and thus may break when the webapp is been used by over 10 users concurrently, just to give an example.
For a "simple webapplication" this high level approach looks fine in general. However, if you want more critical feedback, you'd need to give more details about the low-level approach. It may for example happen that it isn't memory efficient and thus may break when the webapp is been used by over 10 users concurrently, just to give an example.
I only question the choice for the GET method. You'd normally only use it to retrieve data (SELECT), not to create/alter data (INSERT/UPDATE/DELETE). For that you'd normally use POST, so that no one can execute it "accidently" by just clicking a (bookmarked) link.
Changing GET to POST isn't that hard, add method="post" to the element and rename doGet() to doPost().
Thank you for the GET to POST suggestion, I have changed my code to reflect the suggestion. – Mark R Mar 27 '10 at 23:55 You're welcome. – BalusC Mar 28 '10 at 0:15.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.