taglib

In JSP is it necessary to redeclare tag libraries in included files?

Im not really familiar with how this works in JSP but in the main.jsp template there is this: <%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> <jsp:include page="/jsp/common_head.jsp"/> then in common_head.jsp we have this again: <%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %> is this necessary? or in other words Are taglib...

Grails: Templates vs TagLibs.

In Grails, there are two mechanisms for modularity in the view layers : template and taglib. While I am writing my own Grail app, I am often facing the same question when I need to write an UI component : do I need to use a template or a tagLib ?After searching the web, I didn't find a lot of best practices or rules of thumb concerning ...

JSPX namespaces not visible for EL functions?

I'm attempting to use JSPX (pure XML syntax for JSP) and running into what seems like it should work, but doesn't. I'm importing taglibs using namespace declarations in the jsp:root element, then using these later on for elements as well as EL functions: <jsp:root version="2.0" xmlns:jsp="http://java.sun.com/JSP/ xmlns:c="urn:j...

How do I determine where a JSTL expression variable (pageContext attribute) originated in IDEA?

We've got an app that makes heavy use of JSTL expressions and custom taglibs, which means our pageContext attributes could have been set just about anywhere. How do I go about determining where they originated? Consider something like: <c:out value="${ myObject['SOME_KEY'] }" /> I need to know where myObject came from -- how did it ma...

How to stop further request execution from inside a taglib?

Basically, we want to create a taglib that can possibly forward request execution to another page, similar to <jsp:forward />. How can we prevent the rest of the JSP page from executing from within the taglib? ...

Struts2 taglib, compare with null

I am trying to know why this code is not working when I compare a String with null in a JSP. <s:set name="myvar" value="%{'teststring' != null}" /> <!-- always true --> myvar value is ${myvar} Above code works fine, and prints "myvar value is true". But doing any of these <s:property value="myvar" /> <s:property value="%{myvar}" /> ...

taglib# returns wrong duration

I'm getting the duration of an MP3 file in this way: TagLib.File file = TagLib.File.Create(fileName); var duration = file.Properties.Duration; and it is consistently giving me a duration between 68 and 75% of the real duration. Windows File Manager, VLC and just playing the MP3 and measuring with a stopwatch agree on the other duratio...

Should i use JSTL in JSF 2 xhtml pages?

Hi, I would like to bind a backing bean's field to the selected value of a selectOneListbox. This value could be null, so i want to convert this to 0. This will set the selected value to the "default" selectItem. I'm using JSF2 I'm planning to do this with the http://java.sun.com/jstl/core taglib (using <c:if test="#{empty...}>) My q...

How to validate/syntax-check JSP taglibs?

At work I currently write a lot of custom JSP-Tags for our designers, which are written in JSP's XML flavour (rather than Java classes). When I typo'ed or made a mistake and try to load the TLDs or tag files, Tomcat always just throws the non-descript error: Could not add one or more tag libraries. Now I have to hunt around the taglib...

J2EE taglibs and optional packages

I have deployed an optional package as a jar file in Weblogic 9.2 (servlet 2.4, jsp 2.0). In my war file, I specify the jar as an optional package in the MANIFEST.MF. I am able to use a filter and servlet class from the jar file, but I'm not able to find a taglib from my jsp. I'm getting the No tag library could be found with this UR...

cannot load JSTL taglib within embedded Jetty server

I am writing a web application that runs within an embedded Jetty instance. When I attempt to execute a JSTL statement, I receive the following exception: org.apache.jasper.JasperException: /index.jsp(1,63) PWC6188: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed wit...

Netbeans 6.8 Facelets custom componentes autocompletion

I can create and use facelets custom components with netbeans. The steps I followed are: Create a Facelets tag library (mytaglib.xml). Declare the tag library in web.xml (javax.faces.FACELETS_LIBRARIES) Import the tagfile using namespace (xmlns:rde="http://test.com/mytaglib"). But I can not define the metadata of my custom components...

Struts2 strip Script Tag ?

Hello everybody, I have a big pb with struts 2, when i put embedded tag in my jsp, when i want to display it, they seem to have diseappered from the file. Is there any content filtering process in struts ? (to prevent XSS for example) Regards. ...

Grails: Invoking one taglib from within another

Hi, I want to define my own taglib that will use the g:datePicker to generate some of it's output. class MyTagLib def myTag = {attrs -> // I need to invoke the `datePicker` tag of the the `FormTagLib` tag library // provided by Grails } } I want to pass along the attributes map when I invoke this tag. When I invok...

Why is this (trivial) unit test failing?

This was taken nearly verbatim from IBM's Mastering Grails series. DateTagLib.groovy: class DateTagLib { def thisYear = { out << Calendar.getInstance().get(Calendar.YEAR) } } DateTagLibTests.groovy: class DateTagLibTests extends TagLibUnitTestCase { def dateTagLib protected void setUp() { super.setUp() ...

Where do I put jstl.jar and standard.jar so that Netbeans don't give errors/warnings?

Where do I put jstl.jar and standard.jar so that Netbeans don't give errors/warnings anymore about the taglib. ...

JSP Custom Taglib: Nested Evaluation

Say I have my custom taglib: <%@ taglib uri="http://foo.bar/mytaglib" prefix="mytaglib"%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> <mytaglib:doSomething> Test </mytaglib:doSomething> Inside the taglib class I need to process a template and tell the JSP to re-evaluate its output, so for example if I have this: pu...

Struts - Taglib directive in a JSP page for .tld provided by Struts

I am developing a Struts based application. I am new to Struts. I want to use html tags , specified in a taglib directory provided by Struts, in a JSP page. But don't know how to use it. I know how to use taglib directive but I came to know from sources that the .tld file has been embedded in a .jar file after version 1.2.8. I am using ...

JSF tags are required to contain IDs:"html:link " but doesn't work better with id

I try to generate : <html:link href="chargementDonnees.do?Label=ENERGIE">ENERGIE</html:link> <html:link href="chargementDonnees.do?Label=ETAT_PROJET">ETAT_PROJET</html:link> using : <html:link href="${urlTable}" ><c:out value="${label}"/></html:link> But I get an error message : JSPG0048E: Validation error. The following JSF t...

JSP Googlemaps taglib not found, where have I gone wrong?

I'm trying to add Google Maps onto my JSPs by using the Googlemaps taglib. I've added this into my maven pom <dependency> <groupId>com.lamatek</groupId> <artifactId>googlemaps</artifactId> <version>0.98c</version> <scope>provided<>/scope </dependency> This then included the googlemaps-0.98c lib...