aspose file tools*
The moose likes JSP and the fly likes problem with jsp:include Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem with jsp:include" Watch "problem with jsp:include" New topic
Author

problem with jsp:include

Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
Hi, I want to include a different page depending on some requests... for example:
<%
String page=request.getParameter("page");
%>
<jsp:include page="<%=page%>"/>
But I get an error... can somebody help me??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61224
    
  66

"I get an error" is not very informative.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
jasperexception
not valid attribute
Sri Basavanahally
Ranch Hand

Joined: Oct 07, 2003
Posts: 75
the page that you are declaring and initializing is local that block. Use a declaration block for declaring it. Then it will be accessible throughout the page.
This is probably your problem..


UP THE IRONS !
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Hi Leandro ,
Try as follow :
<%!
String page=null;
%>
<%
page=request.getParameter("page");
%>
<jsp:include page="<%=page%>"/>
Create an index.html file and write http://localhost:8080/epfc/index.jsp?page=index.html. It works fine.
Leandro Oliveira
Ranch Hand

Joined: Nov 07, 2002
Posts: 298
thank you really, really!
It did work.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: problem with jsp:include