0

I have action in my jsp page <jsp:include page = <%=(String)request.getAttribute("page")%> /> the page is request parameter that i have set previously in my servlet. But when i try to access my jsp page i get.

<jsp:include page = <%=(String)request.getAttribute("page")%> />

How to set page correctly ?

BalusC
  • 1,040,783
  • 362
  • 3,548
  • 3,513
Oleksandr Papchenko
  • 1,831
  • 19
  • 28

1 Answers1

1

I suggest to avoid Scriplet instead use JSP Standard Tag Library and Expression language that is easy to user and less error prone.

the page is request parameter that i have set previously in my servlet.

Since as per you its request parameter then you can access it using JSTL and EL from parameter.

${param.page}

If its set a request attribute the access it a below:

${requestScope.page}

See Difference between getAttribute() and getParameter()

Community
  • 1
  • 1
Braj
  • 45,615
  • 5
  • 55
  • 73