I'm using Jersey/1.17 together with JSP on Java/6 (that's the stack the client uses, I can't afford to make major upgrades). I'm learning both techs from scratch.
In JSP, I can use Expression Language to print data from the body of an incoming POST request:
<%@ taglib prefix="c" uri="http ://java.sun.com/jsp/jstl/core" %>
<c:out value = "${param.fooName}"/>
However, ${param.fooName} no longer exists whenever use @FormParam to grab the value in the controller:
@POST
@Path("/new")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
public Response saveNew(
@FormParam("fooName") String fooName
) {
// ...
}
There's no issue though when I grab the value from javax.servlet.http.HttpServletRequest rather than using @FormParam:
POST
@Path("/new")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
public Response saveNew() {
String fooName = request.getParameter("fooName");
// ...
}
Is this a known/documented behaviour in @FormParam or just an unexpected conflict between two libraries from different authors? Is there a workaround to be able to use @FormParam and ${param.fooName} simultaneously?