• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Deploying w/ Ant to Weblogic

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, My question is simple, but the answer may not be.
I am using Ant to deploy to WL and things are generally working. Currently, for .jsp I am not compiling with Ant's jspc but let WL do the job upon request.
Q: Which one is better, Compiling by Ant's jspc or WL itself?
Thanks for any input in advance.
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can use Ant(build tools) to complie Servlets of EJB classes or use it to deploy/build you web app(war file).If you have deployed you web app,the weblogic app/web server can issue it.If you want the weblogic server complie the jsp file each time.you can use precompile on web server start.
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, James:
Thanks. I haven't really deployed anything yet using Ant. My question is that in general (doesn't have to be in WebLogic Env.), what's the advantage of compiling JSP's into servlets and then deploy the war file? To me, letting WL to compile either upon first request of newly changed JSP or do precompilation upon loading of WL is easier than using Jasper to do jspc in Ant. Plus, there maybe some differences between the jasper and WL's jspc.
So, unless there are obvious advantages, I wouldn't compile the JSP's by Ant.
Hope this clarify my previous question.
Regards,
 
James Hu
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh,please refer to the document of Ant,then you will find that using wljspc not jsps for weblogic server in Ant tasks.
--------
http://jakarta.apache.org/ant/manual/tasksoverview.html#compile
 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To precompile or not to precompile.... It depends on what you are doing.
When I am working on a small "experimental" webapp - just playing around with things, then I let the server do the compile because it is easier and more productive.
But on projects where there is a large webapp, I like to build it with the rest of the source code. That is what we have here, after all - source code.
The advantage to compiling at build time is you will find things that might be broken - if you let the server do it, then you have to browse to every single page before you find out if its good or not.
Compiling won't tell you if it actually works, but it is a first step.
For webapps that I am checking in to source control, I like to make sure it builds - so I use weblogic.jspc on these. So if I change an EJB, for example, I can rerun a clean build and make sure I didn't break some JSP that calls that EJB.
Ant does have tasks for doing weblogic jspc, but I usually use a <java classname="weblogic.jspc" ... /> task because I like to know exactly what options I am setting (where's the :controlfreak: graemlin?). Also I tend to be working one WebLogic version ahead of ant, so sometimes this stuff doesn't work for me. If the ant tasks do the job for you, use 'em.
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David:
Thanks. your points are clear and well taken. I'd go for the compilation by Ant since I use source control too.
A detail issue, since jsp will become serlvets, then I have to do the setting and mapping in web.xml. It is kinda of tedious, especially when you have a lot of jsp's with sub directories, i.e. you have to servlet-mapping to url to keep the business logic directores clear to yourself and others. Is there a quicker way to edit the web.xml. You know, I am a lazy person ;-)
Regards,
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't have to do anything. If you run jspc and put the output (-d) into WEB-INF/classes, then the server "knows".
There is a "default" mapping for any *.jsp - the server looks for a compiled class and uses it if it's there (and up to date vs. the real *.jsp file). If it does not find the class, or it is out of date, it will recompile it.
So even if you precompile jsps, you still have the option to edit the jsp files while the server is running and have them rebuilt.
The only time you need to do the servlet mappings is if you want to remove the *.jsp files from the webapp for some reason. I do this in some webapps where the source in the jsp is propretary, but I do not yet have a tool to make the mappings - I just do it by hand. I really should move the propretary source out into a tag or bean class, but that is another story....
 
Tony Yan
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
David:
Thanks very much for the advice. It is pretty clear now to me. Well, for the last part, if I do remove the .jsp for some reason, I will prolbaby re-run the ant and so the servlet will be also removed from WEB-INF/classes/...
Regards,
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic