users@jersey.java.net

[Jersey] Re: jersey service trouble, a _at_PathParam entry can have a "/" in it

From: Danilo Reinert <daniloreinert_at_gmail.com>
Date: Wed, 27 Nov 2013 20:13:48 -0200

AFAIK, ProcessModels%2FIBO_BAMOnly1 should be recognized as you modelId
pathparam. If this is not happening then it would be a Jersey matter.

Em quarta-feira, 27 de novembro de 2013, phil swenson escreveu:

> I implemented a jersey web service like so:
>
> @GET
> @Path("/ProcessDiagramDisplayData/{modelId}")
> @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_XML})
> public ProcessDiagramDisplayData
> getProcessDiagramDisplayData(@PathParam("modelId") String modelId,
> @QueryParam("timeZone") String timeZoneId,
>
> @QueryParam("refreshInterval") int refreshInterval,
>
> @QueryParam("startTime") long startTime, @QueryParam("endTime") long
> endTime) {
> ProcessDiagramDisplayData processDiagramDisplayData =
> getGlueProcessAnalyticsService().getProcessDiagramDisplayData(urlDecodeString(modelId),
> timeZoneId, refreshInterval, startTime, endTime);
> return processDiagramDisplayData;
> }
>
>
> This is fine, however I ran into a problem today. It appears that is it
> legit for a "modelId" PathParam to have a "/" character in it.
>
> If I URL encode the model ID "ProcessModels/FIBO_BAMOnly1"
> to "ProcessModels%2FIBO_BAMOnly1", I get the URL below:
>
>
> http://zoso.local:12503/services/rest/ProcessAnalytics/ProcessDiagramDisplayData/ProcessModels%2FIBO_BAMOnly1?timeZone=1&startTime=39393939&endTime=39292&interval=3
>
>
> It appears that the slash gets recognized as part of the URL pathing
> itself, so this fails.
>
> I *think* the only solution to this is I'm going to have to make the
> modelId a query parameter.
>
> Am I correct or is there a way around this?
>
> Thanks!
>
>
>

-- 
--
D. Reinert