简体   繁体   中英

JSP include tag dynamically

I got many custom tags, which I will include in my page depending on a string. I know I can make a choose/when list with each tag written out and switched by the given string, but it is not what I want. Something like this:

<control:${controlName} param=${param} />

You could use some preprocessor, like frameworks such as Apache Struts do. In that case you'd probably have to implement your own markup and handle cases like EL that should be evaluated by the JSP engine, ie ${controlName} would have to be changed in order to distinguish between your own markup and JSP/Java EL.

One preprocessor that you could use would be Apache Velocity .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM