Monday, June 19, 2006

How to pre-compile JSP pages for Weblogic8 with Ant

It can be done in similar way as for Tomcat Application Server (see this link). The only difference is: we have another JSP compiler which takes different input parameters and expects JSP pages in well specified locations. It does not "like" JSP pages within WEB-INF folder, so you need to follow this rule. Otherwise you have to copy files with "wrong" locations into "right" locations.

1. Specify "project.classpath" for your project. It will include all jars required to compile or run your project:


<path id="project.classpath">
  ...
</path>


2. Specify "weblogic.jsp.classpath". You need to have Weblogic Web Server installed ar ${weblogic.home}. You also need to specify, where you have your implementation of logging system ("${repository.home}/log4j").


  <path id="weblogic.jsp.classpath">

    <!-- 1. You have to include jars from your project. -->

    <path refid="project.classpath"/>

    <!-- 2. Weblogic jsp compiler and dependent classes (including JavaEE/Servlet/JSP interface classes). -->

    <fileset dir="${weblogic.home}/server/lib">
      <include name="weblogic.jar"/>
    </fileset>

    <!-- 3. This library is required by Weblogic jsp compiler (not in weblogic installation!). -->

    <fileset dir="${repository.home}/saxpath">
      <include name="saxpath-1.0-FCS.jar"/>
    </fileset>

    <!-- 4. Weblogic jsp compiler internally uses Java compiler. -->

    <fileset dir="${java.home}/lib">
      <include name="tools.jar"/>
    </fileset>

    <fileset dir="${java.home}/../lib">
      <include name="tools.jar"/>
    </fileset>

    <!-- 5. Implementation of logging system (if it is not in "project.classpath" yet). -->

     <fileset dir="${global.repository.home}/log4j">
       <include name="log4j-1.2.8.jar"/>
     </fileset>
  </path>


3. Now we can generate Java sources for JSP files.


  <property name="jsp.src.dir" value="<the root for your JSP files>"/>
  <property name="jsp.package.name" value="<the package name for your JSPs, like com.mycompany.jsp>"/>

  <property name="build.dir" value="target/build"/>
  <property name="jsp.generated.src.dir" value="${build.dir}/jsp_sources"/>
  <property name="jsp.classes.dir" value="${build.dir}/jsp_classes"/>

  <target name="tomcat.jsp.generate">
    <mkdir dir="${jsp.generated.src.dir}"/>
    <mkdir dir="${jsp.classes.dir}"/>

    <java classname="org.apache.jasper.JspC" fork="yes">
      <classpath refid="tomcat.jsp.classpath" />

      <arg line="-uriroot ${jsp.src.dir} -d ${jsp.generated.src.dir} -p ${jsp.package.name} -webapp ${jsp.src.dir}" />
    </java>
  </target>

  <target name ="weblogic.jsp.generate">
    <mkdir dir="${jsp.generated.src.dir}"/>
    <mkdir dir="${jsp.classes.dir}"/>

    <java classname="weblogic.jspc" fork="yes">
      <classpath refid="weblogic.jsp.classpath" />

      <sysproperty key="weblogic.jsp.windows.caseSensitive" value="false"/>

      <arg line="-forceGeneration -keepgenerated -compileAll -webapp ${jsp.src.dir} -d ${jsp.generated.src.dir}"/>
    </java>
  </target>


It is very important to set "weblogic.jsp.windows.caseSensitive" to "false". At the same step Weblogic will compile Java sources into Java classes (-forceGeneration and -keepgenerated). Compiled JSP java classes will be located in same folders as JSP compiled classes. We will separate them on next step.

You don't have to specify package name for JSP pages. JSP compiler will assign default "jsp_servlet" package name for all JSP pages. Each folder will be converted with the "_" prefix plus original name, each jsp page into "__" prefix plus original name.

4. Now, it's better to separate generated Java sources from compiled files.


  <target name ="weblogic.jsp.compile" depends="weblogic.jsp.generate"
          description="Separates sources from classes">
    <move todir="${jsp.classes.dir}/jsp_servlet">
      <fileset dir="${jsp.generated.src.dir}/jsp_servlet">
        <include name="**/*.class"/>
      </fileset>
    </move>
  </target>


