I have a .tag file that requires a javascript library (as in a .js file).
Currently I am just remembering to import the .js file in every JSP that uses the tag but this is a bit cumbersome and prone to error.
Is there a way to do the importing of the .js inside the JSP tag?
(for caching reasons I would want the .js to be a script impo...
I have a JSP page that contains a scriplet where i instantiate an object. I would like to pass that object into the JSP tag without using any cache.
For example i would like to accomplish this:
<%@ taglib prefix="wf" uri="JspCustomTag" %>
<%
Object myObject = new Object();
%>
<wf:my-tag obj=myObject />
I'm trying to avoid dir...
Hi,
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 a HTML table row, and in the last row of the table I'd like to show the total of all the ages.
The code to generate the table rows will look something like this:
<c:forEa...
Hi,
I have a class that defines the names of various constants, e.g.
class Constants {
public static final String ATTR_CURRENT_USER = "current.user";
}
I would like to use these constants within a JSP without using Scriptlet code such as:
<%@ page import="com.example.Constants" %>
<%= Constants.ATTR_CURRENT_USER %>
There appea...
Hello
This is a problem that only occurs on application update (only tested through Admin Console, not CLI). Also, this is only happening on our development environment, which is identical to our prod env. On uninstall/install, everything is compiled properly. However, this is a large application and it takes long enough to do an upd...
HI..
I m creating a Jsp custom tag, that should take an array object in the custom tag and it should display the elements of the tag in the HTML table form. Do anyone have the suggestion kindly helpful.
Thanks and regards.
Vinayak
...
Hi,
Does anyone know how I can retrieve the previous JSP URL that a page has come from within a JSP?
Can I retrieve this from the session/ request/ response object?
Hope this makes sense, Thank you
...
Hi,
How would I assign a variable within scriplet code in JSP <%> and then use struts logic tags to do stuff based on the value of the variable assigned in the scriplet code block?
I have tried using struts:logic equal and greaterthan to no avail....
Many Thanks,
...
I m passing multiple attributes in my custom tag like
< mytag Firstname="Thadeus" Lastname="Jones" >
Then how would I access the individual attributes in the TagHandler class..
Kindly specify any suggestions..
Regards,
Vinayak
...
I'm having trouble with a custom tag:-
org.apache.jasper.JasperException: /custom_tags.jsp(1,0) Unable to find setter method for attribute : firstname
This is my TagHandler class:
package com.cg.tags;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
public class N...
Hi,
I seem to remember reading that it's possible to declare taglib directives such as:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
in web.xml. This eliminates the need to duplicate this directive in every JSP file where the taglib is used. Could someone tell me how these directives can be added to web.xml?
Chee...
Can anybody gimme the idea about the JSP custom tag library and the JSP 2 Tag files..
Are this two are alternatives to use....???
If there is any comparision(or merits and demerits) among this please do specify..
And which one of this is better to work with..
I m waiting for the kind suggestions..
Regards,
Vinayak
...
I am considering creating some JSP-tags that will always give the same output. For example:
<foo:bar>baz</foo:bar>
Will always output:
<div class="bar">baz</div>
Is there any way to get a JSP-tag to behave just like static output in the generated servlet?
For example:
out.write("<div class=\"bar\">");
...
out.write("</div>");
i...
I've seen this question regading the importing of js-files related to the tag content itself. I have a similar problem, here I have a jsp tag that generates some HTML and has a generic js-implementation that handles the behavior of this HTML. Furthermore I need to write some initialization statements, so I can use it afterwards through J...
I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities "thinsp", "ensp" and "emsp" (I can't use "nbsp", these have to be breaking), but th...
Is there a pure-Java equivalent to <jsp:forward page="..." /> that I can use within a <% ... %> block?
For example, I currently have a JSP page something like this:
<%
String errorMessage = SomeClass.getInstance().doSomething();
if (errorMessage != null) {
session.setAttribute("error", errorMessage);
%>
<jsp:forward pag...
In JSP I can reference a bean's property by using the tag
${object.property}
Is there some way to deal with properties that might not exist? I have a JSP page that needs to deal with different types. Example:
public class Person {
public String getName()
}
public class Employee extends Person {
public float getSalary()
}
In J...
Hi,
I'm interested to know what are the "must have" JSP tag libraries apart from JSTL. All I've found so far are
ccc - for accessing static constants in JSP (without scriptlet)
displaytag - for generating sophisticated HTML tables that includes data paging, grouping, sorting, exporting etc.
What other indispensible tag libs are out ...
Hi,
I'm using the JSP displaytag tag lib to create HTML tables. I'd like the user to able to click on a column header in order to sort the data. My JSP code is shown below:
<display:table name="tableData" id="stat" sort="page">
<display:column property="name" title="Name" sortable="true"/>
<display:column property="age" title="Age"...
I am implementing a tree tag for one of my practice projects, where I would display the contents of a directory in the form of a tree (recursively). I had implemented a similar requirement as a Custom Tag in Java during the pre-JSP2.0 days.
Handling a directory needs recursion (to handle the subdirectories)! Is it possible to code this a...