Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat 4.0.1 and JSP

Status
Not open for further replies.

spookytektips

IS-IT--Management
Jan 23, 2002
7
FR
Hello,

My tomcat is giving me weird messages......

I have a JSP wich calls another and so on....

the first one compiles ok...but for the other i get..

"Page directive: can't have multiple occurrences of language"

anyone as a clue on this ????

thanx !
 
It could be several things.

1) when I was using Tomcat 3.2.1 I wasn't able to use &quot;<%@ include&quot; directive to include same jsp fragment more than once. I had situation where I thought reasonable to use the code fragment twice, but the translation step would not allow it. I don't know why such a thing should be illegal maybe it is--I have read a fair amount of the specifications and haven't come across such a rule--or maybe it is a translation bug not yet fixed. (I haven't checked it in 4.0 yet)

Or 2) The error could be because you have declared in both initial jsp page and included jsp fragment a variable with same name--either instance variable <%! or local variable inside scriptlet e.g. <% String duplicatename = &quot;asdf&quot;; %>.

In any case, at translation time I am guessing you have a duplicate variable name that causes the generated servlet compilation to fail.

FYI, per the specification recommendation (JSP.2.1.7), anything that is included via directive and would not compile by itself or does not output a complete valid html page should NOT have a .jsp extension. You should give these jsp fragments some other kind of extension like .jsf or .jspf. I just became aware of this convention.

pfist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top