Java Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 302
Number of posts: 624

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How can variables set in the tag attribute? Posted by yupong on 18 Jul 2003 at 8:49 PM
hi all,

i have a code like this:

<%@ taglib prefix="database" uri="WEB-INF/database.tld" %>

<html>
<body>

<%
String id = request.getParameter("Title_ID");
String title = request.getParameter("Title");
String price = request.getParameter("Price");
String cid = request.getParameter("Category_ID");
%>

<database:addbook bookid=id title=title price=price cid=cid />

</body>
</html>

However, it doesn't work...

If i change From
<database:addbook bookid=id title=title price=price cid=cid />
To
<database:addbook bookid="1" title="2" price="3" cid="4" />
it works.

So I would like to ask how i can set the variables into the tag attribute?

Thanks a lot!!

ypc
Report
Re: How can variables set in the tag attribute? Posted by Chanders2002 on 22 Jul 2003 at 12:32 PM
try this
<database:addbook bookid="<%=id%>" title="<%=title%>" price="<%=price%>" cid="<%=cid%" />

Cheers
Happy Coding
Chander

: hi all,
:
: i have a code like this:
:
: <%@ taglib prefix="database" uri="WEB-INF/database.tld" %>
:
: <html>
: <body>
:
: <%
: String id = request.getParameter("Title_ID");
: String title = request.getParameter("Title");
: String price = request.getParameter("Price");
: String cid = request.getParameter("Category_ID");
: %>
:
: <database:addbook bookid=id title=title price=price cid=cid />
:
: </body>
: </html>
:
: However, it doesn't work...
:
: If i change From
: <database:addbook bookid=id title=title price=price cid=cid />
: To
: <database:addbook bookid="1" title="2" price="3" cid="4" />
: it works.
:
: So I would like to ask how i can set the variables into the tag attribute?
:
: Thanks a lot!!
:
: ypc
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.