Is it possible for a custom JSP tag to detect if there are other instances of itself within a page? If so, what's the preferred way to do this? My tag's output needs to be conditional dependent upon whether it's the only instance or not.
Note that my page has three occurences of my tag, two of which have a different set of attributes fr...
I'm thinking about making a simple web application to practice custom tags, EL, ...
Now I'm thinking about how to make a simple front page.
I want to have a front page where I'll show a short description of a post and then the user can click it to see the full article.
Further down the line I'd like to attach a poster to it, and even fu...
home.jsp
<jsp:useBean id="username" class="java.lang.String" scope="application"/>
<%
username="Jitendra";
%>
<jsp:include page="include.jsp"/>
include.jsp
<%=username%>
This gives an error saying “username” is undefined in include.jsp, even though the scope of Bean is application…
...
I have a customer who created an Oracle ADF/JSF 1.1 application. On one of the pages they have a table with first column as an enabled mutually exclusive radio buttons. I had to enhance the page and add the total line with disabled radio button. How can I disable it in Bean class or on the page without using JavaScript? I've tried to ...
Trying to use JSPX and running into a strange problem. Text inside jsp:text is supposed to not be subject to whitespace removal, according to the JSP documentation, but when I have a jsp:text element with leading whitespace in the beginning of a tagx file, when used in the jspx views, the leading whitespace disappears.
I've done quite ...
Hi,
I am new to servlets and jsps. I wanted to know what the best design would be for a sample problem I am trying to write code for. Here goes -
I want to create a web site (www.example.com) that just lists the login history of every user (not any functionility any one wants but just an example for the sake of one).
So there are two...
we have a list of domain objects needing to be edited on an html page. For example, the command & domain objects:
class MyCommand {
List<Person> persons;
}
class Person {
String fname;
String lname;
}
Then, the HTML I expect to have the Spring MVC tag libraries generate is like this:
<form>
<input name="persons[0].fn...
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?
...
I'm currently writing a bunch of JSP tags for our designers to use. In my .tld file I have some <tag> and many more <tag-file> elements.
Now, I want to give the users of the tag library some examples about how to use them. According to Sun's documentation both <tag-file> and <tag> elements are allowed to have an <example> element.
This...
Is there any configuration option which can be used to disable the dynamic attributes feature in Struts 2.1? I use an older webserver which does not support dynamic attributes. Ideally I'm hoping for an alternative DTD or a configuration option in struts.xml
...
I have a two columns of checkboxes with predictable names. How can I disable a checkbox in column B when the ones in column a is unchecked and only enable it when the first the checkbox a is enabled?
<dmf:checkbox
name="someNameAColumnNumber"
value="true"
onclick = "enableColumnBCheckBox" runatclient="true"
/>
Is there somethi...
I want the user to be redirected to Login.jsp if the "role" stored in Session Scope doesn't match with the Request Parameter "accessRole"
HomePage.jsp
<jsp:include page="Header.jsp">
<jsp:param value="d" name="accessRole" />
</jsp:include>
Header.jsp
<c:if test="${sessionScope.role!=param.accessRole}">
<c:redirect url="Login.jsp"/> ...
I'm trying to use a select all checkbox to select a column of checkboxes.
So I gave all the ones I want checked off at once the same name ABoxesElement so that I can easily check them all on in javascript.
However when I use firebug in firefox I can see that the checkboxes did not keep the name I gave them but pre-pended the component...
hello i need to output a java variable inside a javascript call inside a tag inside a jsp !
for example:
<% String param = "hello";%>
<dmf:checkbox name="checkbox"
onclick = "selectAll(<%=param%>)"
/>
the javascript generated is:
selectAll(<%=param%>),this); but I actually want something like
selectAllCheckBoxes(Hello),this);...
I want to call a function on a bean with an argument passsed to it in jsp using EL.
The problem is it does not allow something like:
"${teacherBean.certificationFor(${particularField})"
the thing is i want to iterate over an array and call the function certificationFor for all the values in the array passed as an argument.
I am getting ...
I'm building my own JSP Tag Library which need to support some features that Application developers can use like this:
<w:user-label id="usrlb" value="${session.user}"/>
<w:textbox id="tb" label="User Name" value="${usrlb.value.name}"/>
which means I want my EL can interact with my Tag declaration. and also I need to add stack concept...
Hi,
i want to do arithmetic operation on jsp . I am using struts tag lib tag
following is the code :
<s:set name="value1" value ="%{0.0}" />
<s:set name="value2" value ="%{0.0}" />
<s:set name="percent" value ="%{0.0}" />
<s:iterator>
<s:set name="value1" value ="%{#value1+ someIntegerValue1}" />
...
Created a Tag Library Descriptor File:
<?xml version="1.0" encoding="UTF-8"?>
<taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">
<tlib-version>1.0</tlib-version>
<short-name>im...
Hi Everyone
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 have display set to block, the rest should be hidden.
What I have seems bloated, and does not work.
Thanks for any help.
<c:forEach items="${learningEntry.samples}...
I want to call request.getContextPath() inside a JSP tag which extends SimpleTagSupport, is there any way to do it?
...