You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Maxx <ma...@gmail.com> on 2008/01/14 12:17:10 UTC

JSP syntax errors through icnlude

Hello!

Before issuing a bug report on Struts' bug tracker, I'd like to have
your advices about a rather stranger syntax error I'm getting with
Eclipse (v.3.3/Europa) and JSP using Struts2 tags.

Here's own I can reproduce it:

Create the project: New Project > Other... > Web > Dynamic Web Project
 => Project Name: Struts2Test
 => Other settings: use default

Add Struts2 needed librairies (e.g. struts2-core-j4-2.0.11.jar &
xwork-j4-2.0.4.jar ) to your
WebContent\WEB-INF\lib folder

Now creating the test *.jsp(f) files under WebContent:

/pages/action/index.jsp: (please respect the folders!!)
-------------------
<%@page language="java" contentType="text/html; charset=ISO-8859-1"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<%@include file="/pages/include/include.jspf"%>
-------------------

/pages/include/include.jspf: (folders too!)
-------------------
<%@taglib prefix="s" uri="/struts-tags"%>

<%-- Affichage des éventuels messages d'information ou d'erreur --%>
<s:if test="actionMessages != null && actionMessages.size > 0 ||
actionErrors != null && actionErrors.size > 0">
<div class="content">
<s:if test="actionMessages != null && actionMessages.size > 0">
	<div id="actionMessages" class="actionMessages">
		<s:actionmessage cssClass="actionMessage" theme="fix" />
	</div>
</s:if>
<s:if test="actionErrors != null && actionErrors.size > 0">
	<div id="errorMessages" class="errorMessages">
		<s:actionerror cssClass="errorMessage" theme="fix" />
	</div>
</s:if>
</div>
</s:if>
-------------------

Now clean & build your project:
you'll get two Syntax ERRORs on the <%@include...%> JSPF row in the index.jsp:

Multiple annotations found at this line:
	- Syntax error on token "catch", Identifier expected
	- Syntax error on token "}", delete this token

I first thought it could be due to the <s:actionmessage> &
<s:actionerror> tags not handling properly exceptions.
But as there's seem to have no syntax error when putting both files
(JSP & JSPF) in the same folder, I'm getting dubious.

This code works, these pages work (I compiled & used them on Tomcat
4.x & WebLogic 8.x)!! So what's the problem with the validation (JSP
Syntax validator)?
Any idea..?

Thanks in advance...
Maxx

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSP syntax errors through icnlude

Posted by Maxx <ma...@gmail.com>.
On Jan 14, 2008 2:27 PM, Al Sutton <al...@alsutton.com> wrote:
> Just re-read your original message. So you have tried it on an app server
> and everything is OK. Doesn't that indicate the problem lies with eclipse
> and not struts?, shouldn't it be the Eclipse bug tracking system you put
> your report in and not Struts Jira?

Well, I thought it might be related to the use of Struts2 tags/taglib,
and then related to the translation into JSP's java code.
But hey, I'm gonna try the Eclipse thing.

Thanks,
Maxx

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSP syntax errors through icnlude

Posted by Al Sutton <al...@alsutton.com>.
Just re-read your original message. So you have tried it on an app server 
and everything is OK. Doesn't that indicate the problem lies with eclipse 
and not struts?, shouldn't it be the Eclipse bug tracking system you put 
your report in and not Struts Jira?

----- Original Message ----- 
From: "Al Sutton" <al...@alsutton.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, January 14, 2008 1:18 PM
Subject: Re: JSP syntax errors through icnlude


