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

JSP Compilation

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic