This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tag libraries  RSS feed

 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
 
Srikanth Nutigattu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • 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...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!