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,082,665
  • 372
  • 3,610
  • 3,555
Oleksandr Papchenko
  • 2,071
  • 21
  • 30

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
  • 46,415
  • 5
  • 60
  • 76