jsp

JSTL forEach tag: problems with enumeration, and with understanding how it should work

Hello, I've experienced rather strange behavior of JSTL forEach tag. I have some bean called SessionBean: public class SessionBean { private Collection<MyObject> objects; public Collection<MyObject> getObjects() {return objects;} ... } And a simple JSP page like that: <%@page contentType="text/html"%> <%@page pageEncoding="UTF...

Doing a generic <sql:query> in Grails

This is a generic way to select data from a table and show the results in an HTML table using JSP taglibs. What is the generic way to do this in Grails? That is, take a few lines of SQL and generate an HTML table from scratch in Grails, including the column names as headers. <sql:query var="results" dataSource="${dsource}"> selec...

sorting HTML tables with displaytag JSP tab library

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

jsp servlet exception: bean not found within scope.

I'm getting this error: javax.servlet.ServletException: bean givingFormBean not found within scope on a page with this at the top. <jsp:useBean id="givingFormBean" scope="request" type="olc.onlinegiving.servlets.BuiltForm"/> The class exists in the classpath, it worked this morning, and I don't get what not found within scope means...

Struts Validation.xml - requiredif problem

hi, I want my validation.xml to only check for a null if certain options are selected from a dropdown. So far I have <field property="empFDServiceStartDate" depends="requiredif, date"> <arg0 key="Service Start date" resource="false"/> <var> <var-name>field[0]</var-name> <var-value>moverCh...

Can struts logic tag evaluate a variable's contents?

Below is what I'm trying to achieve. The problem is "errors" is not defined. If I remove my match logic, the errors are displayed on the web page. Is there anyway of evaluating the text the error contains? <logic:messagesPresent> <tr> <td class="errorcicon"><img src="images/icon_caution.gif" width="18" height="18" alt="Cauti...

AJAX/jsp/HTML vs Applets

Which approach is better? Having jsp/HTML based web application which allows you to traverse web pages in the browser. An applet based web application which opens up a Swing applet screen? ...

How do I get rid of TagExtraInfo JSTL warning in Eclipse?

I'm working with JSTL in Eclipse, using the WTP. I have jstl and standard.jar in my WEB-INF/lib directory, and everything works. Eclipse is giving me this warning in my JSP: The TagExtraInfo class for c:forEach (org.apache.taglibs.standard.tei.ForEachTEI) was not found on the build path. I have JSTL included: <%@ taglib uri="http://...

displaytag, grouping and blank lines

I'm looking for a way to do grouping with displaytag but with the group title separated from the detail. It's probably not all that clear, so here is an example : If I just add groups to a displaytag table, I end up with something like : | group1 | item1 | | | item2 | | | item3 | | group2 | item4 | | | item5 | I ...

Reload the page without submitting it back to the server.

Hi all the problem I have is that I have two sets of values in a drop down list. If type 'A' is selected I want a text box to be populated with a value from the database and be read only. If Type 'B' is selected the box is to be empty and editable. My original code is written in jsp/struts and I have sort of achieved this by using o...

What's the best practice to render JSON data in JSPs?

I need to render JSON data in my JSPs for some AJAX requests. I'd like to know what's the best way to do it in terms of easy to use and stability. ...

Format Date with fmt:formatDate JSP

I am trying to format a date with: <fmt:formatDate value="${newsletter.createdOn}" pattern="MM/dd/yyyy"/> newsletter is an object with a createdOn property which is java.util.Date. When I invoke the previous sentence I get: According to the TLD, the attribute value does not accept expressions. I am importing fmt with <%@ tag...

Best way to modularize a block of JSP code

I have a block of JSP code that needs to be used in several places (basically a widget that several pages use). What's a good way to modularize this? I'd rather not put it in an object since string manipulation of HTML gets ugly. Using <%@ include file="foo.jsp"%> is problematic because we wind up having implicit global vars. ...

java web app decorating/includes issues

Background: we have a system that was written in an older CMS based on Java back during the 2002-2003 days. We want to keep moving forward with our new stuff, using tomcat, stripes, and sitemesh. We have navigation, layouts, "pods", js, css, etc, that we've taken out of the old CMS and into a few of our new apps so we have consistent l...

Is it possible to get calling page name inside a jsp 2.0 custom tag?

I'm writing a custom JSP tag using the JSP 2 tag files. Inside my tag I would like to know which page called the tag in order to construct URLs. Is this possible with out passing it through an attribute? ...

library for server side image resampling using java?

I want to create a serve resampled (downsized) version of images using jsp. The original images are stored in the database as blobs. I want to to create a jsp that serves a downsampled image with decent quality (not pixelated) as per the passed image width/height (e.g. getimage.jsp?imageid=xxxx&maxside=200) . Can you point me to a openso...

How to create conditions based on user role using JSF/MyFaces?

What options do I have to read the roles of the current user from my JSP pages? I'm aware of the visibleOnUserRole="myRole" attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility. ...

Rich interaction in Java/JSP web app

I'm writing a website in JSP using Struts and Hibernate. I'm looking for a way to implement a rich UI where you can have more than just buttons. For examples, drag and drops, drop down lists that updates itself in real time as you type more letters out etc. Is there a way to use something like Swing with Struts and Hibernate? Or are ther...

JSP <c:out> tag

Writing a JSP page, what exactly does the <c:out> do? I've noticed that the following both has the same result: <p>The person's name is <c:out value="${person.name}" /></p> <p>The person's name is ${person.name}</p> ...

Where can I download JSTL jar

Does anyone know because all the places I've tried seem to timeout! ...