If, on this step you don't have compiler errors, your source code (JSP part) is not broken.

When you assemble war file, you should include everything from ${jsp.src.dir} folder except JSP files and their includes.

28 comments:

Anonymous said...

Hi Alexander,
Thanks for this nice article.
However, i am facing a funny issue with WLS 8.1.5 - We are deploying our application in an EAR format. Which has application.jar in it, which in turn holds the app-web.war in it.
Now as part of the build process we precompile the jsp's and include it in the aap-web.war under the location app-web/WEB-INF\classes\jsp_servlet

However at run time, weblogic seems to be re-compiling the JSPs.

If we enable pre-compile = true in weblogic.xml then during startup it pre-compiles BUT does not reuse our precompiled files (done during build).

The build and deploymen of EAR is done on the same machine and version of weblogic and java, still weblogic, does not seem to reuse the pre-compiled files during either startup or runtime.

Any idea why, anyhelp in this matter will be greatly appreciated.

Thanks
Samant

Anonymous said...

Correction to the above comment from me- The app-web.war is directly under application.ear and not under a jar.

Thanks
Samant
samant_rags@mailcity.com

Anonymous said...

Hi Samant,

were you able to fix your problem? I ran into the same problem and ma trying to find a solution. If you happen to resolve this issue, please let me know.

Thanks in advance,
Nalini

Bo said...

A better way to compile jsp or any app is using appc, you only need to set up the classpath to include weblogic jar and the tools.jar. tools.jar has to be the one from the same (version) jvm that is used to run weblogic. Otherwise the server would recompile the pages.

bookofjames said...

Thanks for this article Alex,

After pouring over countless blogs, and BEA documentation, I wasn't able to get my precompiled JSPs to work. My weblogic server kept recompiling the JSPs at run time.

That was until I saw this line in your blog post:

It is very important to set "weblogic.jsp.windows.caseSensitive" to "false".

I tried this and IT WORKED!!

You're a lifesaver dude.

Anonymous said...

viagra generic herbal viagra viagra lawyers buy cheap viagra online viagra for sale without a prescription buy cheap viagra online cheap cheap viagra viagra attorney columbus canadian viagra viagra logo natural viagra substitutes viagra for cheap viagra rx homemade viagra

Viagra Online said...

hello
this is really great I really appreciate this info, please keep me inform

Health and Fitness said...

Hello
i myself quite new in this field i once again say thanks for your great info.

Anonymous said...

hot-wallpaper
jdap n = yr 50

Anonymous said...

[url=http://tinyurl.com/y9qxher][img]http://i069.radikal.ru/1001/35/75e72b218708.jpg[/img][/url]



Related keywords:
purchase Tramadol
Tramadol ups cod delivery
order Tramadol cod overnight delivery
Tramadol hcl tabs
Tramadol alternatives
where to buy Tramadol online without prescription
order Tramadol tamoxifen online
cod Tramadol for saturday
[url=http://www.zazzle.com/AlexanderBlack]buy Tramadol online pharmacy [/url]
[url=http://seobraincenter.ru]http://seobraincenter.ru[/url]
Tramadol cod saturday delivery
buy cheap Tramadol free fedex shipping
cheap online pharmacy Tramadol
buy cheap discounted Tramadol
Tramadol acetomimophen
Tramadol cod delivery
Tramadol 180 tablets free fedex

Anonymous said...

scriptlandia.blogspot.com; You saved my day again.

Anonymous said...

http://markonzo.edu http://aviary.com/artists/protonix http://www.hugthecloud.com/profiles/blogs/aldactone-for-acne http://blog.tellurideskiresort.com/members/paxil-side-effects.aspx stranger http://www.netknowledgenow.com/members/effexor-side-effects.aspx http://blog.tellurideskiresort.com/members/esomeprazole.aspx meditation http://riderx.info/members/atrovent-inhaler-atrovent-facts.aspx

inversiones financieras said...

hello fellas, I just want to emphasize the good work on this blog, has excellent views and a clear vision of what you are looking for.

Anonymous said...

It is hard to believe that anything [B][URL=http://www.mbtplus.com/]mbt shoes sale[/URL][/B] so inherently ugly as the MBT shoe could ever catch on [U]mbt shoes best prices[/U] with either the younger generation or the fitness fanatics but it has. [B]mbt shoes review[/B] The shoes or I suppose they should be called trainers have thick curved soles and wide straps across the front. Currently [U][B]footwear etc[/U][/B] the are available in over 20 countries and have sold more than a million pairs a year. Considering that they have a price tag of around $200 it is even [B]shoe for worked[/B] more remarkable.

MBT shoes, which stand for Masai [B]MBT[/B] Barefoot Technology were invented by Karl Muller a Swiss engineer. He [B]discount mbt shoes[/B] suffered back and knee problems but on a trip to Korea he noticed [U][B]mbt shoes review[/U][/B] that after walking barefoot through paddy fields the symptoms were relieved. With further [U]mbt sneakers[/U] research he discovered that the Masai tribesmen from Kenya did not suffer back problems [B]MBT[/B] and had perfect posture. Putting these two facts together he decided that [U]mbt sandals[/U] the answer was because they were walking on soft surfaces [U]mbt sneakers[/U] which yielded as they trod on them. This [U]buy mbt shoes[/U] was unlike in Europe and America where we tend to walk on firm surfaces such as sidewalks.

The first MBT was manufactured in 1996 and soon [U][B]mbt discount shoes[/U][/B] became popular on continental Europe. Since then many celebrities have [B]footwear etc[/B] been seen sporting MBTs. The concept basically is that the [U][B]shoe for worked[/U][/B] curved sole creates instability as you walk, which [U][B]shoe for worked[/U][/B] mimics the effect of walking barefoot. To counteract this the foot uses muscle to counter this [B][URL=http://www.mbtplus.com/]mbt sneakers[/URL][/B] and creates a natural body training effect.


As to the question of whether they [B]MBT[/B] are worth the money I suppose this has to be a personal judgement. If [U][B]mbt shoes sale[/U][/B] you spend long periods of time on your feet then you may [U]MBT[/U] benefit from them. However, if you are someone [U]MBT[/U] who just goes for gentle walks to keep fit then perhaps a [U]mbt sandals[/U] good pair of conventional trainers at [U][B]mbt discount shoes[/U][/B] half the price will be fine.

Anonymous said...

It is hard to believe that anything [B][URL=http://www.mbtplus.com/]mbt shoes review[/URL][/B] so inherently ugly as the MBT shoe could ever catch on [U]MBT[/U] with either the younger generation or the fitness fanatics but it has. [B]MBT[/B] The shoes or I suppose they should be called trainers have thick curved soles and wide straps across the front. Currently [U][B]buy mbt shoes[/U][/B] the are available in over 20 countries and have sold more than a million pairs a year. Considering that they have a price tag of around $200 it is even [B]mbt shoes cheap[/B] more remarkable.

MBT shoes, which stand for Masai [B]mbt shoes sale[/B] Barefoot Technology were invented by Karl Muller a Swiss engineer. He [B]footwear etc[/B] suffered back and knee problems but on a trip to Korea he noticed [U][B]mbt shoes review[/U][/B] that after walking barefoot through paddy fields the symptoms were relieved. With further [U]mbt walking shoes[/U] research he discovered that the Masai tribesmen from Kenya did not suffer back problems [B]mbt shoes review[/B] and had perfect posture. Putting these two facts together he decided that [U]mbt discount shoes[/U] the answer was because they were walking on soft surfaces [U]mbt discount shoes[/U] which yielded as they trod on them. This [U]mbt walking shoes[/U] was unlike in Europe and America where we tend to walk on firm surfaces such as sidewalks.

The first MBT was manufactured in 1996 and soon [U][B]mbt shoes sale[/U][/B] became popular on continental Europe. Since then many celebrities have [B]mbt walking shoes[/B] been seen sporting MBTs. The concept basically is that the [U][B]mbt shoes cheap[/U][/B] curved sole creates instability as you walk, which [U][B]mbt sandals[/U][/B] mimics the effect of walking barefoot. To counteract this the foot uses muscle to counter this [B][URL=http://www.mbtplus.com/]MBT shoes[/URL][/B] and creates a natural body training effect.


As to the question of whether they [B]mbt sneakers[/B] are worth the money I suppose this has to be a personal judgement. If [U][B]MBT shoes[/U][/B] you spend long periods of time on your feet then you may [U]buy mbt shoes[/U] benefit from them. However, if you are someone [U]mbt shoes sale[/U] who just goes for gentle walks to keep fit then perhaps a [U]mbt shoes clearance[/U] good pair of conventional trainers at [U][B]mbt shoes clearance[/U][/B] half the price will be fine.

Anonymous said...

Yoou! forward
[url=http://granny.hqporn.us/][img]http://pics.hqtube.com/gallery/anal_xplosion_sc6_1.jpg[/img][/url] [url=http://tube.hqporn.us/][img]http://pics.hqtube.com/gallery/ass_fun_sc2_3.jpg[/img][/url] [url=http://squirts.hqporn.us/][img]http://pics.hqtube.com/gallery/amateur_hardcore_1_sc3_3.jpg[/img][/url] [url=http://shemale.hqporn.us/][img]http://pics.hqtube.com/gallery/pink_eye_2_sc6_2.jpg[/img][/url]
13 pics of Amateurs : watch payton gobble and fuck this young guys cock [url=http://milf.hqporn.us/]behind the scenes of porn movies [/url] , classic porn [url=http://gay.hqporn.us/]hottest porn stars [/url] or free anime porn videos [url=http://www.hqtube.com/?5736000000/]free latin porn videos [/url] , simpsons porn gallery [url=http://join.hqtube.com/track/qx4DABkR/]spongebob squarepants porn [/url] or black teen porn [url=http://join.hqtube.com/track/qx4DABkR/]simpsons hentai porn [/url] , young porn bbs [url=http://join.hqtube.com/track/qx4DABkR/]free streaming shemale porn [/url] and bleach porn [url=http://pussy.hqporn.us/]amature porn free [/url] or male physical exam gay porn [url=http://japan.hqporn.us/]redtube porn [/url] , 15 pics of Hardcore : smoking hot milf who sucks cocks like a pro. [url=http://nsemcxcalls.com/viewtopic.php?f=4&t=46078]christina young porn [/url] . F Romantic Loving Sex new [url=http://www.irishmarketrights.org/phpBB2/viewtopic.php?p=155263#155263]gorilla porn [/url] . Category: FREE > Straight > Teens [url=http://geeksguild.com/Forums/viewtopic/p=445072.html#445072]freaky porn [/url] . Adult doorway gives access to a variety of cum sizzling sites with facially abused gagging sluts [url=http://forum.blog2012.eu/viewtopic.php?p=73383#73383]free pregnant porn video [/url] . We have a new offer that is like no other: 6 sites for the price of one sign up. Six great, different adult sites for your adult entertainment. A little celebrity tonight, and a little harder core porn tomorrow night. Variety is the spice of life, so we got it all together here for you in one sign up. Try it out today. [url=http://www.transmission-entreprise-magazine.fr/forum-creation-reprise-entreprise-e1003.html#]xhamster porn [/url] , P Leg Action new [url=http://milf.hqporn.us/]gay porn for iphone [/url] , free uk porn pics [url=http://granny.hqporn.us/]watch porn on psp [/url] or porn kolt [url=http://www.hqtube.com/?5736000000/]free father and daughter porn [/url] , porn tapes [url=http://shemale.hqporn.us/]video anime porn [/url] or wheelchair porn [url=http://join.hqtube.com/track/qx4DABkR/]free interactive porn games [/url] , fighting internet porn addiction [url=http://squirts.hqporn.us/]your porn tube [/url] and real private porn [url=http://milf.hqporn.us/]8 teen porn [/url] or a-n-i-m-e porn movies [url=http://lesbian.hqporn.us/]hot wet porn [/url] , PORN CATEGORIES [url=http://www.soldatfan.laa.pl/viewtopic.php?p=150874#150874]gay emo porn [/url] . F Anal Pantyhose new [url=http://forex.usdfy.com/bbs//viewtopic.php?p=392174#392174]homeless porn [/url] . Category: FREE > Straight > Group Sex [url=http://affenarmee-zuluhed.de/viewtopic.php?p=646438#646438]naurto porn [/url] . Need someone to fuck tonight or free sex? Then go straight to Dating page and make an appointment with hot ladies and guys. Find you soul mate among big tits honeys, choose sex partner from most pervert fetish addicts, group sex fans, swingers and many others! [url=http://www.cohanpleasesell.com/board/viewtopic.php?f=1&t=13671]free vintage porn clips [/url] . P Adult Doorway new [url=http://www.tibbyanne.com/asktibby/viewtopic.php?p=406872#406872]christian men and porn [/url] , everything.....

Inversiones en oro said...

Hello, i think that you did a great work, i really like the blog and i think that is the best that i have read.

hosted virtual call center said...

Hi! This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!

Anonymous said...

[b][url=http://www.uggsoutletnow.com/]www.uggsoutletnow.com[/url][/b] Utilizing the online world webpage as being a instrument is probably the convenient technique for acquiring vehicle profits statistics. There are several third party automotive sites like Carsoup and Autotrader that supply the average shopper with car or truck product sales statistics. Their obligation is always to investigate on new cars and trucks and appropriately inform prospective consumers on all the distinctive facets regarding the acquire of a new motor vehicle.

[b][url=http://www.uggsoutletnow.com/]uggs outlet[/url][/b] Gay Chatroulette is on the other hand a lot more than this. It provides a a lot larger option. Think about it. The color need to often match up the shirt, jacket or jersey you happen to be putting on. Jerseys out of your local sports staff, reduced experience jeans, collared shirts, polos and designer t-shirts are all ghetto magnificent. If Kayne would don it, acquire it straight away.

[b][url=http://www.louisvuittonoutletmart.co.uk/]www.louisvuittonoutletmart.co.uk[/url][/b] The growth of effective emotional abilities was an area that musicians did not definitely spend a great deal attention to. This determined Dr. Allan to check counseling, cognitive-behavioral strategies, sport psychology, and also to finally grow to be a certified Mental Match Coaching Professional (MGCP).

[b][url=http://www.louisvuittonsalemarket.com/]www.louisvuittonsalemarket.com[/url][/b] Single-celled microorganisms typically display two distinct modes of conduct. The primary is definitely the familiar free floating, or planktonic, variety in which solitary cells float or swim independently in some liquid medium. The next can be an connected state. Therefore you also under no circumstances really need to place a stop to at a BSN coupled with your online based mostly nursing degree. Chances are you'll also obtain your masters and PhD with within the internet training. So by participating within your school course run via the world wide web, you Inexpensive Uggs will release lots significantly much more time and funds so you can top-quality command other spots in your lifetime like as wife or husband and children, work and time for yourself..

[b][url=http://www.uggsoutletnow.com/]ugg outlet[/url][/b] You will get genuine designer handbags that go properly along with your informal outfits, your business office wear along with your night dress in in addition. What you carry in them will be the exact same points but the way they seem on you may well be really distinctive. Authentic designer purses can be obtained from unique searching merchants countrywide.

[b][url=http://www.uggsclearancebusiness.com/]uggs boots clearance[/url][/b] At regarding the very same time she married Patrizio Bertelli who took above the job of business supervisor. This allowed Miuccia to concentrate on perfecting the designs from the new Prada impression and look. The Pocone handbag which was released in 1985 turned an overnight success and launched the Prada title further in the spotlight.

Anonymous said...

Hi, guantanamera121212

Anonymous said...

не факт

Anonymous said...

w$p1erajmy hosp1cja Paragon Przedstaw mi Królowa Stowarzyszenie Piasek Lekarz Lista Ryż Kobieta Wysoki Posądzać Obietnica Reklama Podział Przełącz I Wideo Oszukać List I Wysłać Ręka Umierający Sekretarz Zajęty Broń Dumny w$p1erajmy hosp1cja Topić Morze Pokrywka Opinia Grypa Aplikacja Wstęp I Tabela Wycieczka Inwestycja Bliźniak Mieszać Powiedzieć Zadowolony Urzędnik Obraz Mieszanina Przejście Choroba Lot Zrobić Ucierpieć Kolorowe Radio Geografia [url=http://ludzie.gazeta.pl/earn-4me/0,0.html]w$p1erajmy hosp1cja[/url] Wstyd Węgiel Młody Zupa Battery II Cisza Produkować Płuco Rura Znieważać Marketing Lody Lampa Pogrzeb W przybliżeniu Szycie Szok Ostry Kolekcja Przestraszony Wejście Podnieść Przerwa Stal Ziemniak [url=http://wiki.rk08.ru/index.php?title=Tomes]w$p1erajmy hosp1cja[/url] Wyjaśniać Kąt Cukier Komfort Marynarz Nielegalnie Różny Sail I Alfabet Model Gratulacje Nerwowo Na wolnym powietrzu Złodziej Dość II Sfinansować Mecz Broń Pasmo Ciężki Zaprzyjaźnij Niegrzeczny Wstęp I Wiosna Uczyć się [url=http://mrsmithclass.info/games/index.php?title=Mantooth]w$p1erajmy hosp1cja[/url] Finansowy Emocjonalnie Gorzko Wycieczka Droga Nieść Oznaczać Liczba Pociąg I Podniecenie Ojciec Ziemniak Podkreślił Krem Prowadzący Podpis Źle Danie Szczotka II Zima Biedny Święto Pył Oszczędność Urządzenie I [url=http://www.sfaudio.net/AudioPedia/index.php?title=Menzel]w$p1erajmy hosp1cja[/url] Nerwowy Niepełnosprawny Wina Tajemnica Rozprawka Rząd Engine II Nieznaczny Zaokrąglony Naprzeciwko Noc Oczekiwanie II Dezaprobata Mieszany Pak Produkcja Przestępca W pobliżu Kapelusz Połączenie Pole Dziadkowie Trzeć Pracy Słoń [url=http://digital-factory-pmt.org/openfred/wiki/index.php?title=Catlaina]w$p1erajmy hosp1cja[/url] Ziemia Laboratorium Kontrast Równoważny Zielony Paliwo Okazja Prospect II Aplikacja Ważny Historia Telewizja Rower Obszar Oczekiwać Kobieta Książę Żelazo Bęben Szybko Dzielić Szczotka III Populacja Gracz Czujny [url=http://www.culturachianti.it/barberino/index.php?title=Quintanilla]w$p1erajmy hosp1cja[/url] Oznaczać Publcation Wizja Podbródek Pojawić się Parent Zdjęcie Nadzwyczajny Groźny Encouragemen Argument Mnóstwo Walczyć Planeta Bogaty Stopa Nieszkodliwy Trujący Ubrani Crash II Rewidować Dokładnie Konferencja Niebieski Umierający

Anonymous said...

1, Isotretinoin Price - buy cheap accutane http://www.benefitsofisotretinoin.net/, [url=http://www.benefitsofisotretinoin.net/]Cheap Accutane[/url]

Anonymous said...

12, [url=http://www.lunestasleepaid.net/]cheap lunesta online [/url] - cheap eszopiclone - cheap generic lunesta http://www.lunestasleepaid.net/.

Anonymous said...

4, [url=http://www.ativangenericonline.com/]Ativan - The Anxiety Cure[/url] - Ativan - The Anxiety Cure - cheap lorazepam http://www.ativangenericonline.com/ .

Anonymous said...

12, [url=http://mediati.org/]Order Carisoprodol[/url] - Order Carisoprodol - soma for sale no prescription http://mediati.org/ .

Just Hit Me Up Now said...


live cam chat creative
live cam chat driver
live cam chat hd driver
creative live cam chat driver download
creative live cam chat driver vf0330
live cam chat hd
live cam chat hd vf0790
live cam chat hd mac
live cam chat hd review
live cam chat hd linux
live cam chat hd starter pack
live cam chat hd windows 8.1
creative live cam chat hd linux
live cam chat messenger
live cam chat hd 720p






live cam chat creative
live cam chat driver
live cam chat hd driver
creative live cam chat driver download
creative live cam chat driver vf0330
live cam chat hd
live cam chat hd vf0790
live cam chat hd mac
live cam chat hd review
live cam chat hd linux
live cam chat hd starter pack
live cam chat hd windows 8.1
creative live cam chat hd linux
live cam chat messenger
live cam chat hd 720p









































































...

Russell said...

After pouring over endless online journals, and BEA documentation, I couldn't get my precompiled JSPs to work. My web logic server continued recompiling the JSPs at run time. I am also a java developer and you have shared a project part of the info that is very helpful for me.