Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » included JSP shows error - can export to WAR
included JSP shows error - can export to WAR [message #161697] Wed, 22 February 2006 23:02 Go to next message
Philip Wilkinson is currently offline Philip WilkinsonFriend
Messages: 18
Registered: July 2009
Junior Member
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 errors - cant export to WAR [message #161703 is a reply to message #161697] Wed, 22 February 2006 23:05 Go to previous messageGo to next message
Philip Wilkinson is currently offline Philip WilkinsonFriend
Messages: 18
Registered: July 2009
Junior Member
Doh, that should be "Included JSP shows errors - can't export to WAR" why
don't I ever spot these silly mistakes before I post!
Re: included JSP shows error - can export to WAR [message #161741 is a reply to message #161697] Thu, 23 February 2006 15:14 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
Re: included JSP shows errors - cant export to WAR [message #161839 is a reply to message #161741] Thu, 23 February 2006 22:02 Go to previous messageGo to next message
Philip Wilkinson is currently offline Philip WilkinsonFriend
Messages: 18
Registered: July 2009
Junior Member
Cheers. I changed my included jsp file extension to .xjsp and that worked
- I can now export to a war.

However its a minor point but I do miss my jsp editing and syntax
colouring! I've tried associating the xml html and jsp editors with .xjsp
and all I get is a plain text editor (even though the icon changes). (BTW
I had to close the project and then re-open it to refresh the
associations, F5 didnt work)

Oh well I guess I'll get over it.
Thanks again.
Re: included JSP shows errors - cant export to WAR [message #161857 is a reply to message #161839] Fri, 24 February 2006 02:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: improbability.mindspring.com

Try adding "*.xjsp" to the file associations of JSP Fragment under
"General -> Content Types" in the preferences.

Philip Wilkinson wrote:
> Cheers. I changed my included jsp file extension to .xjsp and that
> worked - I can now export to a war.
>
> However its a minor point but I do miss my jsp editing and syntax
> colouring! I've tried associating the xml html and jsp editors with
> .xjsp and all I get is a plain text editor (even though the icon
> changes). (BTW I had to close the project and then re-open it to refresh
> the associations, F5 didnt work)
> Oh well I guess I'll get over it.
> Thanks again.
>
Re: included JSP shows errors - cant export to WAR [message #161911 is a reply to message #161857] Fri, 24 February 2006 13:41 Go to previous message
Philip Wilkinson is currently offline Philip WilkinsonFriend
Messages: 18
Registered: July 2009
Junior Member
Thanks Nathan that worked a treat.

I thought I did try that but I actually added the association at the JSP
level in the tree, not the JSP fragment. Opps. Cheers again.
Previous Topic:wtp-I200602240008 crashes in web service generation
Next Topic:php plugin
Goto Forum:
  


Current Time: Fri Apr 26 10:56:04 GMT 2024

Powered by FUDForum. Page generated in 0.02213 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top