Pizza eu
Pizza eu

Reputation: 1449

Pass parameters to jsp by <%@ include file

I need to pass params to included jsp

 <%@ include file="second.jsp" %>

i need to use it several times in one jsp page, so i need to pass id. I can't use jsp:include because jsp can't see struts action in this way

Can u help me? Thank you

Upvotes: 2

Views: 8914

Answers (1)

Set them as attributes on the request object (which makes them visible to the ${var} syntax) before invoking your include.

See How to access a request attribute set by a servlet in JSP? for a similar question.

Upvotes: 4

Related Questions