R
Robert Jones
I'm working on my first JSP application and I've run into a design
problem that I can't seem to find a good solution to. I need to access
a dynamic list of files and display some information about each of them
in a table in a JSP page.
Here are the details:
I have a directory. I get a list of the files in that directory that
match a certain pattern. I open each file in succession and read a
couple of lines from them. I display the contents of these lines on a
web page.
The problem is that the number of files changes. That's why I'm using
the custom tag. I use a forEach loop in the JSP tag to process each
file. I pass the value of the iteration variable to the custom tag so
it knows which file to access.
I also need to create a URL that includes the name of the file I am
accessing. I don't see how to get the value of the filename into the
value attribute of caram.
<c:url var="reviewURL" value="./viewloc.jsp">
<caram name="filename" value="" />
</c:url>
<a href="<cut value="${reviewURL}" escapeXml="false" />">Review</a>
Normally, the filename is available through a getter method for the
bean, but I don't see how I can use this inside the caram tag, being
that the getter method would need an index.
Any help or recommendation is appreciated greatly. I can provide code,
but I didn't want to clutter up my post if it isn't necessary.
Robert Jones
problem that I can't seem to find a good solution to. I need to access
a dynamic list of files and display some information about each of them
in a table in a JSP page.
Here are the details:
I have a directory. I get a list of the files in that directory that
match a certain pattern. I open each file in succession and read a
couple of lines from them. I display the contents of these lines on a
web page.
The problem is that the number of files changes. That's why I'm using
the custom tag. I use a forEach loop in the JSP tag to process each
file. I pass the value of the iteration variable to the custom tag so
it knows which file to access.
I also need to create a URL that includes the name of the file I am
accessing. I don't see how to get the value of the filename into the
value attribute of caram.
<c:url var="reviewURL" value="./viewloc.jsp">
<caram name="filename" value="" />
</c:url>
<a href="<cut value="${reviewURL}" escapeXml="false" />">Review</a>
Normally, the filename is available through a getter method for the
bean, but I don't see how I can use this inside the caram tag, being
that the getter method would need an index.
Any help or recommendation is appreciated greatly. I can provide code,
but I didn't want to clutter up my post if it isn't necessary.
Robert Jones