tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Austin Lowry <austin.lo...@fedex.com>
Subject Re: How to insert a string into a tag parameter
Date Wed, 08 Jan 2003 19:24:11 GMT
I'm not sure why your statement generates a compile error, but there is 
cleaner way to reference your request parameters using the JSTL 
expression language. Instead of instanciating a String in a scriptlet 
and then calling your string, you can reference the request parameter 
inside your tag like this:

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

See the following URL for more on EL: 
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL4.html


Zvolensky, Thomas J {PGL~Nutley} wrote:

>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.
>
>
><%--
>
>Get Project, Owner and XML file path from the form
>
>--%>
><jsp:useBean id="parameters" class="com.plv2.FormBean"  scope="page" />
><%
>String project = request.getParameter("project");
>String owner = request.getParameter("owner");
>String xmlfile = request.getParameter("xmlfile");
>%>
><%-- 
>
>open the ShareWeb export file 
>
>--%>
><c:import var="shareweb" url="<%=xmlfile%>" />
>
>
>It seems my syntax is incorrect as url="<%=xmlfile%>" results in a compilation error.
>
>Does anybody know the correct way to do this?
>
>TIA
>
>--
>To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>
>
>
>
>  
>


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message