Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

include directive

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to use jspc to precompile jsp pages using ant. I get error message if i use <%@ include file=""%> and it works just fine when I use <jsp:include page=""/>. Is there a way i can stil use <%@include%>
Thanx
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You may want to take a look at this tip, Hans's Top Ten JSP Tips - Choosing the right include mechanism, to understand the issue with your includes.

One includes at compile time, the other includes the response at runtime.

Not much more I can add without more details, like what error message you are getting. See TellTheDetails.

Please don't post the same question multiple times. This is more of a jsp question than a build question.
[ October 19, 2005: Message edited by: Carol Enderlin ]
 
raj pan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Carol for the response.Actually I got that part working but I am having a new problem.I am trying to precompile all the jsp's with this jspc.When I use ant and precompile it gives me a new package name even I defined a package name on jspc.
I have a folder name abc and sub folder a and sub folder b.When I run precompile.bat it gives me a package name as

for folder a
org.apache.jsp.abc.a
for folder b
org.apache.jsp.abc.b
Actually its creating a package name based on folder name. So is there a way I can get only org.apache.jsp and the .java's on the same folder they belong...

<project name="JSP Pages Precompilation" default="JSPprecompile" basedir=".">

<target name="jspc">

<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/lib/tools.jar"/>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${webapp.path}/WEB-INF/tld">
<include name="*.tld"/>
</fileset>
</classpath>
</taskdef>

<jasper2
validateXml="false"
uriroot="${webapp.path}"
package="org.apache.jsp"
webXmlFragment="${webapp.path}/WEB-INF/JSP_precompiled_web.xml"
outputDir="${tomcat.home}/work/Standalone/localhost/_" />

</target>
<target name="JSPprecompile" depends="jspc">
</target>

</project>
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is the exact correct behavior...

Your jsp after compiling does not belong to you any more!!!
 
raj pan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let say I have a folder name abc and under abc i have b,c folders.I am trying to compile jsp's from b and some of b's jsps include jsp's from c .So when I do precompilation it fails or I get 0kb. Is there a way that I can include folder c when precompiling b.Thankx
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic