jsp-tags

javax.servlet.jsp.JspTagException: 'begin' < 0

javax.servlet.jsp.JspTagException: 'begin' < 0 Once in a while you run into an error and you say: What the WHAT?? tagexception begin < 0. Seen this wonder before?? ...

Why is <taglib> giving me a problem in my web.xml

I have this web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="W...

Struts2 a tag`s problems

Hi here is a tiny part of my struts2 code. I am using struts2 tag "a" to carry out my functionality. <s:a href="%{Num}" name="delete"> However, when this converted to plain HTML code, it becomes <a id="delete" href="/WorldExpo/deleteproduct.action?productcode=FLAG_AT"> I am wondering why the HTML tag "a" has got id="delete" rather...

Calling a custom JSP tag from JSTL tag

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 character here? <img align="left" src="<c:url value='/getFile/getfile?<myTag:getValue type="web" name="person" />'/>" alt="person" title="person" width="55" height="70"/> ...

How to call a Servlet when I click on a Hyperlink

On a JSP Page I have populated a table with some id's. I have made these ID's as hyperlink. Now i want that if I click on any id it should go to a servlet and that particular id should also be passed to the servlet. ...

EL evaluation in tags

In the below code snippet, the intention is to take value for name from a variable, however no value gets output when it is tried with EL, while direct assignment works fine. <%! String sName; %> <% sName="ABC"; %> <H3> Hello <c:out value="${sName}"/> </H3> <H3> Hello <c:out value="ABC"/> </H3> What is missing or has gone wrong here?...

How to pre-compile jsp tag files?

http://download.oracle.com/javaee/1.4/tutorial/doc/JSPTags6.html says: Tag files can also be compiled into Java classes and bundled as a tag library. This is useful when you wish to distribute a binary version of the tag library without the original source. If you choose this form of packaging, you must use a tool that ...

Extending JSP Custom Tags

How do you extend an existing JSP custom tag? As you know, a custom tag consists of two parts, an implementation class and a TLD file. I can extend the parent custom tag's class, but how do you "extend" its TLD file? One obvious solution is to cut and paste it and then add my stuff, but I wonder if there's a more elegant solution like t...

Taglib in Java: tag with array parameter

Hi, How can I define a tag that receives a array as a parameter? Thanks ...

Unable to compile class for JSP in tomcat

Symptoms: Any JSP pages in the project produce error messages as below: org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /check.jspf Generated servlet error: *Duplicate local variable usr* An error occurred at line: 5 in the jsp file: /check.jspf Generated servlet erro...

exporting jasper report in pdf format working but exporting it into html format not working properly

When I am exporting a jasper report in pdf format it is working properly and all the charts are working. In the case of exporting in HTML format, it is not working properly. The lists are shown but the charts are not coming out in the report. It is showing unnecessary columns with a cross image. It is not giving any error in the consol...

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...

JSP/servlet read parameters from properties file?

My JSP pages need to display different information depending on which environment they're in (dev, production, sandbox, etc). I want to have a properties file for each of these environments that contain all the parameters they might need. How can I reference the properties from this file in a JSP page? My thoughts are: Have a servle...

How to write tag in my spring project?

I want to write my tag (extends TagSupport) in my spring framework. In my tag class, will use some service which should auto inject by spring. But I always get null, seems spring can't inject service instance in my tag class. The code is like the following: public class FetchTagNameTag extends TagSupport { @Autowired private Tas...

using internationalization on list data

i am using Struts2 in application. <s:iterator value="listObject"> <s:component template="abc.vm"> <s:param name="text" value="listValue" /> <s:param name="prefix" value="listIndex" /> </s:component> </s:iterator> listValue is a values of list. i am using iterator to traverse the list. now on listValue, i want to put here in...

bean write format 000000

I want to make format number in my jsp view as follows: 0000001 0000090 0911111 I try use <bean:write format="0000000"> but the format does not work. ...

How to use list object in <c:forEach tag?

I have two list objects in request. Now I want to use them in jsp page by the following approach: <c:forEach items="${listA}" var="A"> <tr><td>${A.propA}</td><td>${listB[A.index].propB}</td> </c:forEach> Is that possible? Thanks I got the correct approach: <c:forEach items="${listA}" var="A" varStatus="status"> <tr><td>${A.propA}</t...

download spring taglibs

I want to use spring taglibs in UI layer in my project. Can anyone let me know where from i need to download the spring taglibs? ...

useBean setProperty not behaving as advertised

I'm trying to use "auto wiring" between request attributes and a bean with <jsp:useBean id="cib" class="(fqn).CarInfoWebBean" scope="request"> <jsp:setProperty name="cib" property="*" /></jsp:useBean> but the setter of the (only) property doesn't get called. The bean property is of type long, and the property name and attribu...

graphics are not shown on jsp

in my application all jsp pages in jsps folder i give the path in index.jsp:<% response.sendRedirect(response.encodeRedirectURL("/Projectname/jsps/main.jsp")); %> although main.jsp is show but it does not show logo, graphics etc. all the js and logo files in js folder which is parallel to jsps and WEB-INF folders. now structure is: Proje...