included JSP shows error - can export to WAR [message #161697] |
Wed, 22 February 2006 18:02  |
Eclipse User |
|
|
|
Hi Im having problems exporting my dynamic web application to a war file.
My dynamic web application is showing errors because I have several common
jsp files that are included in the "main" jsp pages with
<%@ include file="header.jsp" %> etc. These "main" pages set up the beans
and imports as normal, however I get an error against the included jsp
file against references to the beans (or java objects in scriplets).
Obviously WTP thinks its an error, but it wont be when deployed.
BUT, I cant export to a WAR file because it says my Destination archive is
invalid, which I assume is because of these errors.
The obvious solution is to add
<%@ page ... import="..." %> and <jsp:useBean .. /> at the start of the
common include files. But I am reluctant to do this because
a) Its a bodge to get round the wtp parser
b) I'm unsure as to the effect of having multiple imports\useBeans in the
final composite jsp page.
Are my assumptions correct and is there anyway around this?
Thanks in advance.
|
|
|
|
Re: included JSP shows error - can export to WAR [message #161741 is a reply to message #161697] |
Thu, 23 February 2006 10:14   |
Eclipse User |
|
|
|
Originally posted by: improbability.mindspring.com
Static includes are lexically inserted into the parent page at compile
time and the whole thing is compiled as one big page. As you've
discovered, the fragments themselves generally cannot be compiled
outside of that context. It's a bit like taking a random section of a
method and trying to run it through javac.
The solution is to give your imported fragments an extension, such as
..jspf, that prevents the environment from trying to compile them by
themselves. They will still be compiled, but only when specifically
imported, and any compile errors will appear next to the import line in
the parent page.
Philip Wilkinson wrote:
> Hi Im having problems exporting my dynamic web application to a war file.
>
> My dynamic web application is showing errors because I have several
> common jsp files that are included in the "main" jsp pages with <%@
> include file="header.jsp" %> etc. These "main" pages set up the beans
> and imports as normal, however I get an error against the included jsp
> file against references to the beans (or java objects in scriplets).
> Obviously WTP thinks its an error, but it wont be when deployed.
>
> BUT, I cant export to a WAR file because it says my Destination archive
> is invalid, which I assume is because of these errors.
>
> The obvious solution is to add <%@ page ... import="..." %> and
> <jsp:useBean .. /> at the start of the common include files. But I am
> reluctant to do this because
> a) Its a bodge to get round the wtp parser
> b) I'm unsure as to the effect of having multiple imports\useBeans in
> the final composite jsp page.
>
> Are my assumptions correct and is there anyway around this?
> Thanks in advance.
>
>
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03968 seconds