Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

weblogic JSP precompile

 
nico soum
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does anyone know how I can tell weblogic that I would like it to precompile my JSPs? Currently, users seem to take the hit of JSP compilation when a new version of the project is released. I am looking for a way to avoid this. I have found some material telling me to set this in web.xml but it seems that the project I am working on does not use such a file. I am new to weblogic and don't know what the options are for me.
Thanks,
Nico
 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the WebLogic JSP compiler. The syntax is:
DOS>java weblogic.jspc -options filename
see http://edocs.bea.com/wls/docs60/jsp/reference.html
for details.
 
Tim Chen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what version of WebLogic you are using.
You can set it up in weblogic.xml for webLogic 6.0
<JSP-DESCRIPTOR>
<JSP-PARAM>precompile</JSP-PARAM>
<JSP-VALUE>TRUE</JSP-VALUE>
</JSP-DESCRIPTOR>
(WARNING: I got this from a Bea training class but I CANNOT find it documented on their e-docs. In fact the list of possible JSP-PARAM values does not even include the precompile option!!)
Or set up:
<context-param>
<param-name>weblogic.jsp.precompile</param-name>
<param-value>true</param-value>
</context-param>
In ur web.xml for that application.
If your project only has jsps.. u should still have those files but they might be empty.. if not.. just create them in the WEB-INF directory or ur project.
For more info look at: http://e-docs.bea.com/wls/docs60///////jsp/reference.html#57794
-Tim
Originally posted by nico soum:
does anyone know how I can tell weblogic that I would like it to precompile my JSPs? Currently, users seem to take the hit of JSP compilation when a new version of the project is released. I am looking for a way to avoid this. I have found some material telling me to set this in web.xml but it seems that the project I am working on does not use such a file. I am new to weblogic and don't know what the options are for me.
Thanks,
Nico

 
Harish SK
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It never worked for me(never got the classes generated on startup), I use weblogic 6.1 SP4.
I have set the context-param described in BEA documentaion for 6.0.
 
Aaron Mulder
Author
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't say that I've tried this myself in 6.1SP4, but the parameter described by Tim Chen is certainly present for version 6.1. It's in the jsp-descriptor element of the weblogic.xml deployment descriptor (which goes in the WEB-INF/ directory of your web app next to the standard J2EE web.xml DD). This should result in the JSPs being compiled when the web app is deployed.
Also, you should be able to precompile the JSPs before you deploy the app in WebLogic using the tool described by JiaPei Jen.
Either approach seems reasonable to me, but if you do it outside WebLogic then you can deploy the same precompiled app to multiple servers without having each server recompile the JSPs separately.
 
Mary White
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will go with Tim's solution, I was having the same problem and adding the weblogic.xml in my web-inf folder (at the same level of web.xml) worked.
 
Mary White
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can see my thread at http://www.coderanch.com/t/66148/BEA-Weblogic/Precompile-JSP-Weblogic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic