More on point 1... I tried switching to explicit views and returned a
Viewable containing the model which did render the page but not the
model.
Perhaps what I'm doing doesn't make sense for a POST but how else am I
supposed to "dispatch / forward" to another resource after submitting
a form? It seems that this is only for Read Only apps. Am I missing
something here?
Thanks,
Louis
On 6 Jul 2009, at 22:56, Louis Polycarpou wrote:
> I am working with Jersey's implicit views and would appreciate your
> help on the following issues:
>
> 1) I have a single resource which uses an index.jsp to render a
> (customer) list to the page. I am issuing a POST from a HTML form
> rendered by this index.jsp against the same resource which adds a
> new customer record. How do I then redirect the user back to the
> same page? Currently, I'm returning a Response object. What do I
> need to return in order to render the same index.jsp following a
> successful POST?
>
> @POST
> public Response addCust(@FormParam("name") String name,
> @FormParam("description") String desc) {
> try {
> int custId = persistCust(name, desc);
> return Response.ok().build(); // *** WHAT SHOULD I
> RETURN HERE TO RENDER THE IMPLICIT INDEX.JSP???
> } catch (Exception e) {
> throw new WebApplicationException(e,
> Response.Status.INTERNAL_SERVER_ERROR);
> }
> }
>
> 2) The resource in question is @Path /Customers. I'm hitting an
> intermittent problem where some of the ahref links are not correctly
> rendered by the JSP. I need all links to be relative to the current
> resource at e.g. http://webappname:8080/Customers/{id} but quite
> often the 'Customers' segment is left out. So obviously if I
> hardcode this into the implicit JSP view, it intermittently gets
> inserted twice. Is there a correct way to resolve links on the page
> so that they are relative to the implicit resource?
>
> 3) Finally, I would like to build something which renders a number
> of items on the page that are constructed from multiple REST calls.
> Sort of like a collection of REST portlets (sorry if that is a bad
> word!). Is there any support in Jersey for constructing a page from
> a series of REST calls?
>
> Thanks,
> Louis
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>