jsp

Why do I get an AbstractMethodError when setting a JSTL variable?

I am trying to set a variable that I will refer to in a custom JSP tag, so I have something like this in my JSP: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <c:set var="path" value="test"/> However, I am getting this error when The JSP runs: java.lang.AbstractMethodError: javax.servlet.jsp.PageContext.getELContex...

Use Spring options tag to display enum's toString value

I'm using Spring for an HTML form. One of the fields is an enum and thus I'd like a HTML drop-down list (<option> tag). My enum's name is different than the toString() value. For example: public enum Size { SMALL("Small"), LARGE("Large"), VERY_LARGE("Very large"); private final String displayName; private Size(String displ...

How to link another page when time runs out

I try to develop online exam app with JSP.So I want to link result page with parameters of existing page(exam page) when time runs out. I want to know how to add timer and link another page when time is up. ...

The value for the useBean class attribute ... is invalid

I want to use a java file "SaveProp" which is written in a package "user". The class file has been placed in the WEBINF/classes.Below are the two lines which causes the issue. jsp:useBean id="user" class="user.SaveProp" scope="session" jsp:setProperty name="user" property="*" This is the code, but it throws, The value for the useBean...

el expression in jsp:invoke

I'm trying to use the following snippet inside my tag file: <%@ attribute name="content" fragment="true"%> ... <c:set var="part" value="content"/> <jsp:invoke fragment="${part}" var="partValue"/> ... and compiler gives me the following error: Syntax error, insert ") Statement" to complete IfStatement so as I understand it's not per...

javascript in html spacing

<SCRIPT LANGUAGE="JavaScript"> DynamicImage1(xx) DynamicImage2(yy) DynamicImage3(zz) </SCRIPT> This snippet of JS is in my html. (Each function will display a different value based on the input parameter.) How do I set the spacing between these images? I would like them all on the same row (as they are by default) but with spacin...

how will I do to link another page with parameters (eg radio button controls )of existings page when time runs out in server side code (JSP).

Thanks for answering. As you said , javascript is client side code, and it can also disable. So how will I do to link another page with parameters (eg radio button controls )of existings page when time runs out in server side code (JSP). I also want to try javascript with parameters of controls and also other ways.So if you can , I wan...

use struts tags inside attributes in jspx files

I have some old jsp code that uses the struts tags inside attributes, like this: <link href="<s:url value='/styles/layout.css'/>" rel="stylesheet" type="text/css" media="all"/> I can't get this to work in jspx files though. Is there a good alternative to sort of get the same functionality without too much clutter? ...

Spring MVC Webapp: Where to store paths to common images?

I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously I stored the paths to common images in class Common: public final static String IMG_BREADCRUMBS_NEXT = "/shared/images/famfam/bullet_arrow_right.png"; Then I would use this class in jsp to get the image src like <img src="<%= Common.IMG_BREA...

JSP tags: manipulating body content *before* it is evaluated

I couldn't figure how I can manipulate the body content before its first evaluation. Someone knows how to? [I did succeed manipulating it after the first evaluation, using the BodyTagSupport class by overriding the doAfterBody() method]. ...

Pass JSP output stream to a method

I've created a class MyClass that intends to output a large amount of text to a JSP. Rather than having the MyClass object return a string to be displayed on the page, I figured it would be a better idea for the MyClass object to use the page's output stream. Is this a good/possible idea? In testing possible ways to do this... These ou...

Problem with JSP EL evaluation

Why doesn't the following work: <c:set var="formId" value="#${otherFormId}"/> where <c:set var="formId" value="# ${otherFormId}"/> notice the space ^ works fine (though is invalid for my purposes). Im trying to prepend ${otherFormId} with a # symbol (i.e. creating jquery id selector). The first form ends up with #${o...

In Display tag, on giving a property in the display:column tag, that property gets printed as a column. What should I do to print the same as a row?

In jsp I'm using Display tag to print a table. In Display table tag, on giving a property in the display:column tag, that property gets printed as a column. What should I do to print the same as a row? Let me give an example for clarity: <display:table name="test"> <display:column property="id" title="ID" /> <display:column propert...

How to connect to MySQL from a JSP?

I have installed MySQL Server 4.1 and mysql-connector-java-3.0.17-ga. I have the JSP code just to establish a connection. When I try to execute it, it throws java.lang.ClassNotFoundException: com.mysql.jdbc.Driver. Which file am I missing and where should I place it? Thanks in advance. ...

What is the best way to display multiple PDF files via browser?

I'm developing an web application using Flex and JSP. I am having some performance issues with displaying multiple PDF files. I am trying to display about 50-100 PDF files. I know that is a little crazy. Hence, I made the project to convert PDF files to JPG format and display the JPG files. I'm wondering if there is a way to decrease t...

JSP/Servlets trigger a SQL update

Hello, I have a small window holding an IRC client that opens up when the user logs into a jsp page. I'm trying to figure out a way for an SQL update statement to be called once the pop up window has been closed. Anyone have any ideas on how I could go about doing this? Thanks ~ Kyle G ...

How to get the get method parameters in jsp?

After getting a input from the first page, I passed it in to the url using get method. In the next page I want to process it using jsp, but how do I get that parameter. ...

How to give entry in the where clause when we use it in webpages?

According to the user's input I want to select the record from the database. This is my code: <% String jempid=request.getParameter("empid"); out.println(jempid); int intempid=1223; Connection conn=null; String url="jdbc:mysql://localhost/employees"; Class.forName("com.mysql.jdbc.Driver").newInstance(); conn=DriverManager.getConnection...

Response.End() in Java/JSP

In .net you have the ability to Response.End() in any context you want. Is there similar functionality in Java/JSP? Thanks, Sam ...

Easy way to get started with JSF?

Does anyone know of a good way to get started with JSF for a servlets/JSP person? I'm interested but not sure where to start! Thanks, ...