jstl

java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei

i am finding java.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei. i have already struts2-core-2.1.8.1.jar, struts2-json-plugin-2.1.8.1.jar on my classpath. ...

Parse JSTL XML inside JSF

I'm working on a project which I need to generate a form dynamically. The user chooses the component he wants to put on the screen and the program adds it in the form. To do so, I'm using XML to define the current state of the form and at first sight I thought in using XSLT to make the transformation to JSF but now I am evaluating JSTL t...

XSLT, JSTL e JSF

I have a xml file which I want to transform in a jsf code page. To do that I've created a xsl file. xml: <?xml version='1.0' encoding='ISO-8859-1'?> <questionario xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:noNamespaceSchemaLocation='Schema2.xsd'> <componente nome='input'> <id>input1</id> </...

Spring MVC - JSTL - Session Attribute

Hi: I have a Spring Controller where I am setting a session object with variables . @RequestMapping("/index.html") public String indexHandler(HttpSession session, HttpServletRequest request, HttpServletResponse response){ session ...

How to simulate a group-by in JSTL view layer by keeping track of previous & current values while looping over a List?

First I retrieve the Note objects in the service layer: List<Note> notes = this.getNotes(); Then I pass List of Notes to the view layer and set the same initial value for prevNote and currNote to the first element of the List: <c:forEach items="${notes}" var="note" begin="0" end="1" step="1"> <c:set var="prevNote">${note}</c:set>...

JSTL - parse not working for elements with namespace

I am trying to parse the following XML using JSTL. I can easily retrieve all the elements in the XML apart from the tags with the "t" prefix, how do I do this? XML looks like (feed.xml) <rss version="2.0" xmlns:t="http://www.xxx.co.uk/xxx"&gt; <channel> <title></title> <link></link> <description></description> <languag...

which is evaluated first my taglib or jstl?

I'm a little confused if which one is evaluated first. jstl or my custom taglib. Here is some snippets. <taglib> ... <tag> <name>my_tag</name> <tagclass>MyTagLib</tagclass> <bodycontent>JSP</bodycontent> <attribute> <name>attr1</name> <required>true</required> <rtexprvalue>true</rtexprv...

Label text based on the locale

I want to display the label name depending on the Locale (like English or French). I have two properties file: messages.properties: customer.name=Name messages_fr.properties: customer.name=Nom I have an array list in a Java class. In this list I want to store the values depending on the locale: arraylist.add(new ListItem("CustomerNam...

Iterating Vector of Hashtables using c:forEach

I have Vector of Hashtables and each hash table has two elements with keys 'key1' and 'key2'. Now in the jsp page i have to iterate those vector and print those values in the hash table using jstl tag c:forEach Could anybody helps how to do that using c:forEach ...

Activity display dynamically depend on the locale on Struts 2

i want to display activities dynamically which can be increase or decrease on struts 2 and that depend on the Locale (like English or French) . dynamically means user can be add or delete activity at run time. I have two properties file: messages.properties: activity.name=activity messages_fr.properties: activity.name=activity_fr for...

Possible to comment-out JSTL code?

If you want to temporarily comment-out a piece of JSTL code that you may re-enable later, is this possible? Would this work? <!--<c:out value="${someVar}"/>--> ...

JSTL and hashmap not working

In a servlet I have: HashMap eventsByDayNo = new HashMap(); eventsByDayNo.put (new Integer(12), "day 12 info"); eventsByDayNo.put (new Integer(11), "day 11 info"); eventsByDayNo.put (new Integer(15), "day 15 info"); eventsByDayNo.put (new Integer(16), "day 16 info"); request.setAttribute("eventsByDayNo", eventsByDayNo); request.setAttr...

nested Java collection to list items per person per day in a calendar grid using JSTL?

I am developing an employee scheduler Java web applicatyion where an employee can specify days they will be out of the office for things such as vacation, business travel, etc...I have a simple mechanism for adding/editing/deleting these records. But I am struggling with the JSTL and which collector I should be passing to the jsp for th...

How do I pass a parameter to a JSP via a cross-context JSTL import?

I've come across a few other questions that describe a similar, but not identical situation, to mine. This question, for instance, shows pretty much the same problem, except that I'm not using portlets - I'm just using boring ol' JSP+JSTL+EL+etc. I have two application contexts, and I'd like to import a JSP from one to the other. I know...

simplify the Struts tag

Can you simplify this and how can i use this in Struts 2 <s:iterator value="listObject"> <s:component template="abc.vm"> <s:param name="text" value="listValueObject" /> <s:param name="prefix" value="listIndexObject" /> </s:component> </s:iterator> i want to iterate over a list ...

JSTL : <fmt:setBundle> Illegal scope attribute without var

My jsp file has code line as below: <fmt:setBundle basename="blah" scope="blah"> I have two different environments. On one of the environments it complains about 'scope' attribute being used without using 'var' attribute. On the other environment, this does not complain. I doubt that it could be because of different version of JSTL. H...

How to access variable set by JSTL core in my JSP page?

In my webapp, I want to set a default cookie to store a locale of 'en_US'. I have functionality in place for the user to change this successfully. However, I've removed a lot of scriptlets on my .jsp and replaced with some JSTL tags to set a default cookie value, but it doesn't seem to work. It seems that I can't access my ${lang} varia...

java inheritance and JSTL

I want to acces to an attribute inherited by one of my java classes, in a jsp using jstl 1.2 : Java : public class LigneDeclarationBean { private ELigneDeclaration ligneDecla; private ETypeFormulaire typeForm; ... public ELigneDeclaration getLigneDecla() { return ligneDecla; } public class ELigneDeclaration ext...

JSTL foreach on enum

I have a contant list declared in java using enum type, that must appears in a jsp. Java enum declaration : public class ConstanteADMD { public enum LIST_TYPE_AFFICHAGE { QSDF("qsmldfkj"), POUR("azeproui"); private final String name; @Override public String toString() { return name; ...

JSTL: can't implement class for tag <c:forEach>

Hello! 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")); book_list.add(new Book("BookTitle_02","book_02.htm...