java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

It’s been a while since I posted this, but I thought I would show how I figured it out (as best as I recall now). I did a Maven dependency tree to find dependency conflicts, and I removed all conflicts with exclusions in dependencies, e.g.: <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging-api</artifactId> <version>1.1</version> <exclusions> <exclusion> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> </exclusion> </exclusions> … Read more

How to install JSTL? It fails with “The absolute uri cannot be resolved” or “Unable to find taglib” or NoClassDefFoundError or ClassCastException

In your specific case, org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application that URI is for JSTL 1.0, but you’re actually using JSTL 1.2 which uses URIs with an additional /jsp path. This URI change is because JSTL, who invented EL expressions, was since … Read more

View all fields / properties of bean in JSP / JSTL

Replace object with the bean to determine. <c:set var=”object” value=”${product}” /> Display all declared fields and their values. <c:if test=”${not empty object[‘class’].declaredFields}”> <h2>Declared fields <em>&dollar;{object.name}</em></h2> <ul> <c:forEach var=”field” items=”${object[‘class’].declaredFields}”> <c:catch><li><span style=”font-weight: bold”> ${field.name}: </span>${object[field.name]}</li> </c:catch> </c:forEach> </ul> </c:if> Display all declared methods. <c:if test=”${not empty object[‘class’].declaredMethods}”> <h2>Declared methods<em>&lt;% object.getName() %&gt;</em></h2> <ul> <c:forEach var=”method” items=”${object[‘class’].declaredMethods}”> <c:catch><li>${method.name}</li></c:catch> … Read more

How to obtain request / session / servletcontext attribute in JSP using EL?

It’s just the attribute name as you’ve set yourself here: request.setAttribute(“list”, fooList); It’s thus “list”: ${list} This works the same way for session.setAttribute(“name”, value) and application.setAttribute(“name”, value). The value is in EL available by just ${name}. More detail: EL uses by default PageContext#findAttribute() which scans in subsequently the page, request, session and application scopes for … Read more

How to encode a String representing URL path with JSTL?

The <c:url> does not encode the URI as specified in its value, but just URL request parameters which are specified by a nested <c:param>. The IBM article which you linked also doesn’t tell otherwise. I think that you confused it with “URL rewriting” (which is in essence nothing more than appending the jsessionid whenever necessary). … Read more

javax.el.PropertyNotFoundException: Property ‘foo’ not found on type com.example.Bean

javax.el.PropertyNotFoundException: Property ‘foo’ not found on type com.example.Bean This literally means that the mentioned class com.example.Bean doesn’t have a public (non-static!) getter method for the mentioned property foo. Note that the field itself is irrelevant here! The public getter method name must start with get, followed by the property name which is capitalized at only … Read more

Why are my JSP changes are not reflected without restarting Tomcat?

In the tomcat docs, see the development setting. It must be set to true in order to have jsps reloaded. development – Is Jasper used in development mode? If true, the frequency at which JSPs are checked for modification may be specified via the modificationTestInterval parameter.true or false, default true. This is in your CATALINA_HOME/conf/web.xml … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)