Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Jersey » Conflict between @FormParam and ${param}
Conflict between @FormParam and ${param} [message #1826816] Fri, 01 May 2020 09:25
Álvaro González is currently offline Álvaro GonzálezFriend
Messages: 1
Registered: May 2020
Junior Member
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?
Previous Topic:jersey endpoint throwing an exception org.glassfish.jersey.server.internal.process.MappableException
Next Topic:ResourceFilter and ResourceFilterFactory Interfaces were Removed
Goto Forum:
  


Current Time: Thu Jan 16 11:45:34 GMT 2025

Powered by FUDForum. Page generated in 0.02307 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top