tag 1 « JSTL « JSP-Servlet Q&A





1. Embedded custom-tag in dynamic content (nested tag) not rendering    stackoverflow.com

Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that pulls dynamic content from a javabean and passes the list of objects to a custom tag for processing ...

2. How do I get rid of "Cannot resolve property key" in fmt:message tags in JSPs in Intellij    stackoverflow.com

This one has been bugging me for a while now. Is there a way I can stop Intellj IDEA from reporting missing keys in tags? My messages are not stored in property ...

3. JSTL collection iteration    stackoverflow.com

I have a Java bean like this:

class Person {
  int age;
  String name;
}
I'd like to iterate over a collection of these beans in a JSP, showing each person in ...

4. Is it really a best practice to use jstl out tag?    stackoverflow.com

I remember working on a project with a group of developers and they always wanted static html text to be inside of an out tag (<c:out value="words" />). I don't remember ...

5. JSTL forEach tag: problems with enumeration, and with understanding how it should work    stackoverflow.com


I've experienced rather strange behavior of JSTL forEach tag. I have some bean called SessionBean:

public class SessionBean {
  private Collection<MyObject> objects;
  public Collection<MyObject> getObjects() {return objects;}
  ...
}
And a ...

6. JSP tag    stackoverflow.com

Writing a JSP page, what exactly does the <c:out> do? I've noticed that the following both has the same result:

<p>The person's name is <c:out value="${person.name}" /></p>
<p>The person's name is ${person.name}</p>

7. Access JSTL tag from code inside of forEach loop    stackoverflow.com

Is it possible to access JSTL's forEach variable via code from within the loop?

<c:forEach items="${elements}" var="element">
    <% element.someMethod(); %>
</c:forEach>

8. Forcing Compile of .tag files    stackoverflow.com

How can I force Websphere to compile my .tag files? Cleaning the project, publishing, restarting the server, adding and removing projects all don't help - the .class file for the tag file ...

9. Custom rendering in JSP based on type of class without instanceof    stackoverflow.com

How would you properly render a list of objects in jsp with differing types? Say, for example, I have to render these different objects in a specified order. One way could ...





10. JSTL tag not translate in HTML    stackoverflow.com

My imports :

  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
My JSTL Code :
  <h:outputLabel value="YESS" >
  <fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>

HTML generated code:
  <label>YESS</label>
  <fmt:formatNumber value="0.25" type="percent"></fmt:formatNumber>
The generated code ...

11. How to check for Double.NaN in JSP with JSTL tags?    stackoverflow.com

How to check for Double.NaN in JSP with JSTL tags?

12. Accessing method from JSTL    stackoverflow.com

just was wondering if there is a way to access a method from my class without creating a custom taglib. Example I got a class which provides 4 methods: hasDisplay(), hasCreate(), hasDelete() and ...

13. accessing values in a map using c:out tag    stackoverflow.com

trying to access a value from a map in a c:out tag but the following doesn't appear to be displaying any value. Here's the code:

<c:out value=" letterForm.criteria.map['letterForm.criteria.type']" />
anyone have any ideas ...

14. JSTL: iterate list but treat first element differently    stackoverflow.com

I'm trying to process a list using jstl. I want to treat the first element of the list differently than the rest. Namely, I want only the first element to ...

15. forEach tag having problem    stackoverflow.com

Hi All i am facing a problem while using the forEach for iteration i am giving the complete code please tell me whats wrong with this.

index.jsp

<%@ page language="java" contentType="text/html; ...

16. JSTL fmt tag does not work in IE?    stackoverflow.com

IE seems to ignore the fmt tag in JSTL. I've tried with fmt:formatNumber and fmt:formatDate, and neither work in IE but they work in all other browsers. (I'm using IE8 and ...





17. Enabling JavaServerPages Standard Tag Library (JSTL) in JSP    stackoverflow.com

I feel like I am missing something - from what it seems, JSP comes out of the box with support for tags, as this question's answer shows (the guy was ...

