tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (David M. Karr)
Subject Re: How to insert a string into a tag parameter
Date Wed, 08 Jan 2003 19:00:36 GMT
>>>>> "Thomas" == Thomas J Zvolensky <Zvolensky> writes:

    Thomas> I have a JSP that receives three strings from an upstream form.  I would like
to insert one of the passed strings as a value within a <c:import> tag.  See the last
line of code snippet below.
    Thomas> <%--

    Thomas> Get Project, Owner and XML file path from the form

    Thomas> --%>
    Thomas> <jsp:useBean id="parameters" class="com.plv2.FormBean"  scope="page" />
    Thomas> <%
    Thomas> String project = request.getParameter("project");
    Thomas> String owner = request.getParameter("owner");
    Thomas> String xmlfile = request.getParameter("xmlfile");
    Thomas> %>
    Thomas> <%-- 

    Thomas> open the ShareWeb export file 

    Thomas> --%>
    Thomas> <c:import var="shareweb" url="<%=xmlfile%>" />

    Thomas> It seems my syntax is incorrect as url="<%=xmlfile%>" results in a compilation

    Thomas> Does anybody know the correct way to do this?

If those values are coming from request parameters, than you can use the EL
syntax to reference request parameters directly:

 <c:import var="shareweb" url="${param.xmlfile}" />

David M. Karr          ; Java/J2EE/XML/Unix/C++   ; SCJP; SCWCD

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message