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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to integrate java into <@ include... directive???

Status
Not open for further replies.

HoMyGod

Programmer
Jul 17, 2000
59
CH
Hi,

I would like to integrate a java instruction in an <@ include> directive. I would like something like this :

<%@ include file = &quot;./video.jsp?id<%out.print(anId);%>&quot; %>

Of course, this instruction doesn't work. Is there something to do to have the same result????

A+
H.
 
Ok there is an easy solution to this.... I think.

Try this <jsp:include page=&quot;./video.jsp?id<%= anId %>&quot;/>

Hope this helps! ;-)
 
well tried...but it doesn't work. I've tried the following :

<jsp:include page=&quot;./video.jsp?id<%=id%>&quot; flush=&quot;true&quot;/>

and it just generate me an error like :

runtime attribute: multiple expressions and mixing of expressions and string constants not permitted: ./standard.jsp?id<%=id%>

So, my problem is still not solve...


 
You can not combine the relativeURL with an expression.
Try this:
<jsp:include page=&quot;<%= &quot;./video.jsp?&quot;+id %>&quot; flush=&quot;true&quot;/>
I did not try it, but I think it will work ;-).

Syntax of <jsp:include>:
<jsp:include page=&quot;{relativeURL | <%= expression %>}&quot; flush=&quot;true&quot; />


Otto
 
as far as i know with the statement jsp:include is that the content of the page will be inserted in the original page before compilation and execution. A possible solution for your problem can be to define and assign the id variable in the original page and then include the &quot;video&quot; page. So that the video page knows the id and can work from that point.

Greetings,
Steven.
 
Ok, we can do the following

String aTempString = &quot;./standard.jsp?id=&quot;+stringId;
<jsp:include file=&quot;<%= aTempString %>&quot; flush=&quot;true&quot;/>

and it must work.

Thank you everybody (in fact, I have already chosen a solution like CatWeasel's...but it can be usefull in the close future)

Bye
H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top