0

I am working on a small JSP project...and I want to add a configuration that is mentioned here : https://openliberty.io/docs/latest/reference/config/jspEngine.html Specifically, i want to add keepGenerated ="true"

2 questions:

  1. Is the location of this config corect? I just placed it inside the server element (not clear to me from the link from above if the location is good)

     <server description="My Project">
    
         <featureManager>
             <feature>servlet-5.0</feature>
             <!-- needed to run JSP examples -->
             <feature>pages-3.0</feature>
         </featureManager>
    
         <jspEngine keepGenerated ="true"/>
         ....
     </server>
    
  2. Where will the java files corresponding to the JSP files be generated? I want to see the java code that is generated...

By adding the property from question 1, I was unable to find the java files generated for the JSP file....I tried to run also a search but no use..I assume that the configuration might not be correct..

Thx!

Teshte
  • 624
  • 1
  • 7
  • 26
  • 1
    1. Yes, this is correct, the child elements of `` generally don't need to be ordered. 2. The path here is dynamically calculated based on the runtime bundle and app name. I would just use a `find` command to find them. For me in a quick test of one of our sample apps with a JSP I see a location of `target/liberty/wlp/usr/servers/defaultServer/workarea/org.eclipse.osgi/74/data/temp/default_node/SMF_WebContainer/guide-maven-multimodules-ear/guide-maven-multimodules-war-1.0-SNAPSHOT/_heights.java`. NOTE: the .java files get generated lazily so you might need to invoke the app first – Scott Kurz Dec 19 '22 at 15:01
  • Mostly duplicate of: https://stackoverflow.com/questions/68966343/location-of-compiled-jsp-in-open-liberty – Scott Kurz Dec 19 '22 at 15:02
  • Looks like you can `scratchdir` param might help - "When this attribute is set, the JSPs are compiled to the specified directory instead of the server workarea directory." – Gas Dec 20 '22 at 17:37

0 Answers0