18. How do I make the JSTL core tags work in RAD6.0?    stackoverflow.com

I am using RAD 6.0, where I have put jstl.jar under the lib folder in my application. When I am using the JSTL tags, it does not give any copilation errors. ...

19. c:set tag to set a non-primitive type value    stackoverflow.com

What's a possible way to use Spring Security tag <sec:authentication property="principal.id" /> as the value for the <c:set…> tag? These statements:

<c:set var="userId" value="<sec:authentication property='principal.id' />"/>
<c:set var="userId" value="<sec:authentication property=\"principal.id\" />"/>
won't work.

20. JSTL - Using forEach to iterate over a user-defined class    stackoverflow.com

What methods do I need to add to a custom Java class so that I can iterate over the items in one of its members? I couldn't find any specifications about ...

21. Nested JSTL Tags    stackoverflow.com

I want to use a formatDate tag inside a param tag. This doesn't work:

<fmt:message key="entry">
   <fmt:param value="<fmt:formatDate value='${entry.time}' pattern='h:mm' />"/>
</fmt:message>
How can I do this?

22. JSP/JSTL using or not using tags    stackoverflow.com

i'm helping develop a java jsp jstl based web service and all dynamic objects are being inserted using ${object.foo} and i was wondering if it made a difference whether or not ...

23. Don't understand JspTagException: "Illegal use of -style tag without as its direct parent    stackoverflow.com

I've been staring at the tag nesting below for about an hour now and I still can't figure out why I keep getting a JspTagException:

"Illegal use of <when>-style tag without <choose> ...

24. JSTL tags not working in plain html file    stackoverflow.com

I have plain HTML file and I want to include some JSTL tags in that, first I am trying whether this works. But somehow JSTL tags are now showing value after rendering. ...

25. Calling a custom JSP tag from JSTL tag    stackoverflow.com

I'm trying to call my custom tag from the JSTL tag <c:url>. Because of the quotes, the custom tag is shown as a string instead of a tag. Can I use an escape ...

26. JSTL: can't implement class for tag     stackoverflow.com

I'm trying to write a class for this (forEach) tag. Here's the class:

public class BookList implements Iterable<Book>
{
public ArrayList<Book> book_list;

public BookList()
{
    book_list = new ArrayList<Book>(2);

    book_list.add(new Book("BookTitle_01","book_01.html"));
 ...

27. Is it possible to sort in a JSP?    stackoverflow.com

Is there any way to sort alphabetically two strings variables in a JSP, for example by using jstl? Or at least determinate which string would be first alphabetically? I have been trying ...

28. How to get timezone from a request    stackoverflow.com

Possible Duplicate:
Can You Determine Timezone from Request Variables?
Hi Guys, I have a requirement where in i have to convert long value (that i get from ...

29. I can't use JSTL tag for read rss    stackoverflow.com

I want to read rss from another web. but I can't read rss . I use Netbeans and I add JSTL Library already. I can use forEach tag but every time ...

30. JSTL cout and cset question    stackoverflow.com

I am using JSTL for the first time. Trying to figure out why the JSTL is not behaving the way it should. Here is the sample code...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML ...

31. How to clear all the scriptlets in the following code and add JSTL tags instead of it?    stackoverflow.com

<%@ taglib uri="/WEB-INF/vgnExtTemplating.tld" prefix="templating" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page contentType="text/html" %> <%@ page import="com.vignette.as.client.javabean.Channel" %> "; pageContext.setAttribute("breadCrumbChannelVcmID",breadCrumbChannelVcmID); ...

32. Display tag : The absolute uri: http://displaytag.sf.net cannot be    stackoverflow.com

This is working fine in my machine. But when I deployed it to a different one the following exception is thrown. Both computers run Tomcat 6.0 and the required jar file ...

33. Read data from HashMap using JSTL tag in JSP without using for each or for loop    stackoverflow.com

I want to read data from a hash map in JSP, but without the use of JSTL <c:forEach> or a for loop. How can I do this?

34. JSTL tag set/if    stackoverflow.com

Evaluating using JSTL if Why my value isOnline is not being evaluated as true using JSTL if

<c:set var="isOnline" value="${friend.online}"/>
<h:outputText value="#{isOnline}" />
<br/>
(isOnline) is: ${isOnline}
<c:if test="${isOnline == 'true'}" var="theTruth">
  <h:outputText value="hello"/>
</c:if>
<br/>
(isOnline == ...

35. Can I use a jsp tag to hide an input field on load    stackoverflow.com

I need to hide a field on page load based on the value of a request attribute. I don't want a 'hidden' field because I want to show it again. ...

36. What does ${} means in jsp?    stackoverflow.com

What does ${} means in jsp? for eg:

<c:if test="${!empty cookie.lang}">
    <fmt:setLocale value="${cookie.lang.value}" />
</c:if>
I'll really appreciate any help on this. Thanks!

37.  tag in JSP    stackoverflow.com

I want to write Shopping basket is empty if count value of items in is 0. Here was my unsuccessful attempt. I was wondering how to do this.

<c:forEach items="${lstCart}" var="cartItem" ...

38. How to resolve : Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"    stackoverflow.com

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="com.library.controller.*"%>
<%@ page import="com.library.dao.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="java.util.Date" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Return Page</title>
</head>
<body bgcolor="#aabcde">
<div align="right"><a href="Login.jsp">Logout</a></div>
<table align="center" border="2" cellspacing="3" cellpadding="3">
<tr><th>BookID</th><th>BookName</th><th>Issuedate</th><th>returndate</th></tr>
<c:forEach var="element" ...

39. How do JSP tag files and libraries work?    stackoverflow.com

I've been learning about JSPs and came across tag files and libraries. I know that they are custom actions and useful for pointing out errors instead of using JavaBeans for example, ...

40. JSTL tags performance issues    stackoverflow.com

I am using so many JSTL tags in single JSP page. I want to know if any performance issues occur due to that. How about the Page Rendering Time in ...

41. Conditional with JSP tags    stackoverflow.com

I've got no experience with JSP tags. I'm editing someone's web page (installing a plugin for a table). The table is generated with what seems to be JSP tags. They've got:

<c:forEach items="${row.fields}" ...

42. JSP/JSTL: Passing a Collection to a Custom Tag    stackoverflow.com

I'm trying to implement a custom JSP tag that accepts as an attribute a Collection of objects and outputs them as a JSON-formatted array (each object in the Collection provides a ...

43. Use of JSTL in a web app    stackoverflow.com

I am a front end or UI developer with limited understanding of Java. I have a java based web app with JSTL used in it..I would like to understand the exact ...

44. how to get values passed on from Custom tag in your TagHandler?    stackoverflow.com

How do I get values passed as a tag attribute on a JSP page?

<abc:myTag name="${userName}", empId="${empId}">
  <b> Displaying user's info in HTML </b>
<abc:myTag />
I need to access the value ...

45. How to clear bodycontent of a custom tag?    stackoverflow.com

How do I clear the body content placed inside a Custom tag?

<abc:myTag display="true">

   <b> Clear this content </b>  

<abc:myTag />
Based on the display="true" boolean flag in my tag ...

46. JSP/JSTL: '2 > 10' Evaluates to true    stackoverflow.com

I have a very simple custom JSP tag that I am using to generate pagination links. It goes roughly like:

<span id="${id}" class="paginationLinks ${cssClass}">
    <c:if test="${currentPage gt 1}">
 ...

47. JSTL custom tag    stackoverflow.com

How would I write (just a template) for a custom tag with 2 attributes that lets me output a html fragment (a html table) using jstl tag logic, that can be ...

48. How to come out of if tag of JSTL , like using break in C if loop.    stackoverflow.com

I am using Jstl if tag to check condition I would like to know ,How to come out of if tag of JSTL , like using break in C if loop. ...

49. Use JSTL tags in GSP    stackoverflow.com

I'm trying to use the c:url JSTL tag in a GSP. I've added the following declaration to the top of the GSP's layout:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
I've also added jstl-1.1.2.jar as ...

50. Defining your own JSP tag body    stackoverflow.com

Recently I've decided to get some knowledge about writing custom tags. And there is a problem. In my web app I use some JSTL tags and in every JSP page I have ...

51. Create a custom JSTL tag that returns an object instead of writing to the output stream    stackoverflow.com

I've been searching for a way to create a custom JSTL tag that returns an object or map instead of just using out.print to dump the markup directly from the code. Specifically, ...

52. C:out tag in jstl    stackoverflow.com

I am new to jstl.This is my code. hello.jsp

  <%@ page contentType="text/html" %> 
 <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
 <html> 
 <body> 
  <form method="GET" action="jstl-choose-tag.jsp" > 
 Select an ...

53. How can access java class methods inside jstl tags    stackoverflow.com

I'am using JSTL for jsp pages to display data. This is my code.

<c:set var ="input1" value="${event.eventData}"/>
<c:out value=" <%= stringCustomizer.stringTokernize(args1,0,10) %>" />
first argument(args1) of stringTokernize() method is, "input1" variable which ...

54. rendering dynamic content inside tag    stackoverflow.com

I have a requirement when I have to render dynamic content like "tile:" inside the doStart of the tag. I went through the following post. in the following post ...

55. Logic of JSTL fmt tag in displaying decimal numbers    bytes.com

hi , We have the below code in our jsp if the variable value is 6.650996 it prints 6.7 if the variable ...

56. JSTL forEach Tag and conversationList    seamframework.org

57. problem on jstl core tags in seam    seamframework.org

58. problems on jstl core tags in seam    seamframework.org

59. [ANNOUNCE] JSP Standard Tag Library (JSTL)    coderanch.com

The JSP Standard Tag Library (JSTL) is a new standard under the Java Community Process. JSTL 1.0 was finalized at the end of May 2002, and its reference implementation was released as part of Sun's Web Services Developer Pack (WDSP) earlier this month. The goal of JSTL 1.0 is to simplify the development of JSP pages by standardizing tags for the ...

60. why no while loop tag in JSTL    coderanch.com

61. logic tags in JSTL?    coderanch.com

62. JSTL Jakarta Mailer Tag    coderanch.com

Hi all, I am having trouble with my mailer tags. I have to develop an application which uses them, but I don't have access to the server logs. The trouble is the page appears to be running correctly, except either the E-Mail isn't being sent, or is getting lost/bounced. I am getting no error messages in the page. Is there a ...

63. JSTL forEach tag    coderanch.com

64. small problem with JSTL x tags    coderanch.com

66. JSTL + custom tags    coderanch.com

67. help with JSTL core forEach tag    coderanch.com

I am trying to use the tag to iterate a list and pull out java beans so I can display the properties to the user. Here is the the first line of code: For some reason when I try to access the address object inside the forEach tag I am getting the following error: cannot resolve symbol ...

68. Jstl / Custom Tag Combination    coderanch.com

Could someone please help me? I have a custom tag. I refernce the tag in my Jsp page with: <%@taglib prefix="services" tagdir="/WEB-INF/tags/services" %> inside the tag i have: and I can do things such as which works fine when i use i ...

69. JSTL forEach tag taking longer time than scriplets ???    coderanch.com

You're trading a potential small drop in performance for a massive increase in maintainability and easier development. That's a slightly increased hardware spec for the app for a large decrease in development time and cost. Having created over a hundred JSTL based pages I can tell you the performance of them is excellent. What takes slightly longer is compilation but that ...

70. why prefix is necessary in jstl tag?    coderanch.com

71. diff between jstl and custom tag    coderanch.com

72. Problem with JSTL fmt:setBundle tag    coderanch.com

73. Convertor for html tags to jstl tags    coderanch.com

74. JSTL tag c:if    coderanch.com

75. JSTL tags    coderanch.com

76. Not able to access JSTL tags    coderanch.com

77. JSTL Tags    coderanch.com

78. Problem with JSTL "X:Transform" Tag    coderanch.com

79. JSTL c:out tag    coderanch.com

80. Using JSTL forEach with a custom tag    coderanch.com

81. JSTL tags    coderanch.com

83. How to replace jsp script with jstl tag    coderanch.com

84. Regarding c:forEach jstl tag.    coderanch.com

Originally posted by Adeel Ansari: Which one are you using JSTL 1.1 or JSTL 1.0? i can't find the the jstl version. i am using tomcat V-5.0.28. I am sending my tomcat release note along this. please check the Release Note and let me know which version i am using. Apache Tomcat Version 5.0.28 Release Notes $Id: RELEASE-NOTES,v 1.18 2004/06/15 18:42:06 ...

85. Questions about jstl tags : useBean forEach set    coderanch.com

Hello Bear Bibeault, This is what my jsp looks like: there is too much scriplet code. ArrayList orgaBeans = (ArrayList)request.getAttribute("organigrammesBeans"); OrganigrammeInstitutionBean orgaBean = null; int size = orgaBeans!=null?orgaBeans.size():0; IDepartement departement = null; IPersonne personne = null; IActivite activite = null; String activitePrincipale = null; for(int j=0;j

86. JSTL tags not recognized    coderanch.com

87. Help with JSTL tags, c:when    coderanch.com

Please help me form my JSTL tags correctly... I couldn't found anything that relates to my problem.
|
I need to make a logical condition that when x%10 == 0, it prints a newline (
), and when not, it prints a " | ...

88. jstl - fmt Tag problem    coderanch.com

hi.. I am facing problem in jstl. I have written a jsp file wich is using jstl, tag when I execute this file its gioves me an error HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /dt.jsp(6,8) According to TLD or attribute ...

89. JSTL inside tag    coderanch.com

90. Where to find exercises about JSTL, custom tags, etc    coderanch.com

Hello all, we are a group of colleagues studying together to obtain our SCWCD certification. For every session we have, some of the students make a presentation about the chapters in Head First we studied, and others are supposed to make exercises, so we can practice what we've studied. That last bit, making the exercises, proves to be hard if you ...

91. Can't load JSTL tag library    coderanch.com

92. Nesting JSTL Tags    coderanch.com

93. What does JSTL tags turn into ?    coderanch.com

Hi Friends , Its been quite a long time here at the ranch and there has been a lot i have learnt and contributed to my fellow ranchers here. Now , I have got an book of the Author Shawn Bayern , JSTL in Action by the Manning Publications , I have started learning it and am really loving the way ...

94. using JSTL with Custom Tags    coderanch.com

95. scriptlets or JSTL and custom tags    coderanch.com

If they prefer scriptlets I (and many others) don't want them working on my projects at any time. And as Indians are smart marketeers who almost certainly know that I think you'll find many companies using JSTL by now. Scriptlets are very much legacy tech and should never be used unless there's no way around it, and there almost always is, ...

96. JSTL setBundle Tag - how to reload a resource bundle dynamically    coderanch.com

Hello, I have the following working example that load resource bundles using JSTL fmt Tag Library: Header.jsp has this: ... .. Phone.jsp has this: ... includes Header.jsp... ... LinkResources.properties looks like this: image.but_clickhere_on.gif.relative=/site/en/generic/css/vm_css.css ... By default JSTL use the ResourceBundle java class to load the bundle. The issue with this example is ...

97. Use constants in jstl tag    coderanch.com

98. Displaying local time using jstl tags    coderanch.com

99. jstl anchor tag example    coderanch.com

100. java 1.5 list iteration using jstl tag    coderanch.com