query-parameters

Pass Multidimensional Array in Query String to Controller in Rails

为君一笑 提交于 2019-12-23 20:45:17
问题 When passing a multidimensional array to a rails controller, it does not seem to parse correctly. Am I doing it wrong? url: http://localhost:3000/people?sort[][]=lastname&sort[][]=1&sort[][]=firstname&sort[][]=1 params: { "sort" => [ [0] nil, [1] nil, [2] nil, [3] nil ], "action" => "index", "controller" => "people" } should be: params: { "sort" => [ [0] => [ [0] => 'lastname', [1] => 1 ], [1] = > [ [0] => 'firstname', [1] => 1 ] ], "action" => "index", "controller" => "people" } 回答1: Rails

React Redux with Router Location, Pagination / Sorting and Fetch

人盡茶涼 提交于 2019-12-22 12:09:27
问题 I'm writing some generic Todo-List component, with the following features Pagination / Sorting Keep a part of the state within the URL (page, sort) Fetching the Data asynchronously using HTTP Requests (using redux-saga) Now I'm trying to find a pattern for the "best" sequence of redux actions to get this working without problems. I want the following behavior: When Todo Component loads: Read URL Query Parameters and use this to fetch the data. When the user clicks sort by name (or next page

org.hibernate.QueryParameterException: could not locate named parameter [userId]

你说的曾经没有我的故事 提交于 2019-12-22 11:25:04
问题 I need help, I am getting the aforementioned exception. Where am I going wrong? In the mapping from class to table, I have used the following: private String userId; private String password; Below is the class where I write my query. public class LoginManager extends HibernateUtil { private String loginId; public String checkCredentials(String userId, String password) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); try { loginId = (String

UI Router and query parameters

断了今生、忘了曾经 提交于 2019-12-22 03:46:57
问题 I built a small search app using Angular, UI Router and Elasticsearch and I'm trying to get UI Router query parameters in the url on the results page. I'm trying to achieve this domain.com/search?user_search_terms with this .state('search', { url: '/search?q', and I init searchTerms and $stateParams like this in my controller vm.searchTerms = $stateParams.q || ''; and then in my search function in my controller I have this vm.search = function() { $state.go('search', {q: vm.searchTerms}); ...

Angular is it possible to detect if query Paramter has changed?

南笙酒味 提交于 2019-12-21 17:47:45
问题 Angular is it possible to detect if query Paramter has changed? I have a Component that handles 2 query paramters and according to what paramter you come with it sets some variables true or false. The Problem is if im on my component with queryparameter 1 the qp can change to the second paramter without leaving the component and in that case i need to set variables diffrently. So how do I detect that? Is that even possible? 回答1: You can subscribe to the params in the root component

What is the meaning of Google Translate query params?

廉价感情. 提交于 2019-12-21 03:45:13
问题 What is the meaning of all Google Translate query params? client:t sl:auto tl:sk hl:sk //language of the interface (default:en, you can try xx-bork or xx-hacker) dt:bd dt:ex dt:ld dt:md dt:qc dt:rw dt:rm dt:ss dt:t dt:at dt:sw ie:UTF-8 // encoding of the input (default: utf-8) oe:UTF-8 // encoding of the output, the results (default: utf-8) otf:1 srcrom:1 ssel:3 tsel:0 q:translate // query, what you type in the search box I already discovered some of them. 回答1: I'm developing an online

ZF2: using url helper and reuse query parameters

笑着哭i 提交于 2019-12-20 04:20:48
问题 I'm trying to reuse query params using Url helper in a view. This is my current url: http://localhost/events/index?__orderby=name&__order=asc I'm using this code in the view: $this->url('events/index', array('__page' => '2'), true); I want to obtain this url: http://localhost/events/index?__orderby=name&__order=asc&__page=2 But instead i get this: http://localhost/events/index?controller=Application\Controller\Events&__page=2 This is my route inside module.config.php file: 'events' => array(

Query parameters with url_for?

拥有回忆 提交于 2019-12-18 18:36:28
问题 url_for([:edit, @post]) is working and generating /comments/123/edit . Now I need to add a query parameter, so that instead of /comments/123/edit it is /comments/123/edit?qp=asdf I tried url_for([:edit, @post], :qp => "asdf") but no go. 回答1: Use named routes. edit_post_path(@post, :qp => "asdf") 回答2: You can use polymorphic_path polymorphic_path([:edit, @post], :qp => 'asdf') 回答3: You can pass params to url_for . Checkout it in the sourcecode: https://github.com/rails/rails/blob

Passing an Array to a SQL query using Java's PreparedStatement

[亡魂溺海] 提交于 2019-12-18 09:38:11
问题 I've been having a little trouble passing an array into a SQL query using Java's prepared statements. I had first tried the sourceforge driver, however I would get the AbstractMethodError when I call setArray method. Not knowing the solution to that I swapped to the Microsoft sqlserver driver, but now I get a different error entirely, which is "java.sql.SQLFeatureNotSupportedException: This operation is not supported." Tried a whole bunch of things to try and resolve this but nothing appears

Using Query String in REST Web Services

泪湿孤枕 提交于 2019-12-17 22:17:10
问题 I thought one main characteristic and reason for using REST web services was to use path parameters rather than query parameters. But many publicly available REST web services use query parameters. Am I wrong in thinking that query parameters are not supposed to be used in REST web services? Is there a recommendation or rule about not using query parameters in REST web services? 回答1: The query string can still be used in REST web services just not in the same way as normal. You have to think