When you nest quotes you have to escape them:

value="<%= request.getHeader(\"User-Agent\") %>"

or use a different quote type:

value="<%= request.getHeader('User-Agent') %>"

or use the following markup:

value="<%= request.getHeader(&quot;User-Agent&quot;) %>"


Justy

----- Original Message -----

> I can use request.getHeader() in my JSP scriptlet (Tomcat 3.2.1) and it
> works just fine:
>
> <% String myUserAgent = request.getHeader("User-Agent"); %>
> User-Agent = <%= myUserAgent %><br>
> <jsp:setProperty
>         name="userAgent"
>         property="userAgent"
>         value="<%= myUserAgent %>"   />
>
> But when I try to use it directly in a jsp:setProperty statement, I get an
> error:
>
> <jsp:setProperty
>         name="userAgent"
>         property="userAgent"
>         value="<%= request.getHeader("User-Agent") %>"   />
>
> ... Attribute User-Agent has no value
>
> Any idea why?
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to