> First question;
>
> Why do you think this is a Struts bug?
>
> I encountered the same problem when I upgraded from Eclipse 3.2 to 3.3 
> without changing the project. Have you tried downgrading your version of 
> Eclipse to see if that resolves the problem?, have you also tried 
> compiling and testing the project in an servlet engine?, have you also 
> tried running a "Clean..." on your server within Eclipse and separately a 
> Clean on all the projects in your workspace to ensure there isn't anything 
> left from a previous version of your app?
>
> Al.
>
> ----- Original Message ----- 
> From: "Maxx" <ma...@gmail.com>
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Sent: Monday, January 14, 2008 11:17 AM
> Subject: JSP syntax errors through icnlude
>
>
> Hello!
>
> Before issuing a bug report on Struts' bug tracker, I'd like to have
> your advices about a rather stranger syntax error I'm getting with
> Eclipse (v.3.3/Europa) and JSP using Struts2 tags.
>
> Here's own I can reproduce it:
>
> Create the project: New Project > Other... > Web > Dynamic Web Project
> => Project Name: Struts2Test
> => Other settings: use default
>
> Add Struts2 needed librairies (e.g. struts2-core-j4-2.0.11.jar &
> xwork-j4-2.0.4.jar ) to your
> WebContent\WEB-INF\lib folder
>
> Now creating the test *.jsp(f) files under WebContent:
>
> /pages/action/index.jsp: (please respect the folders!!)
> -------------------
> <%@page language="java" contentType="text/html; charset=ISO-8859-1"%>
> <%@taglib prefix="s" uri="/struts-tags"%>
>
> <%@include file="/pages/include/include.jspf"%>
> -------------------
>
> /pages/include/include.jspf: (folders too!)
> -------------------
> <%@taglib prefix="s" uri="/struts-tags"%>
>
> <%-- Affichage des éventuels messages d'information ou d'erreur --%>
> <s:if test="actionMessages != null && actionMessages.size > 0 ||
> actionErrors != null && actionErrors.size > 0">
> <div class="content">
> <s:if test="actionMessages != null && actionMessages.size > 0">
> <div id="actionMessages" class="actionMessages">
> <s:actionmessage cssClass="actionMessage" theme="fix" />
> </div>
> </s:if>
> <s:if test="actionErrors != null && actionErrors.size > 0">
> <div id="errorMessages" class="errorMessages">
> <s:actionerror cssClass="errorMessage" theme="fix" />
> </div>
> </s:if>
> </div>
> </s:if>
> -------------------
>
> Now clean & build your project:
> you'll get two Syntax ERRORs on the <%@include...%> JSPF row in the 
> index.jsp:
>
> Multiple annotations found at this line:
> - Syntax error on token "catch", Identifier expected
> - Syntax error on token "}", delete this token
>
> I first thought it could be due to the <s:actionmessage> &
> <s:actionerror> tags not handling properly exceptions.
> But as there's seem to have no syntax error when putting both files
> (JSP & JSPF) in the same folder, I'm getting dubious.
>
> This code works, these pages work (I compiled & used them on Tomcat
> 4.x & WebLogic 8.x)!! So what's the problem with the validation (JSP
> Syntax validator)?
> Any idea..?
>
> Thanks in advance...
> Maxx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: JSP syntax errors through icnlude

Posted by Al Sutton <al...@alsutton.com>.
First question;

Why do you think this is a Struts bug?

I encountered the same problem when I upgraded from Eclipse 3.2 to 3.3 
without changing the project. Have you tried downgrading your version of 
Eclipse to see if that resolves the problem?, have you also tried compiling 
and testing the project in an servlet engine?, have you also tried running a 
"Clean..." on your server within Eclipse and separately a Clean on all the 
projects in your workspace to ensure there isn't anything left from a 
previous version of your app?

Al.

----- Original Message ----- 
From: "Maxx" <ma...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Monday, January 14, 2008 11:17 AM
Subject: JSP syntax errors through icnlude


Hello!

Before issuing a bug report on Struts' bug tracker, I'd like to have
your advices about a rather stranger syntax error I'm getting with
Eclipse (v.3.3/Europa) and JSP using Struts2 tags.

Here's own I can reproduce it:

Create the project: New Project > Other... > Web > Dynamic Web Project
 => Project Name: Struts2Test
 => Other settings: use default

Add Struts2 needed librairies (e.g. struts2-core-j4-2.0.11.jar &
xwork-j4-2.0.4.jar ) to your
WebContent\WEB-INF\lib folder

Now creating the test *.jsp(f) files under WebContent:

/pages/action/index.jsp: (please respect the folders!!)
-------------------
<%@page language="java" contentType="text/html; charset=ISO-8859-1"%>
<%@taglib prefix="s" uri="/struts-tags"%>

<%@include file="/pages/include/include.jspf"%>
-------------------

/pages/include/include.jspf: (folders too!)
-------------------
<%@taglib prefix="s" uri="/struts-tags"%>

<%-- Affichage des éventuels messages d'information ou d'erreur --%>
<s:if test="actionMessages != null && actionMessages.size > 0 ||
actionErrors != null && actionErrors.size > 0">
<div class="content">
<s:if test="actionMessages != null && actionMessages.size > 0">
<div id="actionMessages" class="actionMessages">
<s:actionmessage cssClass="actionMessage" theme="fix" />
</div>
</s:if>
<s:if test="actionErrors != null && actionErrors.size > 0">
<div id="errorMessages" class="errorMessages">
<s:actionerror cssClass="errorMessage" theme="fix" />
</div>
</s:if>
</div>
</s:if>
-------------------

Now clean & build your project:
you'll get two Syntax ERRORs on the <%@include...%> JSPF row in the 
index.jsp:

Multiple annotations found at this line:
- Syntax error on token "catch", Identifier expected
- Syntax error on token "}", delete this token

I first thought it could be due to the <s:actionmessage> &
<s:actionerror> tags not handling properly exceptions.
But as there's seem to have no syntax error when putting both files
(JSP & JSPF) in the same folder, I'm getting dubious.

This code works, these pages work (I compiled & used them on Tomcat
4.x & WebLogic 8.x)!! So what's the problem with the validation (JSP
Syntax validator)?
Any idea..?

Thanks in advance...
Maxx

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org