Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2006, 05:07 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default About EL

I run a example about EL in chapter 5 of <<Beginning JSP>> .
The code is following:
index.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>

<html>
<head>
    <title>EL Implicit Object Example</title>
</head>
<body>
<h1>EL Implicit Object Example</h1>
<form action="formproc.jsp" method="post">
    <table>
        <tr>
            <td colspan="2">Design a cake</td>
        </tr>
        <tr>
            <td>cake shape:</td>
            <td>
                <select name="shape">
                    <option>round</option>
                    <option>square</option>
                    <option>heart</option>
                </select>
            </td>
        </tr>
        <tr>
            <td>Toppings:</td>
            <td>
                <input type="checkbox" name="topping" value="choc">Chocolate</input>
                <input type="checkbox" name="topping" value="cane">Candy Cane</input>
                <input type="checkbox" name="topping" value="flower">Flower</input>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="Send">
            </td>
        </tr>
    </table>
</form>
</body>
</html>

formproc.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
<html>
<body>
shape of cake selected:${param.shape}
<br>toppings selected:
<c:forEach var="aTopping" items="${paramValues.topping}">
    &nbsp;&nbsp;${aTopping}&nbsp;&nbsp;
</c:forEach>
</br>
<br>browser:${header["user-agent"]}</br>
<br>
    <a href="ch05.jsp">back to form</a>
</br>
</body>
</html>

After executing,Some EL don't correctly be showed,for example:${param.shape}¡¢${aTopping}¡¢${header["user-agent"]}.These El don't be executed,bu they are be showed as a string in html.And it doesn't write any error information in IE.But other El in JSTL is right.

Who could tell me why?thanks vary much!






Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP2 EL / JSTL ignored ronMasters BOOK: Beginning JavaServer Pages 2 November 6th, 2008 07:09 AM
Problem with EL in JSP IronStar JSP Basics 1 January 31st, 2007 11:54 PM
EL Syntax error savoym JSP Basics 0 November 2nd, 2006 04:48 PM
JSP2 EL/JSTL being ignored ronMasters JSP Basics 0 February 23rd, 2006 07:36 AM
el mismo codigo?? fantasma?? apalmero ASP.NET Espanol 0 December 23rd, 2003 10:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.