You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by sh...@apache.org on 2001/12/12 03:44:39 UTC
cvs commit: jakarta-taglibs/standard/examples/web ShowSource.jsp
shawn 01/12/11 18:44:39
Modified: standard/examples/web ShowSource.jsp
Log:
Modifications to ShowSource.jsp.
Revision Changes Path
1.7 +10 -4 jakarta-taglibs/standard/examples/web/ShowSource.jsp
Index: ShowSource.jsp
===================================================================
RCS file: /home/cvs/jakarta-taglibs/standard/examples/web/ShowSource.jsp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ShowSource.jsp 2001/11/23 14:01:22 1.6
+++ ShowSource.jsp 2001/12/12 02:44:39 1.7
@@ -1,13 +1,22 @@
<!--
Displays the content of the file specified in request
parameter "filename".
+ <%-- Warning! Can be used to retrieve the source code for
+ any file in the 'standard-examples' application.
+ It is not advisable to insert any sensitive code
+ (even as an experiment) into this application --%>
-->
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/ea/core" %>
<%@ taglib prefix="ex" uri="/jstl-examples-taglib" %>
+<%--
+ Let's get back the URL as a String so we can use it to
+ demonstrate "c:import"
+--%>
<% pageContext.setAttribute("filepath",
- "file:" + application.getRealPath(request.getParameter("filename"))); %>
+ application.
+ getResource(request.getParameter("filename")).toExternalForm()); %>
<% pageContext.setAttribute("filename", request.getParameter("filename")); %>
<html>
@@ -19,11 +28,8 @@
<hr>
-<%-- <c:expr value="$filepath"/> --%>
<c:import varReader="reader" url="$filepath">
-<%-- <ex:file id="reader" file="$param:filename"> --%>
<ex:escapeHtml reader="$reader"/>
-<%-- </ex:file> --%>
</c:import>
<hr>
</body>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>