struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhagia, Mahesh" <>
Subject RE: struts: JSP expression not evaluated
Date Thu, 27 Mar 2003 18:40:09 GMT
you can use either JSP XML syntax or regular jsp syntax (not together),

also your jsp page has to follow complete XML syntax to use <jsp:expression>
for e.g 
<jsp:root> (as beginning of page)
<jsp:expression> 3 + 4<jsp:expression>

Please refer jsp syntax card for more details


-----Original Message-----
From: Timo Nentwig []
Sent: Tuesday, March 25, 2003 12:53 PM
Subject: struts: JSP expression not evaluated [adr][adr][bayes]


I do have a very weird problem which I don't even know struts or jasper to
address to so I post it to both mailing lists.

Below is a small piece of JSP code, the struts <html:link> tag contains an
JSP expression in the href attribute which is not evaluated, i.e. the
actuall link contains the expression just as it is printed in the source
code below as *string*. Please note that pre-building a Java String
containing the complete href link and putting that string expression into
the tag's attribute does work just well.

This does only apply to struts' <html:link> tag; <a> works just as it

<%@ page language="java" %>
<%@ page contentType="text/html;charset=WINDOWS-1252"%>

<%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html' %>

<!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
                int var = 1;

                <!-- the link won't read " -->
                <html:link href="<%=var%>">

This works:

    int var = 1;
    String href = "" + var;
    <html:link href="<%=href%>">

Can't I see the woods for the trees or is this a bug?


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

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

View raw message