dinsdag 19 februari 2008

jstl el troubleshooting

A comprehensive troubleshooting guide handling some common jstl/el mistakes:

http://thoughtsgarden.com/p/jstl-1.1.x-installing-configuring/

My experience



1. Download the yakarta taglibs from here: http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi and copy the standard.jar and jstl.jar towards the /WEB-INF/lib/ folder of your webapp.

2. make sure to have the right web.xml declaration, at least 2.4

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">



3. In your jsp pages define the taglibs like this (only the ones you need):
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>


At this point jstl and el should work without the need of adding any tld definitions in the web.xml definition. You can put a javabean on the request in your servlet by this code:
request.setAttribute("idOfTheBean",beanInstance);

Note that a javabean should always have a no args ctor and public setters and getters for private properties.

A great toturial on the MVC part of jsp/servlets/javabeans is this: http://courses.coreservlets.com/Course-Materials/pdf/msajsp/0B-MVC-Review.pdf

woensdag 13 februari 2008

remote debugging

to remotely debug servers, local java executions, ... add the following arguments:

-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n


You can then connect with eclipse, starting a remote java debug on the given port. here that is 8787.

dinsdag 5 februari 2008

free svn hosting

I started using http://opensvn.csie.org but could problems (host not responding) when actually trying to import.

Now I'm evaluating http://www.assembla.com and so far import is working. It's a different approach because you need to sign up for a developer acount and then you can sign in into projects, become members. So in order to give rights to another user these have to register with assembla.

Don't forget that you can find a lot of information on svn in the following free ebook: http://svnbook.red-bean.com/

edit:

assembla



I'm now getting into assembla and it is all for free and very usefull so far!