url-parameters

Boolean logic in RESTful filtering and queries

我与影子孤独终老i 提交于 2019-11-27 22:22:42
问题 This is sort of a follow-up to someone else's question about filtering/querying a list of cars. There the recommendation for a RESTful filtering request was to put filter expressions in the query of the URI, like this: /cars?color=blue&type=sedan&doors=4 That's fine. But what if my filtering query becomes more complicated and I need to use Boolean operators, such as: ((color=blue OR type=sedan) AND doors=4) OR color=red That is, I want to find a four-door blue car or a four-door sedan, but if

What are the URL parameters? (element at position #3 in urlparse result)

╄→гoц情女王★ 提交于 2019-11-27 11:54:43
问题 I've taken a look to urlparse.urlparse method documentation and I'm a little bit confused about what is the parameters part (not to be confused with the more familiar query part, that is what goes after the question mark and before the fragment part). Wikipedia entry on URL's structure doesn't say anything about that, so could please anybody elaborate a little bit on this and possibly give some examples? 回答1: fascinating, this is the first time I've encounter them, found this http:/

Spring security authentication based on request parameter

半腔热情 提交于 2019-11-27 11:42:14
问题 The application I'm working on already has Spring Security to handle form based authentication. Now the requirement is to login a user programmatically via an external service if a token is found in one of the request parameters. In other words, if a particular request parameter, say "token", exists, it needs to call an external service with that token to verify if it's a valid token. If it is then the user will be logged in. I can't figure out how and where to "trigger" or "hook on to"

PHP check if url parameter exists

99封情书 提交于 2019-11-27 11:26:53
问题 I have a URL which i pass parameters into example/success.php?id=link1 I use php to grab it $slide = ($_GET["id"]); then an if statement to display content based on parameter <?php if($slide == 'link1') { ?> //content } ?> Just need to know in PHP how to say, if the url param exists grab it and do the if function, if it doesn't exist do nothing. Thanks Guys 回答1: Use isset() $matchFound = ( isset($_GET["id"]) && trim($_GET["id"]) == 'link1' ); $slide = $matchFound ? trim ($_GET["id"]) : '';

Passing parameters in URL without query string in Struts 2

◇◆丶佛笑我妖孽 提交于 2019-11-27 05:22:40
I Like to use URLs like host/ActionName/123/abc/ , instead of passing query string like host/ActionName?parm1=123&parm2=abc . How can I do that in Struts2? I done as below. but it is not working, showing 500 error code <constant name="struts.enable.SlashesInActionNames" value="true"/> <constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/> <package name="default" extends="struts-default" namespace="/"> <action name="/action/*" class="gov.apiic.serviceRequest.action.ServiceRequest" method="method" > <param name="p1">{1}</param> <result name="success">views.jsp</result> </action

How to replace url parameter with javascript/jquery?

喜夏-厌秋 提交于 2019-11-27 00:13:42
I've been looking for an efficient way to do this but haven't been able to find it, basically what I need is that given this url for example: http://localhost/mysite/includes/phpThumb.php?src=http://media2.jupix.co.uk/v3/clients/4/properties/795/IMG_795_1_large.jpg&w=592&aoe=1&q=100 I'd like to be able to change the URL in the src parameter with another value using javascript or jquery, is this possible? Thanks in advance. ZenMaster Wouldn't this be a better solution? var text = 'http://localhost/mysite/includes/phpThumb.php?src=http://media2.jupix.co.uk/v3/clients/4/properties/795/IMG_795_1

Decoding URL parameters with JavaScript

微笑、不失礼 提交于 2019-11-26 22:38:25
This should be a simple task, but I can't seem to find a solution. I have a basic string that is being passed through as a query string parameter like this one: This+is+a+message+with+spaces . I would like to decode that parameter using JavaScript to This is a message with spaces , but I cannot seem to get it to decode. I've tried decodeURI('This+is+a+message+with+spaces') but the result still contains the + signs. Yes it is true that decodeURIComponent function doesn't convert + to space. So you have to replace the + using replace function. Ideally the below solution works. var str_name =

Pass Hidden parameters using response.sendRedirect()

╄→尐↘猪︶ㄣ 提交于 2019-11-26 22:06:24
How would I pass hidden parameters? I want to call a page (test.jsp) but also pass 2 hidden parameters like a post. response.sendRedirect("/content/test.jsp"); Luiggi Mendoza TheNewIdiot's answer successfully explains the problem and the reason why you can't send attributes in request through a redirect. Possible solutions: Using forwarding. This will enable that request attributes could be passed to the view and you can use them in form of ServletRequest#getAttribute or by using Expression Language and JSTL . Short example (reusing TheNewIdiot's answer] code). Controller (your servlet)

Username and password in https url

让人想犯罪 __ 提交于 2019-11-26 22:04:46
Consider the URL: https://foo:password@example.com Does the username/password portion in the above example qualify as a "URL parameter", as defined in this question ? Holger Just When you put the username and password in front of the host, this data is not sent that way to the server. It is instead transformed to a request header depending on the authentication schema used. Most of the time this is going to be Basic Auth which I describe below. A similar (but significantly less often used) authentication scheme is Digest Auth which nowadays provides comparable security features. With Basic

What is the difference between URL parameters and query strings?

旧城冷巷雨未停 提交于 2019-11-26 21:39:16
I don't see much of a difference between the parameters and the query strings, in the URL. So what is the difference and when should one be used over the over? The query component is indicated by the first ? in a URI. "Query string" might be a synonym (this term is not used in the URI standard). Some examples for HTTP URIs with query components: http://example.com/foo?bar http://example.com/foo/foo/foo?bar/bar/bar http://example.com/?bar http://example.com/?@bar._=???/1: http://example.com/?bar1=a&bar2=b ( list of allowed characters in the query component ) The "format" of the query component