Jsp can not found param in included file

H

homecurr

I am using tomcat 5.0. Here is my test.jsp file

<body>
<jsp:include page="para.html"/>
....

<ht> <%= st%>
....

here i smy para.html

<%
String st = "Hello";
%>

But when I run http://localhost:8080/myjsp/test.jsp, st can not be found...
The message is :
cannot resolve symbol
symbol : variable st


Thanks,

John
 
P

Patrick

I am using tomcat 5.0. Here is my test.jsp file

<body>
<jsp:include page="para.html"/>

If you inlcude an file with jsp:include, the jsp code is ignored,
because this file is included when the main jsp page is requested !

You have to use <%@ include file="" %> in order to include a jsp file
at compilation time. Then the jsp code is interpreted!

Regards,
Patrick

__________________________________________
Sorry for my English - i'm not a native speaker...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top