Fórum

Organize jsp file

Beppo Ivel, modificado 9 Anos atrás.

Organize jsp file

Regular Member Postagens: 112 Data de Entrada: 09/04/14 Postagens Recentes
Hi.

I have two jsp files A.jsp and B.jsp. And I include file B.jsp in file A.jsp:
<%@ include file="/JSPs/B.jsp" %>

and the code is working fine. But if I separate the src code into this two files the eclipse IDE throws warning and errors. How can I separate the src code in several files but the IDE handle it like one file?
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Organize jsp file

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
What warnings/errors are you getting?
Beppo Ivel, modificado 9 Anos atrás.

RE: Organize jsp file

Regular Member Postagens: 112 Data de Entrada: 09/04/14 Postagens Recentes
For instance certain variable can not be resolved. If you declare a variable in A.jsp and use it in B.jsp.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Organize jsp file

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
If it is working in the runetime but eclipse is still complaining then that is likely just the JSP validation rules in eclipse. They're usually nothing more than red herrings -- I wouldn't worry about what eclipse is saying if your code is working at runtime.
thumbnail
David H Nebinger, modificado 9 Anos atrás.

RE: Organize jsp file

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Ah, yeah, the IDE has no clue that B is a fragment of A, it looks at B as a complete JSP page and will report the errors that you're seeing.

Possibly you can get into the validation and disable or lower the errors/warnings for JSP pages, but of course when you do that you expose yourself to possible coding issues (probably 6 of one, half dozen of another, how do you identify real errors when the IDE is reporting all of the fake errors).