restful-url

Struts2 better URLs with dot inside

北战南征 提交于 2020-01-03 17:05:09
问题 Let's say we need to get a login form with pre-defined username. So if user goes to url: //somehost:8080/myapp/auth/myusername the action should take myusername as input parameter. I tried http://www.struts2.info/blog/better-urls-with-struts2 as example, and it works great. But if myusername contains dots, like: //somehost:8080/myapp/auth/firstname.lastname , I get 404 error. Is there any simple solution to use dots as a part of url parameter ? 回答1: In struts.xml : <constant name="struts

How to Parse only some selected Json arrays and Json Objects from a Url to android device

给你一囗甜甜゛ 提交于 2020-01-03 05:09:35
问题 I have a Json data and which contains multiple JSON arrays and JSON Objects so i want to parse some of them in an android activity ,... Example of JSON array and Json objects at here So i want to call some of them in the android device.... i know how to parse but i want only some of contents ,.. I have the data like { "process":"done" "one":1 "List": { "Something": [ { "Name": "John", "phone": "test" } ] "details":"ok" "two":2 "SomethingElse": [ { "Name": "Smith", "phone": "test" } ] } } Like

Restlet, An example of a get with parameters

一曲冷凌霜 提交于 2020-01-02 21:59:10
问题 Just startred using restlet with java and was pleasently surprised how easy it was. However this was with puts. I then started to work with get but couldn't work out how to pass infromation with the get. With the put it was easy as: @Put public Boolean store(Contact contact); But when i try and do this with get it doesnt work. From reading around i think i have to not pass it any parameters and just have this: @Get public Contact retrieve(); and then pass the parameters in a url or something?

How to retrieve result for Google QPX with Javascript/jQuery (Ajax)?

江枫思渺然 提交于 2020-01-01 18:53:08
问题 I have already signed up for Google API Console and set up the account and API key, but my question is how do I retrieve the results from Google QPX. What causes the error below? Setting up the json Query for Google Request var FlightRequest = { "request": { "slice": [ { "origin": "DCA", "destination": "LAX", "date": "2015-02-11" } ], "passengers": { "adultCount": 1, "infantInLapCount": 0, "infantInSeatCount": 0, "childCount": 0, "seniorCount": 0 }, "solutions": 20, "refundable": false } }

SAP BI Open Doc URL for retrieving pdf

邮差的信 提交于 2019-12-30 11:09:31
问题 In a reporting application we use, we were using BI 3.x API to produce Web reports. While doing the migration activity to 4.x version, we thought it is fine to go with open doc url rather than doing the report generation through API. Many of the samples I have seen uses sIDType and iDocID parameters along with Token value to retrieve the document by constructing a URL like below http://server:port/BOE/OpenDocument/opendoc/openDocument.jsp?token=[LogonToken]&iDocID=[XXXX]&sIDType=CUID But all

SLIM Optional Parameter Issue

╄→гoц情女王★ 提交于 2019-12-25 05:26:17
问题 I trying to achieve something like this in Slim PHP: page/p1/p2/p3/p4 I want that If I leave out params from the right(obviously) then I want to do my stuff based on whatever params I've received. $app->get('/page(/)(:p1/?)(:p2/?)(:p3/?)(:p4/?)', function ($p1 = null, $p2 = null, $p3 = null, $p4 = null) { print empty($p1)? : '' . "p1: $p1/<br/>"; print empty($p2)? : '' . "p2: $p2/<br/>"; print empty($p3)? : '' . "p3: $p3/<br/>"; print empty($p4)? : '' . "id: $p4<br/>"; }); Everything works as

Update route generates incorrect url

荒凉一梦 提交于 2019-12-25 03:58:15
问题 This is my html blade code {{ Form::open(array('route' => 'restaurants.update', 'class' => 'mainInformationContrainer')) }} <ul> <li> <label>Website</label> <div class="oneInfo"> <input type="text" value="{{$restaurant->website}}" /> </div> </li> <li> <input type="submit" value="Save Changes"/> <input type="button" value="Cancle" class="cancelButton"/> </li> </ul> {{ Form::close() }} But the url for the form is : public/restaurants/%7Brestaurants%7D Thought I already have the route: Route:

Handling cookies in HTTP request in Jmeter

梦想的初衷 提交于 2019-12-24 19:22:17
问题 I have a Jmeter load project the requires retrieving 2 values of cookies and resend them in the other requests. Here is my project test plan: -Test Plan -Thread Group -Login request -Payment page -Payment history page -HTTP Cookie Manager -HTTP Header Manager -View Results Tree Cookie Data: JSESSIONID=0000SZb55xyLAaqLlDzumq_PpIw:-1; XSRF-TOKEN=a684e233-648e-4219-ae21-25fb362e232d The cookie data is received successfully from the login request by cookie manager and sent in the second request

RESTful authentication API design

霸气de小男生 提交于 2019-12-24 14:23:38
问题 I have a question regarding RESTful API design. Following the guidelines of REST, all endpoints should be nouns and in plural, and should never be verbs. However, it is customary to have authentication routes be: /login /logout which are both verbs. If you should be true to the guidelines these routes should look more like this instead: /users?action=login /users?action=logout but I've never used any API that has this particular authentication implementation, everyone uses the first one, me

How to define variable Resource such as /colours/{colour} in a WADL?

≯℡__Kan透↙ 提交于 2019-12-24 07:07:09
问题 Is it possible to define the fact that you are expecting a {colour} in the /colours/{colour} URL as part of a WADL? If so, how would you do it? If not, isn't this a huge oversight of the spec? Why can't I do something like this to define /colours/{colour}: <resource path="colours" id="Colours"> <resource id="colour" uri="{colour}"> <method name="GET" id="get_colour"/> </resource> </resource> Thanks in advance. 回答1: Found the answer: http://cxf.apache.org/docs/jaxrs-services-description.html