Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tag libraries

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
I am doing taglibraries example in rad..
<%@ taglib uri="META_INF/session.tld" prefix= "sessionData" %>
my questions are
1. At this line I am getting error session.tld unknown..
Do i need to do any pre steps in application server.. if so please let me know where do I need to keep .TLD's.
2. How can we provide the body for those .TLD's.
Thanks
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. You should not be using a file path for the TLD URI. Rather, define a URI within the TLD and use that. Then place the .tld file anywhere under WEB-INF and the container will automatically find it.

2. What do you mean by "body"?
 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for you info..
"session.TLD" how can we define this as a notepad and save it as TLD...
give the functionality in side that notepad..
that's my question about my body..
please give me reply asap
 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my code..
<%@ taglib uri="session.tld" prefix= "sessionData" %>
<sessionData:list>
<TR><TD ALIGN="center" WIDTH="33%"><%= name %></TD>
<TR><TD ALIGN="center" WIDTH="33%"><%=value %></TD>
</sessionData:list>
I am getting an error where name value are not defined..
my doubt is where do i need to define them in the taglibrary.
 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%@ taglib uri="session.tld" prefix= "sessionData" %>
<%
String action = request.getParameter("action");
if((action!= null ) && (action.equals("Add Item")))
{
String itemName = request.getParameter("txtItem");
String itemAmount = request.getParameter("txtAmount");
session.setAttribute(itemName,itemAmount);

}
else if((action != null)&&(action.equals("delete")))
{
String deletedItem = request.getParameter("deletedItem");
session.removeAttribute(deletedItem);
}
%>
<sessionData:list>
<TR><TD ALIGN="center" WIDTH="33%"><%= name%></TD>
<TR><TD ALIGN="center" WIDTH="33%"><%=value %></TD>
<%String partLink="http://localhost:9081/CyberExportStore/shoppingCart.jsp";
String deletLink = partLink+"?action=delett&deletedItem="+name;
%>
<A HREF="<%=deletLink%>">delete</A></TR> %>
</sessionData:list>



how can we get name an values please respond
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<TR><TD ALIGN="center" WIDTH="33%"><%= name%></TD>
<TR><TD ALIGN="center" WIDTH="33%"><%=value %></TD>



the variables "name" and "value" are nowhere to be found... the values are not delcare at all... you dont declare those in TLD's but in your JSP's...
 
I'm full of tinier men! And a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic