Forums Register Login

Generating dynamic includes with servlet

+Pie Number of slices to send: Send
Hello.

I'm trying to code my first administration panel, and I have JSP page with menu:


And I have a servlet:




I want to make something like this: When I will click "add" menu item, servlet gets parameter "category" and "action" and it generates an request attribute with jsp:include or c:import (or only path for the included file).
<jsp:include> is executed at runtime right? So passing the "<jsp:include page="data/blog/add.jsp" /> to the parameter and retriving it in the jsp page is senseless and it doesn't work. When I'm trying to pass only path to the included file and my administration page is not even displaying, I see only index page.

I tried something similar with the c:import. I saved "<c:import url="/data/blog/add.jsp" />" in request parameter and I retrived it in the jsp page, but of course it didn't work. I didn't try to save path to the file in request parameter and retrive it in the <c:import> tag, because it doesn't accept EL.

My question is, how to make the JSP page to be a based on request attributes? If theres a category=blog action=add attributes, the page should display form which allows for adding new blog entry. Is it possible?

It's hard for me to explain this, but I hope you will understand :>

Best Regards.


Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2088 times.
Similar Threads
creating thumbnail for uploaded files
Show menu and submenu on homepage from database using servlet and jsp
Filtering Result Sets based on selectable links (a href:)
Request dispatcher doesn't redirect to the jsp page
how to know which servlet/jsp calling a particular servlet
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:06:55.