Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

jsp compile using ant

Posted on 2010-09-16
8
Medium Priority
?
894 Views
Last Modified: 2013-11-10
I have this piece of code, which gives error as below



<jspc srcdir="${apps}/Stores.war"
      destdir="${apps2}/Stores.war"
      package="com.oracle.fast.*"
      compiler="jasper41"
      verbose="9"
      <include name="**/*.jsp" />
      <classpath refid="libs.classpath" />
</jspc>



BUILD FAILED
/opt/build/build.xml:20: Element type "jspc" must be followed by either attribute specifications, ">" or "/>".

not sure what is causing the issue
0
Comment
Question by:wasman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 9

Expert Comment

by:ioanton
ID: 33695012
I suppose you have to close the line

 verbose="9"

with a <
0
 
LVL 9

Expert Comment

by:ioanton
ID: 33695025
sorry, the required sign is > :)
0
 

Author Comment

by:wasman
ID: 33695404
That helped  and now i get this

$ ant jsp
Buildfile: build.xml

init:
     [echo] +---------------------------------------------------------+
     [echo] +               Project Initiation                        +
     [echo] +---------------------------------------------------------+

classpth:

jsp:
     [jspc] Compiling 1830 source files to /voice/front.war/
this task doesn't support Tomcat 5.x properly, please use the Tomcat provided jspc task instead
  [jasperc] Exception in thread "main" java.lang.NoClassDefFoundError: javax/servlet/ServletContext

BUILD FAILED
/opt/build/build.xml:18: Java returned: 1

Total time: 41 seconds
$

I am using ant jsp compiler (jasper) to compile jsp's which are deployed on WebSphere 6.0 server and it's using websphere JDK 1.4.2 and i downloaded and copied to ant installed lib directory (jasper-compiler-5.5.9.jar and jasper-runtime-5.5.23.jar)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 9

Expert Comment

by:ioanton
ID: 33695610
Here is one thing (from Ant manual) to consider before trying to go on:

jspc (deprecated)
Deprecated if you use this task with Tomcat's Jasper JSP compiler, you should seriously consider using the task shipping with Tomcat instead. This task is only tested against Tomcat 4.x. There are known problems with Tomcat 5.x that won't get fixed in Ant, please use Tomcat's jspc task instead.
Instead of relying on container specific JSP-compilers we suggest deploying the raw files (*.jsp) and use the container build-in functions: after deploying run a test suite (e.g. with Cactus or HttpUnit) against the deployed web application. So you'll get the test result and the compiled JSPs.
0
 

Author Comment

by:wasman
ID: 33695899
i didn't got your suggestion,

you mean to say don't use ant jspc compiler ?

0
 

Author Comment

by:wasman
ID: 33696029
ok....tell me what is the Best way to pre-compile the JSP's which are deployed on my WebSphere application server 6.0, we have build-in container jsp batch compiler, but it takes lot of time and i see ant does more quicker then mine.

0
 
LVL 9

Accepted Solution

by:
ioanton earned 2000 total points
ID: 33699382
As the Ant manual suggests, I would deploy the raw jsp files and then run a HttpUnit test which makes the jsp container to compile the files.
0
 

Author Closing Comment

by:wasman
ID: 33745385
no use
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question