*
The moose likes JSP and the fly likes JSP Compilation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP Compilation" Watch "JSP Compilation" New topic
Author

JSP Compilation

Praveen Dharmavaram
Ranch Hand

Joined: Nov 05, 2002
Posts: 59
I have a lot of JSP's which include other JSP's. I am trying to use the JSP compiler which comes with WebSphere 5.0. The JSP's wont compile and generate errors. When I dont compile and just have the servlet compile them at runtime, they compile without errors. Can Some one help me?


For Ex:-

test.jsp
--------
<html>
<%
String abc = "abc"
%>

<%@ include file="test1.jsp" %>

</html>

test1.jsp
---------
<P> This is a test <%out.print(abc);%></P>
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

Praveen,
WSAD tries to look for compiler errors in the JSP as if it were standalone. At runtime, it uses the includes which results in a full pages.

A few ways around this:
1) Use the .jspf (jsp fragment) extension for the JSPs that go within a page. [I haven't tried this, but is should work]
2) Pass the variables are parameters or request scope attributes to avoid the compilation issue completely.
3) Turn off JSP validation. JSPs often flag errors falsely. You need to determine if there is extra value in having these things flagged or if you can just catch them when running the JSP.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Compilation
 
Similar Threads
How to escape % in JSP
designing error pages
help needed
Verifing User Input
jsp forward