I solved this problem three days ago. Sometimes the inspiration for getting on the toilet suddenly came.
The first time I Parse XML with jstl, I want to print the whole XML file.
What should I do if I don't want to input variables?
Search for answers on the Internet
What to say <% @ taglib prefix = "C" uri = "http://java.sun.com/jstl/core" %> becomes:
<% @ Taglib prefix = "C" uri = http://java.sun.com/jstl/core_rt %>
Nothing happens. Then, go to stackoverflow.
The problem has not been solved.
When the inspiration came, I went to see its source file.
This is the place for parsing in the jstl package that comes with eclipse.
I suddenly realized it.
At first glance, we can see that the tool is the configuration file from here when parsing the principle.
Tag is the configuration file of each tag. For example, the red part declares whether the select attribute has the variable rtexpravlue, which means "variable expression"
Now, I want to find a way to change this expression. Just change it. Of course, we just need to "cheat" the tool.
1. Copy one of the files, such as X. TLD, and then modify them locally, because the files are read-only in the tool.
2. Modify the part of X. TLD that you want to modify. For example, if I want the select attribute to have an expression, I will change the red part above to true.
3. declare such a paragraph in the web. xml file of the project
<jsp-config> <taglib> <taglib-uri>/huang</taglib-uri> <taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> </jsp-config>
4. Reference this custom "Huang" tag on the JSP page.
<%@ taglib prefix="x" uri="/huang" %>
5 OK. Now you can use this new tag to view what you want.
For example, now I can splice variables.
For example, I used
If you set variables in the SELECT statement, the following error occurs: According to TLD or attribute directive in Tag file, attribute select does not accept any expressions.
Now:
<X: Out select = "$ casexml // case // $ {node. name}"/>
You can use the two El expressions <% = XX %>.
Display normal
By the way, my web version is
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
Ultimate Solution: According to TLD or attribute directive in Tag file, attribute select does not accept any expressions