• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to Compile JSP?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wanna see how one method is working in a JSP, but how to compile it? In Tomcat there is working directory, so can view compiled JSPs, but the Project is Java Enterprise, so need to run in Glassfish. But where to find JPSs and generated responses in Glassfish?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This seems relevant: http://closingbraces.net/2008/07/21/jspc-switching-from-tomcat-to-glassfish/
 
Vesko Jel
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes the post is relevant,but i'm still digging for tricky solution, maybe some Glassfish settings(that saves to disk the cached response).
Thanks a lot for this hint!
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Possibly more relevant: http://blogs.sun.com/foo/entry/i_want_to_see_my

Apparently the JSP-processing servlet defined in the Glassfish domain's config/default-web.xml supports an optional <init-param> named keep-generated that you need to set to "true". The source code should then get written into the domain's /generated/jsp directory structure (under the relevant app's subdirectory).

The default-web.xml has comments explaining all the JSP-processing servlet's init-param options, including a saveBytecode option for keeping the resulting class files as well (though it says that depends on JDK 6).

The blog article referenced above says that you also need to specify precompilation of the JSPs when deploying the app, but I'd be tempted to try it "normally" first (might be something the author needed but doesn't apply to your situation; or might depend on which version of Glassfish; or which of the various deployment mechanisms you use etc).
 
Vesko Jel
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was pretty comprehensive response. Thanks a lot. I've always thought that there is such "workarounds" in situation like this, but probably my googling is not the best.
 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic