problem with parameters in JSP includes

M

MuZZy

Hi,

I am looking for help on JSP development:
I have a template JSP page where depending on different criteria i need
to insert different JSP's, eg

<% if (i=1) {%>
<%include file="some.jsp?i=1"%>
<%} else {%>
<%include file="some.jsp?i=2"%>
<%}%>

The problem is java compiler tryes to open file "some.jsp?i=1", not
"some.jsp" and generates an error.

if i try <jsp:include page="some.jsp?i=1"/>, it works, but then i face
another problem - if i want to put a context dependable parameter, eg

<jsp:include page="some.jsp?i=<%=i%>"/>,

java compiler giver me an exception.

How can i include a jsp page with parameters?
Any ideas would be appreciated!

Thank you,
Andrey
 
C

Christophe Vanfleteren

MuZZy said:
Hi,

I am looking for help on JSP development:
I have a template JSP page where depending on different criteria i need
to insert different JSP's, eg

<% if (i=1) {%>
<%include file="some.jsp?i=1"%>
<%} else {%>
<%include file="some.jsp?i=2"%>
<%}%>

The problem is java compiler tryes to open file "some.jsp?i=1", not
"some.jsp" and generates an error.

if i try <jsp:include page="some.jsp?i=1"/>, it works, but then i face
another problem - if i want to put a context dependable parameter, eg

<jsp:include page="some.jsp?i=<%=i%>"/>,

java compiler giver me an exception.

How can i include a jsp page with parameters?
Any ideas would be appreciated!

Thank you,
Andrey

<jsp:include page="{relativeURL | <%= expression %>}" flush="true" >

<jsp:param name="parameterName"

value="{parameterValue | <%= expression %>}" />+

</jsp:include>
 
M

MuZZy

Christophe said:
MuZZy wrote:




<jsp:include page="{relativeURL | <%= expression %>}" flush="true" >

<jsp:param name="parameterName"

value="{parameterValue | <%= expression %>}" />+

</jsp:include>

THANK YOU, CHRISTOFE!!!
YOU'RE A LIFESAVER!!!

Andrey
 

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,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top